aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2009-02-12 14:47:44 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-24 19:20:34 -0400
commite6e244b6cb1f70e7109381626293cd40a8334ed3 (patch)
treef3d1d9a23b603f9a4108799fb0a4fe21969dd695 /include
parente4abe6658aa17a5d7e7321dfda807d287255511b (diff)
usb-storage: prepare for subdriver separation
This patch (as1206) is the first step in converting usb-storage's subdrivers into separate modules. It makes the following large-scale changes: Remove a bunch of unnecessary #ifdef's from usb_usual.h. Not truly necessary, but it does clean things up. Move the USB device-ID table (which is duplicated between libusual and usb-storage) into its own source file, usual-tables.c, and arrange for this to be linked with either libusual or usb-storage according to whether USB_LIBUSUAL is configured. Add to usual-tables.c a new usb_usual_ignore_device() function to detect whether a particular device needs to be managed by a subdriver and not by the standard handlers in usb-storage. Export a whole bunch of functions in usb-storage, renaming some of them because their names don't already begin with "usb_stor_". These functions will be needed by the new subdriver modules. Split usb-storage's probe routine into two functions. The subdrivers will call the probe1 routine, then fill in their transport and protocol settings, and then call the probe2 routine. Take the default cases and error checking out of get_transport() and get_protocol(), which run during probe1, and instead put a check for invalid transport or protocol values into the probe2 function. Add a new probe routine to be used for standard devices, i.e., those that don't need a subdriver. This new routine checks whether the device should be ignored (because it should be handled by ub or by a subdriver), and if not, calls the probe1 and probe2 functions. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb_usual.h21
1 files changed, 4 insertions, 17 deletions
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 1eea1ab68dc4..3d15fb9bc116 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -96,39 +96,26 @@ enum { US_DO_ALL_FLAGS };
96#define US_PR_CBI 0x00 /* Control/Bulk/Interrupt */ 96#define US_PR_CBI 0x00 /* Control/Bulk/Interrupt */
97#define US_PR_CB 0x01 /* Control/Bulk w/o interrupt */ 97#define US_PR_CB 0x01 /* Control/Bulk w/o interrupt */
98#define US_PR_BULK 0x50 /* bulk only */ 98#define US_PR_BULK 0x50 /* bulk only */
99#ifdef CONFIG_USB_STORAGE_USBAT 99
100#define US_PR_USBAT 0x80 /* SCM-ATAPI bridge */ 100#define US_PR_USBAT 0x80 /* SCM-ATAPI bridge */
101#endif
102#ifdef CONFIG_USB_STORAGE_SDDR09
103#define US_PR_EUSB_SDDR09 0x81 /* SCM-SCSI bridge for SDDR-09 */ 101#define US_PR_EUSB_SDDR09 0x81 /* SCM-SCSI bridge for SDDR-09 */
104#endif
105#ifdef CONFIG_USB_STORAGE_SDDR55
106#define US_PR_SDDR55 0x82 /* SDDR-55 (made up) */ 102#define US_PR_SDDR55 0x82 /* SDDR-55 (made up) */
107#endif
108#define US_PR_DPCM_USB 0xf0 /* Combination CB/SDDR09 */ 103#define US_PR_DPCM_USB 0xf0 /* Combination CB/SDDR09 */
109#ifdef CONFIG_USB_STORAGE_FREECOM
110#define US_PR_FREECOM 0xf1 /* Freecom */ 104#define US_PR_FREECOM 0xf1 /* Freecom */
111#endif
112#ifdef CONFIG_USB_STORAGE_DATAFAB
113#define US_PR_DATAFAB 0xf2 /* Datafab chipsets */ 105#define US_PR_DATAFAB 0xf2 /* Datafab chipsets */
114#endif
115#ifdef CONFIG_USB_STORAGE_JUMPSHOT
116#define US_PR_JUMPSHOT 0xf3 /* Lexar Jumpshot */ 106#define US_PR_JUMPSHOT 0xf3 /* Lexar Jumpshot */
117#endif
118#ifdef CONFIG_USB_STORAGE_ALAUDA
119#define US_PR_ALAUDA 0xf4 /* Alauda chipsets */ 107#define US_PR_ALAUDA 0xf4 /* Alauda chipsets */
120#endif
121#ifdef CONFIG_USB_STORAGE_KARMA
122#define US_PR_KARMA 0xf5 /* Rio Karma */ 108#define US_PR_KARMA 0xf5 /* Rio Karma */
123#endif
124 109
125#define US_PR_DEVICE 0xff /* Use device's value */ 110#define US_PR_DEVICE 0xff /* Use device's value */
126 111
127/* 112/*
128 */ 113 */
114extern int usb_usual_ignore_device(struct usb_interface *intf);
115extern struct usb_device_id usb_storage_usb_ids[];
116
129#ifdef CONFIG_USB_LIBUSUAL 117#ifdef CONFIG_USB_LIBUSUAL
130 118
131extern struct usb_device_id storage_usb_ids[];
132extern void usb_usual_set_present(int type); 119extern void usb_usual_set_present(int type);
133extern void usb_usual_clear_present(int type); 120extern void usb_usual_clear_present(int type);
134extern int usb_usual_check_type(const struct usb_device_id *, int type); 121extern int usb_usual_check_type(const struct usb_device_id *, int type);