summaryrefslogtreecommitdiffstats
path: root/scripts/mod/devicetable-offsets.c
blob: f282516acc7be7d26be68037d3381a66126b582d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#include <linux/kbuild.h>
#include <linux/mod_devicetable.h>

#define DEVID(devid) DEFINE(SIZE_##devid, sizeof(struct devid))
#define DEVID_FIELD(devid, field) \
	DEFINE(OFF_##devid##_##field, offsetof(struct devid, field))

int main(void)
{
	DEVID(usb_device_id);
	DEVID_FIELD(usb_device_id, match_flags);
	DEVID_FIELD(usb_device_id, idVendor);
	DEVID_FIELD(usb_device_id, idProduct);
	DEVID_FIELD(usb_device_id, bcdDevice_lo);
	DEVID_FIELD(usb_device_id, bcdDevice_hi);
	DEVID_FIELD(usb_device_id, bDeviceClass);
	DEVID_FIELD(usb_device_id, bDeviceSubClass);
	DEVID_FIELD(usb_device_id, bDeviceProtocol);
	DEVID_FIELD(usb_device_id, bInterfaceClass);
	DEVID_FIELD(usb_device_id, bInterfaceSubClass);
	DEVID_FIELD(usb_device_id, bInterfaceProtocol);
	DEVID_FIELD(usb_device_id, bInterfaceNumber);

	DEVID(hid_device_id);
	DEVID_FIELD(hid_device_id, bus);
	DEVID_FIELD(hid_device_id, group);
	DEVID_FIELD(hid_device_id, vendor);
	DEVID_FIELD(hid_device_id, product);

	DEVID(ieee1394_device_id);
	DEVID_FIELD(ieee1394_device_id, match_flags);
	DEVID_FIELD(ieee1394_device_id, vendor_id);
	DEVID_FIELD(ieee1394_device_id, model_id);
	DEVID_FIELD(ieee1394_device_id, specifier_id);
	DEVID_FIELD(ieee1394_device_id, version);

	DEVID(pci_device_id);
	DEVID_FIELD(pci_device_id, vendor);
	DEVID_FIELD(pci_device_id, device);
	DEVID_FIELD(pci_device_id, subvendor);
	DEVID_FIELD(pci_device_id, subdevice);
	DEVID_FIELD(pci_device_id, class);
	DEVID_FIELD(pci_device_id, class_mask);

	DEVID(ccw_device_id);
	DEVID_FIELD(ccw_device_id, match_flags);
	DEVID_FIELD(ccw_device_id, cu_type);
	DEVID_FIELD(ccw_device_id, cu_model);
	DEVID_FIELD(ccw_device_id, dev_type);
	DEVID_FIELD(ccw_device_id, dev_model);

	DEVID(ap_device_id);
	DEVID_FIELD(ap_device_id, dev_type);

	DEVID(css_device_id);
	DEVID_FIELD(css_device_id, type);

	DEVID(serio_device_id);
	DEVID_FIELD(serio_device_id, type);
	DEVID_FIELD(serio_device_id, proto);
	DEVID_FIELD(serio_device_id, id);
	DEVID_FIELD(serio_device_id, extra);

	DEVID(acpi_device_id);
	DEVID_FIELD(acpi_device_id, id);

	DEVID(pnp_device_id);
	DEVID_FIELD(pnp_device_id, id);

	DEVID(pnp_card_device_id);
	DEVID_FIELD(pnp_card_device_id, devs);

	DEVID(pcmcia_device_id);
	DEVID_FIELD(pcmcia_device_id, match_flags);
	DEVID_FIELD(pcmcia_device_id, manf_id);
	DEVID_FIELD(pcmcia_device_id, card_id);
	DEVID_FIELD(pcmcia_device_id, func_id);
	DEVID_FIELD(pcmcia_device_id, function);
	DEVID_FIELD(pcmcia_device_id, device_no);
	DEVID_FIELD(pcmcia_device_id, prod_id_hash);

	DEVID(of_device_id);
	DEVID_FIELD(of_device_id, name);
	DEVID_FIELD(of_device_id, type);
	DEVID_FIELD(of_device_id, compatible);

	DEVID(vio_device_id);
	DEVID_FIELD(vio_device_id, type);
	DEVID_FIELD(vio_device_id, compat);

	DEVID(input_device_id);
	DEVID_FIELD(input_device_id, flags);
	DEVID_FIELD(input_device_id, bustype);
	DEVID_FIELD(input_device_id, vendor);
	DEVID_FIELD(input_device_id, product);
	DEVID_FIELD(input_device_id, version);
	DEVID_FIELD(input_device_id, evbit);
	DEVID_FIELD(input_device_id, keybit);
	DEVID_FIELD(input_device_id, relbit);
	DEVID_FIELD(input_device_id, absbit);
	DEVID_FIELD(input_device_id, mscbit);
	DEVID_FIELD(input_device_id, ledbit);
	DEVID_FIELD(input_device_id, sndbit);
	DEVID_FIELD(input_device_id, ffbit);
	DEVID_FIELD(input_device_id, swbit);

	DEVID(eisa_device_id);
	DEVID_FIELD(eisa_device_id, sig);

	DEVID(parisc_device_id);
	DEVID_FIELD(parisc_device_id, hw_type);
	DEVID_FIELD(parisc_device_id, hversion);
	DEVID_FIELD(parisc_device_id, hversion_rev);
	DEVID_FIELD(parisc_device_id, sversion);

	DEVID(sdio_device_id);
	DEVID_FIELD(sdio_device_id, class);
	DEVID_FIELD(sdio_device_id, vendor);
	DEVID_FIELD(sdio_device_id, device);

	DEVID(ssb_device_id);
	DEVID_FIELD(ssb_device_id, vendor);
	DEVID_FIELD(ssb_device_id, coreid);
	DEVID_FIELD(ssb_device_id, revision);

	DEVID(bcma_device_id);
	DEVID_FIELD(bcma_device_id, manuf);
	DEVID_FIELD(bcma_device_id, id);
	DEVID_FIELD(bcma_device_id, rev);
	DEVID_FIELD(bcma_device_id, class);

	DEVID(virtio_device_id);
	DEVID_FIELD(virtio_device_id, device);
	DEVID_FIELD(virtio_device_id, vendor);

	DEVID(hv_vmbus_device_id);
	DEVID_FIELD(hv_vmbus_device_id, guid);

	DEVID(i2c_device_id);
	DEVID_FIELD(i2c_device_id, name);

	DEVID(spi_device_id);
	DEVID_FIELD(spi_device_id, name);

	DEVID(dmi_system_id);
	DEVID_FIELD(dmi_system_id, matches);

	DEVID(platform_device_id);
	DEVID_FIELD(platform_device_id, name);

	DEVID(mdio_device_id);
	DEVID_FIELD(mdio_device_id, phy_id);
	DEVID_FIELD(mdio_device_id, phy_id_mask);

	DEVID(zorro_device_id);
	DEVID_FIELD(zorro_device_id, id);

	DEVID(isapnp_device_id);
	DEVID_FIELD(isapnp_device_id, vendor);
	DEVID_FIELD(isapnp_device_id, function);

	DEVID(ipack_device_id);
	DEVID_FIELD(ipack_device_id, format);
	DEVID_FIELD(ipack_device_id, vendor);
	DEVID_FIELD(ipack_device_id, device);

	DEVID(amba_id);
	DEVID_FIELD(amba_id, id);
	DEVID_FIELD(amba_id, mask);

	DEVID(x86_cpu_id);
	DEVID_FIELD(x86_cpu_id, feature);
	DEVID_FIELD(x86_cpu_id, family);
	DEVID_FIELD(x86_cpu_id, model);
	DEVID_FIELD(x86_cpu_id, vendor);

	DEVID(cpu_feature);
	DEVID_FIELD(cpu_feature, feature);

	DEVID(mei_cl_device_id);
	DEVID_FIELD(mei_cl_device_id, name);

	DEVID(rio_device_id);
	DEVID_FIELD(rio_device_id, did);
	DEVID_FIELD(rio_device_id, vid);
	DEVID_FIELD(rio_device_id, asm_did);
	DEVID_FIELD(rio_device_id, asm_vid);

	return 0;
}