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>
此提交包含在:
@@ -1619,15 +1619,6 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
|
||||
}
|
||||
|
||||
if ((dev->flags & (AHD_DEV_Q_TAGGED|AHD_DEV_Q_BASIC)) != 0) {
|
||||
int msg_bytes;
|
||||
uint8_t tag_msgs[2];
|
||||
|
||||
msg_bytes = scsi_populate_tag_msg(cmd, tag_msgs);
|
||||
if (msg_bytes && tag_msgs[0] != MSG_SIMPLE_TASK) {
|
||||
hscb->control |= tag_msgs[0];
|
||||
if (tag_msgs[0] == MSG_ORDERED_TASK)
|
||||
dev->commands_since_idle_or_otag = 0;
|
||||
} else
|
||||
if (dev->commands_since_idle_or_otag == AHD_OTAG_THRESH
|
||||
&& (dev->flags & AHD_DEV_Q_TAGGED) != 0) {
|
||||
hscb->control |= MSG_ORDERED_TASK;
|
||||
|
@@ -1501,15 +1501,7 @@ ahc_linux_run_command(struct ahc_softc *ahc, struct ahc_linux_device *dev,
|
||||
}
|
||||
|
||||
if ((dev->flags & (AHC_DEV_Q_TAGGED|AHC_DEV_Q_BASIC)) != 0) {
|
||||
int msg_bytes;
|
||||
uint8_t tag_msgs[2];
|
||||
|
||||
msg_bytes = scsi_populate_tag_msg(cmd, tag_msgs);
|
||||
if (msg_bytes && tag_msgs[0] != MSG_SIMPLE_TASK) {
|
||||
hscb->control |= tag_msgs[0];
|
||||
if (tag_msgs[0] == MSG_ORDERED_TASK)
|
||||
dev->commands_since_idle_or_otag = 0;
|
||||
} else if (dev->commands_since_idle_or_otag == AHC_OTAG_THRESH
|
||||
if (dev->commands_since_idle_or_otag == AHC_OTAG_THRESH
|
||||
&& (dev->flags & AHC_DEV_Q_TAGGED) != 0) {
|
||||
hscb->control |= MSG_ORDERED_TASK;
|
||||
dev->commands_since_idle_or_otag = 0;
|
||||
|
新增問題並參考
封鎖使用者