devicetable-offsets.c 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/kbuild.h>
  3. #include <linux/mod_devicetable.h>
  4. #define DEVID(devid) DEFINE(SIZE_##devid, sizeof(struct devid))
  5. #define DEVID_FIELD(devid, field) \
  6. DEFINE(OFF_##devid##_##field, offsetof(struct devid, field))
  7. int main(void)
  8. {
  9. DEVID(usb_device_id);
  10. DEVID_FIELD(usb_device_id, match_flags);
  11. DEVID_FIELD(usb_device_id, idVendor);
  12. DEVID_FIELD(usb_device_id, idProduct);
  13. DEVID_FIELD(usb_device_id, bcdDevice_lo);
  14. DEVID_FIELD(usb_device_id, bcdDevice_hi);
  15. DEVID_FIELD(usb_device_id, bDeviceClass);
  16. DEVID_FIELD(usb_device_id, bDeviceSubClass);
  17. DEVID_FIELD(usb_device_id, bDeviceProtocol);
  18. DEVID_FIELD(usb_device_id, bInterfaceClass);
  19. DEVID_FIELD(usb_device_id, bInterfaceSubClass);
  20. DEVID_FIELD(usb_device_id, bInterfaceProtocol);
  21. DEVID_FIELD(usb_device_id, bInterfaceNumber);
  22. DEVID(hid_device_id);
  23. DEVID_FIELD(hid_device_id, bus);
  24. DEVID_FIELD(hid_device_id, group);
  25. DEVID_FIELD(hid_device_id, vendor);
  26. DEVID_FIELD(hid_device_id, product);
  27. DEVID(ieee1394_device_id);
  28. DEVID_FIELD(ieee1394_device_id, match_flags);
  29. DEVID_FIELD(ieee1394_device_id, vendor_id);
  30. DEVID_FIELD(ieee1394_device_id, model_id);
  31. DEVID_FIELD(ieee1394_device_id, specifier_id);
  32. DEVID_FIELD(ieee1394_device_id, version);
  33. DEVID(pci_device_id);
  34. DEVID_FIELD(pci_device_id, vendor);
  35. DEVID_FIELD(pci_device_id, device);
  36. DEVID_FIELD(pci_device_id, subvendor);
  37. DEVID_FIELD(pci_device_id, subdevice);
  38. DEVID_FIELD(pci_device_id, class);
  39. DEVID_FIELD(pci_device_id, class_mask);
  40. DEVID(ccw_device_id);
  41. DEVID_FIELD(ccw_device_id, match_flags);
  42. DEVID_FIELD(ccw_device_id, cu_type);
  43. DEVID_FIELD(ccw_device_id, cu_model);
  44. DEVID_FIELD(ccw_device_id, dev_type);
  45. DEVID_FIELD(ccw_device_id, dev_model);
  46. DEVID(ap_device_id);
  47. DEVID_FIELD(ap_device_id, dev_type);
  48. DEVID(css_device_id);
  49. DEVID_FIELD(css_device_id, type);
  50. DEVID(serio_device_id);
  51. DEVID_FIELD(serio_device_id, type);
  52. DEVID_FIELD(serio_device_id, proto);
  53. DEVID_FIELD(serio_device_id, id);
  54. DEVID_FIELD(serio_device_id, extra);
  55. DEVID(acpi_device_id);
  56. DEVID_FIELD(acpi_device_id, id);
  57. DEVID_FIELD(acpi_device_id, cls);
  58. DEVID_FIELD(acpi_device_id, cls_msk);
  59. DEVID(pnp_device_id);
  60. DEVID_FIELD(pnp_device_id, id);
  61. DEVID(pnp_card_device_id);
  62. DEVID_FIELD(pnp_card_device_id, devs);
  63. DEVID(pcmcia_device_id);
  64. DEVID_FIELD(pcmcia_device_id, match_flags);
  65. DEVID_FIELD(pcmcia_device_id, manf_id);
  66. DEVID_FIELD(pcmcia_device_id, card_id);
  67. DEVID_FIELD(pcmcia_device_id, func_id);
  68. DEVID_FIELD(pcmcia_device_id, function);
  69. DEVID_FIELD(pcmcia_device_id, device_no);
  70. DEVID_FIELD(pcmcia_device_id, prod_id_hash);
  71. DEVID(of_device_id);
  72. DEVID_FIELD(of_device_id, name);
  73. DEVID_FIELD(of_device_id, type);
  74. DEVID_FIELD(of_device_id, compatible);
  75. DEVID(vio_device_id);
  76. DEVID_FIELD(vio_device_id, type);
  77. DEVID_FIELD(vio_device_id, compat);
  78. DEVID(input_device_id);
  79. DEVID_FIELD(input_device_id, flags);
  80. DEVID_FIELD(input_device_id, bustype);
  81. DEVID_FIELD(input_device_id, vendor);
  82. DEVID_FIELD(input_device_id, product);
  83. DEVID_FIELD(input_device_id, version);
  84. DEVID_FIELD(input_device_id, evbit);
  85. DEVID_FIELD(input_device_id, keybit);
  86. DEVID_FIELD(input_device_id, relbit);
  87. DEVID_FIELD(input_device_id, absbit);
  88. DEVID_FIELD(input_device_id, mscbit);
  89. DEVID_FIELD(input_device_id, ledbit);
  90. DEVID_FIELD(input_device_id, sndbit);
  91. DEVID_FIELD(input_device_id, ffbit);
  92. DEVID_FIELD(input_device_id, swbit);
  93. DEVID(eisa_device_id);
  94. DEVID_FIELD(eisa_device_id, sig);
  95. DEVID(parisc_device_id);
  96. DEVID_FIELD(parisc_device_id, hw_type);
  97. DEVID_FIELD(parisc_device_id, hversion);
  98. DEVID_FIELD(parisc_device_id, hversion_rev);
  99. DEVID_FIELD(parisc_device_id, sversion);
  100. DEVID(sdio_device_id);
  101. DEVID_FIELD(sdio_device_id, class);
  102. DEVID_FIELD(sdio_device_id, vendor);
  103. DEVID_FIELD(sdio_device_id, device);
  104. DEVID(ssb_device_id);
  105. DEVID_FIELD(ssb_device_id, vendor);
  106. DEVID_FIELD(ssb_device_id, coreid);
  107. DEVID_FIELD(ssb_device_id, revision);
  108. DEVID(bcma_device_id);
  109. DEVID_FIELD(bcma_device_id, manuf);
  110. DEVID_FIELD(bcma_device_id, id);
  111. DEVID_FIELD(bcma_device_id, rev);
  112. DEVID_FIELD(bcma_device_id, class);
  113. DEVID(virtio_device_id);
  114. DEVID_FIELD(virtio_device_id, device);
  115. DEVID_FIELD(virtio_device_id, vendor);
  116. DEVID(hv_vmbus_device_id);
  117. DEVID_FIELD(hv_vmbus_device_id, guid);
  118. DEVID(rpmsg_device_id);
  119. DEVID_FIELD(rpmsg_device_id, name);
  120. DEVID(i2c_device_id);
  121. DEVID_FIELD(i2c_device_id, name);
  122. DEVID(spi_device_id);
  123. DEVID_FIELD(spi_device_id, name);
  124. DEVID(dmi_system_id);
  125. DEVID_FIELD(dmi_system_id, matches);
  126. DEVID(platform_device_id);
  127. DEVID_FIELD(platform_device_id, name);
  128. DEVID(mdio_device_id);
  129. DEVID_FIELD(mdio_device_id, phy_id);
  130. DEVID_FIELD(mdio_device_id, phy_id_mask);
  131. DEVID(zorro_device_id);
  132. DEVID_FIELD(zorro_device_id, id);
  133. DEVID(isapnp_device_id);
  134. DEVID_FIELD(isapnp_device_id, vendor);
  135. DEVID_FIELD(isapnp_device_id, function);
  136. DEVID(ipack_device_id);
  137. DEVID_FIELD(ipack_device_id, format);
  138. DEVID_FIELD(ipack_device_id, vendor);
  139. DEVID_FIELD(ipack_device_id, device);
  140. DEVID(amba_id);
  141. DEVID_FIELD(amba_id, id);
  142. DEVID_FIELD(amba_id, mask);
  143. DEVID(mips_cdmm_device_id);
  144. DEVID_FIELD(mips_cdmm_device_id, type);
  145. DEVID(x86_cpu_id);
  146. DEVID_FIELD(x86_cpu_id, feature);
  147. DEVID_FIELD(x86_cpu_id, family);
  148. DEVID_FIELD(x86_cpu_id, model);
  149. DEVID_FIELD(x86_cpu_id, vendor);
  150. DEVID(cpu_feature);
  151. DEVID_FIELD(cpu_feature, feature);
  152. DEVID(mei_cl_device_id);
  153. DEVID_FIELD(mei_cl_device_id, name);
  154. DEVID_FIELD(mei_cl_device_id, uuid);
  155. DEVID_FIELD(mei_cl_device_id, version);
  156. DEVID(rio_device_id);
  157. DEVID_FIELD(rio_device_id, did);
  158. DEVID_FIELD(rio_device_id, vid);
  159. DEVID_FIELD(rio_device_id, asm_did);
  160. DEVID_FIELD(rio_device_id, asm_vid);
  161. DEVID(ulpi_device_id);
  162. DEVID_FIELD(ulpi_device_id, vendor);
  163. DEVID_FIELD(ulpi_device_id, product);
  164. DEVID(hda_device_id);
  165. DEVID_FIELD(hda_device_id, vendor_id);
  166. DEVID_FIELD(hda_device_id, rev_id);
  167. DEVID_FIELD(hda_device_id, api_version);
  168. DEVID(sdw_device_id);
  169. DEVID_FIELD(sdw_device_id, mfg_id);
  170. DEVID_FIELD(sdw_device_id, part_id);
  171. DEVID(fsl_mc_device_id);
  172. DEVID_FIELD(fsl_mc_device_id, vendor);
  173. DEVID_FIELD(fsl_mc_device_id, obj_type);
  174. DEVID(tb_service_id);
  175. DEVID_FIELD(tb_service_id, match_flags);
  176. DEVID_FIELD(tb_service_id, protocol_key);
  177. DEVID_FIELD(tb_service_id, protocol_id);
  178. DEVID_FIELD(tb_service_id, protocol_version);
  179. DEVID_FIELD(tb_service_id, protocol_revision);
  180. DEVID(typec_device_id);
  181. DEVID_FIELD(typec_device_id, svid);
  182. DEVID_FIELD(typec_device_id, mode);
  183. return 0;
  184. }