usb: remove libusual
authorSebastian Andrzej Siewior <sebastian@breakpoint.cc>
Tue, 28 Aug 2012 20:37:13 +0000 (22:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Sep 2012 00:21:36 +0000 (17:21 -0700)
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>
21 files changed:
drivers/staging/keucr/usb.c
drivers/usb/storage/Kconfig
drivers/usb/storage/Makefile
drivers/usb/storage/alauda.c
drivers/usb/storage/cypress_atacb.c
drivers/usb/storage/datafab.c
drivers/usb/storage/ene_ub6250.c
drivers/usb/storage/freecom.c
drivers/usb/storage/isd200.c
drivers/usb/storage/jumpshot.c
drivers/usb/storage/karma.c
drivers/usb/storage/libusual.c [deleted file]
drivers/usb/storage/onetouch.c
drivers/usb/storage/realtek_cr.c
drivers/usb/storage/sddr09.c
drivers/usb/storage/sddr55.c
drivers/usb/storage/shuttle_usbat.c
drivers/usb/storage/unusual_devs.h
drivers/usb/storage/usb.c
drivers/usb/storage/usual-tables.c
include/linux/usb_usual.h

index 4833034027351cdadafbe2ee3ee954c8d7e6b914..55a0b82c6391b7eb92c67c98d3f9474b7e6b225e 100644 (file)
@@ -320,7 +320,7 @@ static int get_device_info(struct us_data *us, const struct usb_device_id *id)
 
        us->subclass = idesc->bInterfaceSubClass;
        us->protocol = idesc->bInterfaceProtocol;
-       us->fflags = USB_US_ORIG_FLAGS(id->driver_info);
+       us->fflags = id->driver_info;
        us->Power_IsResum = false;
 
        if (us->fflags & US_FL_IGNORE_DEVICE)
index 7691c866637be6be835442396b1f545da5a7f09c..0ae7bb64b5eacb9915ba713848a3c862989715e7 100644 (file)
@@ -213,17 +213,3 @@ config USB_UAS
          say 'Y' or 'M' here and the kernel will use the right driver.
 
          If you compile this driver as a module, it will be named uas.
-
-config USB_LIBUSUAL
-       bool "The shared table of common (or usual) storage devices"
-       depends on USB
-       help
-         This module contains a table of common (or usual) devices
-         for usb-storage and ub drivers, and allows to switch binding
-         of these devices without rebuilding modules.
-
-         Typical syntax of /etc/modprobe.d/*conf is:
-
-               options libusual bias="ub"
-
-         If unsure, say N.
index 82e6416a2d47a4686126d79d9add9b146e170e66..4cd55481b309197f73b8aa34dae0d60e6bd35382 100644 (file)
@@ -12,16 +12,9 @@ obj-$(CONFIG_USB_STORAGE)    += usb-storage.o
 
 usb-storage-y := scsiglue.o protocol.o transport.o usb.o
 usb-storage-y += initializers.o sierra_ms.o option_ms.o
-
+usb-storage-y += usual-tables.o
 usb-storage-$(CONFIG_USB_STORAGE_DEBUG) += debug.o
 
-ifeq ($(CONFIG_USB_LIBUSUAL),)
-       usb-storage-y           += usual-tables.o
-else
-       obj-$(CONFIG_USB)       += usb-libusual.o
-       usb-libusual-y          := libusual.o usual-tables.o
-endif
-
 obj-$(CONFIG_USB_STORAGE_ALAUDA)       += ums-alauda.o
 obj-$(CONFIG_USB_STORAGE_CYPRESS_ATACB) += ums-cypress.o
 obj-$(CONFIG_USB_STORAGE_DATAFAB)      += ums-datafab.o
index bab8c8fe8290cfd298e6e4361b9925a1169737e4..be5564cc8e0160c466c79558ec3a57f0994418f0 100644 (file)
@@ -137,7 +137,7 @@ static int init_alauda(struct us_data *us);
                    vendorName, productName, useProtocol, useTransport, \
                    initFunction, flags) \
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-  .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
+  .driver_info = (flags) }
 
 static struct usb_device_id alauda_usb_ids[] = {
 #      include "unusual_alauda.h"
index 5fe451d16e6870968ec4dbfc084d37e1e055a361..070b5c0ebbf98d0d822723c4fe04b9ee984c5bf5 100644 (file)
@@ -41,7 +41,7 @@ MODULE_LICENSE("GPL");
                    vendorName, productName, useProtocol, useTransport, \
                    initFunction, flags) \
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-  .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
+  .driver_info = (flags) }
 
 static struct usb_device_id cypress_usb_ids[] = {
 #      include "unusual_cypress.h"
index 35e9c51e66962af08162b5e07022735f7470a4a4..494fee5af41d516c0a1e1e8a2b9b63e1faa6ecaf 100644 (file)
@@ -86,7 +86,7 @@ static int datafab_determine_lun(struct us_data *us,
                    vendorName, productName, useProtocol, useTransport, \
                    initFunction, flags) \
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-  .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
+  .driver_info = (flags) }
 
 static struct usb_device_id datafab_usb_ids[] = {
 #      include "unusual_datafab.h"
index 95edee53d860b917f077725156f3ed4af5ef58c9..118b134a1dad38c970f3a459f9b8868c4002ee43 100644 (file)
@@ -52,7 +52,7 @@ MODULE_FIRMWARE(MS_RW_FIRMWARE);
                    vendorName, productName, useProtocol, useTransport, \
                    initFunction, flags) \
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-       .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
+       .driver_info = (flags)}
 
 static struct usb_device_id ene_ub6250_usb_ids[] = {
 #      include "unusual_ene_ub6250.h"
index 042cf9ef3153e194c7474747b8a9aa74986ab0d9..e6df087dca9d39e0910962df2eb40b2573f94115 100644 (file)
@@ -117,7 +117,7 @@ static int init_freecom(struct us_data *us);
                    vendorName, productName, useProtocol, useTransport, \
                    initFunction, flags) \
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-  .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
+  .driver_info = (flags) }
 
 static struct usb_device_id freecom_usb_ids[] = {
 #      include "unusual_freecom.h"
index 31fa24e7e68ab5a4a78336fc3be7c4d140e02cb7..ecea4787736463ccda4d1a498749eed74c2c9136 100644 (file)
@@ -74,7 +74,7 @@ static int isd200_Initialization(struct us_data *us);
                    vendorName, productName, useProtocol, useTransport, \
                    initFunction, flags) \
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-  .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
+  .driver_info = (flags) }
 
 static struct usb_device_id isd200_usb_ids[] = {
 #      include "unusual_isd200.h"
@@ -83,7 +83,6 @@ static struct usb_device_id isd200_usb_ids[] = {
 MODULE_DEVICE_TABLE(usb, isd200_usb_ids);
 
 #undef UNUSUAL_DEV
-#undef USUAL_DEV
 
 /*
  * The flags table
@@ -105,8 +104,6 @@ static struct us_unusual_dev isd200_unusual_dev_list[] = {
 };
 
 #undef UNUSUAL_DEV
-#undef USUAL_DEV
-
 
 /* Timeout defines (in Seconds) */
 
index e3b97383186ab2f91aaa2df87aeac6304b647259..ddc78780b1ad2a687a198281a181a57f5e0417a4 100644 (file)
@@ -69,7 +69,7 @@ MODULE_LICENSE("GPL");
                    vendorName, productName, useProtocol, useTransport, \
                    initFunction, flags) \
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-  .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
+  .driver_info = (flags) }
 
 static struct usb_device_id jumpshot_usb_ids[] = {
 #      include "unusual_jumpshot.h"
index a8708eae9788eb5cd3104a0b50369fb299d3f58a..f085ffb606c88e9c199dadb81448c2740c4f68a6 100644 (file)
@@ -57,7 +57,7 @@ static int rio_karma_init(struct us_data *us);
                    vendorName, productName, useProtocol, useTransport, \
                    initFunction, flags) \
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-  .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
+  .driver_info = (flags) }
 
 static struct usb_device_id karma_usb_ids[] = {
 #      include "unusual_karma.h"
diff --git a/drivers/usb/storage/libusual.c b/drivers/usb/storage/libusual.c
deleted file mode 100644 (file)
index fe3ffe1..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * libusual
- *
- * The libusual contains the table of devices common for ub and usb-storage.
- */
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/usb.h>
-#include <linux/usb_usual.h>
-#include <linux/vmalloc.h>
-#include <linux/kthread.h>
-#include <linux/mutex.h>
-
-/*
- */
-#define USU_MOD_FL_THREAD   1  /* Thread is running */
-#define USU_MOD_FL_PRESENT  2  /* The module is loaded */
-
-struct mod_status {
-       unsigned long fls;
-};
-
-static struct mod_status stat[3];
-static DEFINE_SPINLOCK(usu_lock);
-
-/*
- */
-#define USB_US_DEFAULT_BIAS    USB_US_TYPE_STOR
-static atomic_t usu_bias = ATOMIC_INIT(USB_US_DEFAULT_BIAS);
-
-#define BIAS_NAME_SIZE  (sizeof("usb-storage"))
-static const char *bias_names[3] = { "none", "usb-storage", "ub" };
-
-static DEFINE_MUTEX(usu_probe_mutex);
-static DECLARE_COMPLETION(usu_end_notify);
-static atomic_t total_threads = ATOMIC_INIT(0);
-
-static int usu_probe_thread(void *arg);
-
-/*
- * @type: the module type as an integer
- */
-void usb_usual_set_present(int type)
-{
-       struct mod_status *st;
-       unsigned long flags;
-
-       if (type <= 0 || type >= 3)
-               return;
-       st = &stat[type];
-       spin_lock_irqsave(&usu_lock, flags);
-       st->fls |= USU_MOD_FL_PRESENT;
-       spin_unlock_irqrestore(&usu_lock, flags);
-}
-EXPORT_SYMBOL_GPL(usb_usual_set_present);
-
-void usb_usual_clear_present(int type)
-{
-       struct mod_status *st;
-       unsigned long flags;
-
-       if (type <= 0 || type >= 3)
-               return;
-       st = &stat[type];
-       spin_lock_irqsave(&usu_lock, flags);
-       st->fls &= ~USU_MOD_FL_PRESENT;
-       spin_unlock_irqrestore(&usu_lock, flags);
-}
-EXPORT_SYMBOL_GPL(usb_usual_clear_present);
-
-/*
- * Match the calling driver type against the table.
- * Returns: 0 if the device matches.
- */
-int usb_usual_check_type(const struct usb_device_id *id, int caller_type)
-{
-       int id_type = USB_US_TYPE(id->driver_info);
-
-       if (caller_type <= 0 || caller_type >= 3)
-               return -EINVAL;
-
-       /* Drivers grab fixed assignment devices */
-       if (id_type == caller_type)
-               return 0;
-       /* Drivers grab devices biased to them */
-       if (id_type == USB_US_TYPE_NONE && caller_type == atomic_read(&usu_bias))
-               return 0;
-       return -ENODEV;
-}
-EXPORT_SYMBOL_GPL(usb_usual_check_type);
-
-/*
- */
-static int usu_probe(struct usb_interface *intf,
-                        const struct usb_device_id *id)
-{
-       int rc;
-       unsigned long type;
-       struct task_struct* task;
-       unsigned long flags;
-
-       type = USB_US_TYPE(id->driver_info);
-       if (type == 0)
-               type = atomic_read(&usu_bias);
-
-       spin_lock_irqsave(&usu_lock, flags);
-       if ((stat[type].fls & (USU_MOD_FL_THREAD|USU_MOD_FL_PRESENT)) != 0) {
-               spin_unlock_irqrestore(&usu_lock, flags);
-               return -ENXIO;
-       }
-       stat[type].fls |= USU_MOD_FL_THREAD;
-       spin_unlock_irqrestore(&usu_lock, flags);
-
-       task = kthread_run(usu_probe_thread, (void*)type, "libusual_%ld", type);
-       if (IS_ERR(task)) {
-               rc = PTR_ERR(task);
-               printk(KERN_WARNING "libusual: "
-                   "Unable to start the thread for %s: %d\n",
-                   bias_names[type], rc);
-               spin_lock_irqsave(&usu_lock, flags);
-               stat[type].fls &= ~USU_MOD_FL_THREAD;
-               spin_unlock_irqrestore(&usu_lock, flags);
-               return rc;      /* Not being -ENXIO causes a message printed */
-       }
-       atomic_inc(&total_threads);
-
-       return -ENXIO;
-}
-
-static void usu_disconnect(struct usb_interface *intf)
-{
-       ;       /* We should not be here. */
-}
-
-static struct usb_driver usu_driver = {
-       .name =         "libusual",
-       .probe =        usu_probe,
-       .disconnect =   usu_disconnect,
-       .id_table =     usb_storage_usb_ids,
-};
-
-/*
- * A whole new thread for a purpose of request_module seems quite stupid.
- * The request_module forks once inside again. However, if we attempt
- * to load a storage module from our own modprobe thread, that module
- * references our symbols, which cannot be resolved until our module is
- * initialized. I wish there was a way to wait for the end of initialization.
- * The module notifier reports MODULE_STATE_COMING only.
- * So, we wait until module->init ends as the next best thing.
- */
-static int usu_probe_thread(void *arg)
-{
-       int type = (unsigned long) arg;
-       struct mod_status *st = &stat[type];
-       int rc;
-       unsigned long flags;
-
-       mutex_lock(&usu_probe_mutex);
-       rc = request_module(bias_names[type]);
-       spin_lock_irqsave(&usu_lock, flags);
-       if (rc == 0 && (st->fls & USU_MOD_FL_PRESENT) == 0) {
-               /*
-                * This should not happen, but let us keep tabs on it.
-                */
-               printk(KERN_NOTICE "libusual: "
-                   "modprobe for %s succeeded, but module is not present\n",
-                   bias_names[type]);
-       }
-       st->fls &= ~USU_MOD_FL_THREAD;
-       spin_unlock_irqrestore(&usu_lock, flags);
-       mutex_unlock(&usu_probe_mutex);
-
-       complete_and_exit(&usu_end_notify, 0);
-}
-
-/*
- */
-static int __init usb_usual_init(void)
-{
-       int rc;
-
-       mutex_lock(&usu_probe_mutex);
-       rc = usb_register(&usu_driver);
-       mutex_unlock(&usu_probe_mutex);
-       return rc;
-}
-
-static void __exit usb_usual_exit(void)
-{
-       /*
-        * We do not check for any drivers present, because
-        * they keep us pinned with symbol references.
-        */
-
-       usb_deregister(&usu_driver);
-
-       while (atomic_read(&total_threads) > 0) {
-               wait_for_completion(&usu_end_notify);
-               atomic_dec(&total_threads);
-       }
-}
-
-/*
- * Validate and accept the bias parameter.
- */
-static int usu_set_bias(const char *bias_s, struct kernel_param *kp)
-{
-       int i;
-       int len;
-       int bias_n = 0;
-
-       len = strlen(bias_s);
-       if (len == 0)
-               return -EDOM;
-       if (bias_s[len-1] == '\n')
-               --len;
-
-       for (i = 1; i < 3; i++) {
-               if (strncmp(bias_s, bias_names[i], len) == 0) {
-                       bias_n = i;
-                       break;
-               }
-       }
-       if (bias_n == 0)
-               return -EINVAL;
-
-       atomic_set(&usu_bias, bias_n);
-       return 0;
-}
-
-static int usu_get_bias(char *buffer, struct kernel_param *kp)
-{
-       return strlen(strcpy(buffer, bias_names[atomic_read(&usu_bias)]));
-}
-
-module_init(usb_usual_init);
-module_exit(usb_usual_exit);
-
-module_param_call(bias, usu_set_bias, usu_get_bias, NULL, S_IRUGO|S_IWUSR);
-__MODULE_PARM_TYPE(bias, "string");
-MODULE_PARM_DESC(bias, "Bias to usb-storage or ub");
-
-MODULE_LICENSE("GPL");
index 886567a3806ddd5d190dfb253dabc6afc44e1ea9..cb79de61f4c837e191e1e8de0616e9b06d33d5fe 100644 (file)
@@ -67,7 +67,7 @@ struct usb_onetouch {
                    vendorName, productName, useProtocol, useTransport, \
                    initFunction, flags) \
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-  .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
+  .driver_info = (flags) }
 
 static struct usb_device_id onetouch_usb_ids[] = {
 #      include "unusual_onetouch.h"
index 63cf2822e299a6213164feb3a9d426e6ff40ee4a..d36446dd7ae867629258b9051b3c1173cde9641f 100644 (file)
@@ -172,7 +172,7 @@ static int init_realtek_cr(struct us_data *us);
                    initFunction, flags) \
 {\
        USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-       .driver_info = (flags)|(USB_US_TYPE_STOR<<24)\
+       .driver_info = (flags) \
 }
 
 static const struct usb_device_id realtek_cr_ids[] = {
index 3252a62b31bcaeb21824ec80323572fe10d0de28..7bd54e0d5120cdaf0dba96fff1928c4380ba4631 100644 (file)
@@ -69,7 +69,7 @@ static int usb_stor_sddr09_init(struct us_data *us);
                    vendorName, productName, useProtocol, useTransport, \
                    initFunction, flags) \
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-  .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
+  .driver_info = (flags) }
 
 static struct usb_device_id sddr09_usb_ids[] = {
 #      include "unusual_sddr09.h"
index c144078065a7f691ce3f1e1c57f2d0244510a724..d278c5a99b7a253a49ba6b2d09ba2abac88bd5e4 100644 (file)
@@ -46,7 +46,7 @@ MODULE_LICENSE("GPL");
                    vendorName, productName, useProtocol, useTransport, \
                    initFunction, flags) \
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-  .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
+  .driver_info = (flags) }
 
 static struct usb_device_id sddr55_usb_ids[] = {
 #      include "unusual_sddr55.h"
index fa1ceebc465ce434a28167bb3c5f633a3e48645b..daf2fc58ae0203857b5b198327d7f9a917214c98 100644 (file)
@@ -168,7 +168,7 @@ static int init_usbat_flash(struct us_data *us);
                    vendorName, productName, useProtocol, useTransport, \
                    initFunction, flags) \
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-  .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
+  .driver_info = (flags) }
 
 static struct usb_device_id usbat_usb_ids[] = {
 #      include "unusual_usbat.h"
index 62a31bea06346b0900fafec5e2d832188e66b860..779cd954abcbd26d1fc935650d102dc524b8ca5a 100644 (file)
@@ -2038,25 +2038,25 @@ UNUSUAL_DEV( 0xed10, 0x7636, 0x0001, 0x0001,
                USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE ),
 
 /* Control/Bulk transport for all SubClass values */
-USUAL_DEV(USB_SC_RBC, USB_PR_CB, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_8020, USB_PR_CB, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_QIC, USB_PR_CB, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_UFI, USB_PR_CB, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_8070, USB_PR_CB, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_SCSI, USB_PR_CB, USB_US_TYPE_STOR),
+USUAL_DEV(USB_SC_RBC, USB_PR_CB),
+USUAL_DEV(USB_SC_8020, USB_PR_CB),
+USUAL_DEV(USB_SC_QIC, USB_PR_CB),
+USUAL_DEV(USB_SC_UFI, USB_PR_CB),
+USUAL_DEV(USB_SC_8070, USB_PR_CB),
+USUAL_DEV(USB_SC_SCSI, USB_PR_CB),
 
 /* Control/Bulk/Interrupt transport for all SubClass values */
-USUAL_DEV(USB_SC_RBC, USB_PR_CBI, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_8020, USB_PR_CBI, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_QIC, USB_PR_CBI, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_UFI, USB_PR_CBI, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_8070, USB_PR_CBI, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_SCSI, USB_PR_CBI, USB_US_TYPE_STOR),
+USUAL_DEV(USB_SC_RBC, USB_PR_CBI),
+USUAL_DEV(USB_SC_8020, USB_PR_CBI),
+USUAL_DEV(USB_SC_QIC, USB_PR_CBI),
+USUAL_DEV(USB_SC_UFI, USB_PR_CBI),
+USUAL_DEV(USB_SC_8070, USB_PR_CBI),
+USUAL_DEV(USB_SC_SCSI, USB_PR_CBI),
 
 /* Bulk-only transport for all SubClass values */
-USUAL_DEV(USB_SC_RBC, USB_PR_BULK, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_8020, USB_PR_BULK, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_QIC, USB_PR_BULK, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_UFI, USB_PR_BULK, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_8070, USB_PR_BULK, USB_US_TYPE_STOR),
-USUAL_DEV(USB_SC_SCSI, USB_PR_BULK, 0),
+USUAL_DEV(USB_SC_RBC, USB_PR_BULK),
+USUAL_DEV(USB_SC_8020, USB_PR_BULK),
+USUAL_DEV(USB_SC_QIC, USB_PR_BULK),
+USUAL_DEV(USB_SC_UFI, USB_PR_BULK),
+USUAL_DEV(USB_SC_8070, USB_PR_BULK),
+USUAL_DEV(USB_SC_SCSI, USB_PR_BULK),
index d012fe4329e7a36660d23f46195bdb86f511f21e..12aa72630aedbb7f88e4cb40b5eb233fae828f72 100644 (file)
@@ -114,7 +114,7 @@ MODULE_PARM_DESC(quirks, "supplemental list of device IDs and their quirks");
 
 #define COMPLIANT_DEV  UNUSUAL_DEV
 
-#define USUAL_DEV(use_protocol, use_transport, use_type) \
+#define USUAL_DEV(use_protocol, use_transport) \
 { \
        .useProtocol = use_protocol,    \
        .useTransport = use_transport,  \
@@ -126,7 +126,7 @@ static struct us_unusual_dev us_unusual_dev_list[] = {
 };
 
 static struct us_unusual_dev for_dynamic_ids =
-               USUAL_DEV(USB_SC_SCSI, USB_PR_BULK, 0);
+               USUAL_DEV(USB_SC_SCSI, USB_PR_BULK);
 
 #undef UNUSUAL_DEV
 #undef COMPLIANT_DEV
@@ -564,7 +564,7 @@ static int get_device_info(struct us_data *us, const struct usb_device_id *id,
        us->protocol = (unusual_dev->useTransport == USB_PR_DEVICE) ?
                        idesc->bInterfaceProtocol :
                        unusual_dev->useTransport;
-       us->fflags = USB_US_ORIG_FLAGS(id->driver_info);
+       us->fflags = id->driver_info;
        adjust_quirks(us);
 
        if (us->fflags & US_FL_IGNORE_DEVICE) {
@@ -1041,13 +1041,10 @@ static int storage_probe(struct usb_interface *intf,
        int size;
 
        /*
-        * If libusual is configured, let it decide whether a standard
-        * device should be handled by usb-storage or by ub.
         * If the device isn't standard (is handled by a subdriver
         * module) then don't accept it.
         */
-       if (usb_usual_check_type(id, USB_US_TYPE_STOR) ||
-                       usb_usual_ignore_device(intf))
+       if (usb_usual_ignore_device(intf))
                return -ENXIO;
 
        /*
@@ -1105,10 +1102,8 @@ static int __init usb_stor_init(void)
 
        /* register the driver, return usb_register return code if error */
        retval = usb_register(&usb_storage_driver);
-       if (retval == 0) {
+       if (retval == 0)
                pr_info("USB Mass Storage support registered.\n");
-               usb_usual_set_present(USB_US_TYPE_STOR);
-       }
        return retval;
 }
 
@@ -1122,8 +1117,6 @@ static void __exit usb_stor_exit(void)
         */
        US_DEBUGP("-- calling usb_deregister()\n");
        usb_deregister(&usb_storage_driver) ;
-
-       usb_usual_clear_present(USB_US_TYPE_STOR);
 }
 
 module_init(usb_stor_init);
index b96927914f89098bc00119d1338fb381368ea687..b78a526910fb31ac257a13800c593236c0e21a27 100644 (file)
 #define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \
                    vendorName, productName, useProtocol, useTransport, \
                    initFunction, flags) \
-{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
-  .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
-
-#define COMPLIANT_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \
-                   vendorName, productName, useProtocol, useTransport, \
-                   initFunction, flags) \
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
   .driver_info = (flags) }
 
-#define USUAL_DEV(useProto, useTrans, useType) \
-{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans), \
-  .driver_info = ((useType)<<24) }
+#define COMPLIANT_DEV  UNUSUAL_DEV
+
+#define USUAL_DEV(useProto, useTrans) \
+{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans) }
 
 struct usb_device_id usb_storage_usb_ids[] = {
 #      include "unusual_devs.h"
        { }             /* Terminating entry */
 };
