blob: b78a526910fb31ac257a13800c593236c0e21a27 [file] [log] [blame]
Alan Sterne6e244b2009-02-12 14:47:44 -05001/* Driver for USB Mass Storage devices
2 * Usual Tables File for usb-storage and libusual
3 *
4 * Copyright (C) 2009 Alan Stern (stern@rowland.harvard.edu)
5 *
6 * Please see http://www.one-eyed-alien.net/~mdharm/linux-usb for more
7 * information about this driver.
8 *
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
12 * later version.
13 *
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.
18 *
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.
22 */
23
24#include <linux/kernel.h>
25#include <linux/module.h>
26#include <linux/usb.h>
27#include <linux/usb_usual.h>
28
29
30/*
31 * The table of devices
32 */
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), \
Alan Sterne6e244b2009-02-12 14:47:44 -050037 .driver_info = (flags) }
38
Sebastian Andrzej Siewiorf61870e2012-08-28 22:37:13 +020039#define COMPLIANT_DEV UNUSUAL_DEV
40
41#define USUAL_DEV(useProto, useTrans) \
42{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans) }
Alan Sterne6e244b2009-02-12 14:47:44 -050043
44struct usb_device_id usb_storage_usb_ids[] = {
45# include "unusual_devs.h"
46 { } /* Terminating entry */
47};
Alan Sterne6e244b2009-02-12 14:47:44 -050048MODULE_DEVICE_TABLE(usb, usb_storage_usb_ids);
49
50#undef UNUSUAL_DEV
51#undef COMPLIANT_DEV
52#undef USUAL_DEV
53
Alan Sterne6e244b2009-02-12 14:47:44 -050054/*
55 * The table of devices to ignore
56 */
57struct ignore_entry {
58 u16 vid, pid, bcdmin, bcdmax;
59};
60
61#define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \
62 vendorName, productName, useProtocol, useTransport, \
63 initFunction, flags) \
64{ \
65 .vid = id_vendor, \
66 .pid = id_product, \
67 .bcdmin = bcdDeviceMin, \
68 .bcdmax = bcdDeviceMax, \
69}
70
71static struct ignore_entry ignore_ids[] = {
Alan Sterna74bba32009-02-12 14:48:22 -050072# include "unusual_alauda.h"
Alan Sternfcdb5142009-02-12 14:48:04 -050073# include "unusual_cypress.h"
Alan Stern2cbbf352009-02-12 14:48:15 -050074# include "unusual_datafab.h"
huajun li41e568d2011-03-04 10:56:18 +080075# include "unusual_ene_ub6250.h"
Alan Stern0d629392009-02-12 14:48:11 -050076# include "unusual_freecom.h"
Alan Stern32d54932009-02-12 14:47:54 -050077# include "unusual_isd200.h"
Alan Sterna9fb6d02009-02-12 14:48:19 -050078# include "unusual_jumpshot.h"
Alan Sternc1033782009-02-12 14:48:26 -050079# include "unusual_karma.h"
Alan Stern9cfb95e2009-02-12 14:48:33 -050080# include "unusual_onetouch.h"
wwang50a6cb92011-01-14 16:53:34 +080081# include "unusual_realtek.h"
Alan Stern0ff71882009-02-12 14:47:49 -050082# include "unusual_sddr09.h"
Alan Stern70fcc002009-02-12 14:47:59 -050083# include "unusual_sddr55.h"
Alan Stern26d68182009-02-12 14:48:08 -050084# include "unusual_usbat.h"
Alan Sterne6e244b2009-02-12 14:47:44 -050085 { } /* Terminating entry */
86};
87
88#undef UNUSUAL_DEV
89
Alan Sterne6e244b2009-02-12 14:47:44 -050090/* Return an error if a device is in the ignore_ids list */
91int usb_usual_ignore_device(struct usb_interface *intf)
92{
93 struct usb_device *udev;
94 unsigned vid, pid, bcd;
95 struct ignore_entry *p;
96
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);
101
102 for (p = ignore_ids; p->vid; ++p) {
103 if (p->vid == vid && p->pid == pid &&
104 p->bcdmin <= bcd && p->bcdmax >= bcd)
105 return -ENXIO;
106 }
107 return 0;
108}