aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-10-30 09:30:06 -0400
committerChristoph Hellwig <hch@lst.de>2014-11-12 05:19:41 -0500
commit5066863337afdb0ad7323f424f7959d9f9f066da (patch)
tree3901d3088c8698f10e1533298ae04a98116bc395 /include
parentabd0c533e37789ef56a73562d6d06d39897bd801 (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 'include')
-rw-r--r--include/scsi/scsi_tcq.h21
-rw-r--r--include/scsi/scsi_transport_spi.h1
2 files changed, 1 insertions, 21 deletions
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h
index 342f38c5b065..005f68da5adb 100644
--- a/include/scsi/scsi_tcq.h
+++ b/include/scsi/scsi_tcq.h
@@ -80,27 +80,6 @@ static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth)
80 scsi_adjust_queue_depth(sdev, 0, depth); 80 scsi_adjust_queue_depth(sdev, 0, depth);
81} 81}
82 82
83/**
84 * scsi_populate_tag_msg - place a tag message in a buffer
85 * @SCpnt: pointer to the Scsi_Cmnd for the tag
86 * @msg: pointer to the area to place the tag
87 *
88 * Notes:
89 * designed to create the correct type of tag message for the
90 * particular request. Returns the size of the tag message.
91 * May return 0 if TCQ is disabled for this device.
92 **/
93static inline int scsi_populate_tag_msg(struct scsi_cmnd *cmd, char *msg)
94{
95 if (cmd->flags & SCMD_TAGGED) {
96 *msg++ = MSG_SIMPLE_TAG;
97 *msg++ = cmd->request->tag;
98 return 2;
99 }
100
101 return 0;
102}
103
104static inline struct scsi_cmnd *scsi_mq_find_tag(struct Scsi_Host *shost, 83static inline struct scsi_cmnd *scsi_mq_find_tag(struct Scsi_Host *shost,
105 int unique_tag) 84 int unique_tag)
106{ 85{
diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h
index 7497a383b1a4..a4fa52b4d5c5 100644
--- a/include/scsi/scsi_transport_spi.h
+++ b/include/scsi/scsi_transport_spi.h
@@ -157,5 +157,6 @@ int spi_populate_width_msg(unsigned char *msg, int width);
157int spi_populate_sync_msg(unsigned char *msg, int period, int offset); 157int spi_populate_sync_msg(unsigned char *msg, int period, int offset);
158int spi_populate_ppr_msg(unsigned char *msg, int period, int offset, int width, 158int spi_populate_ppr_msg(unsigned char *msg, int period, int offset, int width,
159 int options); 159 int options);
160int spi_populate_tag_msg(unsigned char *msg, struct scsi_cmnd *cmd);
160 161
161#endif /* SCSI_TRANSPORT_SPI_H */ 162#endif /* SCSI_TRANSPORT_SPI_H */