Lines Matching +full:sense +full:- +full:freq
1 // SPDX-License-Identifier: GPL-2.0-or-later
9 * Drew Eckhardt's excellent 'Generic NCR5380' sources from Linux-PC
18 * - Target Disconnection/Reconnection is now supported. Any
21 * call 'adaptive disconnect' - meaning that each command
24 * device chooses), or as a "SCSI-bus-hog".
26 * - Synchronous data transfers are now supported. Because of
29 * this faster protocol - it can be enabled via the command-
30 * line on a device-by-device basis.
32 * - Runtime operating parameters can now be specified through
38 * - The old driver relied exclusively on what the Western Digital
41 * overhead. However, by accepting a certain (user-settable)
52 * People with bug reports, wish-lists, complaints, comments,
53 * or improvements are asked to pah-leeez email me (John Shifflett)
60 * Added support for pre -A chips, which don't have advanced features
66 * of transfer periods in sx_table to the actual input-clock.
87 #define optimum_sx_per(hostdata) (hostdata)->sx_table[1].period_ns
99 * settings from the kernel/module command-line to the driver. 'setup_args[]'
100 * is an array of strings that define the compile-time default values for
101 * these settings. If Linux boots with an amiboot or insmod command-line,
103 * command-lines are prefixed with "wd33c93=" while insmod uses a
107 * - nosync:bitmask -bitmask is a byte where the 1st 7 bits correspond with
110 * backwards compatibility, a command-line such as
113 * - nodma:x -x = 1 to disable DMA, x = 0 to enable it. Argument is
114 * optional - if not present, same as "nodma:1".
115 * - period:ns -ns is the minimum # of nanoseconds in a SCSI data transfer
116 * period. Default is 500; acceptable values are 250 - 1000.
117 * - disconnect:x -x = 0 to never allow disconnects, 2 to always allow them.
120 * - debug:x -If 'DEBUGGING_ON' is defined, x is a bit mask that causes
121 * various types of debug output to printed - see the DB_xxx
123 * - clock:x -x = clock input in MHz for WD33c93 chip. Normal values
125 * - burst:x -x = 1 to use Burst Mode (or Demand-Mode) DMA, x = 0 to use
127 * optional - if not present, same as "burst:1".
128 * - fast:x -x = 1 to enable Fast SCSI, which is only effective with
129 * input-clock divisor 4 (WD33C93_FS_16_20), x = 0 to disable
130 * it, which is the default. Argument is optional - if not
132 * - next -No argument. Used to separate blocks of keywords when
136 * - Numeric arguments can be decimal or the '0x' form of hex notation. There
139 * - Keywords are separated by commas, no spaces, in the standard kernel
140 * command-line manner.
141 * - A keyword in the 'nth' comma-separated command-line member will overwrite
142 * the 'nth' element of setup_args[]. A blank command-line member (in
145 * - If a keyword is used more than once, the first one applies to the first
150 * - wd33c93=nosync:255
151 * - wd33c93=nodma
152 * - wd33c93=nodma:1
153 * - wd33c93=disconnect:2,nosync:0x08,period:250
154 * - wd33c93=debug:0x1c
314 if ((period <= sx_table[x - 0].period_ns) && in round_period()
315 (period > sx_table[x - 1].period_ns)) { in round_period()
354 /* 'period' is a "normal"-mode value, like the ones in 'sx_table'. The in calc_sync_msg()
372 hostdata = (struct WD33C93_hostdata *) cmd->device->host->hostdata; in wd33c93_queuecommand_lck()
375 printk("Q-%d-%02x( ", cmd->device->id, cmd->cmnd[0])) in wd33c93_queuecommand_lck()
378 * - host_scribble is the pointer to the next cmd in the input queue in wd33c93_queuecommand_lck()
379 * - scsi_done points to the routine we call when a cmd is finished in wd33c93_queuecommand_lck()
380 * - result is what you'd expect in wd33c93_queuecommand_lck()
382 cmd->host_scribble = NULL; in wd33c93_queuecommand_lck()
383 cmd->scsi_done = done; in wd33c93_queuecommand_lck()
384 cmd->result = 0; in wd33c93_queuecommand_lck()
389 * cmd, and are preserved across disconnect-reselect. This means we in wd33c93_queuecommand_lck()
392 * - SCp.ptr is the pointer into the RAM buffer in wd33c93_queuecommand_lck()
393 * - SCp.this_residual is the size of that buffer in wd33c93_queuecommand_lck()
394 * - SCp.buffer points to the current scatter-gather buffer in wd33c93_queuecommand_lck()
395 * - SCp.buffers_residual tells us how many S.G. buffers there are in wd33c93_queuecommand_lck()
396 * - SCp.have_data_in is not used in wd33c93_queuecommand_lck()
397 * - SCp.sent_command is not used in wd33c93_queuecommand_lck()
398 * - SCp.phase records this command's SRCID_ER bit setting in wd33c93_queuecommand_lck()
402 cmd->SCp.buffer = scsi_sglist(cmd); in wd33c93_queuecommand_lck()
403 cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1; in wd33c93_queuecommand_lck()
404 cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); in wd33c93_queuecommand_lck()
405 cmd->SCp.this_residual = cmd->SCp.buffer->length; in wd33c93_queuecommand_lck()
407 cmd->SCp.buffer = NULL; in wd33c93_queuecommand_lck()
408 cmd->SCp.buffers_residual = 0; in wd33c93_queuecommand_lck()
409 cmd->SCp.ptr = NULL; in wd33c93_queuecommand_lck()
410 cmd->SCp.this_residual = 0; in wd33c93_queuecommand_lck()
430 cmd->SCp.Status = ILLEGAL_STATUS_BYTE; in wd33c93_queuecommand_lck()
433 * Add the cmd to the end of 'input_Q'. Note that REQUEST SENSE in wd33c93_queuecommand_lck()
435 * sense data is not lost before REQUEST_SENSE executes. in wd33c93_queuecommand_lck()
438 spin_lock_irq(&hostdata->lock); in wd33c93_queuecommand_lck()
440 if (!(hostdata->input_Q) || (cmd->cmnd[0] == REQUEST_SENSE)) { in wd33c93_queuecommand_lck()
441 cmd->host_scribble = (uchar *) hostdata->input_Q; in wd33c93_queuecommand_lck()
442 hostdata->input_Q = cmd; in wd33c93_queuecommand_lck()
444 for (tmp = (struct scsi_cmnd *) hostdata->input_Q; in wd33c93_queuecommand_lck()
445 tmp->host_scribble; in wd33c93_queuecommand_lck()
446 tmp = (struct scsi_cmnd *) tmp->host_scribble) ; in wd33c93_queuecommand_lck()
447 tmp->host_scribble = (uchar *) cmd; in wd33c93_queuecommand_lck()
454 wd33c93_execute(cmd->device->host); in wd33c93_queuecommand_lck()
458 spin_unlock_irq(&hostdata->lock); in wd33c93_queuecommand_lck()
468 * for a currently non-busy target/lun. in DEF_SCSI_QCMD()
478 (struct WD33C93_hostdata *) instance->hostdata; in DEF_SCSI_QCMD()
479 const wd33c93_regs regs = hostdata->regs; in DEF_SCSI_QCMD()
483 if (hostdata->selecting || hostdata->connected) { in DEF_SCSI_QCMD()
484 DB(DB_EXECUTE, printk(")EX-0 ")) in DEF_SCSI_QCMD()
493 cmd = (struct scsi_cmnd *) hostdata->input_Q; in DEF_SCSI_QCMD()
496 if (!(hostdata->busy[cmd->device->id] & in DEF_SCSI_QCMD()
497 (1 << (cmd->device->lun & 0xff)))) in DEF_SCSI_QCMD()
500 cmd = (struct scsi_cmnd *) cmd->host_scribble; in DEF_SCSI_QCMD()
506 DB(DB_EXECUTE, printk(")EX-1 ")) in DEF_SCSI_QCMD()
513 prev->host_scribble = cmd->host_scribble; in DEF_SCSI_QCMD()
515 hostdata->input_Q = (struct scsi_cmnd *) cmd->host_scribble; in DEF_SCSI_QCMD()
518 hostdata->cmd_cnt[cmd->device->id]++; in DEF_SCSI_QCMD()
525 if (cmd->sc_data_direction == DMA_TO_DEVICE) in DEF_SCSI_QCMD()
526 write_wd33c93(regs, WD_DESTINATION_ID, cmd->device->id); in DEF_SCSI_QCMD()
528 write_wd33c93(regs, WD_DESTINATION_ID, cmd->device->id | DSTID_DPD); in DEF_SCSI_QCMD()
538 * + Commands should NEVER disconnect if hostdata->disconnect = in DEF_SCSI_QCMD()
540 * disconnect if hostdata->disconnect = DIS_ALWAYS. in DEF_SCSI_QCMD()
546 * should be made disconnect-able, if not already. in DEF_SCSI_QCMD()
548 * I know, I know - this code would flunk me out of any in DEF_SCSI_QCMD()
553 cmd->SCp.phase = 0; /* assume no disconnect */ in DEF_SCSI_QCMD()
554 if (hostdata->disconnect == DIS_NEVER) in DEF_SCSI_QCMD()
556 if (hostdata->disconnect == DIS_ALWAYS) in DEF_SCSI_QCMD()
558 if (cmd->device->type == 1) /* tape drive? */ in DEF_SCSI_QCMD()
560 if (hostdata->disconnected_Q) /* other commands disconnected? */ in DEF_SCSI_QCMD()
562 if (!(hostdata->input_Q)) /* input_Q empty? */ in DEF_SCSI_QCMD()
564 for (prev = (struct scsi_cmnd *) hostdata->input_Q; prev; in DEF_SCSI_QCMD()
565 prev = (struct scsi_cmnd *) prev->host_scribble) { in DEF_SCSI_QCMD()
566 if ((prev->device->id != cmd->device->id) || in DEF_SCSI_QCMD()
567 (prev->device->lun != cmd->device->lun)) { in DEF_SCSI_QCMD()
568 for (prev = (struct scsi_cmnd *) hostdata->input_Q; prev; in DEF_SCSI_QCMD()
569 prev = (struct scsi_cmnd *) prev->host_scribble) in DEF_SCSI_QCMD()
570 prev->SCp.phase = 1; in DEF_SCSI_QCMD()
578 cmd->SCp.phase = 1; in DEF_SCSI_QCMD()
581 hostdata->disc_allowed_cnt[cmd->device->id]++; in DEF_SCSI_QCMD()
586 write_wd33c93(regs, WD_SOURCE_ID, ((cmd->SCp.phase) ? SRCID_ER : 0)); in DEF_SCSI_QCMD()
588 write_wd33c93(regs, WD_TARGET_LUN, (u8)cmd->device->lun); in DEF_SCSI_QCMD()
590 hostdata->sync_xfer[cmd->device->id]); in DEF_SCSI_QCMD()
591 hostdata->busy[cmd->device->id] |= (1 << (cmd->device->lun & 0xFF)); in DEF_SCSI_QCMD()
593 if ((hostdata->level2 == L2_NONE) || in DEF_SCSI_QCMD()
594 (hostdata->sync_stat[cmd->device->id] == SS_UNSET)) { in DEF_SCSI_QCMD()
597 * Do a 'Select-With-ATN' command. This will end with in DEF_SCSI_QCMD()
599 * CSR_RESEL_AM: failure - can try again later. in DEF_SCSI_QCMD()
600 * CSR_TIMEOUT: failure - give up. in DEF_SCSI_QCMD()
601 * CSR_SELECT: success - proceed. in DEF_SCSI_QCMD()
604 hostdata->selecting = cmd; in DEF_SCSI_QCMD()
618 if (hostdata->sync_stat[cmd->device->id] == SS_UNSET) in DEF_SCSI_QCMD()
619 hostdata->sync_stat[cmd->device->id] = SS_FIRST; in DEF_SCSI_QCMD()
620 hostdata->state = S_SELECTING; in DEF_SCSI_QCMD()
626 * Do a 'Select-With-ATN-Xfer' command. This will end with in DEF_SCSI_QCMD()
628 * CSR_RESEL_AM: failure - can try again later. in DEF_SCSI_QCMD()
629 * CSR_TIMEOUT: failure - give up. in DEF_SCSI_QCMD()
630 * anything else: success - proceed. in DEF_SCSI_QCMD()
633 hostdata->connected = cmd; in DEF_SCSI_QCMD()
637 * (take advantage of auto-incrementing) in DEF_SCSI_QCMD()
640 write_wd33c93_cdb(regs, cmd->cmd_len, cmd->cmnd); in DEF_SCSI_QCMD()
643 * it's doing a 'select-and-transfer'. To be safe, we write the in DEF_SCSI_QCMD()
645 * way there won't be problems with vendor-unique, audio, etc. in DEF_SCSI_QCMD()
648 write_wd33c93(regs, WD_OWN_ID, cmd->cmd_len); in DEF_SCSI_QCMD()
650 /* When doing a non-disconnect command with DMA, we can save in DEF_SCSI_QCMD()
655 if ((cmd->SCp.phase == 0) && (hostdata->no_dma == 0)) { in DEF_SCSI_QCMD()
656 if (hostdata->dma_setup(cmd, in DEF_SCSI_QCMD()
657 (cmd->sc_data_direction == DMA_TO_DEVICE) ? in DEF_SCSI_QCMD()
662 cmd->SCp.this_residual); in DEF_SCSI_QCMD()
664 CTRL_IDI | CTRL_EDI | hostdata->dma_mode); in DEF_SCSI_QCMD()
665 hostdata->dma = D_DMA_RUNNING; in DEF_SCSI_QCMD()
670 hostdata->state = S_RUNNING_LEVEL2; in DEF_SCSI_QCMD()
682 printk("%s)EX-2 ", (cmd->SCp.phase) ? "d:" : "")) in DEF_SCSI_QCMD()
711 /* Note: we are returning with the interrupt UN-cleared. in transfer_pio()
727 hostdata = (struct WD33C93_hostdata *) cmd->device->host->hostdata; in transfer_bytes()
729 /* Normally, you'd expect 'this_residual' to be non-zero here. in transfer_bytes()
730 * In a series of scatter-gather transfers, however, this in transfer_bytes()
732 * to 0 and 'buffers_residual' non-zero. This means that a in transfer_bytes()
734 * now we need to setup the next scatter-gather buffer as the in transfer_bytes()
737 if (!cmd->SCp.this_residual && cmd->SCp.buffers_residual) { in transfer_bytes()
738 cmd->SCp.buffer = sg_next(cmd->SCp.buffer); in transfer_bytes()
739 --cmd->SCp.buffers_residual; in transfer_bytes()
740 cmd->SCp.this_residual = cmd->SCp.buffer->length; in transfer_bytes()
741 cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); in transfer_bytes()
743 if (!cmd->SCp.this_residual) /* avoid bogus setups */ in transfer_bytes()
747 hostdata->sync_xfer[cmd->device->id]); in transfer_bytes()
749 /* 'hostdata->no_dma' is TRUE if we don't even want to try DMA. in transfer_bytes()
753 if (hostdata->no_dma || hostdata->dma_setup(cmd, data_in_dir)) { in transfer_bytes()
755 hostdata->pio_cnt++; in transfer_bytes()
757 transfer_pio(regs, (uchar *) cmd->SCp.ptr, in transfer_bytes()
758 cmd->SCp.this_residual, data_in_dir, hostdata); in transfer_bytes()
759 length = cmd->SCp.this_residual; in transfer_bytes()
760 cmd->SCp.this_residual = read_wd33c93_count(regs); in transfer_bytes()
761 cmd->SCp.ptr += (length - cmd->SCp.this_residual); in transfer_bytes()
766 * We set 'hostdata->dma' = D_DMA_RUNNING so that when the in transfer_bytes()
775 hostdata->dma_cnt++; in transfer_bytes()
777 write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | hostdata->dma_mode); in transfer_bytes()
778 write_wd33c93_count(regs, cmd->SCp.this_residual); in transfer_bytes()
780 if ((hostdata->level2 >= L2_DATA) || in transfer_bytes()
781 (hostdata->level2 == L2_BASIC && cmd->SCp.phase == 0)) { in transfer_bytes()
784 hostdata->state = S_RUNNING_LEVEL2; in transfer_bytes()
788 hostdata->dma = D_DMA_RUNNING; in transfer_bytes()
796 (struct WD33C93_hostdata *) instance->hostdata; in wd33c93_intr()
797 const wd33c93_regs regs = hostdata->regs; in wd33c93_intr()
806 spin_lock_irqsave(&hostdata->lock, flags); in wd33c93_intr()
809 hostdata->int_cnt++; in wd33c93_intr()
812 cmd = (struct scsi_cmnd *) hostdata->connected; /* assume we're connected */ in wd33c93_intr()
816 DB(DB_INTR, printk("{%02x:%02x-", asr, sr)) in wd33c93_intr()
821 * in an open-ended fashion, it needs to be told when in wd33c93_intr()
832 if (hostdata->dma == D_DMA_RUNNING) { in wd33c93_intr()
834 printk("[%p/%d:", cmd->SCp.ptr, cmd->SCp.this_residual)) in wd33c93_intr()
835 hostdata->dma_stop(cmd->device->host, cmd, 1); in wd33c93_intr()
836 hostdata->dma = D_DMA_OFF; in wd33c93_intr()
837 length = cmd->SCp.this_residual; in wd33c93_intr()
838 cmd->SCp.this_residual = read_wd33c93_count(regs); in wd33c93_intr()
839 cmd->SCp.ptr += (length - cmd->SCp.this_residual); in wd33c93_intr()
841 printk("%p/%d]", cmd->SCp.ptr, cmd->SCp.this_residual)) in wd33c93_intr()
844 /* Respond to the specific WD3393 interrupt - there are quite a few! */ in wd33c93_intr()
849 if (hostdata->state == S_RUNNING_LEVEL2) in wd33c93_intr()
850 hostdata->connected = NULL; in wd33c93_intr()
852 cmd = (struct scsi_cmnd *) hostdata->selecting; /* get a valid cmd */ in wd33c93_intr()
853 hostdata->selecting = NULL; in wd33c93_intr()
856 cmd->result = DID_NO_CONNECT << 16; in wd33c93_intr()
857 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); in wd33c93_intr()
858 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
859 cmd->scsi_done(cmd); in wd33c93_intr()
871 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
873 /* We are not connected to a target - check to see if there in wd33c93_intr()
884 hostdata->connected = cmd = in wd33c93_intr()
885 (struct scsi_cmnd *) hostdata->selecting; in wd33c93_intr()
886 hostdata->selecting = NULL; in wd33c93_intr()
890 hostdata->outgoing_msg[0] = IDENTIFY(0, cmd->device->lun); in wd33c93_intr()
891 if (cmd->SCp.phase) in wd33c93_intr()
892 hostdata->outgoing_msg[0] |= 0x40; in wd33c93_intr()
894 if (hostdata->sync_stat[cmd->device->id] == SS_FIRST) { in wd33c93_intr()
896 hostdata->sync_stat[cmd->device->id] = SS_WAITING; in wd33c93_intr()
900 * request a fifo depth of 0, which is equivalent to async - should in wd33c93_intr()
904 hostdata->outgoing_msg[1] = EXTENDED_MESSAGE; in wd33c93_intr()
905 hostdata->outgoing_msg[2] = 3; in wd33c93_intr()
906 hostdata->outgoing_msg[3] = EXTENDED_SDTR; in wd33c93_intr()
907 if (hostdata->no_sync & (1 << cmd->device->id)) { in wd33c93_intr()
908 calc_sync_msg(hostdata->default_sx_per, 0, in wd33c93_intr()
909 0, hostdata->outgoing_msg + 4); in wd33c93_intr()
913 hostdata->fast, in wd33c93_intr()
914 hostdata->outgoing_msg + 4); in wd33c93_intr()
916 hostdata->outgoing_len = 6; in wd33c93_intr()
918 ucp = hostdata->outgoing_msg + 1; in wd33c93_intr()
923 hostdata->outgoing_len = 1; in wd33c93_intr()
925 hostdata->state = S_CONNECTED; in wd33c93_intr()
926 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
933 printk("IN-%d.%d", cmd->SCp.this_residual, in wd33c93_intr()
934 cmd->SCp.buffers_residual)) in wd33c93_intr()
936 if (hostdata->state != S_RUNNING_LEVEL2) in wd33c93_intr()
937 hostdata->state = S_CONNECTED; in wd33c93_intr()
938 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
945 printk("OUT-%d.%d", cmd->SCp.this_residual, in wd33c93_intr()
946 cmd->SCp.buffers_residual)) in wd33c93_intr()
948 if (hostdata->state != S_RUNNING_LEVEL2) in wd33c93_intr()
949 hostdata->state = S_CONNECTED; in wd33c93_intr()
950 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
958 DB(DB_INTR, printk("CMND-%02x", cmd->cmnd[0])) in wd33c93_intr()
959 transfer_pio(regs, cmd->cmnd, cmd->cmd_len, DATA_OUT_DIR, in wd33c93_intr()
961 hostdata->state = S_CONNECTED; in wd33c93_intr()
962 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
969 cmd->SCp.Status = read_1_byte(regs); in wd33c93_intr()
970 DB(DB_INTR, printk("%02x", cmd->SCp.Status)) in wd33c93_intr()
971 if (hostdata->level2 >= L2_BASIC) { in wd33c93_intr()
974 hostdata->state = S_RUNNING_LEVEL2; in wd33c93_intr()
978 hostdata->state = S_CONNECTED; in wd33c93_intr()
980 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
992 hostdata->incoming_msg[hostdata->incoming_ptr] = msg; in wd33c93_intr()
993 if (hostdata->incoming_msg[0] == EXTENDED_MESSAGE) in wd33c93_intr()
996 hostdata->incoming_ptr = 0; in wd33c93_intr()
998 cmd->SCp.Message = msg; in wd33c93_intr()
1004 hostdata->state = S_PRE_CMP_DISC; in wd33c93_intr()
1010 hostdata->state = S_CONNECTED; in wd33c93_intr()
1015 if (hostdata->level2 >= L2_BASIC) { in wd33c93_intr()
1018 hostdata->state = S_RUNNING_LEVEL2; in wd33c93_intr()
1021 hostdata->state = S_CONNECTED; in wd33c93_intr()
1027 cmd->device->disconnect = 1; in wd33c93_intr()
1029 hostdata->state = S_PRE_TMP_DISC; in wd33c93_intr()
1035 printk("-REJ-"); in wd33c93_intr()
1037 if (hostdata->sync_stat[cmd->device->id] == SS_WAITING) { in wd33c93_intr()
1038 hostdata->sync_stat[cmd->device->id] = SS_SET; in wd33c93_intr()
1040 hostdata->sync_xfer[cmd->device->id] = in wd33c93_intr()
1041 calc_sync_xfer(hostdata->default_sx_per in wd33c93_intr()
1042 / 4, 0, 0, hostdata->sx_table); in wd33c93_intr()
1045 hostdata->state = S_CONNECTED; in wd33c93_intr()
1051 ucp = hostdata->incoming_msg; in wd33c93_intr()
1054 printk("%02x", ucp[hostdata->incoming_ptr]); in wd33c93_intr()
1058 if ((hostdata->incoming_ptr >= 2) && in wd33c93_intr()
1059 (hostdata->incoming_ptr == (ucp[1] + 1))) { in wd33c93_intr()
1064 id = calc_sync_xfer(hostdata-> in wd33c93_intr()
1066 0, hostdata->sx_table); in wd33c93_intr()
1067 if (hostdata->sync_stat[cmd->device->id] != in wd33c93_intr()
1074 * transfers - not ideal but so much easier. in wd33c93_intr()
1080 hostdata->outgoing_msg[0] = in wd33c93_intr()
1082 hostdata->outgoing_msg[1] = 3; in wd33c93_intr()
1083 hostdata->outgoing_msg[2] = in wd33c93_intr()
1085 calc_sync_msg(hostdata-> in wd33c93_intr()
1087 0, hostdata->outgoing_msg + 3); in wd33c93_intr()
1088 hostdata->outgoing_len = 5; in wd33c93_intr()
1092 hostdata->fast, in wd33c93_intr()
1093 hostdata->sx_table); in wd33c93_intr()
1096 0, hostdata->sx_table); in wd33c93_intr()
1098 hostdata->sync_xfer[cmd->device->id] = id; in wd33c93_intr()
1101 hostdata->sync_xfer[cmd->device->id]); in wd33c93_intr()
1103 hostdata->sync_stat[cmd->device->id] = in wd33c93_intr()
1107 hostdata->state = S_CONNECTED; in wd33c93_intr()
1112 hostdata->outgoing_msg[0] = in wd33c93_intr()
1114 hostdata->outgoing_msg[1] = 2; in wd33c93_intr()
1115 hostdata->outgoing_msg[2] = in wd33c93_intr()
1117 hostdata->outgoing_msg[3] = 0; /* 8 bit transfer width */ in wd33c93_intr()
1118 hostdata->outgoing_len = 4; in wd33c93_intr()
1121 hostdata->state = S_CONNECTED; in wd33c93_intr()
1128 hostdata->outgoing_msg[0] = in wd33c93_intr()
1130 hostdata->outgoing_len = 1; in wd33c93_intr()
1133 hostdata->state = S_CONNECTED; in wd33c93_intr()
1136 hostdata->incoming_ptr = 0; in wd33c93_intr()
1142 hostdata->incoming_ptr++; in wd33c93_intr()
1144 hostdata->state = S_CONNECTED; in wd33c93_intr()
1151 hostdata->outgoing_msg[0] = MESSAGE_REJECT; in wd33c93_intr()
1152 hostdata->outgoing_len = 1; in wd33c93_intr()
1154 hostdata->state = S_CONNECTED; in wd33c93_intr()
1156 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1163 /* Make sure that reselection is enabled at this point - it may in wd33c93_intr()
1169 DB(DB_INTR, printk("SX-DONE")) in wd33c93_intr()
1170 cmd->SCp.Message = COMMAND_COMPLETE; in wd33c93_intr()
1172 DB(DB_INTR, printk(":%d.%d", cmd->SCp.Status, lun)) in wd33c93_intr()
1173 hostdata->connected = NULL; in wd33c93_intr()
1174 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); in wd33c93_intr()
1175 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1176 if (cmd->SCp.Status == ILLEGAL_STATUS_BYTE) in wd33c93_intr()
1177 cmd->SCp.Status = lun; in wd33c93_intr()
1178 if (cmd->cmnd[0] == REQUEST_SENSE in wd33c93_intr()
1179 && cmd->SCp.Status != GOOD) in wd33c93_intr()
1180 cmd->result = in wd33c93_intr()
1181 (cmd-> in wd33c93_intr()
1184 cmd->result = in wd33c93_intr()
1185 cmd->SCp.Status | (cmd->SCp.Message << 8); in wd33c93_intr()
1186 cmd->scsi_done(cmd); in wd33c93_intr()
1188 /* We are no longer connected to a target - check to see if in wd33c93_intr()
1191 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1195 ("%02x:%02x:%02x: Unknown SEL_XFER_DONE phase!!---", in wd33c93_intr()
1197 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1205 hostdata->state = S_RUNNING_LEVEL2; in wd33c93_intr()
1208 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1220 * it - like when our SDTR message is rejected by a target. Some in wd33c93_intr()
1228 if (hostdata->outgoing_len == 0) { in wd33c93_intr()
1229 hostdata->outgoing_len = 1; in wd33c93_intr()
1230 hostdata->outgoing_msg[0] = NOP; in wd33c93_intr()
1232 transfer_pio(regs, hostdata->outgoing_msg, in wd33c93_intr()
1233 hostdata->outgoing_len, DATA_OUT_DIR, hostdata); in wd33c93_intr()
1234 DB(DB_INTR, printk("%02x", hostdata->outgoing_msg[0])) in wd33c93_intr()
1235 hostdata->outgoing_len = 0; in wd33c93_intr()
1236 hostdata->state = S_CONNECTED; in wd33c93_intr()
1237 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1242 /* I think I've seen this after a request-sense that was in response in wd33c93_intr()
1244 * something when we get this interrupt - the question is 'what?'. in wd33c93_intr()
1246 * in a legal manner (like a command that provokes a request-sense), in wd33c93_intr()
1247 * so we treat it as a normal command-complete-disconnect. in wd33c93_intr()
1250 /* Make sure that reselection is enabled at this point - it may in wd33c93_intr()
1256 printk(" - Already disconnected! "); in wd33c93_intr()
1257 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1258 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1262 hostdata->connected = NULL; in wd33c93_intr()
1263 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); in wd33c93_intr()
1264 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1265 if (cmd->cmnd[0] == REQUEST_SENSE && cmd->SCp.Status != GOOD) in wd33c93_intr()
1266 cmd->result = in wd33c93_intr()
1267 (cmd->result & 0x00ffff) | (DID_ERROR << 16); in wd33c93_intr()
1269 cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); in wd33c93_intr()
1270 cmd->scsi_done(cmd); in wd33c93_intr()
1272 /* We are no longer connected to a target - check to see if in wd33c93_intr()
1276 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1282 /* Make sure that reselection is enabled at this point - it may in wd33c93_intr()
1289 printk(" - Already disconnected! "); in wd33c93_intr()
1290 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1292 switch (hostdata->state) { in wd33c93_intr()
1294 hostdata->connected = NULL; in wd33c93_intr()
1295 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); in wd33c93_intr()
1296 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1297 DB(DB_INTR, printk(":%d", cmd->SCp.Status)) in wd33c93_intr()
1298 if (cmd->cmnd[0] == REQUEST_SENSE in wd33c93_intr()
1299 && cmd->SCp.Status != GOOD) in wd33c93_intr()
1300 cmd->result = in wd33c93_intr()
1301 (cmd-> in wd33c93_intr()
1304 cmd->result = in wd33c93_intr()
1305 cmd->SCp.Status | (cmd->SCp.Message << 8); in wd33c93_intr()
1306 cmd->scsi_done(cmd); in wd33c93_intr()
1310 cmd->host_scribble = (uchar *) hostdata->disconnected_Q; in wd33c93_intr()
1311 hostdata->disconnected_Q = cmd; in wd33c93_intr()
1312 hostdata->connected = NULL; in wd33c93_intr()
1313 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1316 hostdata->disc_done_cnt[cmd->device->id]++; in wd33c93_intr()
1322 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1325 /* We are no longer connected to a target - check to see if in wd33c93_intr()
1328 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1336 /* Old chips (pre -A ???) don't have advanced features and will in wd33c93_intr()
1343 if (hostdata->level2 <= L2_NONE) { in wd33c93_intr()
1345 if (hostdata->selecting) { in wd33c93_intr()
1346 cmd = (struct scsi_cmnd *) hostdata->selecting; in wd33c93_intr()
1347 hostdata->selecting = NULL; in wd33c93_intr()
1348 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); in wd33c93_intr()
1349 cmd->host_scribble = in wd33c93_intr()
1350 (uchar *) hostdata->input_Q; in wd33c93_intr()
1351 hostdata->input_Q = cmd; in wd33c93_intr()
1359 hostdata->busy[cmd->device->id] &= in wd33c93_intr()
1360 ~(1 << (cmd->device->lun & 0xff)); in wd33c93_intr()
1361 cmd->host_scribble = in wd33c93_intr()
1362 (uchar *) hostdata->input_Q; in wd33c93_intr()
1363 hostdata->input_Q = cmd; in wd33c93_intr()
1366 ("---%02x:%02x:%02x-TROUBLE: Intrusive ReSelect!---", in wd33c93_intr()
1375 /* OK - find out which device reselected us. */ in wd33c93_intr()
1381 * bother to check for a valid message here - I guess this is in wd33c93_intr()
1387 if (hostdata->level2 < L2_RESELECT) in wd33c93_intr()
1392 for (lun = 255; lun; lun--) { in wd33c93_intr()
1440 cmd = (struct scsi_cmnd *) hostdata->disconnected_Q; in wd33c93_intr()
1443 if (id == cmd->device->id && lun == (u8)cmd->device->lun) in wd33c93_intr()
1446 cmd = (struct scsi_cmnd *) cmd->host_scribble; in wd33c93_intr()
1453 ("---TROUBLE: target %d.%d not in disconnect queue---", in wd33c93_intr()
1455 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1459 /* Ok, found the command - now start it up again. */ in wd33c93_intr()
1462 patch->host_scribble = cmd->host_scribble; in wd33c93_intr()
1464 hostdata->disconnected_Q = in wd33c93_intr()
1465 (struct scsi_cmnd *) cmd->host_scribble; in wd33c93_intr()
1466 hostdata->connected = cmd; in wd33c93_intr()
1468 /* We don't need to worry about 'initialize_SCp()' or 'hostdata->busy[]' in wd33c93_intr()
1473 if (cmd->sc_data_direction == DMA_TO_DEVICE) in wd33c93_intr()
1474 write_wd33c93(regs, WD_DESTINATION_ID, cmd->device->id); in wd33c93_intr()
1477 cmd->device->id | DSTID_DPD); in wd33c93_intr()
1478 if (hostdata->level2 >= L2_RESELECT) { in wd33c93_intr()
1482 hostdata->state = S_RUNNING_LEVEL2; in wd33c93_intr()
1484 hostdata->state = S_CONNECTED; in wd33c93_intr()
1486 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1490 printk("--UNKNOWN INTERRUPT:%02x:%02x:%02x--", asr, sr, phs); in wd33c93_intr()
1491 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1502 (struct WD33C93_hostdata *) instance->hostdata; in reset_wd33c93()
1503 const wd33c93_regs regs = hostdata->regs; in reset_wd33c93()
1522 sgiwd93_reset(instance->base); /* yeah, give it the hard one */ in reset_wd33c93()
1527 instance->this_id | hostdata->clock_freq); in reset_wd33c93()
1530 calc_sync_xfer(hostdata->default_sx_per / 4, in reset_wd33c93()
1531 DEFAULT_SX_OFF, 0, hostdata->sx_table)); in reset_wd33c93()
1543 hostdata->microcode = read_wd33c93(regs, WD_CDB_1); in reset_wd33c93()
1545 hostdata->chip = C_WD33C93; in reset_wd33c93()
1550 hostdata->chip = C_WD33C93B; in reset_wd33c93()
1553 hostdata->chip = C_WD33C93A; in reset_wd33c93()
1555 hostdata->chip = C_UNKNOWN_CHIP; in reset_wd33c93()
1557 if (hostdata->chip != C_WD33C93B) /* Fast SCSI unavailable */ in reset_wd33c93()
1558 hostdata->fast = 0; in reset_wd33c93()
1571 instance = SCpnt->device->host; in wd33c93_host_reset()
1572 spin_lock_irq(instance->host_lock); in wd33c93_host_reset()
1573 hostdata = (struct WD33C93_hostdata *) instance->hostdata; in wd33c93_host_reset()
1575 printk("scsi%d: reset. ", instance->host_no); in wd33c93_host_reset()
1576 disable_irq(instance->irq); in wd33c93_host_reset()
1578 hostdata->dma_stop(instance, NULL, 0); in wd33c93_host_reset()
1580 hostdata->busy[i] = 0; in wd33c93_host_reset()
1581 hostdata->sync_xfer[i] = in wd33c93_host_reset()
1583 0, hostdata->sx_table); in wd33c93_host_reset()
1584 hostdata->sync_stat[i] = SS_UNSET; /* using default sync values */ in wd33c93_host_reset()
1586 hostdata->input_Q = NULL; in wd33c93_host_reset()
1587 hostdata->selecting = NULL; in wd33c93_host_reset()
1588 hostdata->connected = NULL; in wd33c93_host_reset()
1589 hostdata->disconnected_Q = NULL; in wd33c93_host_reset()
1590 hostdata->state = S_UNCONNECTED; in wd33c93_host_reset()
1591 hostdata->dma = D_DMA_OFF; in wd33c93_host_reset()
1592 hostdata->incoming_ptr = 0; in wd33c93_host_reset()
1593 hostdata->outgoing_len = 0; in wd33c93_host_reset()
1596 SCpnt->result = DID_RESET << 16; in wd33c93_host_reset()
1597 enable_irq(instance->irq); in wd33c93_host_reset()
1598 spin_unlock_irq(instance->host_lock); in wd33c93_host_reset()
1610 disable_irq(cmd->device->host->irq); in wd33c93_abort()
1612 instance = cmd->device->host; in wd33c93_abort()
1613 hostdata = (struct WD33C93_hostdata *) instance->hostdata; in wd33c93_abort()
1614 regs = hostdata->regs; in wd33c93_abort()
1621 tmp = (struct scsi_cmnd *) hostdata->input_Q; in wd33c93_abort()
1626 prev->host_scribble = cmd->host_scribble; in wd33c93_abort()
1628 hostdata->input_Q = in wd33c93_abort()
1629 (struct scsi_cmnd *) cmd->host_scribble; in wd33c93_abort()
1630 cmd->host_scribble = NULL; in wd33c93_abort()
1631 cmd->result = DID_ABORT << 16; in wd33c93_abort()
1633 ("scsi%d: Abort - removing command from input_Q. ", in wd33c93_abort()
1634 instance->host_no); in wd33c93_abort()
1635 enable_irq(cmd->device->host->irq); in wd33c93_abort()
1636 cmd->scsi_done(cmd); in wd33c93_abort()
1640 tmp = (struct scsi_cmnd *) tmp->host_scribble; in wd33c93_abort()
1654 if (hostdata->connected == cmd) { in wd33c93_abort()
1658 printk("scsi%d: Aborting connected command - ", in wd33c93_abort()
1659 instance->host_no); in wd33c93_abort()
1661 printk("stopping DMA - "); in wd33c93_abort()
1662 if (hostdata->dma == D_DMA_RUNNING) { in wd33c93_abort()
1663 hostdata->dma_stop(instance, cmd, 0); in wd33c93_abort()
1664 hostdata->dma = D_DMA_OFF; in wd33c93_abort()
1667 printk("sending wd33c93 ABORT command - "); in wd33c93_abort()
1674 printk("flushing fifo - "); in wd33c93_abort()
1680 } while (!(asr & ASR_INT) && timeout-- > 0); in wd33c93_abort()
1683 ("asr=%02x, sr=%02x, %ld bytes un-transferred (timeout=%ld) - ", in wd33c93_abort()
1692 printk("sending wd33c93 DISCONNECT command - "); in wd33c93_abort()
1697 while ((asr & ASR_CIP) && timeout-- > 0) in wd33c93_abort()
1702 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); in wd33c93_abort()
1703 hostdata->connected = NULL; in wd33c93_abort()
1704 hostdata->state = S_UNCONNECTED; in wd33c93_abort()
1705 cmd->result = DID_ABORT << 16; in wd33c93_abort()
1710 enable_irq(cmd->device->host->irq); in wd33c93_abort()
1711 cmd->scsi_done(cmd); in wd33c93_abort()
1721 tmp = (struct scsi_cmnd *) hostdata->disconnected_Q; in wd33c93_abort()
1725 ("scsi%d: Abort - command found on disconnected_Q - ", in wd33c93_abort()
1726 instance->host_no); in wd33c93_abort()
1728 enable_irq(cmd->device->host->irq); in wd33c93_abort()
1731 tmp = (struct scsi_cmnd *) tmp->host_scribble; in wd33c93_abort()
1747 enable_irq(cmd->device->host->irq); in wd33c93_abort()
1749 " before abortion. ", instance->host_no); in wd33c93_abort()
1766 /* The kernel does some processing of the command-line before calling in wd33c93_setup()
1769 * themselves. str points to where the non-numeric arguments (if any) in wd33c93_setup()
1778 strncpy(p1, str, SETUP_BUFFER_SIZE - strlen(setup_buffer)); in wd33c93_setup()
1779 setup_buffer[SETUP_BUFFER_SIZE - 1] = '\0'; in wd33c93_setup()
1823 *val = -1; in check_setup_args()
1834 * Calculate internal data-transfer-clock cycle from input-clock
1838 * for (only) the lower limits of the respective input-clock-frequency ranges
1839 * (8-10/12-15/16-20 MHz). Although it seems, that no problems occurred with
1841 * closer to the really attached, possibly 25% higher, input-clock, since
1842 * - the wd33c93 may really use a significant shorter period, than it has
1845 * - the wd33c93 may ask the target for a lower transfer rate, than the target
1854 case 1: --x; in round_4()
1868 d = 2; /* divisor for 8-10 MHz input-clock */ in calc_sx_table()
1870 d = 3; /* divisor for 12-15 MHz input-clock */ in calc_sx_table()
1872 d = 4; /* divisor for 16-20 MHz input-clock */ in calc_sx_table()
1888 * check and, maybe, map an init- or "clock:"- argument.
1891 set_clk_freq(int freq, int *mhz) in set_clk_freq() argument
1893 int x = freq; in set_clk_freq()
1894 if (WD33C93_FS_8_10 == freq) in set_clk_freq()
1895 freq = 8; in set_clk_freq()
1896 else if (WD33C93_FS_12_15 == freq) in set_clk_freq()
1897 freq = 12; in set_clk_freq()
1898 else if (WD33C93_FS_16_20 == freq) in set_clk_freq()
1899 freq = 16; in set_clk_freq()
1900 else if (freq > 7 && freq < 11) in set_clk_freq()
1902 else if (freq > 11 && freq < 16) in set_clk_freq()
1904 else if (freq > 15 && freq < 21) in set_clk_freq()
1907 /* Hmm, wouldn't it be safer to assume highest freq here? */ in set_clk_freq()
1909 freq = 8; in set_clk_freq()
1911 *mhz = freq; in set_clk_freq()
1923 hd->sync_stat[i] = SS_UNSET; in set_resync()
1939 hostdata = (struct WD33C93_hostdata *) instance->hostdata; in wd33c93_init()
1941 hostdata->regs = regs; in wd33c93_init()
1942 hostdata->clock_freq = set_clk_freq(clock_freq, &i); in wd33c93_init()
1943 calc_sx_table(i, hostdata->sx_table); in wd33c93_init()
1944 hostdata->dma_setup = setup; in wd33c93_init()
1945 hostdata->dma_stop = stop; in wd33c93_init()
1946 hostdata->dma_bounce_buffer = NULL; in wd33c93_init()
1947 hostdata->dma_bounce_len = 0; in wd33c93_init()
1949 hostdata->busy[i] = 0; in wd33c93_init()
1950 hostdata->sync_xfer[i] = in wd33c93_init()
1952 0, hostdata->sx_table); in wd33c93_init()
1953 hostdata->sync_stat[i] = SS_UNSET; /* using default sync values */ in wd33c93_init()
1955 hostdata->cmd_cnt[i] = 0; in wd33c93_init()
1956 hostdata->disc_allowed_cnt[i] = 0; in wd33c93_init()
1957 hostdata->disc_done_cnt[i] = 0; in wd33c93_init()
1960 hostdata->input_Q = NULL; in wd33c93_init()
1961 hostdata->selecting = NULL; in wd33c93_init()
1962 hostdata->connected = NULL; in wd33c93_init()
1963 hostdata->disconnected_Q = NULL; in wd33c93_init()
1964 hostdata->state = S_UNCONNECTED; in wd33c93_init()
1965 hostdata->dma = D_DMA_OFF; in wd33c93_init()
1966 hostdata->level2 = L2_BASIC; in wd33c93_init()
1967 hostdata->disconnect = DIS_ADAPTIVE; in wd33c93_init()
1968 hostdata->args = DEBUG_DEFAULTS; in wd33c93_init()
1969 hostdata->incoming_ptr = 0; in wd33c93_init()
1970 hostdata->outgoing_len = 0; in wd33c93_init()
1971 hostdata->default_sx_per = DEFAULT_SX_PER; in wd33c93_init()
1972 hostdata->no_dma = 0; /* default is DMA enabled */ in wd33c93_init()
1975 hostdata->proc = PR_VERSION | PR_INFO | PR_STATISTICS | in wd33c93_init()
1978 hostdata->dma_cnt = 0; in wd33c93_init()
1979 hostdata->pio_cnt = 0; in wd33c93_init()
1980 hostdata->int_cnt = 0; in wd33c93_init()
1985 hostdata->clock_freq = set_clk_freq(val, &val); in wd33c93_init()
1986 calc_sx_table(val, hostdata->sx_table); in wd33c93_init()
1990 hostdata->no_sync = val; in wd33c93_init()
1993 hostdata->no_dma = (val == -1) ? 1 : val; in wd33c93_init()
1996 hostdata->default_sx_per = in wd33c93_init()
1997 hostdata->sx_table[round_period((unsigned int) val, in wd33c93_init()
1998 hostdata->sx_table)].period_ns; in wd33c93_init()
2002 hostdata->disconnect = val; in wd33c93_init()
2004 hostdata->disconnect = DIS_ADAPTIVE; in wd33c93_init()
2008 hostdata->level2 = val; in wd33c93_init()
2011 hostdata->args = val & DB_MASK; in wd33c93_init()
2014 hostdata->dma_mode = val ? CTRL_BURST:CTRL_DMA; in wd33c93_init()
2016 if (WD33C93_FS_16_20 == hostdata->clock_freq /* divisor 4 */ in wd33c93_init()
2018 hostdata->fast = !!val; in wd33c93_init()
2022 setup_used[--i] = 1; in wd33c93_init()
2026 hostdata->proc = val; in wd33c93_init()
2029 spin_lock_irq(&hostdata->lock); in wd33c93_init()
2031 spin_unlock_irq(&hostdata->lock); in wd33c93_init()
2033 printk("wd33c93-%d: chip=%s/%d no_sync=0x%x no_dma=%d", in wd33c93_init()
2034 instance->host_no, in wd33c93_init()
2035 (hostdata->chip == C_WD33C93) ? "WD33c93" : (hostdata->chip == in wd33c93_init()
2037 "WD33c93A" : (hostdata->chip == in wd33c93_init()
2039 hostdata->microcode, hostdata->no_sync, hostdata->no_dma); in wd33c93_init()
2041 printk(" debug_flags=0x%02x\n", hostdata->args); in wd33c93_init()
2049 printk(" Version %s - %s\n", WD33C93_VERSION, WD33C93_DATE); in wd33c93_init()
2059 hd = (struct WD33C93_hostdata *) instance->hostdata; in wd33c93_write_info()
2062 * keywords (same format as command-line, but arguments are not optional): in wd33c93_write_info()
2080 hd->args = simple_strtoul(bp+6, &bp, 0) & DB_MASK; in wd33c93_write_info()
2085 hd->disconnect = x; in wd33c93_write_info()
2088 hd->default_sx_per = in wd33c93_write_info()
2089 hd->sx_table[round_period((unsigned int) x, in wd33c93_write_info()
2090 hd->sx_table)].period_ns; in wd33c93_write_info()
2094 hd->proc = simple_strtoul(bp+5, &bp, 0); in wd33c93_write_info()
2096 hd->no_dma = simple_strtoul(bp+6, &bp, 0); in wd33c93_write_info()
2098 hd->level2 = simple_strtoul(bp+7, &bp, 0); in wd33c93_write_info()
2100 hd->dma_mode = in wd33c93_write_info()
2104 if (x != hd->fast) in wd33c93_write_info()
2106 hd->fast = x; in wd33c93_write_info()
2109 set_resync(hd, x ^ hd->no_sync); in wd33c93_write_info()
2110 hd->no_sync = x; in wd33c93_write_info()
2112 break; /* unknown keyword,syntax-error,... */ in wd33c93_write_info()
2129 hd = (struct WD33C93_hostdata *) instance->hostdata; in wd33c93_show_info()
2131 spin_lock_irq(&hd->lock); in wd33c93_show_info()
2132 if (hd->proc & PR_VERSION) in wd33c93_show_info()
2133 seq_printf(m, "\nVersion %s - %s.", in wd33c93_show_info()
2136 if (hd->proc & PR_INFO) { in wd33c93_show_info()
2139 hd->clock_freq, hd->no_sync, hd->no_dma, hd->dma_mode, hd->fast); in wd33c93_show_info()
2142 seq_printf(m, "\t%02x", hd->sync_xfer[x]); in wd33c93_show_info()
2145 seq_printf(m, "\t%02x", hd->sync_stat[x]); in wd33c93_show_info()
2148 if (hd->proc & PR_STATISTICS) { in wd33c93_show_info()
2151 seq_printf(m, "\t%ld", hd->cmd_cnt[x]); in wd33c93_show_info()
2154 seq_printf(m, "\t%ld", hd->disc_allowed_cnt[x]); in wd33c93_show_info()
2157 seq_printf(m, "\t%ld", hd->disc_done_cnt[x]); in wd33c93_show_info()
2160 hd->int_cnt, hd->dma_cnt, hd->pio_cnt); in wd33c93_show_info()
2163 if (hd->proc & PR_CONNECTED) { in wd33c93_show_info()
2165 if (hd->connected) { in wd33c93_show_info()
2166 cmd = (struct scsi_cmnd *) hd->connected; in wd33c93_show_info()
2168 cmd->device->id, cmd->device->lun, cmd->cmnd[0]); in wd33c93_show_info()
2171 if (hd->proc & PR_INPUTQ) { in wd33c93_show_info()
2173 cmd = (struct scsi_cmnd *) hd->input_Q; in wd33c93_show_info()
2176 cmd->device->id, cmd->device->lun, cmd->cmnd[0]); in wd33c93_show_info()
2177 cmd = (struct scsi_cmnd *) cmd->host_scribble; in wd33c93_show_info()
2180 if (hd->proc & PR_DISCQ) { in wd33c93_show_info()
2182 cmd = (struct scsi_cmnd *) hd->disconnected_Q; in wd33c93_show_info()
2185 cmd->device->id, cmd->device->lun, cmd->cmnd[0]); in wd33c93_show_info()
2186 cmd = (struct scsi_cmnd *) cmd->host_scribble; in wd33c93_show_info()
2190 spin_unlock_irq(&hd->lock); in wd33c93_show_info()