Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] fas216: Use scsi_eh API for REQUEST_SENSE invocation

Use new scsi_eh_prep/restor_cmnd() for synchronous REQUEST_SENSE
invocation. This also converts the driver to the new accessor based
scatterlist implementation.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Tested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

authored by

Boaz Harrosh and committed by
James Bottomley
ccf9ea91 7c46c20a

+6 -13
+3 -13
drivers/scsi/arm/fas216.c
··· 2018 2018 * the upper layers to process. This would have been set 2019 2019 * correctly by fas216_std_done. 2020 2020 */ 2021 + scsi_eh_restore_cmnd(SCpnt, &info->ses); 2021 2022 SCpnt->scsi_done(SCpnt); 2022 2023 } 2023 2024 ··· 2104 2103 if (SCpnt->cmnd[0] == REQUEST_SENSE) 2105 2104 goto done; 2106 2105 2106 + scsi_eh_prep_cmnd(SCpnt, &info->ses, NULL, 0, ~0); 2107 2107 fas216_log_target(info, LOG_CONNECT, SCpnt->device->id, 2108 2108 "requesting sense"); 2109 - memset(SCpnt->cmnd, 0, sizeof (SCpnt->cmnd)); 2110 - SCpnt->cmnd[0] = REQUEST_SENSE; 2111 - SCpnt->cmnd[1] = SCpnt->device->lun << 5; 2112 - SCpnt->cmnd[4] = sizeof(SCpnt->sense_buffer); 2113 - SCpnt->cmd_len = COMMAND_SIZE(SCpnt->cmnd[0]); 2114 - SCpnt->SCp.buffer = NULL; 2115 - SCpnt->SCp.buffers_residual = 0; 2116 - SCpnt->SCp.ptr = (char *)SCpnt->sense_buffer; 2117 - SCpnt->SCp.this_residual = sizeof(SCpnt->sense_buffer); 2118 - SCpnt->SCp.phase = sizeof(SCpnt->sense_buffer); 2109 + init_SCp(SCpnt); 2119 2110 SCpnt->SCp.Message = 0; 2120 2111 SCpnt->SCp.Status = 0; 2121 - SCpnt->request_bufflen = sizeof(SCpnt->sense_buffer); 2122 - SCpnt->sc_data_direction = DMA_FROM_DEVICE; 2123 - SCpnt->use_sg = 0; 2124 2112 SCpnt->tag = 0; 2125 2113 SCpnt->host_scribble = (void *)fas216_rq_sns_done; 2126 2114
+3
drivers/scsi/arm/fas216.h
··· 16 16 #define NO_IRQ 255 17 17 #endif 18 18 19 + #include <scsi/scsi_eh.h> 20 + 19 21 #include "queue.h" 20 22 #include "msgqueue.h" 21 23 ··· 313 311 314 312 /* miscellaneous */ 315 313 int internal_done; /* flag to indicate request done */ 314 + struct scsi_eh_save *ses; /* holds request sense restore info */ 316 315 unsigned long magic_end; 317 316 } FAS216_Info; 318 317