On Sat, Jan 19, 2008 at 10:09:47PM -0800, Matthew Dharm wrote: > On Sat, Jan 19, 2008 at 09:25:57PM -0700, Grant Grundler wrote: > > Hi, > > I'm slightly confused by this declaration in drivers/usb/storage/usb.c: > > #define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \ > > vendorName, productName,useProtocol, useTransport, \ > > initFunction, flags) \ > > ... > > > > and in unusual.h: > > UAL_DEV( 0x03eb, 0x2002, 0x0100, 0x0100, > > "ATMEL", > > "SND1 Storage", > > US_SC_DEVICE, US_PR_DEVICE, NULL, > > US_FL_IGNORE_RESIDUE), > > > > So US_SC_DEVICE ("Sub Classes" per include/linux/usb_usual.h) is used as a > > wild card for useProtocol and US_PR_DEVICE ("Protocols") is the wildcard > > for useTransport? > > > No, they aren't wildcards. > > The value means "use whatever the device presents". It's not used as a > matching parameter. Matching only happens on VID/PID and revision.
Sorry - "wildcards" was a poor choice of words. > Also, the naming is goofy for a reason. The USB spec calls the numbers > "SubClass" and "Protocol". However, the way they are used, the SubClass > defines the protocol (i.e. language) the device uses; the "Protocol" > defines the transport (i.e. how messages are packed for exchange). > > There is no USB-spec field named 'Transport'. Thanks for the excellent, concise explanation. I've proposed a patch below to help capture some of it. I just want to "connect the dots" between the related code. thanks, grant Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> --- include/linux/usb_usual.h-ORIG 2007-10-09 13:31:38.000000000 -0700 +++ include/linux/usb_usual.h 2008-01-20 00:00:30.000000000 -0800 @@ -69,7 +69,7 @@ * But it's the only header included into all places which need them. */ -/* Sub Classes */ +/* Sub Classes - defines which Protocol will be used */ #define US_SC_RBC 0x01 /* Typically, flash devices */ #define US_SC_8020 0x02 /* CD-ROM */ @@ -83,7 +83,7 @@ #define US_SC_DEVICE 0xff /* Use device's value */ -/* Protocols */ +/* Protocols - defines which transport used (how messages are packed) */ #define US_PR_CBI 0x00 /* Control/Bulk/Interrupt */ #define US_PR_CB 0x01 /* Control/Bulk w/o interrupt */ > > Matt > > -- > Matthew Dharm Home: [EMAIL PROTECTED] > Maintainer, Linux USB Mass Storage Driver > > You were using cheat codes too. You guys suck. > -- Greg to General Studebaker > User Friendly, 12/16/1997 - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html