Commit 8e31f1f4d94c8e7e09efab0166cb2ef2ceeec2ce
Committed by
James Bottomley
1 parent
fc3fdfcc8b
Exists in
master
and in
39 other branches
[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>
Showing 1 changed file with 11 additions and 25 deletions Side-by-side Diff
drivers/scsi/fd_mcs.c
... | ... | @@ -1017,24 +1017,6 @@ |
1017 | 1017 | printk(" ** IN DONE %d ** ", current_SC->SCp.have_data_in); |
1018 | 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 | 1020 | #if EVERY_ACCESS |
1039 | 1021 | printk("BEFORE MY_DONE. . ."); |
1040 | 1022 | #endif |
... | ... | @@ -1097,7 +1079,9 @@ |
1097 | 1079 | panic("fd_mcs: fd_mcs_queue() NOT REENTRANT!\n"); |
1098 | 1080 | } |
1099 | 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 | 1085 | #endif |
1102 | 1086 | |
1103 | 1087 | fd_mcs_make_bus_idle(shpnt); |
1104 | 1088 | |
1105 | 1089 | |
... | ... | @@ -1107,14 +1091,14 @@ |
1107 | 1091 | |
1108 | 1092 | /* Initialize static data */ |
1109 | 1093 | |
1110 | - if (current_SC->use_sg) { | |
1111 | - current_SC->SCp.buffer = (struct scatterlist *) current_SC->request_buffer; | |
1094 | + if (scsi_bufflen(current_SC)) { | |
1095 | + current_SC->SCp.buffer = scsi_sglist(current_SC); | |
1112 | 1096 | current_SC->SCp.ptr = sg_virt(current_SC->SCp.buffer); |
1113 | 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 | 1099 | } else { |
1116 | - current_SC->SCp.ptr = (char *) current_SC->request_buffer; | |
1117 | - current_SC->SCp.this_residual = current_SC->request_bufflen; | |
1100 | + current_SC->SCp.ptr = NULL; | |
1101 | + current_SC->SCp.this_residual = 0; | |
1118 | 1102 | current_SC->SCp.buffer = NULL; |
1119 | 1103 | current_SC->SCp.buffers_residual = 0; |
1120 | 1104 | } |
... | ... | @@ -1166,7 +1150,9 @@ |
1166 | 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 | 1156 | printk("sent_command = %d, have_data_in = %d, timeout = %d\n", SCpnt->SCp.sent_command, SCpnt->SCp.have_data_in, SCpnt->timeout); |
1171 | 1157 | #if DEBUG_RACE |
1172 | 1158 | printk("in_interrupt_flag = %d\n", in_interrupt_flag); |