Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ccf9ea91 authored by Boaz Harrosh's avatar Boaz Harrosh Committed by James Bottomley
Browse files

[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: default avatarBoaz Harrosh <bharrosh@panasas.com>
Tested-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 7c46c20a
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -2018,6 +2018,7 @@ static void fas216_rq_sns_done(FAS216_Info *info, struct scsi_cmnd *SCpnt,
	 * the upper layers to process.  This would have been set
	 * correctly by fas216_std_done.
	 */
	scsi_eh_restore_cmnd(SCpnt, &info->ses);
	SCpnt->scsi_done(SCpnt);
}

@@ -2103,23 +2104,12 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result)
	if (SCpnt->cmnd[0] == REQUEST_SENSE)
		goto done;

	scsi_eh_prep_cmnd(SCpnt, &info->ses, NULL, 0, ~0);
	fas216_log_target(info, LOG_CONNECT, SCpnt->device->id,
			  "requesting sense");
	memset(SCpnt->cmnd, 0, sizeof (SCpnt->cmnd));
	SCpnt->cmnd[0] = REQUEST_SENSE;
	SCpnt->cmnd[1] = SCpnt->device->lun << 5;
	SCpnt->cmnd[4] = sizeof(SCpnt->sense_buffer);
	SCpnt->cmd_len = COMMAND_SIZE(SCpnt->cmnd[0]);
	SCpnt->SCp.buffer = NULL;
	SCpnt->SCp.buffers_residual = 0;
	SCpnt->SCp.ptr = (char *)SCpnt->sense_buffer;
	SCpnt->SCp.this_residual = sizeof(SCpnt->sense_buffer);
	SCpnt->SCp.phase = sizeof(SCpnt->sense_buffer);
	init_SCp(SCpnt);
	SCpnt->SCp.Message = 0;
	SCpnt->SCp.Status = 0;
	SCpnt->request_bufflen = sizeof(SCpnt->sense_buffer);
	SCpnt->sc_data_direction = DMA_FROM_DEVICE;
	SCpnt->use_sg = 0;
	SCpnt->tag = 0;
	SCpnt->host_scribble = (void *)fas216_rq_sns_done;

+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
#define NO_IRQ 255
#endif

#include <scsi/scsi_eh.h>

#include "queue.h"
#include "msgqueue.h"

@@ -311,6 +313,7 @@ typedef struct {

	/* miscellaneous */
	int			internal_done;		/* flag to indicate request done */
	struct scsi_eh_save	*ses;		/* holds request sense restore info */
	unsigned long		magic_end;
} FAS216_Info;