depmod: fix tabs in help output
[module-init-tools.git] / tables.h
blob920e8df45ead94612f890ff649e54d82cbec4dd1
1 #ifndef MODINITTOOLS_TABLES_H
2 #define MODINITTOOLS_TABLES_H
3 #include <stddef.h>
5 /* Taken from the 2.5.49 kernel, with the kernel specific fields removed */
6 struct pci_device_id {
7 unsigned int vendor, device; /* Vendor and device ID or PCI_ANY_ID */
8 unsigned int subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */
9 unsigned int class, class_mask; /* (class,subclass,prog-if) triplet */
11 #define PCI_DEVICE_SIZE32 (6 * 4 + 4)
12 #define PCI_DEVICE_SIZE64 (6 * 4 + 8)
14 struct usb_device_id {
15 /* which fields to match against? */
16 unsigned short match_flags;
18 /* Used for product specific matches; range is inclusive */
19 unsigned short idVendor;
20 unsigned short idProduct;
21 unsigned short bcdDevice_lo;
22 unsigned short bcdDevice_hi;
24 /* Used for device class matches */
25 unsigned char bDeviceClass;
26 unsigned char bDeviceSubClass;
27 unsigned char bDeviceProtocol;
29 /* Used for interface class matches */
30 unsigned char bInterfaceClass;
31 unsigned char bInterfaceSubClass;
32 unsigned char bInterfaceProtocol;
35 #define USB_DEVICE_SIZE32 (5 * 2 + 6 * 1 + 4)
36 #define USB_DEVICE_SIZE64 (5 * 2 + 6 * 1 + 8)
38 struct ieee1394_device_id {
39 unsigned int match_flags;
40 unsigned int vendor_id;
41 unsigned int model_id;
42 unsigned int specifier_id;
43 unsigned int version;
45 #define IEEE1394_DEVICE_SIZE32 (5 * 4 + 4)
46 #define IEEE1394_DEVICE_SIZE64 (5 * 4 + 4 /*padding*/ + 8)
48 struct ccw_device_id {
49 unsigned short match_flags; /* which fields to match against */
51 unsigned short cu_type; /* control unit type */
52 unsigned short dev_type; /* device type */
53 unsigned char cu_model; /* control unit model */
54 unsigned char dev_model; /* device model */
56 #define CCW_DEVICE_SIZE32 (3 * 2 + 2 * 1 + 4)
57 #define CCW_DEVICE_SIZE64 (3 * 2 + 2 * 1 + 8)
59 struct pnp_device_id {
60 char id[8];
62 #define PNP_DEVICE_SIZE32 (8 + 4)
63 #define PNP_DEVICE_SIZE64 (8 + 8)
65 struct pnp_card_devid
67 char devid[8][8];
69 struct pnp_card_device_id_32 {
70 char id[8];
71 char driver_data[4];
72 char devid[8][8];
74 struct pnp_card_device_id_64 {
75 char id[8];
76 char driver_data[8];
77 char devid[8][8];
79 #define PNP_CARD_DEVICE_SIZE32 (sizeof(struct pnp_card_device_id_32))
80 #define PNP_CARD_DEVICE_SIZE64 (sizeof(struct pnp_card_device_id_64))
81 #define PNP_CARD_DEVICE_OFFSET32 (offsetof(struct pnp_card_device_id_32, devid))
82 #define PNP_CARD_DEVICE_OFFSET64 (offsetof(struct pnp_card_device_id_64, devid))
83 struct input_device_id_old_64 {
84 unsigned long long match_flags;
85 unsigned short bustype;
86 unsigned short vendor;
87 unsigned short product;
88 unsigned short version;
89 unsigned long long evbit[1];
90 unsigned long long keybit[8]; /* 512 bits */
91 unsigned long long relbit[1];
92 unsigned long long absbit[1]; /* 64 bits */
93 unsigned long long mscbit[1];
94 unsigned long long ledbit[1];
95 unsigned long long sndbit[1];
96 unsigned long long ffbit[2]; /* 128 bits */
97 unsigned long long driver_info;
100 struct input_device_id_old_32 {
101 unsigned int match_flags;
102 unsigned short bustype;
103 unsigned short vendor;
104 unsigned short product;
105 unsigned short version;
106 unsigned int evbit[1];
107 unsigned int keybit[16]; /* 512 bits */
108 unsigned int relbit[1];
109 unsigned int absbit[2]; /* 64 bits */
110 unsigned int mscbit[1];
111 unsigned int ledbit[1];
112 unsigned int sndbit[1];
113 unsigned int ffbit[4]; /* 128 bits */
114 unsigned int driver_info;
117 /* Whee... structure changed in 2.6.14 and broke module-init-tools. */
118 struct input_device_id_64 {
119 unsigned long long match_flags;
120 unsigned short bustype;
121 unsigned short vendor;
122 unsigned short product;
123 unsigned short version;
124 unsigned long long evbit[1];
125 unsigned long long keybit[8]; /* 512 bits */
126 unsigned long long relbit[1];
127 unsigned long long absbit[1]; /* 64 bits */
128 unsigned long long mscbit[1];
129 unsigned long long ledbit[1];
130 unsigned long long sndbit[1];
131 unsigned long long ffbit[2]; /* 128 bits */
132 unsigned long long swbit[1];
133 unsigned long long driver_info;
136 struct input_device_id_32 {
137 unsigned int match_flags;
138 unsigned short bustype;
139 unsigned short vendor;
140 unsigned short product;
141 unsigned short version;
142 unsigned int evbit[1];
143 unsigned int keybit[16]; /* 512 bits */
144 unsigned int relbit[1];
145 unsigned int absbit[2]; /* 64 bits */
146 unsigned int mscbit[1];
147 unsigned int ledbit[1];
148 unsigned int sndbit[1];
149 unsigned int ffbit[4]; /* 128 bits */
150 unsigned int swbit[1];
151 unsigned int driver_info;
154 /* These are the old sizes. */
155 #define INPUT_DEVICE_SIZE32 (4 + 4 * 2 + 4 + 16 * 4 + 4 + 2 * 4 + 4 + 4 + 4 + 4 * 4 + 4)
156 #define INPUT_DEVICE_SIZE64 (8 + 4 * 2 + 8 + 8 * 8 + 8 + 8 + 8 + 8 + 8 + 2 * 8 + 8)
158 struct serio_device_id {
159 unsigned char type;
160 unsigned char extra;
161 unsigned char id;
162 unsigned char proto;
164 #define SERIO_DEVICE_SIZE32 (4 * 1)
165 #define SERIO_DEVICE_SIZE64 (4 * 1 + 4)
167 struct of_device_id {
168 char name[32];
169 char type[32];
170 char compatible[128];
173 #define OF_DEVICE_SIZE32 (32 * 2 + 128 + 4)
174 #define OF_DEVICE_SIZE64 (32 * 2 + 128 + 8)
176 /* Functions provided by tables.c */
177 struct module;
178 int output_usb_table(struct module *modules, FILE *out, char *dirname);
179 int output_ieee1394_table(struct module *modules, FILE *out, char *dirname);
180 int output_pci_table(struct module *modules, FILE *out, char *dirname);
181 int output_ccw_table(struct module *modules, FILE *out, char *dirname);
182 int output_isapnp_table(struct module *modules, FILE *out, char *dirname);
183 int output_input_table(struct module *modules, FILE *out, char *dirname);
184 int output_serio_table(struct module *modules, FILE *out, char *dirname);
185 int output_of_table(struct module *modules, FILE *out, char *dirname);
187 #endif /* MODINITTOOLS_TABLES_H */