ChangeSet 1.1074.1.12, 2003/07/09 21:40:56-07:00, stern@rowland.harvard.edu [PATCH] USB: Reconcile unusual_devs.h for 2.4 and 2.5 This patch for 2.4 removes the now-unneeded code for handling START-STOP commands and fixes up the unusual_devs.h file. Instances of the START_STOP flag are removed as are unnecessary entries. The entries are sorted into numerical order and the US_SC_DEVICE and US_PR_DEVICE flags have been added in. Also a few changes in whitespace were made. When this patch and as48 are applied, unusual_devs.h should be identical between 2.4 and 2.5, except for one line. An entry created by Andries Brouwer refers in 2.5 to an initialization function that is #ifdef'ed out in 2.4. I'm asking him how best to fix this up. drivers/usb/storage/unusual_devs.h | 296 ++++++++++++++++--------------------- drivers/usb/storage/usb.c | 12 - drivers/usb/storage/usb.h | 1 3 files changed, 129 insertions(+), 180 deletions(-) diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h --- a/drivers/usb/storage/unusual_devs.h Mon Jul 14 10:04:17 2003 +++ b/drivers/usb/storage/unusual_devs.h Mon Jul 14 10:04:17 2003 @@ -75,28 +75,26 @@ /* Deduced by Jonathan Woithe * Entry needed for flags: US_FL_FIX_INQUIRY because initial inquiry message - * always fails and confuses drive; without US_FL_START_STOP, drive accesses - * (read or write) all fail. + * always fails and confuses drive. */ UNUSUAL_DEV( 0x0411, 0x001c, 0x0113, 0x0113, "Buffalo", "DUB-P40G HDD", - US_SC_SCSI, US_PR_BULK, NULL, - US_FL_FIX_INQUIRY | US_FL_START_STOP), + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_INQUIRY ), #ifdef CONFIG_USB_STORAGE_DPCM UNUSUAL_DEV( 0x0436, 0x0005, 0x0100, 0x0100, "Microtech", "CameraMate (DPCM_USB)", - US_SC_SCSI, US_PR_DPCM_USB, NULL, - US_FL_START_STOP ), + US_SC_SCSI, US_PR_DPCM_USB, NULL, 0 ), #endif /* Made with the help of Edd Dumbill */ UNUSUAL_DEV( 0x0451, 0x5409, 0x0001, 0x0001, "Frontier Labs", "Nex II Digital", - US_SC_SCSI, US_PR_BULK, NULL, US_FL_START_STOP), + US_SC_SCSI, US_PR_BULK, NULL, 0), /* Patch submitted by Philipp Friedrich */ UNUSUAL_DEV( 0x0482, 0x0100, 0x0100, 0x0100, @@ -124,15 +122,6 @@ "785EPX Storage", US_SC_SCSI, US_PR_BULK, NULL, US_FL_SINGLE_LUN), -/* Reported by Jan Willamowius - * The device needs the flags only. - */ -UNUSUAL_DEV( 0x04c8, 0x0723, 0x0000, 0x9999, - "Konica", - "KD-200Z", - US_SC_SCSI, US_PR_BULK, NULL, - US_FL_START_STOP), - UNUSUAL_DEV( 0x04cb, 0x0100, 0x0000, 0x2210, "Fujifilm", "FinePix 1400Zoom", @@ -144,7 +133,7 @@ UNUSUAL_DEV( 0x04ce, 0x0002, 0x0074, 0x0074, "ScanLogic", "SL11R-IDE", - US_SC_SCSI, US_PR_BULK, NULL, + US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY), /* Reported by Kriston Fincher @@ -153,9 +142,16 @@ * This entry is needed because the device reports Sub=ff */ UNUSUAL_DEV( 0x04da, 0x0901, 0x0100, 0x0200, - "Panasonic", - "LS-120 Camera", - US_SC_UFI, US_PR_CBI, NULL, 0), + "Panasonic", + "LS-120 Camera", + US_SC_UFI, US_PR_CBI, NULL, 0), + +/* From Yukihiro Nakai, via zaitcev@yahoo.com. + * This is needed for CB instead of CBI */ +UNUSUAL_DEV( 0x04da, 0x0d05, 0x0000, 0x0000, + "Sharp CE-CW05", + "CD-R/RW Drive", + US_SC_8070, US_PR_CB, NULL, 0), /* Most of the following entries were developed with the help of * Shuttle/SCM directly. @@ -176,15 +172,15 @@ "Sandisk", "ImageMate SDDR09", US_SC_SCSI, US_PR_EUSB_SDDR09, NULL, - US_FL_SINGLE_LUN | US_FL_START_STOP ), -#endif + US_FL_SINGLE_LUN ), /* This entry is from Andries.Brouwer@cwi.nl */ UNUSUAL_DEV( 0x04e6, 0x0005, 0x0100, 0x0208, "SCM Microsystems", "eUSB SmartMedia / CompactFlash Adapter", US_SC_SCSI, US_PR_DPCM_USB, NULL, - US_FL_START_STOP), + 0), +#endif UNUSUAL_DEV( 0x04e6, 0x0006, 0x0100, 0x0205, "Shuttle", @@ -240,58 +236,58 @@ "Iomega", "USB Clik! 40", US_SC_8070, US_PR_BULK, NULL, - US_FL_FIX_INQUIRY | US_FL_START_STOP ), - -/* Submitted by Lars Gemeinhardt - * Needed for START_STOP flag */ -UNUSUAL_DEV( 0x0547, 0x2810, 0x0001, 0x0001, - "Mello", - "MP3 Player", - US_SC_SCSI, US_PR_BULK, NULL, - US_FL_START_STOP), + US_FL_FIX_INQUIRY ), /* This entry is needed because the device reports Sub=ff */ UNUSUAL_DEV( 0x054c, 0x0010, 0x0106, 0x0450, "Sony", "DSC-S30/S70/S75/505V/F505/F707/F717/P8", US_SC_SCSI, US_PR_CB, NULL, - US_FL_SINGLE_LUN | US_FL_START_STOP | US_FL_MODE_XLATE ), + US_FL_SINGLE_LUN | US_FL_MODE_XLATE ), /* Reported by wim@geeks.nl */ UNUSUAL_DEV( 0x054c, 0x0025, 0x0100, 0x0100, "Sony", "Memorystick NW-MS7", US_SC_UFI, US_PR_CB, NULL, - US_FL_SINGLE_LUN | US_FL_START_STOP ), + US_FL_SINGLE_LUN ), + +#ifdef CONFIG_USB_STORAGE_ISD200 +UNUSUAL_DEV( 0x054c, 0x002b, 0x0100, 0x0110, + "Sony", + "Portable USB Harddrive V2", + US_SC_ISD200, US_PR_BULK, isd200_Initialization, + 0 ), +#endif UNUSUAL_DEV( 0x054c, 0x002d, 0x0100, 0x0100, "Sony", "Memorystick MSAC-US1", US_SC_UFI, US_PR_CB, NULL, - US_FL_SINGLE_LUN | US_FL_START_STOP ), + US_FL_SINGLE_LUN ), /* Submitted by Klaus Mueller */ UNUSUAL_DEV( 0x054c, 0x002e, 0x0106, 0x0310, "Sony", "Handycam", US_SC_SCSI, US_PR_CB, NULL, - US_FL_SINGLE_LUN | US_FL_START_STOP | US_FL_MODE_XLATE), + US_FL_SINGLE_LUN | US_FL_MODE_XLATE), UNUSUAL_DEV( 0x054c, 0x0032, 0x0000, 0x9999, - "Sony", + "Sony", "Memorystick MSC-U01N", US_SC_UFI, US_PR_CB, NULL, - US_FL_SINGLE_LUN | US_FL_START_STOP ), + US_FL_SINGLE_LUN ), UNUSUAL_DEV( 0x054c, 0x0069, 0x0000, 0x9999, "Sony", "Memorystick MSC-U03", US_SC_UFI, US_PR_CB, NULL, - US_FL_SINGLE_LUN | US_FL_START_STOP ), + US_FL_SINGLE_LUN ), /* Submitted by Nathan Babb */ UNUSUAL_DEV( 0x054c, 0x006d, 0x0000, 0x9999, - "Sony", + "Sony", "PEG Mass Storage", US_SC_8070, US_PR_CBI, NULL, US_FL_FIX_INQUIRY ), @@ -313,65 +309,30 @@ "USB Hard Disk", US_SC_RBC, US_PR_CB, NULL, 0 ), -/* Enable USB storage access to the MMC/SD and CompactFlash cards inside the - * Pontis SP600 MP3 player (entry found on http://www.pontis.de/). - */ -UNUSUAL_DEV( 0x09bc, 0x0003, 0x0000, 0x9999, - "PONTIS", - "SP600", - US_SC_SCSI, US_PR_BULK, NULL, - US_FL_START_STOP ), - -/* This Pentax still camera is not conformant - * to the USB storage specification: - - * - It does not like the INQUIRY command. So we must handle this command - * of the SCSI layer ourselves. - * Tested on Rev. 10.00 (0x1000) - * Submitted by James Courtier-Dutton - */ -UNUSUAL_DEV( 0x0a17, 0x0004, 0x1000, 0x1000, - "Pentax", - "Optio 2/3/400", - US_SC_8070, US_PR_CBI, NULL, - US_FL_FIX_INQUIRY ), - -/* Submitted by Per Winkvist */ -UNUSUAL_DEV( 0x0a17, 0x006, 0x1000, 0x9009, - "Pentax", - "Optio S", - US_SC_8070, US_PR_CBI, NULL, - US_FL_FIX_INQUIRY ), - #ifdef CONFIG_USB_STORAGE_ISD200 UNUSUAL_DEV( 0x05ab, 0x0031, 0x0100, 0x0110, - "In-System", - "USB/IDE Bridge (ATA/ATAPI)", - US_SC_ISD200, US_PR_BULK, isd200_Initialization, - 0 ), + "In-System", + "USB/IDE Bridge (ATA/ATAPI)", + US_SC_ISD200, US_PR_BULK, isd200_Initialization, + 0 ), UNUSUAL_DEV( 0x05ab, 0x0301, 0x0100, 0x0110, - "In-System", - "Portable USB Harddrive V2", - US_SC_ISD200, US_PR_BULK, isd200_Initialization, - 0 ), + "In-System", + "Portable USB Harddrive V2", + US_SC_ISD200, US_PR_BULK, isd200_Initialization, + 0 ), UNUSUAL_DEV( 0x05ab, 0x0351, 0x0100, 0x0110, - "In-System", - "Portable USB Harddrive V2", - US_SC_ISD200, US_PR_BULK, isd200_Initialization, - 0 ), + "In-System", + "Portable USB Harddrive V2", + US_SC_ISD200, US_PR_BULK, isd200_Initialization, + 0 ), UNUSUAL_DEV( 0x05ab, 0x5701, 0x0100, 0x0110, - "In-System", - "USB Storage Adapter V2", - US_SC_ISD200, US_PR_BULK, isd200_Initialization, - 0 ), - -UNUSUAL_DEV( 0x054c, 0x002b, 0x0100, 0x0110, - "Sony", - "Portable USB Harddrive V2", - US_SC_ISD200, US_PR_BULK, isd200_Initialization, - 0 ), + "In-System", + "USB Storage Adapter V2", + US_SC_ISD200, US_PR_BULK, isd200_Initialization, + 0 ), #endif #ifdef CONFIG_USB_STORAGE_JUMPSHOT @@ -396,7 +357,7 @@ UNUSUAL_DEV( 0x05e3, 0x0700, 0x0000, 0xffff, "SIIG", "CompactFlash Card Reader", - US_SC_SCSI, US_PR_BULK, NULL, + US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY ), /* Reported by Peter Marks @@ -409,7 +370,7 @@ UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0x0001, "EagleTec", "External Hard Disk", - US_SC_SCSI, US_PR_BULK, NULL, + US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY ), /* Reported by Hanno Boeck @@ -430,31 +391,9 @@ "Olympus", "Camedia MAUSB-2", US_SC_SCSI, US_PR_EUSB_SDDR09, NULL, - US_FL_SINGLE_LUN | US_FL_START_STOP ), + US_FL_SINGLE_LUN ), #endif -/* Submitted by kedar@centillium - * Needed for START_STOP flag, but that is unconfirmed */ -UNUSUAL_DEV( 0x0686, 0x4006, 0x0001, 0x0001, - "Minolta", - "Dimage S304", - US_SC_SCSI, US_PR_BULK, NULL, - US_FL_START_STOP ), - -/* Submitted by f.brugmans@hccnet.nl - * Needed for START_STOP flag */ -UNUSUAL_DEV( 0x0686, 0x4007, 0x0001, 0x0001, - "Minolta", - "Dimage S304", - US_SC_SCSI, US_PR_BULK, NULL, - US_FL_START_STOP ), - -UNUSUAL_DEV( 0x0686, 0x400b, 0x0001, 0x0001, - "Minolta", - "Dimage 7i", - US_SC_SCSI, US_PR_BULK, NULL, - US_FL_START_STOP ), - UNUSUAL_DEV( 0x0693, 0x0002, 0x0100, 0x0100, "Hagiwara", "FlashGate SmartMedia", @@ -469,33 +408,33 @@ "Sandisk", "ImageMate SDDR-05a", US_SC_SCSI, US_PR_CB, NULL, - US_FL_SINGLE_LUN | US_FL_START_STOP), + US_FL_SINGLE_LUN ), UNUSUAL_DEV( 0x0781, 0x0002, 0x0009, 0x0009, "Sandisk", "ImageMate SDDR-31", US_SC_SCSI, US_PR_BULK, NULL, - US_FL_IGNORE_SER), + US_FL_IGNORE_SER ), UNUSUAL_DEV( 0x0781, 0x0100, 0x0100, 0x0100, - "Sandisk", - "ImageMate SDDR-12", - US_SC_SCSI, US_PR_CB, NULL, - US_FL_SINGLE_LUN ), + "Sandisk", + "ImageMate SDDR-12", + US_SC_SCSI, US_PR_CB, NULL, + US_FL_SINGLE_LUN ), #ifdef CONFIG_USB_STORAGE_SDDR09 UNUSUAL_DEV( 0x0781, 0x0200, 0x0000, 0x9999, "Sandisk", "ImageMate SDDR-09", US_SC_SCSI, US_PR_EUSB_SDDR09, NULL, - US_FL_SINGLE_LUN | US_FL_START_STOP ), + US_FL_SINGLE_LUN ), #endif #ifdef CONFIG_USB_STORAGE_FREECOM UNUSUAL_DEV( 0x07ab, 0xfc01, 0x0000, 0x9999, - "Freecom", - "USB-IDE", - US_SC_QIC, US_PR_FREECOM, freecom_init, 0), + "Freecom", + "USB-IDE", + US_SC_QIC, US_PR_FREECOM, freecom_init, 0), #endif UNUSUAL_DEV( 0x07af, 0x0004, 0x0100, 0x0133, @@ -514,8 +453,7 @@ UNUSUAL_DEV( 0x07af, 0x0006, 0x0100, 0x0100, "Microtech", "CameraMate (DPCM_USB)", - US_SC_SCSI, US_PR_DPCM_USB, NULL, - US_FL_START_STOP ), + US_SC_SCSI, US_PR_DPCM_USB, NULL, 0 ), #endif #ifdef CONFIG_USB_STORAGE_DATAFAB @@ -565,7 +503,18 @@ "Simple Tech/Datafab CF+SM Reader", US_SC_SCSI, US_PR_DATAFAB, NULL, US_FL_MODE_XLATE ), +#endif + +#ifdef CONFIG_USB_STORAGE_SDDR55 +/* Contributed by Peter Waechtler */ +UNUSUAL_DEV( 0x07c4, 0xa103, 0x0000, 0x9999, + "Datafab", + "MDSM-B reader", + US_SC_SCSI, US_PR_SDDR55, NULL, + US_FL_FIX_INQUIRY ), +#endif +#ifdef CONFIG_USB_STORAGE_DATAFAB /* Submitted by Olaf Hering */ UNUSUAL_DEV( 0x07c4, 0xa109, 0x0000, 0xffff, "Datafab Systems, Inc.", @@ -583,7 +532,7 @@ UNUSUAL_DEV( 0x07c4, 0xa400, 0x0000, 0xffff, "Datafab", "KECF-USB", - US_SC_SCSI, US_PR_BULK, NULL, + US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY ), /* Casio QV 2x00/3x00/4000/8000 digital still cameras are not conformant @@ -594,18 +543,34 @@ * of the SCSI layer ourselves. */ UNUSUAL_DEV( 0x07cf, 0x1001, 0x1000, 0x9009, - "Casio", - "QV DigitalCamera", - US_SC_8070, US_PR_CB, NULL, - US_FL_FIX_INQUIRY ), + "Casio", + "QV DigitalCamera", + US_SC_8070, US_PR_CB, NULL, + US_FL_FIX_INQUIRY ), /* Submitted by Hartmut Wahl */ UNUSUAL_DEV( 0x0839, 0x000a, 0x0001, 0x0001, - "Samsung", - "Digimax 410", - US_SC_SCSI, US_PR_BULK, NULL, - US_FL_FIX_INQUIRY), - + "Samsung", + "Digimax 410", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_INQUIRY), + +/* Aiptek PocketCAM 3Mega + * Nicolas DUPEUX + */ +UNUSUAL_DEV( 0x08ca, 0x2011, 0x0000, 0x9999, + "AIPTEK", + "PocketCAM 3Mega", + US_SC_SCSI, US_PR_BULK, NULL, + US_FL_MODE_XLATE ), + +/* aeb */ +UNUSUAL_DEV( 0x090c, 0x1132, 0x0000, 0xffff, + "Feiya", + "5-in-1 Card Reader", + US_SC_SCSI, US_PR_BULK, NULL, + US_FL_FIX_CAPACITY ), + UNUSUAL_DEV( 0x097a, 0x0001, 0x0000, 0x0001, "Minds@Work", "Digital Wallet", @@ -617,28 +582,35 @@ "IBM USB Memory Key", US_SC_SCSI, US_PR_BULK, NULL, US_FL_FIX_INQUIRY ), + +/* This Pentax still camera is not conformant + * to the USB storage specification: - + * - It does not like the INQUIRY command. So we must handle this command + * of the SCSI layer ourselves. + * Tested on Rev. 10.00 (0x1000) + * Submitted by James Courtier-Dutton + */ +UNUSUAL_DEV( 0x0a17, 0x0004, 0x1000, 0x1000, + "Pentax", + "Optio 2/3/400", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_INQUIRY ), + +/* Submitted by Per Winkvist */ +UNUSUAL_DEV( 0x0a17, 0x006, 0x1000, 0x9009, + "Pentax", + "Optio S", + US_SC_8070, US_PR_CBI, NULL, + US_FL_FIX_INQUIRY ), #ifdef CONFIG_USB_STORAGE_ISD200 UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110, - "ATI", - "USB Cable 205", - US_SC_ISD200, US_PR_BULK, isd200_Initialization, - 0 ), + "ATI", + "USB Cable 205", + US_SC_ISD200, US_PR_BULK, isd200_Initialization, + 0 ), #endif -/* Submitted by Brian Hall - * Needed for START_STOP flag */ -UNUSUAL_DEV( 0x0c76, 0x0003, 0x0100, 0x0100, - "JMTek", - "USBDrive", - US_SC_SCSI, US_PR_BULK, NULL, - US_FL_START_STOP ), -UNUSUAL_DEV( 0x0c76, 0x0005, 0x0100, 0x0100, - "JMTek", - "USBDrive", - US_SC_SCSI, US_PR_BULK, NULL, - US_FL_START_STOP ), - /* Reported by Kevin Cernekee * Tested on hardware version 1.10. * Entry is needed only for the initializer function override. @@ -657,8 +629,8 @@ UNUSUAL_DEV( 0x1065, 0x2136, 0x0000, 0x9999, "CCYU TECHNOLOGY", "EasyDisk Portable Device", - US_SC_SCSI, US_PR_BULK, NULL, - US_FL_MODE_XLATE | US_FL_START_STOP), + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_MODE_XLATE ), #ifdef CONFIG_USB_STORAGE_SDDR55 UNUSUAL_DEV( 0x55aa, 0xa103, 0x0000, 0x9999, @@ -667,13 +639,3 @@ US_SC_SCSI, US_PR_SDDR55, NULL, US_FL_SINGLE_LUN), #endif - -/* Aiptek PocketCAM 3Mega - * Nicolas DUPEUX - */ -UNUSUAL_DEV( 0x08ca, 0x2011, 0x0000, 0x9999, - "AIPTEK", - "PocketCAM 3Mega", - US_SC_SCSI, US_PR_BULK, NULL, - US_FL_MODE_XLATE | US_FL_START_STOP), - diff -Nru a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c --- a/drivers/usb/storage/usb.c Mon Jul 14 10:04:17 2003 +++ b/drivers/usb/storage/usb.c Mon Jul 14 10:04:17 2003 @@ -401,18 +401,6 @@ break; } - /* handle those devices which can't do a START_STOP */ - if ((us->srb->cmnd[0] == START_STOP) && - (us->flags & US_FL_START_STOP)) { - US_DEBUGP("Skipping START_STOP command\n"); - us->srb->result = GOOD << 1; - - set_current_state(TASK_INTERRUPTIBLE); - us->srb->scsi_done(us->srb); - us->srb = NULL; - break; - } - /* lock the device pointers */ down(&(us->dev_semaphore)); diff -Nru a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h --- a/drivers/usb/storage/usb.h Mon Jul 14 10:04:17 2003 +++ b/drivers/usb/storage/usb.h Mon Jul 14 10:04:17 2003 @@ -99,7 +99,6 @@ #define US_FL_SINGLE_LUN 0x00000001 /* allow access to only LUN 0 */ #define US_FL_MODE_XLATE 0x00000002 /* translate _6 to _10 commands for Win/MacOS compatibility */ -#define US_FL_START_STOP 0x00000004 /* ignore START_STOP commands */ #define US_FL_IGNORE_SER 0x00000010 /* Ignore the serial number given */ #define US_FL_SCM_MULT_TARG 0x00000020 /* supports multiple targets */ #define US_FL_FIX_INQUIRY 0x00000040 /* INQUIRY response needs fixing */