-EXPORT_SYMBOL_GPL(usb_storage_usb_ids);
-
 MODULE_DEVICE_TABLE(usb, usb_storage_usb_ids);
 
 #undef UNUSUAL_DEV
 #undef COMPLIANT_DEV
 #undef USUAL_DEV
 
-
 /*
  * The table of devices to ignore
  */
@@ -95,7 +87,6 @@ static struct ignore_entry ignore_ids[] = {
 
 #undef UNUSUAL_DEV
 
-
 /* Return an error if a device is in the ignore_ids list */
 int usb_usual_ignore_device(struct usb_interface *intf)
 {
@@ -115,4 +106,3 @@ int usb_usual_ignore_device(struct usb_interface *intf)
        }
        return 0;
 }
-EXPORT_SYMBOL_GPL(usb_usual_ignore_device);
index e84e769aaddc39ec51515c0b1169727115c51ad9..bf99cd01be206ebeb170d826e176c3ac22e1493e 100644 (file)
 enum { US_DO_ALL_FLAGS };
 #undef US_FLAG
 
-/*
- * The bias field for libusual and friends.
- */
-#define USB_US_TYPE_NONE   0
-#define USB_US_TYPE_STOR   1           /* usb-storage */
-#define USB_US_TYPE_UB     2           /* ub */
-
-#define USB_US_TYPE(flags)             (((flags) >> 24) & 0xFF)
-#define USB_US_ORIG_FLAGS(flags)       ((flags) & 0x00FFFFFF)
-
 #include <linux/usb/storage.h>
 
-/*
- */
 extern int usb_usual_ignore_device(struct usb_interface *intf);
 extern struct usb_device_id usb_storage_usb_ids[];
 
-#ifdef CONFIG_USB_LIBUSUAL
-
-extern void usb_usual_set_present(int type);
-extern void usb_usual_clear_present(int type);
-extern int usb_usual_check_type(const struct usb_device_id *, int type);
-#else
-
-#define usb_usual_set_present(t)       do { } while(0)
-#define usb_usual_clear_present(t)     do { } while(0)
-#define usb_usual_check_type(id, t)    (0)
-#endif /* CONFIG_USB_LIBUSUAL */
-
 #endif /* __LINUX_USB_USUAL_H */