diff options
Diffstat (limited to 'drivers/message')
-rw-r--r-- | drivers/message/fusion/mptfc.c | 15 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 47 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.h | 2 | ||||
-rw-r--r-- | drivers/message/fusion/mptspi.c | 15 |
4 files changed, 24 insertions, 55 deletions
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index 79959562248c..29f66de4e8f1 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c | |||
@@ -83,19 +83,6 @@ static int mptfcDoneCtx = -1; | |||
83 | static int mptfcTaskCtx = -1; | 83 | static int mptfcTaskCtx = -1; |
84 | static int mptfcInternalCtx = -1; /* Used only for internal commands */ | 84 | static int mptfcInternalCtx = -1; /* Used only for internal commands */ |
85 | 85 | ||
86 | static struct device_attribute mptfc_queue_depth_attr = { | ||
87 | .attr = { | ||
88 | .name = "queue_depth", | ||
89 | .mode = S_IWUSR, | ||
90 | }, | ||
91 | .store = mptscsih_store_queue_depth, | ||
92 | }; | ||
93 | |||
94 | static struct device_attribute *mptfc_dev_attrs[] = { | ||
95 | &mptfc_queue_depth_attr, | ||
96 | NULL, | ||
97 | }; | ||
98 | |||
99 | static struct scsi_host_template mptfc_driver_template = { | 86 | static struct scsi_host_template mptfc_driver_template = { |
100 | .proc_name = "mptfc", | 87 | .proc_name = "mptfc", |
101 | .proc_info = mptscsih_proc_info, | 88 | .proc_info = mptscsih_proc_info, |
@@ -105,6 +92,7 @@ static struct scsi_host_template mptfc_driver_template = { | |||
105 | .slave_alloc = mptscsih_slave_alloc, | 92 | .slave_alloc = mptscsih_slave_alloc, |
106 | .slave_configure = mptscsih_slave_configure, | 93 | .slave_configure = mptscsih_slave_configure, |
107 | .slave_destroy = mptscsih_slave_destroy, | 94 | .slave_destroy = mptscsih_slave_destroy, |
95 | .change_queue_depth = mptscsih_change_queue_depth, | ||
108 | .eh_abort_handler = mptscsih_abort, | 96 | .eh_abort_handler = mptscsih_abort, |
109 | .eh_device_reset_handler = mptscsih_dev_reset, | 97 | .eh_device_reset_handler = mptscsih_dev_reset, |
110 | .eh_bus_reset_handler = mptscsih_bus_reset, | 98 | .eh_bus_reset_handler = mptscsih_bus_reset, |
@@ -116,7 +104,6 @@ static struct scsi_host_template mptfc_driver_template = { | |||
116 | .max_sectors = 8192, | 104 | .max_sectors = 8192, |
117 | .cmd_per_lun = 7, | 105 | .cmd_per_lun = 7, |
118 | .use_clustering = ENABLE_CLUSTERING, | 106 | .use_clustering = ENABLE_CLUSTERING, |
119 | .sdev_attrs = mptfc_dev_attrs, | ||
120 | }; | 107 | }; |
121 | 108 | ||
122 | /**************************************************************************** | 109 | /**************************************************************************** |
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index a0078ae5b9b8..364c49cb7482 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -2234,13 +2234,27 @@ mptscsih_slave_destroy(struct scsi_device *device) | |||
2234 | } | 2234 | } |
2235 | } | 2235 | } |
2236 | 2236 | ||
2237 | static void | 2237 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
2238 | mptscsih_set_queue_depth(struct scsi_device *device, MPT_SCSI_HOST *hd, | 2238 | /* |
2239 | VirtDevice *pTarget, int qdepth) | 2239 | * mptscsih_change_queue_depth - This function will set a devices queue depth |
2240 | * @sdev: per scsi_device pointer | ||
2241 | * @qdepth: requested queue depth | ||
2242 | * | ||
2243 | * Adding support for new 'change_queue_depth' api. | ||
2244 | */ | ||
2245 | int | ||
2246 | mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth) | ||
2240 | { | 2247 | { |
2248 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)sdev->host->hostdata; | ||
2249 | VirtDevice *pTarget; | ||
2241 | int max_depth; | 2250 | int max_depth; |
2242 | int tagged; | 2251 | int tagged; |
2243 | 2252 | ||
2253 | if (hd == NULL) | ||
2254 | return 0; | ||
2255 | if (!(pTarget = hd->Targets[sdev->id])) | ||
2256 | return 0; | ||
2257 | |||
2244 | if (hd->ioc->bus_type == SCSI) { | 2258 | if (hd->ioc->bus_type == SCSI) { |
2245 | if (pTarget->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY) { | 2259 | if (pTarget->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY) { |
2246 | if (!(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)) | 2260 | if (!(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)) |
@@ -2264,10 +2278,10 @@ mptscsih_set_queue_depth(struct scsi_device *device, MPT_SCSI_HOST *hd, | |||
2264 | else | 2278 | else |
2265 | tagged = MSG_SIMPLE_TAG; | 2279 | tagged = MSG_SIMPLE_TAG; |
2266 | 2280 | ||
2267 | scsi_adjust_queue_depth(device, tagged, qdepth); | 2281 | scsi_adjust_queue_depth(sdev, tagged, qdepth); |
2282 | return sdev->queue_depth; | ||
2268 | } | 2283 | } |
2269 | 2284 | ||
2270 | |||
2271 | /* | 2285 | /* |
2272 | * OS entry point to adjust the queue_depths on a per-device basis. | 2286 | * OS entry point to adjust the queue_depths on a per-device basis. |
2273 | * Called once per device the bus scan. Use it to force the queue_depth | 2287 | * Called once per device the bus scan. Use it to force the queue_depth |
@@ -2317,7 +2331,7 @@ mptscsih_slave_configure(struct scsi_device *device) | |||
2317 | 2331 | ||
2318 | mptscsih_initTarget(hd, device->channel, device->id, device->lun, | 2332 | mptscsih_initTarget(hd, device->channel, device->id, device->lun, |
2319 | device->inquiry, device->inquiry_len ); | 2333 | device->inquiry, device->inquiry_len ); |
2320 | mptscsih_set_queue_depth(device, hd, pTarget, MPT_SCSI_CMD_PER_DEV_HIGH); | 2334 | mptscsih_change_queue_depth(device, MPT_SCSI_CMD_PER_DEV_HIGH); |
2321 | 2335 | ||
2322 | dsprintk((MYIOC_s_INFO_FMT | 2336 | dsprintk((MYIOC_s_INFO_FMT |
2323 | "Queue depth=%d, tflags=%x\n", | 2337 | "Queue depth=%d, tflags=%x\n", |
@@ -2337,25 +2351,6 @@ slave_configure_exit: | |||
2337 | return 0; | 2351 | return 0; |
2338 | } | 2352 | } |
2339 | 2353 | ||
2340 | ssize_t | ||
2341 | mptscsih_store_queue_depth(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | ||
2342 | { | ||
2343 | int depth; | ||
2344 | struct scsi_device *sdev = to_scsi_device(dev); | ||
2345 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *) sdev->host->hostdata; | ||
2346 | VirtDevice *pTarget; | ||
2347 | |||
2348 | depth = simple_strtoul(buf, NULL, 0); | ||
2349 | if (depth == 0) | ||
2350 | return -EINVAL; | ||
2351 | pTarget = hd->Targets[sdev->id]; | ||
2352 | if (pTarget == NULL) | ||
2353 | return -EINVAL; | ||
2354 | mptscsih_set_queue_depth(sdev, (MPT_SCSI_HOST *) sdev->host->hostdata, | ||
2355 | pTarget, depth); | ||
2356 | return count; | ||
2357 | } | ||
2358 | |||
2359 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 2354 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
2360 | /* | 2355 | /* |
2361 | * Private routines... | 2356 | * Private routines... |
@@ -5586,7 +5581,7 @@ EXPORT_SYMBOL(mptscsih_taskmgmt_complete); | |||
5586 | EXPORT_SYMBOL(mptscsih_scandv_complete); | 5581 | EXPORT_SYMBOL(mptscsih_scandv_complete); |
5587 | EXPORT_SYMBOL(mptscsih_event_process); | 5582 | EXPORT_SYMBOL(mptscsih_event_process); |
5588 | EXPORT_SYMBOL(mptscsih_ioc_reset); | 5583 | EXPORT_SYMBOL(mptscsih_ioc_reset); |
5589 | EXPORT_SYMBOL(mptscsih_store_queue_depth); | 5584 | EXPORT_SYMBOL(mptscsih_change_queue_depth); |
5590 | EXPORT_SYMBOL(mptscsih_timer_expired); | 5585 | EXPORT_SYMBOL(mptscsih_timer_expired); |
5591 | 5586 | ||
5592 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 5587 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h index d73aec33e16a..c202ce89a0ff 100644 --- a/drivers/message/fusion/mptscsih.h +++ b/drivers/message/fusion/mptscsih.h | |||
@@ -103,5 +103,5 @@ extern int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_F | |||
103 | extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); | 103 | extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); |
104 | extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); | 104 | extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); |
105 | extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); | 105 | extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); |
106 | extern ssize_t mptscsih_store_queue_depth(struct device *dev, struct device_attribute *attr, const char *buf, size_t count); | 106 | extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth); |
107 | extern void mptscsih_timer_expired(unsigned long data); | 107 | extern void mptscsih_timer_expired(unsigned long data); |
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index d2b53eac9c94..a0a2e0afb21d 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c | |||
@@ -102,19 +102,6 @@ static int mptspiDoneCtx = -1; | |||
102 | static int mptspiTaskCtx = -1; | 102 | static int mptspiTaskCtx = -1; |
103 | static int mptspiInternalCtx = -1; /* Used only for internal commands */ | 103 | static int mptspiInternalCtx = -1; /* Used only for internal commands */ |
104 | 104 | ||
105 | static struct device_attribute mptspi_queue_depth_attr = { | ||
106 | .attr = { | ||
107 | .name = "queue_depth", | ||
108 | .mode = S_IWUSR, | ||
109 | }, | ||
110 | .store = mptscsih_store_queue_depth, | ||
111 | }; | ||
112 | |||
113 | static struct device_attribute *mptspi_dev_attrs[] = { | ||
114 | &mptspi_queue_depth_attr, | ||
115 | NULL, | ||
116 | }; | ||
117 | |||
118 | static struct scsi_host_template mptspi_driver_template = { | 105 | static struct scsi_host_template mptspi_driver_template = { |
119 | .proc_name = "mptspi", | 106 | .proc_name = "mptspi", |
120 | .proc_info = mptscsih_proc_info, | 107 | .proc_info = mptscsih_proc_info, |
@@ -124,6 +111,7 @@ static struct scsi_host_template mptspi_driver_template = { | |||
124 | .slave_alloc = mptscsih_slave_alloc, | 111 | .slave_alloc = mptscsih_slave_alloc, |
125 | .slave_configure = mptscsih_slave_configure, | 112 | .slave_configure = mptscsih_slave_configure, |
126 | .slave_destroy = mptscsih_slave_destroy, | 113 | .slave_destroy = mptscsih_slave_destroy, |
114 | .change_queue_depth = mptscsih_change_queue_depth, | ||
127 | .eh_abort_handler = mptscsih_abort, | 115 | .eh_abort_handler = mptscsih_abort, |
128 | .eh_device_reset_handler = mptscsih_dev_reset, | 116 | .eh_device_reset_handler = mptscsih_dev_reset, |
129 | .eh_bus_reset_handler = mptscsih_bus_reset, | 117 | .eh_bus_reset_handler = mptscsih_bus_reset, |
@@ -135,7 +123,6 @@ static struct scsi_host_template mptspi_driver_template = { | |||
135 | .max_sectors = 8192, | 123 | .max_sectors = 8192, |
136 | .cmd_per_lun = 7, | 124 | .cmd_per_lun = 7, |
137 | .use_clustering = ENABLE_CLUSTERING, | 125 | .use_clustering = ENABLE_CLUSTERING, |
138 | .sdev_attrs = mptspi_dev_attrs, | ||
139 | }; | 126 | }; |
140 | 127 | ||
141 | 128 | ||