diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2010-02-25 15:02:51 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-03-03 08:05:40 -0500 |
commit | 667e23d4e968f6826dc5d3e81238a7f1f343fb4f (patch) | |
tree | e29001893863cb6315c8a45096f93e4f668bdce0 /drivers/scsi | |
parent | b0f4d4cf12d0eaa0bd766686bba843fc105b6a60 (diff) |
[SCSI] hpsa: allow modifying device queue depth.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/hpsa.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 03697ba94251..745c62444d25 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <scsi/scsi_cmnd.h> | 43 | #include <scsi/scsi_cmnd.h> |
44 | #include <scsi/scsi_device.h> | 44 | #include <scsi/scsi_device.h> |
45 | #include <scsi/scsi_host.h> | 45 | #include <scsi/scsi_host.h> |
46 | #include <scsi/scsi_tcq.h> | ||
46 | #include <linux/cciss_ioctl.h> | 47 | #include <linux/cciss_ioctl.h> |
47 | #include <linux/string.h> | 48 | #include <linux/string.h> |
48 | #include <linux/bitmap.h> | 49 | #include <linux/bitmap.h> |
@@ -134,6 +135,8 @@ static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd, | |||
134 | static void hpsa_scan_start(struct Scsi_Host *); | 135 | static void hpsa_scan_start(struct Scsi_Host *); |
135 | static int hpsa_scan_finished(struct Scsi_Host *sh, | 136 | static int hpsa_scan_finished(struct Scsi_Host *sh, |
136 | unsigned long elapsed_time); | 137 | unsigned long elapsed_time); |
138 | static int hpsa_change_queue_depth(struct scsi_device *sdev, | ||
139 | int qdepth, int reason); | ||
137 | 140 | ||
138 | static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd); | 141 | static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd); |
139 | static int hpsa_slave_alloc(struct scsi_device *sdev); | 142 | static int hpsa_slave_alloc(struct scsi_device *sdev); |
@@ -182,6 +185,7 @@ static struct scsi_host_template hpsa_driver_template = { | |||
182 | .queuecommand = hpsa_scsi_queue_command, | 185 | .queuecommand = hpsa_scsi_queue_command, |
183 | .scan_start = hpsa_scan_start, | 186 | .scan_start = hpsa_scan_start, |
184 | .scan_finished = hpsa_scan_finished, | 187 | .scan_finished = hpsa_scan_finished, |
188 | .change_queue_depth = hpsa_change_queue_depth, | ||
185 | .this_id = -1, | 189 | .this_id = -1, |
186 | .sg_tablesize = MAXSGENTRIES, | 190 | .sg_tablesize = MAXSGENTRIES, |
187 | .use_clustering = ENABLE_CLUSTERING, | 191 | .use_clustering = ENABLE_CLUSTERING, |
@@ -2077,6 +2081,23 @@ static int hpsa_scan_finished(struct Scsi_Host *sh, | |||
2077 | return finished; | 2081 | return finished; |
2078 | } | 2082 | } |
2079 | 2083 | ||
2084 | static int hpsa_change_queue_depth(struct scsi_device *sdev, | ||
2085 | int qdepth, int reason) | ||
2086 | { | ||
2087 | struct ctlr_info *h = sdev_to_hba(sdev); | ||
2088 | |||
2089 | if (reason != SCSI_QDEPTH_DEFAULT) | ||
2090 | return -ENOTSUPP; | ||
2091 | |||
2092 | if (qdepth < 1) | ||
2093 | qdepth = 1; | ||
2094 | else | ||
2095 | if (qdepth > h->nr_cmds) | ||
2096 | qdepth = h->nr_cmds; | ||
2097 | scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), qdepth); | ||
2098 | return sdev->queue_depth; | ||
2099 | } | ||
2100 | |||
2080 | static void hpsa_unregister_scsi(struct ctlr_info *h) | 2101 | static void hpsa_unregister_scsi(struct ctlr_info *h) |
2081 | { | 2102 | { |
2082 | /* we are being forcibly unloaded, and may not refuse. */ | 2103 | /* we are being forcibly unloaded, and may not refuse. */ |