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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #ifndef _IPXE_SANBOOT_H
  2. #define _IPXE_SANBOOT_H
  3. /** @file
  4. *
  5. * iPXE sanboot API
  6. *
  7. * The sanboot API provides methods for hooking, unhooking,
  8. * describing, and booting from SAN devices.
  9. *
  10. * The standard methods (readl()/writel() etc.) do not strictly check
  11. * the type of the address parameter; this is because traditional
  12. * usage does not necessarily provide the correct pointer type. For
  13. * example, code written for ISA devices at fixed I/O addresses (such
  14. * as the keyboard controller) tend to use plain integer constants for
  15. * the address parameter.
  16. */
  17. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  18. #include <ipxe/api.h>
  19. #include <config/sanboot.h>
  20. struct uri;
  21. /**
  22. * Calculate static inline sanboot API function name
  23. *
  24. * @v _prefix Subsystem prefix
  25. * @v _api_func API function
  26. * @ret _subsys_func Subsystem API function
  27. */
  28. #define SANBOOT_INLINE( _subsys, _api_func ) \
  29. SINGLE_API_INLINE ( SANBOOT_PREFIX_ ## _subsys, _api_func )
  30. /**
  31. * Provide a sanboot API implementation
  32. *
  33. * @v _prefix Subsystem prefix
  34. * @v _api_func API function
  35. * @v _func Implementing function
  36. */
  37. #define PROVIDE_SANBOOT( _subsys, _api_func, _func ) \
  38. PROVIDE_SINGLE_API ( SANBOOT_PREFIX_ ## _subsys, _api_func, _func )
  39. /**
  40. * Provide a static inline sanboot API implementation
  41. *
  42. * @v _prefix Subsystem prefix
  43. * @v _api_func API function
  44. */
  45. #define PROVIDE_SANBOOT_INLINE( _subsys, _api_func ) \
  46. PROVIDE_SINGLE_API_INLINE ( SANBOOT_PREFIX_ ## _subsys, _api_func )
  47. /* Include all architecture-independent sanboot API headers */
  48. #include <ipxe/null_sanboot.h>
  49. #include <ipxe/efi/efi_block.h>
  50. /* Include all architecture-dependent sanboot API headers */
  51. #include <bits/sanboot.h>
  52. /**
  53. * Get default SAN drive number
  54. *
  55. * @ret drive Default drive number
  56. */
  57. unsigned int san_default_drive ( void );
  58. /**
  59. * Hook SAN device
  60. *
  61. * @v uri URI
  62. * @v drive Drive number
  63. * @ret drive Drive number, or negative error
  64. */
  65. int san_hook ( struct uri *uri, unsigned int drive );
  66. /**
  67. * Unhook SAN device
  68. *
  69. * @v drive Drive number
  70. */
  71. void san_unhook ( unsigned int drive );
  72. /**
  73. * Attempt to boot from a SAN device
  74. *
  75. * @v drive Drive number
  76. * @ret rc Return status code
  77. */
  78. int san_boot ( unsigned int drive );
  79. /**
  80. * Describe SAN device for SAN-booted operating system
  81. *
  82. * @v drive Drive number
  83. * @ret rc Return status code
  84. */
  85. int san_describe ( unsigned int drive );
  86. #endif /* _IPXE_SANBOOT_H */