Commit 2fd8f23a authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: myrb: Use scsi_cmd_to_rq() instead of scsi_cmnd.request

Prepare for removal of the request pointer by using scsi_cmd_to_rq()
instead. This patch does not change any functionality.

Link: https://lore.kernel.org/r/20210809230355.8186-33-bvanassche@acm.orgSigned-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ce425dd7
...@@ -1263,6 +1263,7 @@ static int myrb_host_reset(struct scsi_cmnd *scmd) ...@@ -1263,6 +1263,7 @@ static int myrb_host_reset(struct scsi_cmnd *scmd)
static int myrb_pthru_queuecommand(struct Scsi_Host *shost, static int myrb_pthru_queuecommand(struct Scsi_Host *shost,
struct scsi_cmnd *scmd) struct scsi_cmnd *scmd)
{ {
struct request *rq = scsi_cmd_to_rq(scmd);
struct myrb_hba *cb = shost_priv(shost); struct myrb_hba *cb = shost_priv(shost);
struct myrb_cmdblk *cmd_blk = scsi_cmd_priv(scmd); struct myrb_cmdblk *cmd_blk = scsi_cmd_priv(scmd);
union myrb_cmd_mbox *mbox = &cmd_blk->mbox; union myrb_cmd_mbox *mbox = &cmd_blk->mbox;
...@@ -1286,7 +1287,7 @@ static int myrb_pthru_queuecommand(struct Scsi_Host *shost, ...@@ -1286,7 +1287,7 @@ static int myrb_pthru_queuecommand(struct Scsi_Host *shost,
} }
mbox->type3.opcode = MYRB_CMD_DCDB; mbox->type3.opcode = MYRB_CMD_DCDB;
mbox->type3.id = scmd->request->tag + 3; mbox->type3.id = rq->tag + 3;
mbox->type3.addr = dcdb_addr; mbox->type3.addr = dcdb_addr;
dcdb->channel = sdev->channel; dcdb->channel = sdev->channel;
dcdb->target = sdev->id; dcdb->target = sdev->id;
...@@ -1305,11 +1306,11 @@ static int myrb_pthru_queuecommand(struct Scsi_Host *shost, ...@@ -1305,11 +1306,11 @@ static int myrb_pthru_queuecommand(struct Scsi_Host *shost,
break; break;
} }
dcdb->early_status = false; dcdb->early_status = false;
if (scmd->request->timeout <= 10) if (rq->timeout <= 10)
dcdb->timeout = MYRB_DCDB_TMO_10_SECS; dcdb->timeout = MYRB_DCDB_TMO_10_SECS;
else if (scmd->request->timeout <= 60) else if (rq->timeout <= 60)
dcdb->timeout = MYRB_DCDB_TMO_60_SECS; dcdb->timeout = MYRB_DCDB_TMO_60_SECS;
else if (scmd->request->timeout <= 600) else if (rq->timeout <= 600)
dcdb->timeout = MYRB_DCDB_TMO_10_MINS; dcdb->timeout = MYRB_DCDB_TMO_10_MINS;
else else
dcdb->timeout = MYRB_DCDB_TMO_24_HRS; dcdb->timeout = MYRB_DCDB_TMO_24_HRS;
...@@ -1550,7 +1551,7 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost, ...@@ -1550,7 +1551,7 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost,
} }
myrb_reset_cmd(cmd_blk); myrb_reset_cmd(cmd_blk);
mbox->type5.id = scmd->request->tag + 3; mbox->type5.id = scsi_cmd_to_rq(scmd)->tag + 3;
if (scmd->sc_data_direction == DMA_NONE) if (scmd->sc_data_direction == DMA_NONE)
goto submit; goto submit;
nsge = scsi_dma_map(scmd); nsge = scsi_dma_map(scmd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment