devicetable-offsets.c 5.5 KB

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