diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-26 16:28:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-26 16:28:47 -0400 |
commit | 2d986010ad13a00b83851238d52601d6092df40e (patch) | |
tree | 6a43ffd30290fc051435643d485ad12fb1448ed5 /drivers/message/fusion/mptscsih.c | |
parent | 6b6a93c6876ea1c530d5d3f68e3678093a27fab0 (diff) | |
parent | e10fb91c4dc81a4ae47caf0828df152f600f2546 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-for-linus-2.6
Diffstat (limited to 'drivers/message/fusion/mptscsih.c')
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 4f973a49be4c..b9d4f78725b4 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 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |