diff options
author | Christoph Hellwig <hch@lst.de> | 2014-10-30 09:30:06 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-12 05:19:41 -0500 |
commit | 5066863337afdb0ad7323f424f7959d9f9f066da (patch) | |
tree | 3901d3088c8698f10e1533298ae04a98116bc395 /drivers/scsi/csiostor | |
parent | abd0c533e37789ef56a73562d6d06d39897bd801 (diff) |
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 <hch@lst.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/scsi/csiostor')
-rw-r--r-- | drivers/scsi/csiostor/csio_scsi.c | 29 |
1 files changed, 4 insertions, 25 deletions
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) | |||
152 | return 0; | 152 | return 0; |
153 | } | 153 | } |
154 | 154 | ||
155 | static inline void | ||
156 | csio_scsi_tag(struct scsi_cmnd *scmnd, uint8_t *tag, uint8_t hq, | ||
157 | uint8_t oq, uint8_t sq) | ||
158 | { | ||
159 | char stag[2]; | ||
160 | |||
161 | if (scsi_populate_tag_msg(scmnd, stag)) { | ||
162 | switch (stag[0]) { | ||
163 | case HEAD_OF_QUEUE_TAG: | ||
164 | *tag = hq; | ||
165 | break; | ||
166 | case ORDERED_QUEUE_TAG: | ||
167 | *tag = oq; | ||
168 | break; | ||
169 | default: | ||
170 | *tag = sq; | ||
171 | break; | ||
172 | } | ||
173 | } else | ||
174 | *tag = 0; | ||
175 | } | ||
176 | |||
177 | /* | 155 | /* |
178 | * csio_scsi_fcp_cmnd - Frame the SCSI FCP command paylod. | 156 | * csio_scsi_fcp_cmnd - Frame the SCSI FCP command paylod. |
179 | * @req: IO req structure. | 157 | * @req: IO req structure. |
@@ -192,11 +170,12 @@ csio_scsi_fcp_cmnd(struct csio_ioreq *req, void *addr) | |||
192 | int_to_scsilun(scmnd->device->lun, &fcp_cmnd->fc_lun); | 170 | int_to_scsilun(scmnd->device->lun, &fcp_cmnd->fc_lun); |
193 | fcp_cmnd->fc_tm_flags = 0; | 171 | fcp_cmnd->fc_tm_flags = 0; |
194 | fcp_cmnd->fc_cmdref = 0; | 172 | fcp_cmnd->fc_cmdref = 0; |
195 | fcp_cmnd->fc_pri_ta = 0; | ||
196 | 173 | ||
197 | memcpy(fcp_cmnd->fc_cdb, scmnd->cmnd, 16); | 174 | memcpy(fcp_cmnd->fc_cdb, scmnd->cmnd, 16); |
198 | csio_scsi_tag(scmnd, &fcp_cmnd->fc_pri_ta, | 175 | if (scmnd->flags & SCMD_TAGGED) |
199 | FCP_PTA_HEADQ, FCP_PTA_ORDERED, FCP_PTA_SIMPLE); | 176 | fcp_cmnd->fc_pri_ta = FCP_PTA_SIMPLE; |
177 | else | ||
178 | fcp_cmnd->fc_pri_ta = 0; | ||
200 | fcp_cmnd->fc_dl = cpu_to_be32(scsi_bufflen(scmnd)); | 179 | fcp_cmnd->fc_dl = cpu_to_be32(scsi_bufflen(scmnd)); |
201 | 180 | ||
202 | if (req->nsge) | 181 | if (req->nsge) |