aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fd_mcs.c
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2007-09-09 14:12:24 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 19:22:35 -0500
commit8e31f1f4d94c8e7e09efab0166cb2ef2ceeec2ce (patch)
tree3bb9f90444ef917bc3f9aadbc6c653b83e6b146c /drivers/scsi/fd_mcs.c
parentfc3fdfcc8bb0e069a2d172e745664fa2c1f1b0ca (diff)
[SCSI] fd_mcs: convert to accessors and !use_sg cleanup
- convert to accessors and !use_sg cleanup - Not ready for sg-chaining Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/fd_mcs.c')
-rw-r--r--drivers/scsi/fd_mcs.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/drivers/scsi/fd_mcs.c b/drivers/scsi/fd_mcs.c
index 8335b608e571..85bd54c77b50 100644
--- a/drivers/scsi/fd_mcs.c
+++ b/drivers/scsi/fd_mcs.c
@@ -1017,24 +1017,6 @@ static irqreturn_t fd_mcs_intr(int irq, void *dev_id)
1017 printk(" ** IN DONE %d ** ", current_SC->SCp.have_data_in); 1017 printk(" ** IN DONE %d ** ", current_SC->SCp.have_data_in);
1018#endif 1018#endif
1019 1019
1020#if ERRORS_ONLY
1021 if (current_SC->cmnd[0] == REQUEST_SENSE && !current_SC->SCp.Status) {
1022 if ((unsigned char) (*((char *) current_SC->request_buffer + 2)) & 0x0f) {
1023 unsigned char key;
1024 unsigned char code;
1025 unsigned char qualifier;
1026
1027 key = (unsigned char) (*((char *) current_SC->request_buffer + 2)) & 0x0f;
1028 code = (unsigned char) (*((char *) current_SC->request_buffer + 12));
1029 qualifier = (unsigned char) (*((char *) current_SC->request_buffer + 13));
1030
1031 if (key != UNIT_ATTENTION && !(key == NOT_READY && code == 0x04 && (!qualifier || qualifier == 0x02 || qualifier == 0x01))
1032 && !(key == ILLEGAL_REQUEST && (code == 0x25 || code == 0x24 || !code)))
1033
1034 printk("fd_mcs: REQUEST SENSE " "Key = %x, Code = %x, Qualifier = %x\n", key, code, qualifier);
1035 }
1036 }
1037#endif
1038#if EVERY_ACCESS 1020#if EVERY_ACCESS
1039 printk("BEFORE MY_DONE. . ."); 1021 printk("BEFORE MY_DONE. . .");
1040#endif 1022#endif
@@ -1097,7 +1079,9 @@ static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
1097 panic("fd_mcs: fd_mcs_queue() NOT REENTRANT!\n"); 1079 panic("fd_mcs: fd_mcs_queue() NOT REENTRANT!\n");
1098 } 1080 }
1099#if EVERY_ACCESS 1081#if EVERY_ACCESS
1100 printk("queue: target = %d cmnd = 0x%02x pieces = %d size = %u\n", SCpnt->target, *(unsigned char *) SCpnt->cmnd, SCpnt->use_sg, SCpnt->request_bufflen); 1082 printk("queue: target = %d cmnd = 0x%02x pieces = %d size = %u\n",
1083 SCpnt->target, *(unsigned char *) SCpnt->cmnd,
1084 scsi_sg_count(SCpnt), scsi_bufflen(SCpnt));
1101#endif 1085#endif
1102 1086
1103 fd_mcs_make_bus_idle(shpnt); 1087 fd_mcs_make_bus_idle(shpnt);
@@ -1107,14 +1091,14 @@ static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
1107 1091
1108 /* Initialize static data */ 1092 /* Initialize static data */
1109 1093
1110 if (current_SC->use_sg) { 1094 if (scsi_bufflen(current_SC)) {
1111 current_SC->SCp.buffer = (struct scatterlist *) current_SC->request_buffer; 1095 current_SC->SCp.buffer = scsi_sglist(current_SC);
1112 current_SC->SCp.ptr = sg_virt(current_SC->SCp.buffer); 1096 current_SC->SCp.ptr = sg_virt(current_SC->SCp.buffer);
1113 current_SC->SCp.this_residual = current_SC->SCp.buffer->length; 1097 current_SC->SCp.this_residual = current_SC->SCp.buffer->length;
1114 current_SC->SCp.buffers_residual = current_SC->use_sg - 1; 1098 current_SC->SCp.buffers_residual = scsi_sg_count(current_SC) - 1;
1115 } else { 1099 } else {
1116 current_SC->SCp.ptr = (char *) current_SC->request_buffer; 1100 current_SC->SCp.ptr = NULL;
1117 current_SC->SCp.this_residual = current_SC->request_bufflen; 1101 current_SC->SCp.this_residual = 0;
1118 current_SC->SCp.buffer = NULL; 1102 current_SC->SCp.buffer = NULL;
1119 current_SC->SCp.buffers_residual = 0; 1103 current_SC->SCp.buffers_residual = 0;
1120 } 1104 }
@@ -1166,7 +1150,9 @@ static void fd_mcs_print_info(Scsi_Cmnd * SCpnt)
1166 break; 1150 break;
1167 } 1151 }
1168 1152
1169 printk("(%d), target = %d cmnd = 0x%02x pieces = %d size = %u\n", SCpnt->SCp.phase, SCpnt->device->id, *(unsigned char *) SCpnt->cmnd, SCpnt->use_sg, SCpnt->request_bufflen); 1153 printk("(%d), target = %d cmnd = 0x%02x pieces = %d size = %u\n",
1154 SCpnt->SCp.phase, SCpnt->device->id, *(unsigned char *) SCpnt->cmnd,
1155 scsi_sg_count(SCpnt), scsi_bufflen(SCpnt));
1170 printk("sent_command = %d, have_data_in = %d, timeout = %d\n", SCpnt->SCp.sent_command, SCpnt->SCp.have_data_in, SCpnt->timeout); 1156 printk("sent_command = %d, have_data_in = %d, timeout = %d\n", SCpnt->SCp.sent_command, SCpnt->SCp.have_data_in, SCpnt->timeout);
1171#if DEBUG_RACE 1157#if DEBUG_RACE
1172 printk("in_interrupt_flag = %d\n", in_interrupt_flag); 1158 printk("in_interrupt_flag = %d\n", in_interrupt_flag);