Commit 924cb24d authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen
Browse files

scsi: fnic: Stop using the SCSI pointer

Set .cmd_size in the SCSI host template instead of using the SCSI pointer
from struct scsi_cmnd. This patch prepares for removal of the SCSI pointer
from struct scsi_cmnd.

Link: https://lore.kernel.org/r/20220218195117.25689-23-bvanassche@acm.org


Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 3032ed77
Loading
Loading
Loading
Loading
+20 −7
Original line number Diff line number Diff line
@@ -89,15 +89,28 @@
#define FNIC_DEV_RST_ABTS_PENDING       BIT(21)

/*
 * Usage of the scsi_cmnd scratchpad.
 * fnic private data per SCSI command.
 * These fields are locked by the hashed io_req_lock.
 */
#define CMD_SP(Cmnd)		((Cmnd)->SCp.ptr)
#define CMD_STATE(Cmnd)		((Cmnd)->SCp.phase)
#define CMD_ABTS_STATUS(Cmnd)	((Cmnd)->SCp.Message)
#define CMD_LR_STATUS(Cmnd)	((Cmnd)->SCp.have_data_in)
#define CMD_TAG(Cmnd)           ((Cmnd)->SCp.sent_command)
#define CMD_FLAGS(Cmnd)         ((Cmnd)->SCp.Status)
struct fnic_cmd_priv {
	struct fnic_io_req *io_req;
	enum fnic_ioreq_state state;
	u32 flags;
	u16 abts_status;
	u16 lr_status;
};

static inline struct fnic_cmd_priv *fnic_priv(struct scsi_cmnd *cmd)
{
	return scsi_cmd_priv(cmd);
}

static inline u64 fnic_flags_and_state(struct scsi_cmnd *cmd)
{
	struct fnic_cmd_priv *fcmd = fnic_priv(cmd);

	return ((u64)fcmd->flags << 32) | fcmd->state;
}

#define FCPIO_INVALID_CODE 0x100 /* hdr_status value unused by firmware */

+1 −0
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ static struct scsi_host_template fnic_host_template = {
	.max_sectors = 0xffff,
	.shost_groups = fnic_host_groups,
	.track_queue_depth = 1,
	.cmd_size = sizeof(struct fnic_cmd_priv),
};

static void
+142 −147

File changed.

Preview size limit exceeded, changes collapsed.