source: svn/trunk/newcon3bcm2_21bu/toolchain/mips-linux-uclibc/include/linux/mod_devicetable.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 5.7 KB
Line 
1/*
2 * Device tables which are exported to userspace via
3 * scripts/table2alias.c.  You must keep that file in sync with this
4 * header.
5 */
6
7#ifndef LINUX_MOD_DEVICETABLE_H
8#define LINUX_MOD_DEVICETABLE_H
9
10#include <asm/types.h>
11typedef unsigned long kernel_ulong_t;
12
13#define PCI_ANY_ID (~0)
14
15struct pci_device_id {
16        __u32 vendor, device;           /* Vendor and device ID or PCI_ANY_ID*/
17        __u32 subvendor, subdevice;     /* Subsystem ID's or PCI_ANY_ID */
18        __u32 class, class_mask;        /* (class,subclass,prog-if) triplet */
19        kernel_ulong_t driver_data;     /* Data private to the driver */
20};
21
22
23#define IEEE1394_MATCH_VENDOR_ID        0x0001
24#define IEEE1394_MATCH_MODEL_ID         0x0002
25#define IEEE1394_MATCH_SPECIFIER_ID     0x0004
26#define IEEE1394_MATCH_VERSION          0x0008
27
28struct ieee1394_device_id {
29        __u32 match_flags;
30        __u32 vendor_id;
31        __u32 model_id;
32        __u32 specifier_id;
33        __u32 version;
34        kernel_ulong_t driver_data;
35};
36
37
38/*
39 * Device table entry for "new style" table-driven USB drivers.
40 * User mode code can read these tables to choose which modules to load.
41 * Declare the table as a MODULE_DEVICE_TABLE.
42 *
43 * A probe() parameter will point to a matching entry from this table.
44 * Use the driver_info field for each match to hold information tied
45 * to that match:  device quirks, etc.
46 *
47 * Terminate the driver's table with an all-zeroes entry.
48 * Use the flag values to control which fields are compared.
49 */
50
51/**
52 * struct usb_device_id - identifies USB devices for probing and hotplugging
53 * @match_flags: Bit mask controlling of the other fields are used to match
54 *      against new devices.  Any field except for driver_info may be used,
55 *      although some only make sense in conjunction with other fields.
56 *      This is usually set by a USB_DEVICE_*() macro, which sets all
57 *      other fields in this structure except for driver_info.
58 * @idVendor: USB vendor ID for a device; numbers are assigned
59 *      by the USB forum to its members.
60 * @idProduct: Vendor-assigned product ID.
61 * @bcdDevice_lo: Low end of range of vendor-assigned product version numbers.
62 *      This is also used to identify individual product versions, for
63 *      a range consisting of a single device.
64 * @bcdDevice_hi: High end of version number range.  The range of product
65 *      versions is inclusive.
66 * @bDeviceClass: Class of device; numbers are assigned
67 *      by the USB forum.  Products may choose to implement classes,
68 *      or be vendor-specific.  Device classes specify behavior of all
69 *      the interfaces on a devices.
70 * @bDeviceSubClass: Subclass of device; associated with bDeviceClass.
71 * @bDeviceProtocol: Protocol of device; associated with bDeviceClass.
72 * @bInterfaceClass: Class of interface; numbers are assigned
73 *      by the USB forum.  Products may choose to implement classes,
74 *      or be vendor-specific.  Interface classes specify behavior only
75 *      of a given interface; other interfaces may support other classes.
76 * @bInterfaceSubClass: Subclass of interface; associated with bInterfaceClass.
77 * @bInterfaceProtocol: Protocol of interface; associated with bInterfaceClass.
78 * @driver_info: Holds information used by the driver.  Usually it holds
79 *      a pointer to a descriptor understood by the driver, or perhaps
80 *      device flags.
81 *
82 * In most cases, drivers will create a table of device IDs by using
83 * USB_DEVICE(), or similar macros designed for that purpose.
84 * They will then export it to userspace using MODULE_DEVICE_TABLE(),
85 * and provide it to the USB core through their usb_driver structure.
86 *
87 * See the usb_match_id() function for information about how matches are
88 * performed.  Briefly, you will normally use one of several macros to help
89 * construct these entries.  Each entry you provide will either identify
90 * one or more specific products, or will identify a class of products
91 * which have agreed to behave the same.  You should put the more specific
92 * matches towards the beginning of your table, so that driver_info can
93 * record quirks of specific products.
94 */
95struct usb_device_id {
96        /* which fields to match against? */
97        __u16           match_flags;
98
99        /* Used for product specific matches; range is inclusive */
100        __u16           idVendor;
101        __u16           idProduct;
102        __u16           bcdDevice_lo;
103        __u16           bcdDevice_hi;
104
105        /* Used for device class matches */
106        __u8            bDeviceClass;
107        __u8            bDeviceSubClass;
108        __u8            bDeviceProtocol;
109
110        /* Used for interface class matches */
111        __u8            bInterfaceClass;
112        __u8            bInterfaceSubClass;
113        __u8            bInterfaceProtocol;
114
115        /* not matched against */
116        kernel_ulong_t  driver_info;
117};
118
119/* Some useful macros to use to create struct usb_device_id */
120#define USB_DEVICE_ID_MATCH_VENDOR              0x0001
121#define USB_DEVICE_ID_MATCH_PRODUCT             0x0002
122#define USB_DEVICE_ID_MATCH_DEV_LO              0x0004
123#define USB_DEVICE_ID_MATCH_DEV_HI              0x0008
124#define USB_DEVICE_ID_MATCH_DEV_CLASS           0x0010
125#define USB_DEVICE_ID_MATCH_DEV_SUBCLASS        0x0020
126#define USB_DEVICE_ID_MATCH_DEV_PROTOCOL        0x0040
127#define USB_DEVICE_ID_MATCH_INT_CLASS           0x0080
128#define USB_DEVICE_ID_MATCH_INT_SUBCLASS        0x0100
129#define USB_DEVICE_ID_MATCH_INT_PROTOCOL        0x0200
130
131/* s390 CCW devices */
132struct ccw_device_id {
133        __u16   match_flags;    /* which fields to match against */
134
135        __u16   cu_type;        /* control unit type     */
136        __u16   dev_type;       /* device type           */
137        __u8    cu_model;       /* control unit model    */
138        __u8    dev_model;      /* device model          */
139
140        kernel_ulong_t driver_info;
141};
142
143#define CCW_DEVICE_ID_MATCH_CU_TYPE             0x01
144#define CCW_DEVICE_ID_MATCH_CU_MODEL            0x02
145#define CCW_DEVICE_ID_MATCH_DEVICE_TYPE         0x04
146#define CCW_DEVICE_ID_MATCH_DEVICE_MODEL        0x08
147
148
149#define PNP_ID_LEN      8
150#define PNP_MAX_DEVICES 8
151
152struct pnp_device_id {
153        __u8 id[PNP_ID_LEN];
154        kernel_ulong_t driver_data;
155};
156
157struct pnp_card_device_id {
158        __u8 id[PNP_ID_LEN];
159        kernel_ulong_t driver_data;
160        struct {
161                __u8 id[PNP_ID_LEN];
162        } devs[PNP_MAX_DEVICES];
163};
164
165
166#define SERIO_ANY       0xff
167
168struct serio_device_id {
169        __u8 type;
170        __u8 extra;
171        __u8 id;
172        __u8 proto;
173};
174
175
176#endif /* LINUX_MOD_DEVICETABLE_H */
Note: See TracBrowser for help on using the repository browser.