diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2007-05-14 07:27:00 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-05-26 20:11:52 -0400 |
commit | e1eaf460098e4fd168908af4e6951f921951e916 (patch) | |
tree | 22cab30d8acb5d250b80039ebb948bc6498696ae /drivers/scsi/fdomain.c | |
parent | 9482ef855ef42acb8259f95296b1e93bfb474e74 (diff) |
[SCSI] fdomain: convert to use the data buffer accessors
- remove the unnecessary map_single path.
- convert to use the new accessors for the sg lists and the
parameters.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/fdomain.c')
-rw-r--r-- | drivers/scsi/fdomain.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index 5d4ea6f77953..0d1661a8116b 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c | |||
@@ -1345,16 +1345,15 @@ static irqreturn_t do_fdomain_16x0_intr(int irq, void *dev_id) | |||
1345 | 1345 | ||
1346 | #if ERRORS_ONLY | 1346 | #if ERRORS_ONLY |
1347 | if (current_SC->cmnd[0] == REQUEST_SENSE && !current_SC->SCp.Status) { | 1347 | if (current_SC->cmnd[0] == REQUEST_SENSE && !current_SC->SCp.Status) { |
1348 | if ((unsigned char)(*((char *)current_SC->request_buffer+2)) & 0x0f) { | 1348 | char *buf = scsi_sglist(current_SC); |
1349 | if ((unsigned char)(*(buf + 2)) & 0x0f) { | ||
1349 | unsigned char key; | 1350 | unsigned char key; |
1350 | unsigned char code; | 1351 | unsigned char code; |
1351 | unsigned char qualifier; | 1352 | unsigned char qualifier; |
1352 | 1353 | ||
1353 | key = (unsigned char)(*((char *)current_SC->request_buffer + 2)) | 1354 | key = (unsigned char)(*(buf + 2)) & 0x0f; |
1354 | & 0x0f; | 1355 | code = (unsigned char)(*(buf + 12)); |
1355 | code = (unsigned char)(*((char *)current_SC->request_buffer + 12)); | 1356 | qualifier = (unsigned char)(*(buf + 13)); |
1356 | qualifier = (unsigned char)(*((char *)current_SC->request_buffer | ||
1357 | + 13)); | ||
1358 | 1357 | ||
1359 | if (key != UNIT_ATTENTION | 1358 | if (key != UNIT_ATTENTION |
1360 | && !(key == NOT_READY | 1359 | && !(key == NOT_READY |
@@ -1405,8 +1404,8 @@ static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt, | |||
1405 | printk( "queue: target = %d cmnd = 0x%02x pieces = %d size = %u\n", | 1404 | printk( "queue: target = %d cmnd = 0x%02x pieces = %d size = %u\n", |
1406 | SCpnt->target, | 1405 | SCpnt->target, |
1407 | *(unsigned char *)SCpnt->cmnd, | 1406 | *(unsigned char *)SCpnt->cmnd, |
1408 | SCpnt->use_sg, | 1407 | scsi_sg_count(SCpnt), |
1409 | SCpnt->request_bufflen ); | 1408 | scsi_bufflen(SCpnt)); |
1410 | #endif | 1409 | #endif |
1411 | 1410 | ||
1412 | fdomain_make_bus_idle(); | 1411 | fdomain_make_bus_idle(); |
@@ -1416,20 +1415,19 @@ static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt, | |||
1416 | 1415 | ||
1417 | /* Initialize static data */ | 1416 | /* Initialize static data */ |
1418 | 1417 | ||
1419 | if (current_SC->use_sg) { | 1418 | if (scsi_sg_count(current_SC)) { |
1420 | current_SC->SCp.buffer = | 1419 | current_SC->SCp.buffer = scsi_sglist(current_SC); |
1421 | (struct scatterlist *)current_SC->request_buffer; | 1420 | current_SC->SCp.ptr = page_address(current_SC->SCp.buffer->page) |
1422 | current_SC->SCp.ptr = page_address(current_SC->SCp.buffer->page) + current_SC->SCp.buffer->offset; | 1421 | + current_SC->SCp.buffer->offset; |
1423 | current_SC->SCp.this_residual = current_SC->SCp.buffer->length; | 1422 | current_SC->SCp.this_residual = current_SC->SCp.buffer->length; |
1424 | current_SC->SCp.buffers_residual = current_SC->use_sg - 1; | 1423 | current_SC->SCp.buffers_residual = scsi_sg_count(current_SC) - 1; |
1425 | } else { | 1424 | } else { |
1426 | current_SC->SCp.ptr = (char *)current_SC->request_buffer; | 1425 | current_SC->SCp.ptr = 0; |
1427 | current_SC->SCp.this_residual = current_SC->request_bufflen; | 1426 | current_SC->SCp.this_residual = 0; |
1428 | current_SC->SCp.buffer = NULL; | 1427 | current_SC->SCp.buffer = NULL; |
1429 | current_SC->SCp.buffers_residual = 0; | 1428 | current_SC->SCp.buffers_residual = 0; |
1430 | } | 1429 | } |
1431 | 1430 | ||
1432 | |||
1433 | current_SC->SCp.Status = 0; | 1431 | current_SC->SCp.Status = 0; |
1434 | current_SC->SCp.Message = 0; | 1432 | current_SC->SCp.Message = 0; |
1435 | current_SC->SCp.have_data_in = 0; | 1433 | current_SC->SCp.have_data_in = 0; |
@@ -1472,8 +1470,8 @@ static void print_info(struct scsi_cmnd *SCpnt) | |||
1472 | SCpnt->SCp.phase, | 1470 | SCpnt->SCp.phase, |
1473 | SCpnt->device->id, | 1471 | SCpnt->device->id, |
1474 | *(unsigned char *)SCpnt->cmnd, | 1472 | *(unsigned char *)SCpnt->cmnd, |
1475 | SCpnt->use_sg, | 1473 | scsi_sg_count(SCpnt), |
1476 | SCpnt->request_bufflen ); | 1474 | scsi_bufflen(SCpnt)); |
1477 | printk( "sent_command = %d, have_data_in = %d, timeout = %d\n", | 1475 | printk( "sent_command = %d, have_data_in = %d, timeout = %d\n", |
1478 | SCpnt->SCp.sent_command, | 1476 | SCpnt->SCp.sent_command, |
1479 | SCpnt->SCp.have_data_in, | 1477 | SCpnt->SCp.have_data_in, |