Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: remove libusual

The "Low Performance USB Block driver" has been removed which a user of
libusual. Now we have only the usb-storage driver as the only driver in
tree. This makes libusual needless.
This patch removes libusal, fixes up all users. The usual-table is now
linked into usb-storage.
usb_usual.h remains in public include directory because some staging
users seem to need it.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Sebastian Andrzej Siewior and committed by
Greg Kroah-Hartman
f61870ee 68a5059e

+42 -350
+1 -1
drivers/staging/keucr/usb.c
··· 320 320 321 321 us->subclass = idesc->bInterfaceSubClass; 322 322 us->protocol = idesc->bInterfaceProtocol; 323 - us->fflags = USB_US_ORIG_FLAGS(id->driver_info); 323 + us->fflags = id->driver_info; 324 324 us->Power_IsResum = false; 325 325 326 326 if (us->fflags & US_FL_IGNORE_DEVICE)
-14
drivers/usb/storage/Kconfig
··· 213 213 say 'Y' or 'M' here and the kernel will use the right driver. 214 214 215 215 If you compile this driver as a module, it will be named uas. 216 - 217 - config USB_LIBUSUAL 218 - bool "The shared table of common (or usual) storage devices" 219 - depends on USB 220 - help 221 - This module contains a table of common (or usual) devices 222 - for usb-storage and ub drivers, and allows to switch binding 223 - of these devices without rebuilding modules. 224 - 225 - Typical syntax of /etc/modprobe.d/*conf is: 226 - 227 - options libusual bias="ub" 228 - 229 - If unsure, say N.
+1 -8
drivers/usb/storage/Makefile
··· 12 12 13 13 usb-storage-y := scsiglue.o protocol.o transport.o usb.o 14 14 usb-storage-y += initializers.o sierra_ms.o option_ms.o 15 - 15 + usb-storage-y += usual-tables.o 16 16 usb-storage-$(CONFIG_USB_STORAGE_DEBUG) += debug.o 17 - 18 - ifeq ($(CONFIG_USB_LIBUSUAL),) 19 - usb-storage-y += usual-tables.o 20 - else 21 - obj-$(CONFIG_USB) += usb-libusual.o 22 - usb-libusual-y := libusual.o usual-tables.o 23 - endif 24 17 25 18 obj-$(CONFIG_USB_STORAGE_ALAUDA) += ums-alauda.o 26 19 obj-$(CONFIG_USB_STORAGE_CYPRESS_ATACB) += ums-cypress.o
+1 -1
drivers/usb/storage/alauda.c
··· 137 137 vendorName, productName, useProtocol, useTransport, \ 138 138 initFunction, flags) \ 139 139 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 140 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } 140 + .driver_info = (flags) } 141 141 142 142 static struct usb_device_id alauda_usb_ids[] = { 143 143 # include "unusual_alauda.h"
+1 -1
drivers/usb/storage/cypress_atacb.c
··· 41 41 vendorName, productName, useProtocol, useTransport, \ 42 42 initFunction, flags) \ 43 43 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 44 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } 44 + .driver_info = (flags) } 45 45 46 46 static struct usb_device_id cypress_usb_ids[] = { 47 47 # include "unusual_cypress.h"
+1 -1
drivers/usb/storage/datafab.c
··· 86 86 vendorName, productName, useProtocol, useTransport, \ 87 87 initFunction, flags) \ 88 88 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 89 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } 89 + .driver_info = (flags) } 90 90 91 91 static struct usb_device_id datafab_usb_ids[] = { 92 92 # include "unusual_datafab.h"
+1 -1
drivers/usb/storage/ene_ub6250.c
··· 52 52 vendorName, productName, useProtocol, useTransport, \ 53 53 initFunction, flags) \ 54 54 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 55 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } 55 + .driver_info = (flags)} 56 56 57 57 static struct usb_device_id ene_ub6250_usb_ids[] = { 58 58 # include "unusual_ene_ub6250.h"
+1 -1
drivers/usb/storage/freecom.c
··· 117 117 vendorName, productName, useProtocol, useTransport, \ 118 118 initFunction, flags) \ 119 119 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 120 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } 120 + .driver_info = (flags) } 121 121 122 122 static struct usb_device_id freecom_usb_ids[] = { 123 123 # include "unusual_freecom.h"
+1 -4
drivers/usb/storage/isd200.c
··· 74 74 vendorName, productName, useProtocol, useTransport, \ 75 75 initFunction, flags) \ 76 76 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 77 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } 77 + .driver_info = (flags) } 78 78 79 79 static struct usb_device_id isd200_usb_ids[] = { 80 80 # include "unusual_isd200.h" ··· 83 83 MODULE_DEVICE_TABLE(usb, isd200_usb_ids); 84 84 85 85 #undef UNUSUAL_DEV 86 - #undef USUAL_DEV 87 86 88 87 /* 89 88 * The flags table ··· 104 105 }; 105 106 106 107 #undef UNUSUAL_DEV 107 - #undef USUAL_DEV 108 - 109 108 110 109 /* Timeout defines (in Seconds) */ 111 110
+1 -1
drivers/usb/storage/jumpshot.c
··· 69 69 vendorName, productName, useProtocol, useTransport, \ 70 70 initFunction, flags) \ 71 71 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 72 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } 72 + .driver_info = (flags) } 73 73 74 74 static struct usb_device_id jumpshot_usb_ids[] = { 75 75 # include "unusual_jumpshot.h"
+1 -1
drivers/usb/storage/karma.c
··· 57 57 vendorName, productName, useProtocol, useTransport, \ 58 58 initFunction, flags) \ 59 59 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 60 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } 60 + .driver_info = (flags) } 61 61 62 62 static struct usb_device_id karma_usb_ids[] = { 63 63 # include "unusual_karma.h"
-243
drivers/usb/storage/libusual.c
··· 1 - /* 2 - * libusual 3 - * 4 - * The libusual contains the table of devices common for ub and usb-storage. 5 - */ 6 - #include <linux/kernel.h> 7 - #include <linux/module.h> 8 - #include <linux/usb.h> 9 - #include <linux/usb_usual.h> 10 - #include <linux/vmalloc.h> 11 - #include <linux/kthread.h> 12 - #include <linux/mutex.h> 13 - 14 - /* 15 - */ 16 - #define USU_MOD_FL_THREAD 1 /* Thread is running */ 17 - #define USU_MOD_FL_PRESENT 2 /* The module is loaded */ 18 - 19 - struct mod_status { 20 - unsigned long fls; 21 - }; 22 - 23 - static struct mod_status stat[3]; 24 - static DEFINE_SPINLOCK(usu_lock); 25 - 26 - /* 27 - */ 28 - #define USB_US_DEFAULT_BIAS USB_US_TYPE_STOR 29 - static atomic_t usu_bias = ATOMIC_INIT(USB_US_DEFAULT_BIAS); 30 - 31 - #define BIAS_NAME_SIZE (sizeof("usb-storage")) 32 - static const char *bias_names[3] = { "none", "usb-storage", "ub" }; 33 - 34 - static DEFINE_MUTEX(usu_probe_mutex); 35 - static DECLARE_COMPLETION(usu_end_notify); 36 - static atomic_t total_threads = ATOMIC_INIT(0); 37 - 38 - static int usu_probe_thread(void *arg); 39 - 40 - /* 41 - * @type: the module type as an integer 42 - */ 43 - void usb_usual_set_present(int type) 44 - { 45 - struct mod_status *st; 46 - unsigned long flags; 47 - 48 - if (type <= 0 || type >= 3) 49 - return; 50 - st = &stat[type]; 51 - spin_lock_irqsave(&usu_lock, flags); 52 - st->fls |= USU_MOD_FL_PRESENT; 53 - spin_unlock_irqrestore(&usu_lock, flags); 54 - } 55 - EXPORT_SYMBOL_GPL(usb_usual_set_present); 56 - 57 - void usb_usual_clear_present(int type) 58 - { 59 - struct mod_status *st; 60 - unsigned long flags; 61 - 62 - if (type <= 0 || type >= 3) 63 - return; 64 - st = &stat[type]; 65 - spin_lock_irqsave(&usu_lock, flags); 66 - st->fls &= ~USU_MOD_FL_PRESENT; 67 - spin_unlock_irqrestore(&usu_lock, flags); 68 - } 69 - EXPORT_SYMBOL_GPL(usb_usual_clear_present); 70 - 71 - /* 72 - * Match the calling driver type against the table. 73 - * Returns: 0 if the device matches. 74 - */ 75 - int usb_usual_check_type(const struct usb_device_id *id, int caller_type) 76 - { 77 - int id_type = USB_US_TYPE(id->driver_info); 78 - 79 - if (caller_type <= 0 || caller_type >= 3) 80 - return -EINVAL; 81 - 82 - /* Drivers grab fixed assignment devices */ 83 - if (id_type == caller_type) 84 - return 0; 85 - /* Drivers grab devices biased to them */ 86 - if (id_type == USB_US_TYPE_NONE && caller_type == atomic_read(&usu_bias)) 87 - return 0; 88 - return -ENODEV; 89 - } 90 - EXPORT_SYMBOL_GPL(usb_usual_check_type); 91 - 92 - /* 93 - */ 94 - static int usu_probe(struct usb_interface *intf, 95 - const struct usb_device_id *id) 96 - { 97 - int rc; 98 - unsigned long type; 99 - struct task_struct* task; 100 - unsigned long flags; 101 - 102 - type = USB_US_TYPE(id->driver_info); 103 - if (type == 0) 104 - type = atomic_read(&usu_bias); 105 - 106 - spin_lock_irqsave(&usu_lock, flags); 107 - if ((stat[type].fls & (USU_MOD_FL_THREAD|USU_MOD_FL_PRESENT)) != 0) { 108 - spin_unlock_irqrestore(&usu_lock, flags); 109 - return -ENXIO; 110 - } 111 - stat[type].fls |= USU_MOD_FL_THREAD; 112 - spin_unlock_irqrestore(&usu_lock, flags); 113 - 114 - task = kthread_run(usu_probe_thread, (void*)type, "libusual_%ld", type); 115 - if (IS_ERR(task)) { 116 - rc = PTR_ERR(task); 117 - printk(KERN_WARNING "libusual: " 118 - "Unable to start the thread for %s: %d\n", 119 - bias_names[type], rc); 120 - spin_lock_irqsave(&usu_lock, flags); 121 - stat[type].fls &= ~USU_MOD_FL_THREAD; 122 - spin_unlock_irqrestore(&usu_lock, flags); 123 - return rc; /* Not being -ENXIO causes a message printed */ 124 - } 125 - atomic_inc(&total_threads); 126 - 127 - return -ENXIO; 128 - } 129 - 130 - static void usu_disconnect(struct usb_interface *intf) 131 - { 132 - ; /* We should not be here. */ 133 - } 134 - 135 - static struct usb_driver usu_driver = { 136 - .name = "libusual", 137 - .probe = usu_probe, 138 - .disconnect = usu_disconnect, 139 - .id_table = usb_storage_usb_ids, 140 - }; 141 - 142 - /* 143 - * A whole new thread for a purpose of request_module seems quite stupid. 144 - * The request_module forks once inside again. However, if we attempt 145 - * to load a storage module from our own modprobe thread, that module 146 - * references our symbols, which cannot be resolved until our module is 147 - * initialized. I wish there was a way to wait for the end of initialization. 148 - * The module notifier reports MODULE_STATE_COMING only. 149 - * So, we wait until module->init ends as the next best thing. 150 - */ 151 - static int usu_probe_thread(void *arg) 152 - { 153 - int type = (unsigned long) arg; 154 - struct mod_status *st = &stat[type]; 155 - int rc; 156 - unsigned long flags; 157 - 158 - mutex_lock(&usu_probe_mutex); 159 - rc = request_module(bias_names[type]); 160 - spin_lock_irqsave(&usu_lock, flags); 161 - if (rc == 0 && (st->fls & USU_MOD_FL_PRESENT) == 0) { 162 - /* 163 - * This should not happen, but let us keep tabs on it. 164 - */ 165 - printk(KERN_NOTICE "libusual: " 166 - "modprobe for %s succeeded, but module is not present\n", 167 - bias_names[type]); 168 - } 169 - st->fls &= ~USU_MOD_FL_THREAD; 170 - spin_unlock_irqrestore(&usu_lock, flags); 171 - mutex_unlock(&usu_probe_mutex); 172 - 173 - complete_and_exit(&usu_end_notify, 0); 174 - } 175 - 176 - /* 177 - */ 178 - static int __init usb_usual_init(void) 179 - { 180 - int rc; 181 - 182 - mutex_lock(&usu_probe_mutex); 183 - rc = usb_register(&usu_driver); 184 - mutex_unlock(&usu_probe_mutex); 185 - return rc; 186 - } 187 - 188 - static void __exit usb_usual_exit(void) 189 - { 190 - /* 191 - * We do not check for any drivers present, because 192 - * they keep us pinned with symbol references. 193 - */ 194 - 195 - usb_deregister(&usu_driver); 196 - 197 - while (atomic_read(&total_threads) > 0) { 198 - wait_for_completion(&usu_end_notify); 199 - atomic_dec(&total_threads); 200 - } 201 - } 202 - 203 - /* 204 - * Validate and accept the bias parameter. 205 - */ 206 - static int usu_set_bias(const char *bias_s, struct kernel_param *kp) 207 - { 208 - int i; 209 - int len; 210 - int bias_n = 0; 211 - 212 - len = strlen(bias_s); 213 - if (len == 0) 214 - return -EDOM; 215 - if (bias_s[len-1] == '\n') 216 - --len; 217 - 218 - for (i = 1; i < 3; i++) { 219 - if (strncmp(bias_s, bias_names[i], len) == 0) { 220 - bias_n = i; 221 - break; 222 - } 223 - } 224 - if (bias_n == 0) 225 - return -EINVAL; 226 - 227 - atomic_set(&usu_bias, bias_n); 228 - return 0; 229 - } 230 - 231 - static int usu_get_bias(char *buffer, struct kernel_param *kp) 232 - { 233 - return strlen(strcpy(buffer, bias_names[atomic_read(&usu_bias)])); 234 - } 235 - 236 - module_init(usb_usual_init); 237 - module_exit(usb_usual_exit); 238 - 239 - module_param_call(bias, usu_set_bias, usu_get_bias, NULL, S_IRUGO|S_IWUSR); 240 - __MODULE_PARM_TYPE(bias, "string"); 241 - MODULE_PARM_DESC(bias, "Bias to usb-storage or ub"); 242 - 243 - MODULE_LICENSE("GPL");
+1 -1
drivers/usb/storage/onetouch.c
··· 67 67 vendorName, productName, useProtocol, useTransport, \ 68 68 initFunction, flags) \ 69 69 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 70 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } 70 + .driver_info = (flags) } 71 71 72 72 static struct usb_device_id onetouch_usb_ids[] = { 73 73 # include "unusual_onetouch.h"
+1 -1
drivers/usb/storage/realtek_cr.c
··· 172 172 initFunction, flags) \ 173 173 {\ 174 174 USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 175 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24)\ 175 + .driver_info = (flags) \ 176 176 } 177 177 178 178 static const struct usb_device_id realtek_cr_ids[] = {
+1 -1
drivers/usb/storage/sddr09.c
··· 69 69 vendorName, productName, useProtocol, useTransport, \ 70 70 initFunction, flags) \ 71 71 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 72 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } 72 + .driver_info = (flags) } 73 73 74 74 static struct usb_device_id sddr09_usb_ids[] = { 75 75 # include "unusual_sddr09.h"
+1 -1
drivers/usb/storage/sddr55.c
··· 46 46 vendorName, productName, useProtocol, useTransport, \ 47 47 initFunction, flags) \ 48 48 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 49 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } 49 + .driver_info = (flags) } 50 50 51 51 static struct usb_device_id sddr55_usb_ids[] = { 52 52 # include "unusual_sddr55.h"
+1 -1
drivers/usb/storage/shuttle_usbat.c
··· 168 168 vendorName, productName, useProtocol, useTransport, \ 169 169 initFunction, flags) \ 170 170 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 171 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } 171 + .driver_info = (flags) } 172 172 173 173 static struct usb_device_id usbat_usb_ids[] = { 174 174 # include "unusual_usbat.h"
+18 -18
drivers/usb/storage/unusual_devs.h
··· 2038 2038 USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE ), 2039 2039 2040 2040 /* Control/Bulk transport for all SubClass values */ 2041 - USUAL_DEV(USB_SC_RBC, USB_PR_CB, USB_US_TYPE_STOR), 2042 - USUAL_DEV(USB_SC_8020, USB_PR_CB, USB_US_TYPE_STOR), 2043 - USUAL_DEV(USB_SC_QIC, USB_PR_CB, USB_US_TYPE_STOR), 2044 - USUAL_DEV(USB_SC_UFI, USB_PR_CB, USB_US_TYPE_STOR), 2045 - USUAL_DEV(USB_SC_8070, USB_PR_CB, USB_US_TYPE_STOR), 2046 - USUAL_DEV(USB_SC_SCSI, USB_PR_CB, USB_US_TYPE_STOR), 2041 + USUAL_DEV(USB_SC_RBC, USB_PR_CB), 2042 + USUAL_DEV(USB_SC_8020, USB_PR_CB), 2043 + USUAL_DEV(USB_SC_QIC, USB_PR_CB), 2044 + USUAL_DEV(USB_SC_UFI, USB_PR_CB), 2045 + USUAL_DEV(USB_SC_8070, USB_PR_CB), 2046 + USUAL_DEV(USB_SC_SCSI, USB_PR_CB), 2047 2047 2048 2048 /* Control/Bulk/Interrupt transport for all SubClass values */ 2049 - USUAL_DEV(USB_SC_RBC, USB_PR_CBI, USB_US_TYPE_STOR), 2050 - USUAL_DEV(USB_SC_8020, USB_PR_CBI, USB_US_TYPE_STOR), 2051 - USUAL_DEV(USB_SC_QIC, USB_PR_CBI, USB_US_TYPE_STOR), 2052 - USUAL_DEV(USB_SC_UFI, USB_PR_CBI, USB_US_TYPE_STOR), 2053 - USUAL_DEV(USB_SC_8070, USB_PR_CBI, USB_US_TYPE_STOR), 2054 - USUAL_DEV(USB_SC_SCSI, USB_PR_CBI, USB_US_TYPE_STOR), 2049 + USUAL_DEV(USB_SC_RBC, USB_PR_CBI), 2050 + USUAL_DEV(USB_SC_8020, USB_PR_CBI), 2051 + USUAL_DEV(USB_SC_QIC, USB_PR_CBI), 2052 + USUAL_DEV(USB_SC_UFI, USB_PR_CBI), 2053 + USUAL_DEV(USB_SC_8070, USB_PR_CBI), 2054 + USUAL_DEV(USB_SC_SCSI, USB_PR_CBI), 2055 2055 2056 2056 /* Bulk-only transport for all SubClass values */ 2057 - USUAL_DEV(USB_SC_RBC, USB_PR_BULK, USB_US_TYPE_STOR), 2058 - USUAL_DEV(USB_SC_8020, USB_PR_BULK, USB_US_TYPE_STOR), 2059 - USUAL_DEV(USB_SC_QIC, USB_PR_BULK, USB_US_TYPE_STOR), 2060 - USUAL_DEV(USB_SC_UFI, USB_PR_BULK, USB_US_TYPE_STOR), 2061 - USUAL_DEV(USB_SC_8070, USB_PR_BULK, USB_US_TYPE_STOR), 2062 - USUAL_DEV(USB_SC_SCSI, USB_PR_BULK, 0), 2057 + USUAL_DEV(USB_SC_RBC, USB_PR_BULK), 2058 + USUAL_DEV(USB_SC_8020, USB_PR_BULK), 2059 + USUAL_DEV(USB_SC_QIC, USB_PR_BULK), 2060 + USUAL_DEV(USB_SC_UFI, USB_PR_BULK), 2061 + USUAL_DEV(USB_SC_8070, USB_PR_BULK), 2062 + USUAL_DEV(USB_SC_SCSI, USB_PR_BULK),
+5 -12
drivers/usb/storage/usb.c
··· 114 114 115 115 #define COMPLIANT_DEV UNUSUAL_DEV 116 116 117 - #define USUAL_DEV(use_protocol, use_transport, use_type) \ 117 + #define USUAL_DEV(use_protocol, use_transport) \ 118 118 { \ 119 119 .useProtocol = use_protocol, \ 120 120 .useTransport = use_transport, \ ··· 126 126 }; 127 127 128 128 static struct us_unusual_dev for_dynamic_ids = 129 - USUAL_DEV(USB_SC_SCSI, USB_PR_BULK, 0); 129 + USUAL_DEV(USB_SC_SCSI, USB_PR_BULK); 130 130 131 131 #undef UNUSUAL_DEV 132 132 #undef COMPLIANT_DEV ··· 564 564 us->protocol = (unusual_dev->useTransport == USB_PR_DEVICE) ? 565 565 idesc->bInterfaceProtocol : 566 566 unusual_dev->useTransport; 567 - us->fflags = USB_US_ORIG_FLAGS(id->driver_info); 567 + us->fflags = id->driver_info; 568 568 adjust_quirks(us); 569 569 570 570 if (us->fflags & US_FL_IGNORE_DEVICE) { ··· 1041 1041 int size; 1042 1042 1043 1043 /* 1044 - * If libusual is configured, let it decide whether a standard 1045 - * device should be handled by usb-storage or by ub. 1046 1044 * If the device isn't standard (is handled by a subdriver 1047 1045 * module) then don't accept it. 1048 1046 */ 1049 - if (usb_usual_check_type(id, USB_US_TYPE_STOR) || 1050 - usb_usual_ignore_device(intf)) 1047 + if (usb_usual_ignore_device(intf)) 1051 1048 return -ENXIO; 1052 1049 1053 1050 /* ··· 1102 1105 1103 1106 /* register the driver, return usb_register return code if error */ 1104 1107 retval = usb_register(&usb_storage_driver); 1105 - if (retval == 0) { 1108 + if (retval == 0) 1106 1109 pr_info("USB Mass Storage support registered.\n"); 1107 - usb_usual_set_present(USB_US_TYPE_STOR); 1108 - } 1109 1110 return retval; 1110 1111 } 1111 1112 ··· 1117 1122 */ 1118 1123 US_DEBUGP("-- calling usb_deregister()\n"); 1119 1124 usb_deregister(&usb_storage_driver) ; 1120 - 1121 - usb_usual_clear_present(USB_US_TYPE_STOR); 1122 1125 } 1123 1126 1124 1127 module_init(usb_stor_init);
+4 -14
drivers/usb/storage/usual-tables.c
··· 34 34 vendorName, productName, useProtocol, useTransport, \ 35 35 initFunction, flags) \ 36 36 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 37 - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } 38 - 39 - #define COMPLIANT_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \ 40 - vendorName, productName, useProtocol, useTransport, \ 41 - initFunction, flags) \ 42 - { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ 43 37 .driver_info = (flags) } 44 38 45 - #define USUAL_DEV(useProto, useTrans, useType) \ 46 - { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans), \ 47 - .driver_info = ((useType)<<24) } 39 + #define COMPLIANT_DEV UNUSUAL_DEV 40 + 41 + #define USUAL_DEV(useProto, useTrans) \ 42 + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans) } 48 43 49 44 struct usb_device_id usb_storage_usb_ids[] = { 50 45 # include "unusual_devs.h" 51 46 { } /* Terminating entry */ 52 47 }; 53 - EXPORT_SYMBOL_GPL(usb_storage_usb_ids); 54 - 55 48 MODULE_DEVICE_TABLE(usb, usb_storage_usb_ids); 56 49 57 50 #undef UNUSUAL_DEV 58 51 #undef COMPLIANT_DEV 59 52 #undef USUAL_DEV 60 - 61 53 62 54 /* 63 55 * The table of devices to ignore ··· 87 95 88 96 #undef UNUSUAL_DEV 89 97 90 - 91 98 /* Return an error if a device is in the ignore_ids list */ 92 99 int usb_usual_ignore_device(struct usb_interface *intf) 93 100 { ··· 106 115 } 107 116 return 0; 108 117 } 109 - EXPORT_SYMBOL_GPL(usb_usual_ignore_device);
-24
include/linux/usb_usual.h
··· 72 72 enum { US_DO_ALL_FLAGS }; 73 73 #undef US_FLAG 74 74 75 - /* 76 - * The bias field for libusual and friends. 77 - */ 78 - #define USB_US_TYPE_NONE 0 79 - #define USB_US_TYPE_STOR 1 /* usb-storage */ 80 - #define USB_US_TYPE_UB 2 /* ub */ 81 - 82 - #define USB_US_TYPE(flags) (((flags) >> 24) & 0xFF) 83 - #define USB_US_ORIG_FLAGS(flags) ((flags) & 0x00FFFFFF) 84 - 85 75 #include <linux/usb/storage.h> 86 76 87 - /* 88 - */ 89 77 extern int usb_usual_ignore_device(struct usb_interface *intf); 90 78 extern struct usb_device_id usb_storage_usb_ids[]; 91 - 92 - #ifdef CONFIG_USB_LIBUSUAL 93 - 94 - extern void usb_usual_set_present(int type); 95 - extern void usb_usual_clear_present(int type); 96 - extern int usb_usual_check_type(const struct usb_device_id *, int type); 97 - #else 98 - 99 - #define usb_usual_set_present(t) do { } while(0) 100 - #define usb_usual_clear_present(t) do { } while(0) 101 - #define usb_usual_check_type(id, t) (0) 102 - #endif /* CONFIG_USB_LIBUSUAL */ 103 79 104 80 #endif /* __LINUX_USB_USUAL_H */