another unusual flag for a really limited device
Doug Maxey <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
Howdy, Have run across a virtual USB host that needs (yes, I know, a strong word :) to limit the maximum number of sectors transferred in a single request to 32. In theory, the device should be fine with 32k, but when it loses, it never seems to recover without a full reset. Did some searching in the archives, but saw nothing. What about something along the lines of adding UL_FL_MAX_SECTORS_32 to follow the pattern used with MAX_SECTORS_64, thusly? Based on linus 2.6.24-rc2. ++doug ---- diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 1ba19ea..3fe0712 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -118,6 +118,10 @@ static int slave_configure(struct scsi_device *sdev) sdev->request_queue->max_sectors > 64) blk_queue_max_sectors(sdev->request_queue, 64); + if ((us->flags & US_FL_MAX_SECTORS_32) && + sdev->request_queue->max_sectors > 32) + blk_queue_max_sectors(sdev->request_queue, 32); + /* We can't put these settings in slave_alloc() because that gets * called before the device type is known. Consequently these * settings can't be overridden via the scsi devinfo mechanism. */ diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 22ab238..56f0b43 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -376,6 +376,13 @@ UNUSUAL_DEV( 0x04b0, 0x0417, 0x0100, 0x0100, US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_CAPACITY), +/* Reported by Doug Maxey ([email protected]) */ +UNUSUAL_DEV( 0x04b3, 0x4003, 0x0110, 0x0110, + "IBM", + "IBM RSA2", + US_SC_DEVICE, US_PR_CB, NULL, + US_FL_MAX_SECTORS_32), + /* BENQ DC5330 * Reported by Manuel Fombuena <[email protected]> and * Frank Copeland <[email protected]> */ diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index 1b792b9..37bb4a0 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h @@ -48,7 +48,10 @@ US_FLAG(IGNORE_DEVICE, 0x00000800) \ /* Don't claim device */ \ US_FLAG(CAPACITY_HEURISTICS, 0x00001000) \ - /* sometimes sizes is too big */ + /* sometimes sizes is too big */ \ + US_FLAG(MAX_SECTORS_32, 0x00001000) \ + /* Sets max_sectors to 32 */ + #define US_FLAG(name, value) US_FL_##name = value , enum { US_DO_ALL_FLAGS }; ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel