aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-02-25 15:02:51 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-03-03 08:05:40 -0500
commit667e23d4e968f6826dc5d3e81238a7f1f343fb4f (patch)
treee29001893863cb6315c8a45096f93e4f668bdce0 /drivers/scsi/hpsa.c
parentb0f4d4cf12d0eaa0bd766686bba843fc105b6a60 (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/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c21
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,
134static void hpsa_scan_start(struct Scsi_Host *); 135static void hpsa_scan_start(struct Scsi_Host *);
135static int hpsa_scan_finished(struct Scsi_Host *sh, 136static int hpsa_scan_finished(struct Scsi_Host *sh,
136 unsigned long elapsed_time); 137 unsigned long elapsed_time);
138static int hpsa_change_queue_depth(struct scsi_device *sdev,
139 int qdepth, int reason);
137 140
138static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd); 141static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd);
139static int hpsa_slave_alloc(struct scsi_device *sdev); 142static 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
2084static 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
2080static void hpsa_unregister_scsi(struct ctlr_info *h) 2101static 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. */