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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #ifndef _UNDI_H
  2. #define _UNDI_H
  3. /** @file
  4. *
  5. * UNDI driver
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER );
  9. #ifndef ASSEMBLY
  10. #include <ipxe/device.h>
  11. #include <pxe_types.h>
  12. /** An UNDI device
  13. *
  14. * This structure is used by assembly code as well as C; do not alter
  15. * this structure without editing pxeprefix.S to match.
  16. */
  17. struct undi_device {
  18. /** PXENV+ structure address */
  19. SEGOFF16_t pxenv;
  20. /** !PXE structure address */
  21. SEGOFF16_t ppxe;
  22. /** Entry point */
  23. SEGOFF16_t entry;
  24. /** Free base memory after load */
  25. UINT16_t fbms;
  26. /** Free base memory prior to load */
  27. UINT16_t restore_fbms;
  28. /** PCI bus:dev.fn, or @c UNDI_NO_PCI_BUSDEVFN */
  29. UINT16_t pci_busdevfn;
  30. /** ISAPnP card select number, or @c UNDI_NO_ISAPNP_CSN */
  31. UINT16_t isapnp_csn;
  32. /** ISAPnP read port, or @c UNDI_NO_ISAPNP_READ_PORT */
  33. UINT16_t isapnp_read_port;
  34. /** PCI vendor ID
  35. *
  36. * Filled in only for the preloaded UNDI device by pxeprefix.S
  37. */
  38. UINT16_t pci_vendor;
  39. /** PCI device ID
  40. *
  41. * Filled in only for the preloaded UNDI device by pxeprefix.S
  42. */
  43. UINT16_t pci_device;
  44. /** Flags
  45. *
  46. * This is the bitwise OR of zero or more UNDI_FL_XXX
  47. * constants.
  48. */
  49. UINT16_t flags;
  50. /** Generic device */
  51. struct device dev;
  52. /** Driver-private data
  53. *
  54. * Use undi_set_drvdata() and undi_get_drvdata() to access this
  55. * field.
  56. */
  57. void *priv;
  58. } __attribute__ (( packed ));
  59. /**
  60. * Set UNDI driver-private data
  61. *
  62. * @v undi UNDI device
  63. * @v priv Private data
  64. */
  65. static inline void undi_set_drvdata ( struct undi_device *undi, void *priv ) {
  66. undi->priv = priv;
  67. }
  68. /**
  69. * Get UNDI driver-private data
  70. *
  71. * @v undi UNDI device
  72. * @ret priv Private data
  73. */
  74. static inline void * undi_get_drvdata ( struct undi_device *undi ) {
  75. return undi->priv;
  76. }
  77. #endif /* ASSEMBLY */
  78. /** PCI bus:dev.fn field is invalid */
  79. #define UNDI_NO_PCI_BUSDEVFN 0xffff
  80. /** ISAPnP card select number field is invalid */
  81. #define UNDI_NO_ISAPNP_CSN 0xffff
  82. /** ISAPnP read port field is invalid */
  83. #define UNDI_NO_ISAPNP_READ_PORT 0xffff
  84. /** UNDI flag: START_UNDI has been called */
  85. #define UNDI_FL_STARTED 0x0001
  86. /** UNDI flag: UNDI_STARTUP and UNDI_INITIALIZE have been called */
  87. #define UNDI_FL_INITIALIZED 0x0002
  88. /** UNDI flag: keep stack resident */
  89. #define UNDI_FL_KEEP_ALL 0x0004
  90. #endif /* _UNDI_H */