ChangeSet 1.1268, 2003/06/18 17:27:07-07:00, stern@rowland.harvard.edu [PATCH] USB: US_SC_DEVICE and US_PR_DEVICE for 2.4 This patch implements the new subclass and protocol unusual_devs.h codes for 2.4.21. Now new entries can remain consistent between 2.4 and 2.5. drivers/usb/storage/protocol.h | 2 ++ drivers/usb/storage/transport.h | 2 ++ drivers/usb/storage/usb.c | 8 ++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff -Nru a/drivers/usb/storage/protocol.h b/drivers/usb/storage/protocol.h --- a/drivers/usb/storage/protocol.h Wed Jun 18 17:34:31 2003 +++ b/drivers/usb/storage/protocol.h Wed Jun 18 17:34:31 2003 @@ -57,6 +57,8 @@ #define US_SC_MIN US_SC_RBC #define US_SC_MAX US_SC_ISD200 +#define US_SC_DEVICE 0xff /* Use device's value */ + extern void usb_stor_ATAPI_command(Scsi_Cmnd*, struct us_data*); extern void usb_stor_qic157_command(Scsi_Cmnd*, struct us_data*); extern void usb_stor_ufi_command(Scsi_Cmnd*, struct us_data*); diff -Nru a/drivers/usb/storage/transport.h b/drivers/usb/storage/transport.h --- a/drivers/usb/storage/transport.h Wed Jun 18 17:34:31 2003 +++ b/drivers/usb/storage/transport.h Wed Jun 18 17:34:31 2003 @@ -75,6 +75,8 @@ #define US_PR_JUMPSHOT 0xf3 /* Lexar Jumpshot */ #endif +#define US_PR_DEVICE 0xff /* Use device's value */ + /* * Bulk only data structures */ diff -Nru a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c --- a/drivers/usb/storage/usb.c Wed Jun 18 17:34:31 2003 +++ b/drivers/usb/storage/usb.c Wed Jun 18 17:34:31 2003 @@ -621,8 +621,12 @@ US_DEBUGP("USB Mass Storage device detected\n"); /* Determine subclass and protocol, or copy from the interface */ - subclass = unusual_dev->useProtocol; - protocol = unusual_dev->useTransport; + subclass = (unusual_dev->useProtocol == US_SC_DEVICE) ? + altsetting->bInterfaceSubClass : + unusual_dev->useProtocol; + protocol = (unusual_dev->useTransport == US_PR_DEVICE) ? + altsetting->bInterfaceProtocol : + unusual_dev->useTransport; flags = unusual_dev->flags; /*