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.

undi.h 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #ifndef _UNDI_H
  2. #define _UNDI_H
  3. /** @file
  4. *
  5. * UNDI driver
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  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. /** Driver-private data
  51. *
  52. * Use undi_set_drvdata() and undi_get_drvdata() to access this
  53. * field.
  54. */
  55. void *priv;
  56. } __attribute__ (( packed ));
  57. /**
  58. * Set UNDI driver-private data
  59. *
  60. * @v undi UNDI device
  61. * @v priv Private data
  62. */
  63. static inline void undi_set_drvdata ( struct undi_device *undi, void *priv ) {
  64. undi->priv = priv;
  65. }
  66. /**
  67. * Get UNDI driver-private data
  68. *
  69. * @v undi UNDI device
  70. * @ret priv Private data
  71. */
  72. static inline void * undi_get_drvdata ( struct undi_device *undi ) {
  73. return undi->priv;
  74. }
  75. #endif /* ASSEMBLY */
  76. /** PCI bus:dev.fn field is invalid */
  77. #define UNDI_NO_PCI_BUSDEVFN 0xffff
  78. /** ISAPnP card select number field is invalid */
  79. #define UNDI_NO_ISAPNP_CSN 0xffff
  80. /** ISAPnP read port field is invalid */
  81. #define UNDI_NO_ISAPNP_READ_PORT 0xffff
  82. /** UNDI flag: START_UNDI has been called */
  83. #define UNDI_FL_STARTED 0x0001
  84. /** UNDI flag: UNDI_STARTUP and UNDI_INITIALIZE have been called */
  85. #define UNDI_FL_INITIALIZED 0x0002
  86. /** UNDI flag: keep stack resident */
  87. #define UNDI_FL_KEEP_ALL 0x0004
  88. #endif /* _UNDI_H */