1 /* Driver for USB Mass Storage devices
2 * Usual Tables File for usb-storage and libusual
4 * Copyright (C) 2009 Alan Stern (stern@rowland.harvard.edu)
6 * Please see http://www.one-eyed-alien.net/~mdharm/linux-usb for more
7 * information about this driver.
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2, or (at your option) any
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include <linux/kernel.h>
25 #include <linux/module.h>
26 #include <linux/usb.h>
27 #include <linux/usb_usual.h>
31 * The table of devices
33 #define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \
34 vendorName, productName, useProtocol, useTransport, \
35 initFunction, flags) \
36 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
37 .driver_info = (flags) }
39 #define COMPLIANT_DEV UNUSUAL_DEV
41 #define USUAL_DEV(useProto, useTrans) \
42 { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans) }
44 struct usb_device_id usb_storage_usb_ids[] = {
45 # include "unusual_devs.h"
46 { } /* Terminating entry */
48 MODULE_DEVICE_TABLE(usb, usb_storage_usb_ids);
55 * The table of devices to ignore
58 u16 vid, pid, bcdmin, bcdmax;
61 #define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \
62 vendorName, productName, useProtocol, useTransport, \
63 initFunction, flags) \
67 .bcdmin = bcdDeviceMin, \
68 .bcdmax = bcdDeviceMax, \
71 static struct ignore_entry ignore_ids[] = {
72 # include "unusual_alauda.h"
73 # include "unusual_cypress.h"
74 # include "unusual_datafab.h"
75 # include "unusual_ene_ub6250.h"
76 # include "unusual_freecom.h"
77 # include "unusual_isd200.h"
78 # include "unusual_jumpshot.h"
79 # include "unusual_karma.h"
80 # include "unusual_onetouch.h"
81 # include "unusual_realtek.h"
82 # include "unusual_sddr09.h"
83 # include "unusual_sddr55.h"
84 # include "unusual_usbat.h"
85 { } /* Terminating entry */
90 /* Return an error if a device is in the ignore_ids list */
91 int usb_usual_ignore_device(struct usb_interface *intf)
93 struct usb_device *udev;
94 unsigned vid, pid, bcd;
95 struct ignore_entry *p;
97 udev = interface_to_usbdev(intf);
98 vid = le16_to_cpu(udev->descriptor.idVendor);
99 pid = le16_to_cpu(udev->descriptor.idProduct);
100 bcd = le16_to_cpu(udev->descriptor.bcdDevice);
102 for (p = ignore_ids; p->vid; ++p) {
103 if (p->vid == vid && p->pid == pid &&
104 p->bcdmin <= bcd && p->bcdmax >= bcd)