Lines Matching refs:current_SC
228 #define current_SC (HOSTDATA(shpnt)->_current_SC) macro
687 current_SC->result = error; in my_done()
688 current_SC->scsi_done( current_SC ); in my_done()
726 if (current_SC->SCp.phase & aborted) { in fd_mcs_intr()
737 if (current_SC->SCp.phase & in_arbitration) { in fd_mcs_intr()
748 current_SC->SCp.phase = in_selection; in fd_mcs_intr()
753 outb( adapter_mask | (1 << current_SC->target), SCSI_Data_NoACK_port ); in fd_mcs_intr()
761 } else if (current_SC->SCp.phase & in_selection) { in fd_mcs_intr()
765 if (fd_mcs_select(shpnt, current_SC->target )) { in fd_mcs_intr()
781 current_SC->SCp.phase = in_other; in fd_mcs_intr()
799 outb( current_SC->cmnd[current_SC->SCp.sent_command++], in fd_mcs_intr()
803 current_SC->cmnd[ current_SC->SCp.sent_command - 1] ); in fd_mcs_intr()
807 if (chip != tmc1800 && !current_SC->SCp.have_data_in) { in fd_mcs_intr()
808 current_SC->SCp.have_data_in = -1; in fd_mcs_intr()
813 if (chip != tmc1800 && !current_SC->SCp.have_data_in) { in fd_mcs_intr()
814 current_SC->SCp.have_data_in = 1; in fd_mcs_intr()
819 current_SC->SCp.Status = inb( Read_SCSI_Data_port ); in fd_mcs_intr()
821 printk( "Status = %x, ", current_SC->SCp.Status ); in fd_mcs_intr()
824 if (current_SC->SCp.Status in fd_mcs_intr()
825 && current_SC->SCp.Status != 2 in fd_mcs_intr()
826 && current_SC->SCp.Status != 8) { in fd_mcs_intr()
828 current_SC->target, in fd_mcs_intr()
829 current_SC->cmnd[0], in fd_mcs_intr()
830 current_SC->SCp.Status ); in fd_mcs_intr()
838 current_SC->SCp.Message = inb( Read_SCSI_Data_port ); in fd_mcs_intr()
840 printk( "Message = %x, ", current_SC->SCp.Message ); in fd_mcs_intr()
842 if (!current_SC->SCp.Message) ++done; in fd_mcs_intr()
844 if (current_SC->SCp.Message) { in fd_mcs_intr()
845 printk( "fd_mcs: message = %x\n", current_SC->SCp.Message ); in fd_mcs_intr()
853 && !current_SC->SCp.have_data_in in fd_mcs_intr()
854 && (current_SC->SCp.sent_command in fd_mcs_intr()
855 >= current_SC->cmd_len)) { in fd_mcs_intr()
982 switch (current_SC->cmnd[0]) { in fd_mcs_intr()
1003 current_SC->SCp.have_data_in = -1; in fd_mcs_intr()
1010 current_SC->SCp.have_data_in = 1; in fd_mcs_intr()
1016 if (current_SC->SCp.have_data_in == -1) { /* DATA OUT */ in fd_mcs_intr()
1021 if (data_count > current_SC->SCp.this_residual) in fd_mcs_intr()
1022 data_count = current_SC->SCp.this_residual; in fd_mcs_intr()
1030 outb( *current_SC->SCp.ptr++, Write_FIFO_port ); in fd_mcs_intr()
1031 --current_SC->SCp.this_residual; in fd_mcs_intr()
1035 outsw( Write_FIFO_port, current_SC->SCp.ptr, data_count ); in fd_mcs_intr()
1036 current_SC->SCp.ptr += tmp_count; in fd_mcs_intr()
1038 current_SC->SCp.this_residual -= tmp_count; in fd_mcs_intr()
1041 if (!current_SC->SCp.this_residual) { in fd_mcs_intr()
1042 if (current_SC->SCp.buffers_residual) { in fd_mcs_intr()
1043 --current_SC->SCp.buffers_residual; in fd_mcs_intr()
1044 ++current_SC->SCp.buffer; in fd_mcs_intr()
1045 current_SC->SCp.ptr = current_SC->SCp.buffer->address; in fd_mcs_intr()
1046 current_SC->SCp.this_residual = current_SC->SCp.buffer->length; in fd_mcs_intr()
1051 } else if (current_SC->SCp.have_data_in == 1) { /* DATA IN */ in fd_mcs_intr()
1056 if (data_count > current_SC->SCp.this_residual) in fd_mcs_intr()
1057 data_count = current_SC->SCp.this_residual; in fd_mcs_intr()
1064 *current_SC->SCp.ptr++ = inb( Read_FIFO_port ); in fd_mcs_intr()
1065 --current_SC->SCp.this_residual; in fd_mcs_intr()
1069 insw( Read_FIFO_port, current_SC->SCp.ptr, data_count ); in fd_mcs_intr()
1070 current_SC->SCp.ptr += tmp_count; in fd_mcs_intr()
1072 current_SC->SCp.this_residual -= tmp_count; in fd_mcs_intr()
1075 if (!current_SC->SCp.this_residual in fd_mcs_intr()
1076 && current_SC->SCp.buffers_residual) { in fd_mcs_intr()
1077 --current_SC->SCp.buffers_residual; in fd_mcs_intr()
1078 ++current_SC->SCp.buffer; in fd_mcs_intr()
1079 current_SC->SCp.ptr = current_SC->SCp.buffer->address; in fd_mcs_intr()
1080 current_SC->SCp.this_residual = current_SC->SCp.buffer->length; in fd_mcs_intr()
1087 printk( " ** IN DONE %d ** ", current_SC->SCp.have_data_in ); in fd_mcs_intr()
1091 if (current_SC->cmnd[0] == REQUEST_SENSE && !current_SC->SCp.Status) { in fd_mcs_intr()
1092 if ((unsigned char)(*((char *)current_SC->request_buffer+2)) & 0x0f) { in fd_mcs_intr()
1097 key = (unsigned char)(*((char *)current_SC->request_buffer + 2)) in fd_mcs_intr()
1099 code = (unsigned char)(*((char *)current_SC->request_buffer + 12)); in fd_mcs_intr()
1100 qualifier = (unsigned char)(*((char *)current_SC->request_buffer in fd_mcs_intr()
1122 (current_SC->SCp.Status & 0xff) in fd_mcs_intr()
1123 | ((current_SC->SCp.Message & 0xff) << 8) | (DID_OK << 16) ); in fd_mcs_intr()
1130 if (current_SC->SCp.phase & disconnect) { in fd_mcs_intr()
1190 current_SC = SCpnt; in fd_mcs_queue()
1194 if (current_SC->use_sg) { in fd_mcs_queue()
1195 current_SC->SCp.buffer = in fd_mcs_queue()
1196 (struct scatterlist *)current_SC->request_buffer; in fd_mcs_queue()
1197 current_SC->SCp.ptr = current_SC->SCp.buffer->address; in fd_mcs_queue()
1198 current_SC->SCp.this_residual = current_SC->SCp.buffer->length; in fd_mcs_queue()
1199 current_SC->SCp.buffers_residual = current_SC->use_sg - 1; in fd_mcs_queue()
1201 current_SC->SCp.ptr = (char *)current_SC->request_buffer; in fd_mcs_queue()
1202 current_SC->SCp.this_residual = current_SC->request_bufflen; in fd_mcs_queue()
1203 current_SC->SCp.buffer = NULL; in fd_mcs_queue()
1204 current_SC->SCp.buffers_residual = 0; in fd_mcs_queue()
1208 current_SC->SCp.Status = 0; in fd_mcs_queue()
1209 current_SC->SCp.Message = 0; in fd_mcs_queue()
1210 current_SC->SCp.have_data_in = 0; in fd_mcs_queue()
1211 current_SC->SCp.sent_command = 0; in fd_mcs_queue()
1212 current_SC->SCp.phase = in_arbitration; in fd_mcs_queue()
1338 current_SC->SCp.phase |= aborted; in fd_mcs_abort()
1340 current_SC->result = DID_ABORT << 16; in fd_mcs_abort()
1365 if (called_once) fd_mcs_print_info( current_SC ); in fd_mcs_reset()