From 5066863337afdb0ad7323f424f7959d9f9f066da Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 30 Oct 2014 14:30:06 +0100 Subject: scsi: remove abuses of scsi_populate_tag Unless we want to build a SPI tag message we should just check SCMD_TAGGED instead of reverse engineering a tag type through the use of scsi_populate_tag_msg. Also rename the function to spi_populate_tag_msg, make it behave like the other spi message helpers, and move it to the spi transport class. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Christie Reviewed-by: Hannes Reinecke --- drivers/scsi/csiostor/csio_scsi.c | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'drivers/scsi/csiostor/csio_scsi.c') diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c index 86103c8475d8..8231505cce0a 100644 --- a/drivers/scsi/csiostor/csio_scsi.c +++ b/drivers/scsi/csiostor/csio_scsi.c @@ -152,28 +152,6 @@ csio_scsi_itnexus_loss_error(uint16_t error) return 0; } -static inline void -csio_scsi_tag(struct scsi_cmnd *scmnd, uint8_t *tag, uint8_t hq, - uint8_t oq, uint8_t sq) -{ - char stag[2]; - - if (scsi_populate_tag_msg(scmnd, stag)) { - switch (stag[0]) { - case HEAD_OF_QUEUE_TAG: - *tag = hq; - break; - case ORDERED_QUEUE_TAG: - *tag = oq; - break; - default: - *tag = sq; - break; - } - } else - *tag = 0; -} - /* * csio_scsi_fcp_cmnd - Frame the SCSI FCP command paylod. * @req: IO req structure. @@ -192,11 +170,12 @@ csio_scsi_fcp_cmnd(struct csio_ioreq *req, void *addr) int_to_scsilun(scmnd->device->lun, &fcp_cmnd->fc_lun); fcp_cmnd->fc_tm_flags = 0; fcp_cmnd->fc_cmdref = 0; - fcp_cmnd->fc_pri_ta = 0; memcpy(fcp_cmnd->fc_cdb, scmnd->cmnd, 16); - csio_scsi_tag(scmnd, &fcp_cmnd->fc_pri_ta, - FCP_PTA_HEADQ, FCP_PTA_ORDERED, FCP_PTA_SIMPLE); + if (scmnd->flags & SCMD_TAGGED) + fcp_cmnd->fc_pri_ta = FCP_PTA_SIMPLE; + else + fcp_cmnd->fc_pri_ta = 0; fcp_cmnd->fc_dl = cpu_to_be32(scsi_bufflen(scmnd)); if (req->nsge) -- cgit v1.2.3