You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

isa.h 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #ifndef ISA_H
  2. #define ISA_H
  3. #include <stdint.h>
  4. #include <gpxe/isa_ids.h>
  5. #include <gpxe/device.h>
  6. #include <gpxe/tables.h>
  7. /** An ISA device */
  8. struct isa_device {
  9. /** Generic device */
  10. struct device dev;
  11. /** I/O address */
  12. uint16_t ioaddr;
  13. /** Driver for this device */
  14. struct isa_driver *driver;
  15. /** Driver-private data
  16. *
  17. * Use isa_set_drvdata() and isa_get_drvdata() to access
  18. * this field.
  19. */
  20. void *priv;
  21. /** Driver name */
  22. const char *driver_name;
  23. };
  24. /*
  25. * An individual ISA device, identified by probe address
  26. *
  27. */
  28. typedef uint16_t isa_probe_addr_t;
  29. /** An ISA driver */
  30. struct isa_driver {
  31. /** Name */
  32. const char *name;
  33. /** Probe address list */
  34. isa_probe_addr_t *probe_addrs;
  35. /** Number of entries in probe address list */
  36. unsigned int addr_count;
  37. /** Manufacturer ID to be assumed for this device */
  38. uint16_t vendor_id;
  39. /** Product ID to be assumed for this device */
  40. uint16_t prod_id;
  41. /**
  42. * Probe device
  43. *
  44. * @v isa ISA device
  45. * @v id Matching entry in ID table
  46. * @ret rc Return status code
  47. */
  48. int ( * probe ) ( struct isa_device *isa );
  49. /**
  50. * Remove device
  51. *
  52. * @v isa ISA device
  53. */
  54. void ( * remove ) ( struct isa_device *isa );
  55. };
  56. /** Declare an ISA driver */
  57. #define __isa_driver __table ( struct isa_driver, isa_drivers, 01 )
  58. /**
  59. * Set ISA driver-private data
  60. *
  61. * @v isa ISA device
  62. * @v priv Private data
  63. */
  64. static inline void isa_set_drvdata ( struct isa_device *isa, void *priv ) {
  65. isa->priv = priv;
  66. }
  67. /**
  68. * Get ISA driver-private data
  69. *
  70. * @v isa ISA device
  71. * @ret priv Private data
  72. */
  73. static inline void * isa_get_drvdata ( struct isa_device *isa ) {
  74. return isa->priv;
  75. }
  76. /*
  77. * ISA_ROM is parsed by parserom.pl to generate Makefile rules and
  78. * files for rom-o-matic.
  79. *
  80. */
  81. #define ISA_ROM( IMAGE, DESCRIPTION )
  82. #endif /* ISA_H */