diff options
Diffstat (limited to 'include/scsi/scsi_tcq.h')
-rw-r--r-- | include/scsi/scsi_tcq.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index e47e36a4ef49..d04d05adfa9b 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/blkdev.h> | 4 | #include <linux/blkdev.h> |
5 | #include <scsi/scsi_cmnd.h> | 5 | #include <scsi/scsi_cmnd.h> |
6 | #include <scsi/scsi_device.h> | 6 | #include <scsi/scsi_device.h> |
7 | #include <scsi/scsi_host.h> | ||
7 | 8 | ||
8 | 9 | ||
9 | #define MSG_SIMPLE_TAG 0x20 | 10 | #define MSG_SIMPLE_TAG 0x20 |
@@ -66,7 +67,8 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) | |||
66 | return; | 67 | return; |
67 | 68 | ||
68 | if (!blk_queue_tagged(sdev->request_queue)) | 69 | if (!blk_queue_tagged(sdev->request_queue)) |
69 | blk_queue_init_tags(sdev->request_queue, depth, NULL); | 70 | blk_queue_init_tags(sdev->request_queue, depth, |
71 | sdev->host->bqt); | ||
70 | 72 | ||
71 | scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth); | 73 | scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth); |
72 | } | 74 | } |
@@ -131,4 +133,15 @@ static inline struct scsi_cmnd *scsi_find_tag(struct scsi_device *sdev, int tag) | |||
131 | return sdev->current_cmnd; | 133 | return sdev->current_cmnd; |
132 | } | 134 | } |
133 | 135 | ||
136 | /** | ||
137 | * scsi_init_shared_tag_map - create a shared tag map | ||
138 | * @shost: the host to share the tag map among all devices | ||
139 | * @depth: the total depth of the map | ||
140 | */ | ||
141 | static inline int scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth) | ||
142 | { | ||
143 | shost->bqt = blk_init_tags(depth); | ||
144 | return shost->bqt ? 0 : -ENOMEM; | ||
145 | } | ||
146 | |||
134 | #endif /* _SCSI_SCSI_TCQ_H */ | 147 | #endif /* _SCSI_SCSI_TCQ_H */ |