diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2005-08-26 22:09:30 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-09-04 20:53:40 -0400 |
commit | ce7e4af7f507c156c3fd3dbb41ffe4a77c700b54 (patch) | |
tree | dcb5d6a63ad4e1d88cfd58fca6ebfec4710cc998 /drivers | |
parent | 131736d34ebc3251d79ddfd08a5e57a3e86decd4 (diff) |
[SCSI] qla2xxx: Add change_queue_depth/type() API support.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 29cf3f510935..413ccc152de5 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -111,6 +111,9 @@ static int qla2xxx_eh_host_reset(struct scsi_cmnd *); | |||
111 | static int qla2x00_loop_reset(scsi_qla_host_t *ha); | 111 | static int qla2x00_loop_reset(scsi_qla_host_t *ha); |
112 | static int qla2x00_device_reset(scsi_qla_host_t *, fc_port_t *); | 112 | static int qla2x00_device_reset(scsi_qla_host_t *, fc_port_t *); |
113 | 113 | ||
114 | static int qla2x00_change_queue_depth(struct scsi_device *, int); | ||
115 | static int qla2x00_change_queue_type(struct scsi_device *, int); | ||
116 | |||
114 | static struct scsi_host_template qla2x00_driver_template = { | 117 | static struct scsi_host_template qla2x00_driver_template = { |
115 | .module = THIS_MODULE, | 118 | .module = THIS_MODULE, |
116 | .name = "qla2xxx", | 119 | .name = "qla2xxx", |
@@ -125,6 +128,8 @@ static struct scsi_host_template qla2x00_driver_template = { | |||
125 | 128 | ||
126 | .slave_alloc = qla2xxx_slave_alloc, | 129 | .slave_alloc = qla2xxx_slave_alloc, |
127 | .slave_destroy = qla2xxx_slave_destroy, | 130 | .slave_destroy = qla2xxx_slave_destroy, |
131 | .change_queue_depth = qla2x00_change_queue_depth, | ||
132 | .change_queue_type = qla2x00_change_queue_type, | ||
128 | .this_id = -1, | 133 | .this_id = -1, |
129 | .cmd_per_lun = 3, | 134 | .cmd_per_lun = 3, |
130 | .use_clustering = ENABLE_CLUSTERING, | 135 | .use_clustering = ENABLE_CLUSTERING, |
@@ -151,6 +156,8 @@ static struct scsi_host_template qla24xx_driver_template = { | |||
151 | 156 | ||
152 | .slave_alloc = qla2xxx_slave_alloc, | 157 | .slave_alloc = qla2xxx_slave_alloc, |
153 | .slave_destroy = qla2xxx_slave_destroy, | 158 | .slave_destroy = qla2xxx_slave_destroy, |
159 | .change_queue_depth = qla2x00_change_queue_depth, | ||
160 | .change_queue_type = qla2x00_change_queue_type, | ||
154 | .this_id = -1, | 161 | .this_id = -1, |
155 | .cmd_per_lun = 3, | 162 | .cmd_per_lun = 3, |
156 | .use_clustering = ENABLE_CLUSTERING, | 163 | .use_clustering = ENABLE_CLUSTERING, |
@@ -1109,6 +1116,28 @@ qla2xxx_slave_destroy(struct scsi_device *sdev) | |||
1109 | sdev->hostdata = NULL; | 1116 | sdev->hostdata = NULL; |
1110 | } | 1117 | } |
1111 | 1118 | ||
1119 | static int | ||
1120 | qla2x00_change_queue_depth(struct scsi_device *sdev, int qdepth) | ||
1121 | { | ||
1122 | scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), qdepth); | ||
1123 | return sdev->queue_depth; | ||
1124 | } | ||
1125 | |||
1126 | static int | ||
1127 | qla2x00_change_queue_type(struct scsi_device *sdev, int tag_type) | ||
1128 | { | ||
1129 | if (sdev->tagged_supported) { | ||
1130 | scsi_set_tag_type(sdev, tag_type); | ||
1131 | if (tag_type) | ||
1132 | scsi_activate_tcq(sdev, sdev->queue_depth); | ||
1133 | else | ||
1134 | scsi_deactivate_tcq(sdev, sdev->queue_depth); | ||
1135 | } else | ||
1136 | tag_type = 0; | ||
1137 | |||
1138 | return tag_type; | ||
1139 | } | ||
1140 | |||
1112 | /** | 1141 | /** |
1113 | * qla2x00_config_dma_addressing() - Configure OS DMA addressing method. | 1142 | * qla2x00_config_dma_addressing() - Configure OS DMA addressing method. |
1114 | * @ha: HA context | 1143 | * @ha: HA context |