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
254 if ((period <= sx_table[x - 0].period_ns) && in round_period()
255 (period > sx_table[x - 1].period_ns)) { in round_period()
294 /* 'period' is a "normal"-mode value, like the ones in 'sx_table'. The in calc_sync_msg()
311 hostdata = (struct WD33C93_hostdata *) cmd->device->host->hostdata; in wd33c93_queuecommand_lck()
314 printk("Q-%d-%02x( ", cmd->device->id, cmd->cmnd[0])) in wd33c93_queuecommand_lck()
317 * - host_scribble is the pointer to the next cmd in the input queue in wd33c93_queuecommand_lck()
318 * - result is what you'd expect in wd33c93_queuecommand_lck()
320 cmd->host_scribble = NULL; in wd33c93_queuecommand_lck()
321 cmd->result = 0; in wd33c93_queuecommand_lck()
326 * cmd, and are preserved across disconnect-reselect. This means we in wd33c93_queuecommand_lck()
329 * - SCp.ptr is the pointer into the RAM buffer in wd33c93_queuecommand_lck()
330 * - SCp.this_residual is the size of that buffer in wd33c93_queuecommand_lck()
331 * - SCp.buffer points to the current scatter-gather buffer in wd33c93_queuecommand_lck()
332 * - SCp.buffers_residual tells us how many S.G. buffers there are in wd33c93_queuecommand_lck()
333 * - SCp.have_data_in is not used in wd33c93_queuecommand_lck()
334 * - SCp.sent_command is not used in wd33c93_queuecommand_lck()
335 * - SCp.phase records this command's SRCID_ER bit setting in wd33c93_queuecommand_lck()
339 scsi_pointer->buffer = scsi_sglist(cmd); in wd33c93_queuecommand_lck()
340 scsi_pointer->buffers_residual = scsi_sg_count(cmd) - 1; in wd33c93_queuecommand_lck()
341 scsi_pointer->ptr = sg_virt(scsi_pointer->buffer); in wd33c93_queuecommand_lck()
342 scsi_pointer->this_residual = scsi_pointer->buffer->length; in wd33c93_queuecommand_lck()
344 scsi_pointer->buffer = NULL; in wd33c93_queuecommand_lck()
345 scsi_pointer->buffers_residual = 0; in wd33c93_queuecommand_lck()
346 scsi_pointer->ptr = NULL; in wd33c93_queuecommand_lck()
347 scsi_pointer->this_residual = 0; in wd33c93_queuecommand_lck()
367 scsi_pointer->Status = ILLEGAL_STATUS_BYTE; in wd33c93_queuecommand_lck()
370 * Add the cmd to the end of 'input_Q'. Note that REQUEST SENSE in wd33c93_queuecommand_lck()
372 * sense data is not lost before REQUEST_SENSE executes. in wd33c93_queuecommand_lck()
375 spin_lock_irq(&hostdata->lock); in wd33c93_queuecommand_lck()
377 if (!(hostdata->input_Q) || (cmd->cmnd[0] == REQUEST_SENSE)) { in wd33c93_queuecommand_lck()
378 cmd->host_scribble = (uchar *) hostdata->input_Q; in wd33c93_queuecommand_lck()
379 hostdata->input_Q = cmd; in wd33c93_queuecommand_lck()
381 for (tmp = (struct scsi_cmnd *) hostdata->input_Q; in wd33c93_queuecommand_lck()
382 tmp->host_scribble; in wd33c93_queuecommand_lck()
383 tmp = (struct scsi_cmnd *) tmp->host_scribble) ; in wd33c93_queuecommand_lck()
384 tmp->host_scribble = (uchar *) cmd; in wd33c93_queuecommand_lck()
391 wd33c93_execute(cmd->device->host); in wd33c93_queuecommand_lck()
395 spin_unlock_irq(&hostdata->lock); in wd33c93_queuecommand_lck()
405 * for a currently non-busy target/lun. in DEF_SCSI_QCMD()
416 (struct WD33C93_hostdata *) instance->hostdata; in DEF_SCSI_QCMD()
417 const wd33c93_regs regs = hostdata->regs; in DEF_SCSI_QCMD()
421 if (hostdata->selecting || hostdata->connected) { in DEF_SCSI_QCMD()
422 DB(DB_EXECUTE, printk(")EX-0 ")) in DEF_SCSI_QCMD()
431 cmd = (struct scsi_cmnd *) hostdata->input_Q; in DEF_SCSI_QCMD()
434 if (!(hostdata->busy[cmd->device->id] & in DEF_SCSI_QCMD()
435 (1 << (cmd->device->lun & 0xff)))) in DEF_SCSI_QCMD()
438 cmd = (struct scsi_cmnd *) cmd->host_scribble; in DEF_SCSI_QCMD()
444 DB(DB_EXECUTE, printk(")EX-1 ")) in DEF_SCSI_QCMD()
451 prev->host_scribble = cmd->host_scribble; in DEF_SCSI_QCMD()
453 hostdata->input_Q = (struct scsi_cmnd *) cmd->host_scribble; in DEF_SCSI_QCMD()
456 hostdata->cmd_cnt[cmd->device->id]++; in DEF_SCSI_QCMD()
463 if (cmd->sc_data_direction == DMA_TO_DEVICE) in DEF_SCSI_QCMD()
464 write_wd33c93(regs, WD_DESTINATION_ID, cmd->device->id); in DEF_SCSI_QCMD()
466 write_wd33c93(regs, WD_DESTINATION_ID, cmd->device->id | DSTID_DPD); in DEF_SCSI_QCMD()
476 * + Commands should NEVER disconnect if hostdata->disconnect = in DEF_SCSI_QCMD()
478 * disconnect if hostdata->disconnect = DIS_ALWAYS. in DEF_SCSI_QCMD()
484 * should be made disconnect-able, if not already. in DEF_SCSI_QCMD()
486 * I know, I know - this code would flunk me out of any in DEF_SCSI_QCMD()
492 scsi_pointer->phase = 0; /* assume no disconnect */ in DEF_SCSI_QCMD()
493 if (hostdata->disconnect == DIS_NEVER) in DEF_SCSI_QCMD()
495 if (hostdata->disconnect == DIS_ALWAYS) in DEF_SCSI_QCMD()
497 if (cmd->device->type == 1) /* tape drive? */ in DEF_SCSI_QCMD()
499 if (hostdata->disconnected_Q) /* other commands disconnected? */ in DEF_SCSI_QCMD()
501 if (!(hostdata->input_Q)) /* input_Q empty? */ in DEF_SCSI_QCMD()
503 for (prev = (struct scsi_cmnd *) hostdata->input_Q; prev; in DEF_SCSI_QCMD()
504 prev = (struct scsi_cmnd *) prev->host_scribble) { in DEF_SCSI_QCMD()
505 if ((prev->device->id != cmd->device->id) || in DEF_SCSI_QCMD()
506 (prev->device->lun != cmd->device->lun)) { in DEF_SCSI_QCMD()
507 for (prev = (struct scsi_cmnd *) hostdata->input_Q; prev; in DEF_SCSI_QCMD()
508 prev = (struct scsi_cmnd *) prev->host_scribble) in DEF_SCSI_QCMD()
509 WD33C93_scsi_pointer(prev)->phase = 1; in DEF_SCSI_QCMD()
517 scsi_pointer->phase = 1; in DEF_SCSI_QCMD()
520 hostdata->disc_allowed_cnt[cmd->device->id]++; in DEF_SCSI_QCMD()
525 write_wd33c93(regs, WD_SOURCE_ID, scsi_pointer->phase ? SRCID_ER : 0); in DEF_SCSI_QCMD()
527 write_wd33c93(regs, WD_TARGET_LUN, (u8)cmd->device->lun); in DEF_SCSI_QCMD()
529 hostdata->sync_xfer[cmd->device->id]); in DEF_SCSI_QCMD()
530 hostdata->busy[cmd->device->id] |= (1 << (cmd->device->lun & 0xFF)); in DEF_SCSI_QCMD()
532 if ((hostdata->level2 == L2_NONE) || in DEF_SCSI_QCMD()
533 (hostdata->sync_stat[cmd->device->id] == SS_UNSET)) { in DEF_SCSI_QCMD()
536 * Do a 'Select-With-ATN' command. This will end with in DEF_SCSI_QCMD()
538 * CSR_RESEL_AM: failure - can try again later. in DEF_SCSI_QCMD()
539 * CSR_TIMEOUT: failure - give up. in DEF_SCSI_QCMD()
540 * CSR_SELECT: success - proceed. in DEF_SCSI_QCMD()
543 hostdata->selecting = cmd; in DEF_SCSI_QCMD()
557 if (hostdata->sync_stat[cmd->device->id] == SS_UNSET) in DEF_SCSI_QCMD()
558 hostdata->sync_stat[cmd->device->id] = SS_FIRST; in DEF_SCSI_QCMD()
559 hostdata->state = S_SELECTING; in DEF_SCSI_QCMD()
565 * Do a 'Select-With-ATN-Xfer' command. This will end with in DEF_SCSI_QCMD()
567 * CSR_RESEL_AM: failure - can try again later. in DEF_SCSI_QCMD()
568 * CSR_TIMEOUT: failure - give up. in DEF_SCSI_QCMD()
569 * anything else: success - proceed. in DEF_SCSI_QCMD()
572 hostdata->connected = cmd; in DEF_SCSI_QCMD()
576 * (take advantage of auto-incrementing) in DEF_SCSI_QCMD()
579 write_wd33c93_cdb(regs, cmd->cmd_len, cmd->cmnd); in DEF_SCSI_QCMD()
582 * it's doing a 'select-and-transfer'. To be safe, we write the in DEF_SCSI_QCMD()
584 * way there won't be problems with vendor-unique, audio, etc. in DEF_SCSI_QCMD()
587 write_wd33c93(regs, WD_OWN_ID, cmd->cmd_len); in DEF_SCSI_QCMD()
589 /* When doing a non-disconnect command with DMA, we can save in DEF_SCSI_QCMD()
594 if (scsi_pointer->phase == 0 && hostdata->no_dma == 0) { in DEF_SCSI_QCMD()
595 if (hostdata->dma_setup(cmd, in DEF_SCSI_QCMD()
596 (cmd->sc_data_direction == DMA_TO_DEVICE) ? in DEF_SCSI_QCMD()
601 scsi_pointer->this_residual); in DEF_SCSI_QCMD()
603 CTRL_IDI | CTRL_EDI | hostdata->dma_mode); in DEF_SCSI_QCMD()
604 hostdata->dma = D_DMA_RUNNING; in DEF_SCSI_QCMD()
609 hostdata->state = S_RUNNING_LEVEL2; in DEF_SCSI_QCMD()
621 printk("%s)EX-2 ", scsi_pointer->phase ? "d:" : "")) in DEF_SCSI_QCMD()
650 /* Note: we are returning with the interrupt UN-cleared. in transfer_pio()
667 hostdata = (struct WD33C93_hostdata *) cmd->device->host->hostdata; in transfer_bytes()
669 /* Normally, you'd expect 'this_residual' to be non-zero here. in transfer_bytes()
670 * In a series of scatter-gather transfers, however, this in transfer_bytes()
672 * to 0 and 'buffers_residual' non-zero. This means that a in transfer_bytes()
674 * now we need to setup the next scatter-gather buffer as the in transfer_bytes()
677 if (!scsi_pointer->this_residual && scsi_pointer->buffers_residual) { in transfer_bytes()
678 scsi_pointer->buffer = sg_next(scsi_pointer->buffer); in transfer_bytes()
679 --scsi_pointer->buffers_residual; in transfer_bytes()
680 scsi_pointer->this_residual = scsi_pointer->buffer->length; in transfer_bytes()
681 scsi_pointer->ptr = sg_virt(scsi_pointer->buffer); in transfer_bytes()
683 if (!scsi_pointer->this_residual) /* avoid bogus setups */ in transfer_bytes()
687 hostdata->sync_xfer[cmd->device->id]); in transfer_bytes()
689 /* 'hostdata->no_dma' is TRUE if we don't even want to try DMA. in transfer_bytes()
693 if (hostdata->no_dma || hostdata->dma_setup(cmd, data_in_dir)) { in transfer_bytes()
695 hostdata->pio_cnt++; in transfer_bytes()
697 transfer_pio(regs, (uchar *) scsi_pointer->ptr, in transfer_bytes()
698 scsi_pointer->this_residual, data_in_dir, in transfer_bytes()
700 length = scsi_pointer->this_residual; in transfer_bytes()
701 scsi_pointer->this_residual = read_wd33c93_count(regs); in transfer_bytes()
702 scsi_pointer->ptr += length - scsi_pointer->this_residual; in transfer_bytes()
707 * We set 'hostdata->dma' = D_DMA_RUNNING so that when the in transfer_bytes()
716 hostdata->dma_cnt++; in transfer_bytes()
718 write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | hostdata->dma_mode); in transfer_bytes()
719 write_wd33c93_count(regs, scsi_pointer->this_residual); in transfer_bytes()
721 if ((hostdata->level2 >= L2_DATA) || in transfer_bytes()
722 (hostdata->level2 == L2_BASIC && scsi_pointer->phase == 0)) { in transfer_bytes()
725 hostdata->state = S_RUNNING_LEVEL2; in transfer_bytes()
729 hostdata->dma = D_DMA_RUNNING; in transfer_bytes()
738 (struct WD33C93_hostdata *) instance->hostdata; in wd33c93_intr()
739 const wd33c93_regs regs = hostdata->regs; in wd33c93_intr()
748 spin_lock_irqsave(&hostdata->lock, flags); in wd33c93_intr()
751 hostdata->int_cnt++; in wd33c93_intr()
754 cmd = (struct scsi_cmnd *) hostdata->connected; /* assume we're connected */ in wd33c93_intr()
759 DB(DB_INTR, printk("{%02x:%02x-", asr, sr)) in wd33c93_intr()
764 * in an open-ended fashion, it needs to be told when in wd33c93_intr()
775 if (hostdata->dma == D_DMA_RUNNING) { in wd33c93_intr()
777 printk("[%p/%d:", scsi_pointer->ptr, scsi_pointer->this_residual)) in wd33c93_intr()
778 hostdata->dma_stop(cmd->device->host, cmd, 1); in wd33c93_intr()
779 hostdata->dma = D_DMA_OFF; in wd33c93_intr()
780 length = scsi_pointer->this_residual; in wd33c93_intr()
781 scsi_pointer->this_residual = read_wd33c93_count(regs); in wd33c93_intr()
782 scsi_pointer->ptr += length - scsi_pointer->this_residual; in wd33c93_intr()
784 printk("%p/%d]", scsi_pointer->ptr, scsi_pointer->this_residual)) in wd33c93_intr()
787 /* Respond to the specific WD3393 interrupt - there are quite a few! */ in wd33c93_intr()
792 if (hostdata->state == S_RUNNING_LEVEL2) in wd33c93_intr()
793 hostdata->connected = NULL; in wd33c93_intr()
795 cmd = (struct scsi_cmnd *) hostdata->selecting; /* get a valid cmd */ in wd33c93_intr()
796 hostdata->selecting = NULL; in wd33c93_intr()
799 cmd->result = DID_NO_CONNECT << 16; in wd33c93_intr()
800 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); in wd33c93_intr()
801 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
814 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
816 /* We are not connected to a target - check to see if there in wd33c93_intr()
827 hostdata->connected = cmd = in wd33c93_intr()
828 (struct scsi_cmnd *) hostdata->selecting; in wd33c93_intr()
829 hostdata->selecting = NULL; in wd33c93_intr()
833 hostdata->outgoing_msg[0] = IDENTIFY(0, cmd->device->lun); in wd33c93_intr()
834 if (WD33C93_scsi_pointer(cmd)->phase) in wd33c93_intr()
835 hostdata->outgoing_msg[0] |= 0x40; in wd33c93_intr()
837 if (hostdata->sync_stat[cmd->device->id] == SS_FIRST) { in wd33c93_intr()
839 hostdata->sync_stat[cmd->device->id] = SS_WAITING; in wd33c93_intr()
843 * request a fifo depth of 0, which is equivalent to async - should in wd33c93_intr()
847 hostdata->outgoing_msg[1] = EXTENDED_MESSAGE; in wd33c93_intr()
848 hostdata->outgoing_msg[2] = 3; in wd33c93_intr()
849 hostdata->outgoing_msg[3] = EXTENDED_SDTR; in wd33c93_intr()
850 if (hostdata->no_sync & (1 << cmd->device->id)) { in wd33c93_intr()
851 calc_sync_msg(hostdata->default_sx_per, 0, in wd33c93_intr()
852 0, hostdata->outgoing_msg + 4); in wd33c93_intr()
856 hostdata->fast, in wd33c93_intr()
857 hostdata->outgoing_msg + 4); in wd33c93_intr()
859 hostdata->outgoing_len = 6; in wd33c93_intr()
861 ucp = hostdata->outgoing_msg + 1; in wd33c93_intr()
866 hostdata->outgoing_len = 1; in wd33c93_intr()
868 hostdata->state = S_CONNECTED; in wd33c93_intr()
869 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
876 printk("IN-%d.%d", scsi_pointer->this_residual, in wd33c93_intr()
877 scsi_pointer->buffers_residual)) in wd33c93_intr()
879 if (hostdata->state != S_RUNNING_LEVEL2) in wd33c93_intr()
880 hostdata->state = S_CONNECTED; in wd33c93_intr()
881 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
888 printk("OUT-%d.%d", scsi_pointer->this_residual, in wd33c93_intr()
889 scsi_pointer->buffers_residual)) in wd33c93_intr()
891 if (hostdata->state != S_RUNNING_LEVEL2) in wd33c93_intr()
892 hostdata->state = S_CONNECTED; in wd33c93_intr()
893 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
901 DB(DB_INTR, printk("CMND-%02x", cmd->cmnd[0])) in wd33c93_intr()
902 transfer_pio(regs, cmd->cmnd, cmd->cmd_len, DATA_OUT_DIR, in wd33c93_intr()
904 hostdata->state = S_CONNECTED; in wd33c93_intr()
905 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
912 scsi_pointer->Status = read_1_byte(regs); in wd33c93_intr()
913 DB(DB_INTR, printk("%02x", scsi_pointer->Status)) in wd33c93_intr()
914 if (hostdata->level2 >= L2_BASIC) { in wd33c93_intr()
917 hostdata->state = S_RUNNING_LEVEL2; in wd33c93_intr()
921 hostdata->state = S_CONNECTED; in wd33c93_intr()
923 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
935 hostdata->incoming_msg[hostdata->incoming_ptr] = msg; in wd33c93_intr()
936 if (hostdata->incoming_msg[0] == EXTENDED_MESSAGE) in wd33c93_intr()
939 hostdata->incoming_ptr = 0; in wd33c93_intr()
941 scsi_pointer->Message = msg; in wd33c93_intr()
947 hostdata->state = S_PRE_CMP_DISC; in wd33c93_intr()
953 hostdata->state = S_CONNECTED; in wd33c93_intr()
958 if (hostdata->level2 >= L2_BASIC) { in wd33c93_intr()
961 hostdata->state = S_RUNNING_LEVEL2; in wd33c93_intr()
964 hostdata->state = S_CONNECTED; in wd33c93_intr()
970 cmd->device->disconnect = 1; in wd33c93_intr()
972 hostdata->state = S_PRE_TMP_DISC; in wd33c93_intr()
978 printk("-REJ-"); in wd33c93_intr()
980 if (hostdata->sync_stat[cmd->device->id] == SS_WAITING) { in wd33c93_intr()
981 hostdata->sync_stat[cmd->device->id] = SS_SET; in wd33c93_intr()
983 hostdata->sync_xfer[cmd->device->id] = in wd33c93_intr()
984 calc_sync_xfer(hostdata->default_sx_per in wd33c93_intr()
985 / 4, 0, 0, hostdata->sx_table); in wd33c93_intr()
988 hostdata->state = S_CONNECTED; in wd33c93_intr()
994 ucp = hostdata->incoming_msg; in wd33c93_intr()
997 printk("%02x", ucp[hostdata->incoming_ptr]); in wd33c93_intr()
1001 if ((hostdata->incoming_ptr >= 2) && in wd33c93_intr()
1002 (hostdata->incoming_ptr == (ucp[1] + 1))) { in wd33c93_intr()
1007 id = calc_sync_xfer(hostdata-> in wd33c93_intr()
1009 0, hostdata->sx_table); in wd33c93_intr()
1010 if (hostdata->sync_stat[cmd->device->id] != in wd33c93_intr()
1017 * transfers - not ideal but so much easier. in wd33c93_intr()
1023 hostdata->outgoing_msg[0] = in wd33c93_intr()
1025 hostdata->outgoing_msg[1] = 3; in wd33c93_intr()
1026 hostdata->outgoing_msg[2] = in wd33c93_intr()
1028 calc_sync_msg(hostdata-> in wd33c93_intr()
1030 0, hostdata->outgoing_msg + 3); in wd33c93_intr()
1031 hostdata->outgoing_len = 5; in wd33c93_intr()
1035 hostdata->fast, in wd33c93_intr()
1036 hostdata->sx_table); in wd33c93_intr()
1039 0, hostdata->sx_table); in wd33c93_intr()
1041 hostdata->sync_xfer[cmd->device->id] = id; in wd33c93_intr()
1044 hostdata->sync_xfer[cmd->device->id]); in wd33c93_intr()
1046 hostdata->sync_stat[cmd->device->id] = in wd33c93_intr()
1050 hostdata->state = S_CONNECTED; in wd33c93_intr()
1055 hostdata->outgoing_msg[0] = in wd33c93_intr()
1057 hostdata->outgoing_msg[1] = 2; in wd33c93_intr()
1058 hostdata->outgoing_msg[2] = in wd33c93_intr()
1060 hostdata->outgoing_msg[3] = 0; /* 8 bit transfer width */ in wd33c93_intr()
1061 hostdata->outgoing_len = 4; in wd33c93_intr()
1064 hostdata->state = S_CONNECTED; in wd33c93_intr()
1071 hostdata->outgoing_msg[0] = in wd33c93_intr()
1073 hostdata->outgoing_len = 1; in wd33c93_intr()
1076 hostdata->state = S_CONNECTED; in wd33c93_intr()
1079 hostdata->incoming_ptr = 0; in wd33c93_intr()
1085 hostdata->incoming_ptr++; in wd33c93_intr()
1087 hostdata->state = S_CONNECTED; in wd33c93_intr()
1094 hostdata->outgoing_msg[0] = MESSAGE_REJECT; in wd33c93_intr()
1095 hostdata->outgoing_len = 1; in wd33c93_intr()
1097 hostdata->state = S_CONNECTED; in wd33c93_intr()
1099 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1106 /* Make sure that reselection is enabled at this point - it may in wd33c93_intr()
1112 DB(DB_INTR, printk("SX-DONE")) in wd33c93_intr()
1113 scsi_pointer->Message = COMMAND_COMPLETE; in wd33c93_intr()
1115 DB(DB_INTR, printk(":%d.%d", scsi_pointer->Status, lun)) in wd33c93_intr()
1116 hostdata->connected = NULL; in wd33c93_intr()
1117 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); in wd33c93_intr()
1118 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1119 if (scsi_pointer->Status == ILLEGAL_STATUS_BYTE) in wd33c93_intr()
1120 scsi_pointer->Status = lun; in wd33c93_intr()
1121 if (cmd->cmnd[0] == REQUEST_SENSE in wd33c93_intr()
1122 && scsi_pointer->Status != SAM_STAT_GOOD) { in wd33c93_intr()
1126 scsi_msg_to_host_byte(cmd, scsi_pointer->Message); in wd33c93_intr()
1127 set_status_byte(cmd, scsi_pointer->Status); in wd33c93_intr()
1131 /* We are no longer connected to a target - check to see if in wd33c93_intr()
1134 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1138 ("%02x:%02x:%02x: Unknown SEL_XFER_DONE phase!!---", in wd33c93_intr()
1140 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1148 hostdata->state = S_RUNNING_LEVEL2; in wd33c93_intr()
1151 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1163 * it - like when our SDTR message is rejected by a target. Some in wd33c93_intr()
1171 if (hostdata->outgoing_len == 0) { in wd33c93_intr()
1172 hostdata->outgoing_len = 1; in wd33c93_intr()
1173 hostdata->outgoing_msg[0] = NOP; in wd33c93_intr()
1175 transfer_pio(regs, hostdata->outgoing_msg, in wd33c93_intr()
1176 hostdata->outgoing_len, DATA_OUT_DIR, hostdata); in wd33c93_intr()
1177 DB(DB_INTR, printk("%02x", hostdata->outgoing_msg[0])) in wd33c93_intr()
1178 hostdata->outgoing_len = 0; in wd33c93_intr()
1179 hostdata->state = S_CONNECTED; in wd33c93_intr()
1180 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1185 /* I think I've seen this after a request-sense that was in response in wd33c93_intr()
1187 * something when we get this interrupt - the question is 'what?'. in wd33c93_intr()
1189 * in a legal manner (like a command that provokes a request-sense), in wd33c93_intr()
1190 * so we treat it as a normal command-complete-disconnect. in wd33c93_intr()
1193 /* Make sure that reselection is enabled at this point - it may in wd33c93_intr()
1199 printk(" - Already disconnected! "); in wd33c93_intr()
1200 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1201 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1205 hostdata->connected = NULL; in wd33c93_intr()
1206 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); in wd33c93_intr()
1207 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1208 if (cmd->cmnd[0] == REQUEST_SENSE && in wd33c93_intr()
1209 scsi_pointer->Status != SAM_STAT_GOOD) { in wd33c93_intr()
1213 scsi_msg_to_host_byte(cmd, scsi_pointer->Message); in wd33c93_intr()
1214 set_status_byte(cmd, scsi_pointer->Status); in wd33c93_intr()
1218 /* We are no longer connected to a target - check to see if in wd33c93_intr()
1222 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1228 /* Make sure that reselection is enabled at this point - it may in wd33c93_intr()
1235 printk(" - Already disconnected! "); in wd33c93_intr()
1236 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1238 switch (hostdata->state) { in wd33c93_intr()
1240 hostdata->connected = NULL; in wd33c93_intr()
1241 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); in wd33c93_intr()
1242 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1243 DB(DB_INTR, printk(":%d", scsi_pointer->Status)) in wd33c93_intr()
1244 if (cmd->cmnd[0] == REQUEST_SENSE in wd33c93_intr()
1245 && scsi_pointer->Status != SAM_STAT_GOOD) { in wd33c93_intr()
1249 scsi_msg_to_host_byte(cmd, scsi_pointer->Message); in wd33c93_intr()
1250 set_status_byte(cmd, scsi_pointer->Status); in wd33c93_intr()
1256 cmd->host_scribble = (uchar *) hostdata->disconnected_Q; in wd33c93_intr()
1257 hostdata->disconnected_Q = cmd; in wd33c93_intr()
1258 hostdata->connected = NULL; in wd33c93_intr()
1259 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1262 hostdata->disc_done_cnt[cmd->device->id]++; in wd33c93_intr()
1268 hostdata->state = S_UNCONNECTED; in wd33c93_intr()
1271 /* We are no longer connected to a target - check to see if in wd33c93_intr()
1274 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1282 /* Old chips (pre -A ???) don't have advanced features and will in wd33c93_intr()
1289 if (hostdata->level2 <= L2_NONE) { in wd33c93_intr()
1291 if (hostdata->selecting) { in wd33c93_intr()
1292 cmd = (struct scsi_cmnd *) hostdata->selecting; in wd33c93_intr()
1293 hostdata->selecting = NULL; in wd33c93_intr()
1294 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); in wd33c93_intr()
1295 cmd->host_scribble = in wd33c93_intr()
1296 (uchar *) hostdata->input_Q; in wd33c93_intr()
1297 hostdata->input_Q = cmd; in wd33c93_intr()
1305 hostdata->busy[cmd->device->id] &= in wd33c93_intr()
1306 ~(1 << (cmd->device->lun & 0xff)); in wd33c93_intr()
1307 cmd->host_scribble = in wd33c93_intr()
1308 (uchar *) hostdata->input_Q; in wd33c93_intr()
1309 hostdata->input_Q = cmd; in wd33c93_intr()
1312 ("---%02x:%02x:%02x-TROUBLE: Intrusive ReSelect!---", in wd33c93_intr()
1321 /* OK - find out which device reselected us. */ in wd33c93_intr()
1327 * bother to check for a valid message here - I guess this is in wd33c93_intr()
1333 if (hostdata->level2 < L2_RESELECT) in wd33c93_intr()
1338 for (lun = 255; lun; lun--) { in wd33c93_intr()
1386 cmd = (struct scsi_cmnd *) hostdata->disconnected_Q; in wd33c93_intr()
1389 if (id == cmd->device->id && lun == (u8)cmd->device->lun) in wd33c93_intr()
1392 cmd = (struct scsi_cmnd *) cmd->host_scribble; in wd33c93_intr()
1399 ("---TROUBLE: target %d.%d not in disconnect queue---", in wd33c93_intr()
1401 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1405 /* Ok, found the command - now start it up again. */ in wd33c93_intr()
1408 patch->host_scribble = cmd->host_scribble; in wd33c93_intr()
1410 hostdata->disconnected_Q = in wd33c93_intr()
1411 (struct scsi_cmnd *) cmd->host_scribble; in wd33c93_intr()
1412 hostdata->connected = cmd; in wd33c93_intr()
1414 /* We don't need to worry about 'initialize_SCp()' or 'hostdata->busy[]' in wd33c93_intr()
1419 if (cmd->sc_data_direction == DMA_TO_DEVICE) in wd33c93_intr()
1420 write_wd33c93(regs, WD_DESTINATION_ID, cmd->device->id); in wd33c93_intr()
1423 cmd->device->id | DSTID_DPD); in wd33c93_intr()
1424 if (hostdata->level2 >= L2_RESELECT) { in wd33c93_intr()
1428 hostdata->state = S_RUNNING_LEVEL2; in wd33c93_intr()
1430 hostdata->state = S_CONNECTED; in wd33c93_intr()
1432 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1436 printk("--UNKNOWN INTERRUPT:%02x:%02x:%02x--", asr, sr, phs); in wd33c93_intr()
1437 spin_unlock_irqrestore(&hostdata->lock, flags); in wd33c93_intr()
1448 (struct WD33C93_hostdata *) instance->hostdata; in reset_wd33c93()
1449 const wd33c93_regs regs = hostdata->regs; in reset_wd33c93()
1468 sgiwd93_reset(instance->base); /* yeah, give it the hard one */ in reset_wd33c93()
1473 instance->this_id | hostdata->clock_freq); in reset_wd33c93()
1476 calc_sync_xfer(hostdata->default_sx_per / 4, in reset_wd33c93()
1477 DEFAULT_SX_OFF, 0, hostdata->sx_table)); in reset_wd33c93()
1489 hostdata->microcode = read_wd33c93(regs, WD_CDB_1); in reset_wd33c93()
1491 hostdata->chip = C_WD33C93; in reset_wd33c93()
1496 hostdata->chip = C_WD33C93B; in reset_wd33c93()
1499 hostdata->chip = C_WD33C93A; in reset_wd33c93()
1501 hostdata->chip = C_UNKNOWN_CHIP; in reset_wd33c93()
1503 if (hostdata->chip != C_WD33C93B) /* Fast SCSI unavailable */ in reset_wd33c93()
1504 hostdata->fast = 0; in reset_wd33c93()
1517 instance = SCpnt->device->host; in wd33c93_host_reset()
1518 spin_lock_irq(instance->host_lock); in wd33c93_host_reset()
1519 hostdata = (struct WD33C93_hostdata *) instance->hostdata; in wd33c93_host_reset()
1521 printk("scsi%d: reset. ", instance->host_no); in wd33c93_host_reset()
1522 disable_irq(instance->irq); in wd33c93_host_reset()
1524 hostdata->dma_stop(instance, NULL, 0); in wd33c93_host_reset()
1526 hostdata->busy[i] = 0; in wd33c93_host_reset()
1527 hostdata->sync_xfer[i] = in wd33c93_host_reset()
1529 0, hostdata->sx_table); in wd33c93_host_reset()
1530 hostdata->sync_stat[i] = SS_UNSET; /* using default sync values */ in wd33c93_host_reset()
1532 hostdata->input_Q = NULL; in wd33c93_host_reset()
1533 hostdata->selecting = NULL; in wd33c93_host_reset()
1534 hostdata->connected = NULL; in wd33c93_host_reset()
1535 hostdata->disconnected_Q = NULL; in wd33c93_host_reset()
1536 hostdata->state = S_UNCONNECTED; in wd33c93_host_reset()
1537 hostdata->dma = D_DMA_OFF; in wd33c93_host_reset()
1538 hostdata->incoming_ptr = 0; in wd33c93_host_reset()
1539 hostdata->outgoing_len = 0; in wd33c93_host_reset()
1542 SCpnt->result = DID_RESET << 16; in wd33c93_host_reset()
1543 enable_irq(instance->irq); in wd33c93_host_reset()
1544 spin_unlock_irq(instance->host_lock); in wd33c93_host_reset()
1556 disable_irq(cmd->device->host->irq); in wd33c93_abort()
1558 instance = cmd->device->host; in wd33c93_abort()
1559 hostdata = (struct WD33C93_hostdata *) instance->hostdata; in wd33c93_abort()
1560 regs = hostdata->regs; in wd33c93_abort()
1567 tmp = (struct scsi_cmnd *) hostdata->input_Q; in wd33c93_abort()
1572 prev->host_scribble = cmd->host_scribble; in wd33c93_abort()
1574 hostdata->input_Q = in wd33c93_abort()
1575 (struct scsi_cmnd *) cmd->host_scribble; in wd33c93_abort()
1576 cmd->host_scribble = NULL; in wd33c93_abort()
1577 cmd->result = DID_ABORT << 16; in wd33c93_abort()
1579 ("scsi%d: Abort - removing command from input_Q. ", in wd33c93_abort()
1580 instance->host_no); in wd33c93_abort()
1581 enable_irq(cmd->device->host->irq); in wd33c93_abort()
1586 tmp = (struct scsi_cmnd *) tmp->host_scribble; in wd33c93_abort()
1600 if (hostdata->connected == cmd) { in wd33c93_abort()
1604 printk("scsi%d: Aborting connected command - ", in wd33c93_abort()
1605 instance->host_no); in wd33c93_abort()
1607 printk("stopping DMA - "); in wd33c93_abort()
1608 if (hostdata->dma == D_DMA_RUNNING) { in wd33c93_abort()
1609 hostdata->dma_stop(instance, cmd, 0); in wd33c93_abort()
1610 hostdata->dma = D_DMA_OFF; in wd33c93_abort()
1613 printk("sending wd33c93 ABORT command - "); in wd33c93_abort()
1620 printk("flushing fifo - "); in wd33c93_abort()
1626 } while (!(asr & ASR_INT) && timeout-- > 0); in wd33c93_abort()
1629 ("asr=%02x, sr=%02x, %ld bytes un-transferred (timeout=%ld) - ", in wd33c93_abort()
1638 printk("sending wd33c93 DISCONNECT command - "); in wd33c93_abort()
1643 while ((asr & ASR_CIP) && timeout-- > 0) in wd33c93_abort()
1648 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); in wd33c93_abort()
1649 hostdata->connected = NULL; in wd33c93_abort()
1650 hostdata->state = S_UNCONNECTED; in wd33c93_abort()
1651 cmd->result = DID_ABORT << 16; in wd33c93_abort()
1656 enable_irq(cmd->device->host->irq); in wd33c93_abort()
1667 tmp = (struct scsi_cmnd *) hostdata->disconnected_Q; in wd33c93_abort()
1671 ("scsi%d: Abort - command found on disconnected_Q - ", in wd33c93_abort()
1672 instance->host_no); in wd33c93_abort()
1674 enable_irq(cmd->device->host->irq); in wd33c93_abort()
1677 tmp = (struct scsi_cmnd *) tmp->host_scribble; in wd33c93_abort()
1693 enable_irq(cmd->device->host->irq); in wd33c93_abort()
1695 " before abortion. ", instance->host_no); in wd33c93_abort()
1712 /* The kernel does some processing of the command-line before calling in wd33c93_setup()
1715 * themselves. str points to where the non-numeric arguments (if any) in wd33c93_setup()
1767 *val = -1; in check_setup_args()
1778 * Calculate internal data-transfer-clock cycle from input-clock
1782 * for (only) the lower limits of the respective input-clock-frequency ranges
1783 * (8-10/12-15/16-20 MHz). Although it seems, that no problems occurred with
1785 * closer to the really attached, possibly 25% higher, input-clock, since
1786 * - the wd33c93 may really use a significant shorter period, than it has
1789 * - the wd33c93 may ask the target for a lower transfer rate, than the target
1798 case 1: --x; in round_4()
1812 d = 2; /* divisor for 8-10 MHz input-clock */ in calc_sx_table()
1814 d = 3; /* divisor for 12-15 MHz input-clock */ in calc_sx_table()
1816 d = 4; /* divisor for 16-20 MHz input-clock */ in calc_sx_table()
1832 * check and, maybe, map an init- or "clock:"- argument.
1835 set_clk_freq(int freq, int *mhz) in set_clk_freq() argument
1837 int x = freq; in set_clk_freq()
1838 if (WD33C93_FS_8_10 == freq) in set_clk_freq()
1839 freq = 8; in set_clk_freq()
1840 else if (WD33C93_FS_12_15 == freq) in set_clk_freq()
1841 freq = 12; in set_clk_freq()
1842 else if (WD33C93_FS_16_20 == freq) in set_clk_freq()
1843 freq = 16; in set_clk_freq()
1844 else if (freq > 7 && freq < 11) in set_clk_freq()
1846 else if (freq > 11 && freq < 16) in set_clk_freq()
1848 else if (freq > 15 && freq < 21) in set_clk_freq()
1851 /* Hmm, wouldn't it be safer to assume highest freq here? */ in set_clk_freq()
1853 freq = 8; in set_clk_freq()
1855 *mhz = freq; in set_clk_freq()
1867 hd->sync_stat[i] = SS_UNSET; in set_resync()
1883 hostdata = (struct WD33C93_hostdata *) instance->hostdata; in wd33c93_init()
1885 hostdata->regs = regs; in wd33c93_init()
1886 hostdata->clock_freq = set_clk_freq(clock_freq, &i); in wd33c93_init()
1887 calc_sx_table(i, hostdata->sx_table); in wd33c93_init()
1888 hostdata->dma_setup = setup; in wd33c93_init()
1889 hostdata->dma_stop = stop; in wd33c93_init()
1890 hostdata->dma_bounce_buffer = NULL; in wd33c93_init()
1891 hostdata->dma_bounce_len = 0; in wd33c93_init()
1893 hostdata->busy[i] = 0; in wd33c93_init()
1894 hostdata->sync_xfer[i] = in wd33c93_init()
1896 0, hostdata->sx_table); in wd33c93_init()
1897 hostdata->sync_stat[i] = SS_UNSET; /* using default sync values */ in wd33c93_init()
1899 hostdata->cmd_cnt[i] = 0; in wd33c93_init()
1900 hostdata->disc_allowed_cnt[i] = 0; in wd33c93_init()
1901 hostdata->disc_done_cnt[i] = 0; in wd33c93_init()
1904 hostdata->input_Q = NULL; in wd33c93_init()
1905 hostdata->selecting = NULL; in wd33c93_init()
1906 hostdata->connected = NULL; in wd33c93_init()
1907 hostdata->disconnected_Q = NULL; in wd33c93_init()
1908 hostdata->state = S_UNCONNECTED; in wd33c93_init()
1909 hostdata->dma = D_DMA_OFF; in wd33c93_init()
1910 hostdata->level2 = L2_BASIC; in wd33c93_init()
1911 hostdata->disconnect = DIS_ADAPTIVE; in wd33c93_init()
1912 hostdata->args = DEBUG_DEFAULTS; in wd33c93_init()
1913 hostdata->incoming_ptr = 0; in wd33c93_init()
1914 hostdata->outgoing_len = 0; in wd33c93_init()
1915 hostdata->default_sx_per = DEFAULT_SX_PER; in wd33c93_init()
1916 hostdata->no_dma = 0; /* default is DMA enabled */ in wd33c93_init()
1919 hostdata->proc = PR_VERSION | PR_INFO | PR_STATISTICS | in wd33c93_init()
1922 hostdata->dma_cnt = 0; in wd33c93_init()
1923 hostdata->pio_cnt = 0; in wd33c93_init()
1924 hostdata->int_cnt = 0; in wd33c93_init()
1929 hostdata->clock_freq = set_clk_freq(val, &val); in wd33c93_init()
1930 calc_sx_table(val, hostdata->sx_table); in wd33c93_init()
1934 hostdata->no_sync = val; in wd33c93_init()
1937 hostdata->no_dma = (val == -1) ? 1 : val; in wd33c93_init()
1940 hostdata->default_sx_per = in wd33c93_init()
1941 hostdata->sx_table[round_period((unsigned int) val, in wd33c93_init()
1942 hostdata->sx_table)].period_ns; in wd33c93_init()
1946 hostdata->disconnect = val; in wd33c93_init()
1948 hostdata->disconnect = DIS_ADAPTIVE; in wd33c93_init()
1952 hostdata->level2 = val; in wd33c93_init()
1955 hostdata->args = val & DB_MASK; in wd33c93_init()
1958 hostdata->dma_mode = val ? CTRL_BURST:CTRL_DMA; in wd33c93_init()
1960 if (WD33C93_FS_16_20 == hostdata->clock_freq /* divisor 4 */ in wd33c93_init()
1962 hostdata->fast = !!val; in wd33c93_init()
1966 setup_used[--i] = 1; in wd33c93_init()
1970 hostdata->proc = val; in wd33c93_init()
1973 spin_lock_irq(&hostdata->lock); in wd33c93_init()
1975 spin_unlock_irq(&hostdata->lock); in wd33c93_init()
1977 printk("wd33c93-%d: chip=%s/%d no_sync=0x%x no_dma=%d", in wd33c93_init()
1978 instance->host_no, in wd33c93_init()
1979 (hostdata->chip == C_WD33C93) ? "WD33c93" : (hostdata->chip == in wd33c93_init()
1981 "WD33c93A" : (hostdata->chip == in wd33c93_init()
1983 hostdata->microcode, hostdata->no_sync, hostdata->no_dma); in wd33c93_init()
1985 printk(" debug_flags=0x%02x\n", hostdata->args); in wd33c93_init()
1993 printk(" Version %s - %s\n", WD33C93_VERSION, WD33C93_DATE); in wd33c93_init()
2003 hd = (struct WD33C93_hostdata *) instance->hostdata; in wd33c93_write_info()
2006 * keywords (same format as command-line, but arguments are not optional): in wd33c93_write_info()
2024 hd->args = simple_strtoul(bp+6, &bp, 0) & DB_MASK; in wd33c93_write_info()
2029 hd->disconnect = x; in wd33c93_write_info()
2032 hd->default_sx_per = in wd33c93_write_info()
2033 hd->sx_table[round_period((unsigned int) x, in wd33c93_write_info()
2034 hd->sx_table)].period_ns; in wd33c93_write_info()
2038 hd->proc = simple_strtoul(bp+5, &bp, 0); in wd33c93_write_info()
2040 hd->no_dma = simple_strtoul(bp+6, &bp, 0); in wd33c93_write_info()
2042 hd->level2 = simple_strtoul(bp+7, &bp, 0); in wd33c93_write_info()
2044 hd->dma_mode = in wd33c93_write_info()
2048 if (x != hd->fast) in wd33c93_write_info()
2050 hd->fast = x; in wd33c93_write_info()
2053 set_resync(hd, x ^ hd->no_sync); in wd33c93_write_info()
2054 hd->no_sync = x; in wd33c93_write_info()
2056 break; /* unknown keyword,syntax-error,... */ in wd33c93_write_info()
2073 hd = (struct WD33C93_hostdata *) instance->hostdata; in wd33c93_show_info()
2075 spin_lock_irq(&hd->lock); in wd33c93_show_info()
2076 if (hd->proc & PR_VERSION) in wd33c93_show_info()
2077 seq_printf(m, "\nVersion %s - %s.", in wd33c93_show_info()
2080 if (hd->proc & PR_INFO) { in wd33c93_show_info()
2083 hd->clock_freq, hd->no_sync, hd->no_dma, hd->dma_mode, hd->fast); in wd33c93_show_info()
2086 seq_printf(m, "\t%02x", hd->sync_xfer[x]); in wd33c93_show_info()
2089 seq_printf(m, "\t%02x", hd->sync_stat[x]); in wd33c93_show_info()
2092 if (hd->proc & PR_STATISTICS) { in wd33c93_show_info()
2095 seq_printf(m, "\t%ld", hd->cmd_cnt[x]); in wd33c93_show_info()
2098 seq_printf(m, "\t%ld", hd->disc_allowed_cnt[x]); in wd33c93_show_info()
2101 seq_printf(m, "\t%ld", hd->disc_done_cnt[x]); in wd33c93_show_info()
2104 hd->int_cnt, hd->dma_cnt, hd->pio_cnt); in wd33c93_show_info()
2107 if (hd->proc & PR_CONNECTED) { in wd33c93_show_info()
2109 if (hd->connected) { in wd33c93_show_info()
2110 cmd = (struct scsi_cmnd *) hd->connected; in wd33c93_show_info()
2112 cmd->device->id, cmd->device->lun, cmd->cmnd[0]); in wd33c93_show_info()
2115 if (hd->proc & PR_INPUTQ) { in wd33c93_show_info()
2117 cmd = (struct scsi_cmnd *) hd->input_Q; in wd33c93_show_info()
2120 cmd->device->id, cmd->device->lun, cmd->cmnd[0]); in wd33c93_show_info()
2121 cmd = (struct scsi_cmnd *) cmd->host_scribble; in wd33c93_show_info()
2124 if (hd->proc & PR_DISCQ) { in wd33c93_show_info()
2126 cmd = (struct scsi_cmnd *) hd->disconnected_Q; in wd33c93_show_info()
2129 cmd->device->id, cmd->device->lun, cmd->cmnd[0]); in wd33c93_show_info()
2130 cmd = (struct scsi_cmnd *) cmd->host_scribble; in wd33c93_show_info()
2134 spin_unlock_irq(&hd->lock); in wd33c93_show_info()