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.

sanboot.h 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  11. #include <ipxe/api.h>
  12. #include <config/sanboot.h>
  13. struct uri;
  14. /**
  15. * Calculate static inline sanboot API function name
  16. *
  17. * @v _prefix Subsystem prefix
  18. * @v _api_func API function
  19. * @ret _subsys_func Subsystem API function
  20. */
  21. #define SANBOOT_INLINE( _subsys, _api_func ) \
  22. SINGLE_API_INLINE ( SANBOOT_PREFIX_ ## _subsys, _api_func )
  23. /**
  24. * Provide a sanboot API implementation
  25. *
  26. * @v _prefix Subsystem prefix
  27. * @v _api_func API function
  28. * @v _func Implementing function
  29. */
  30. #define PROVIDE_SANBOOT( _subsys, _api_func, _func ) \
  31. PROVIDE_SINGLE_API ( SANBOOT_PREFIX_ ## _subsys, _api_func, _func )
  32. /**
  33. * Provide a static inline sanboot API implementation
  34. *
  35. * @v _prefix Subsystem prefix
  36. * @v _api_func API function
  37. */
  38. #define PROVIDE_SANBOOT_INLINE( _subsys, _api_func ) \
  39. PROVIDE_SINGLE_API_INLINE ( SANBOOT_PREFIX_ ## _subsys, _api_func )
  40. /* Include all architecture-independent sanboot API headers */
  41. #include <ipxe/null_sanboot.h>
  42. #include <ipxe/efi/efi_block.h>
  43. /* Include all architecture-dependent sanboot API headers */
  44. #include <bits/sanboot.h>
  45. /**
  46. * Get default SAN drive number
  47. *
  48. * @ret drive Default drive number
  49. */
  50. unsigned int san_default_drive ( void );
  51. /**
  52. * Hook SAN device
  53. *
  54. * @v uri URI
  55. * @v drive Drive number
  56. * @ret drive Drive number, or negative error
  57. */
  58. int san_hook ( struct uri *uri, unsigned int drive );
  59. /**
  60. * Unhook SAN device
  61. *
  62. * @v drive Drive number
  63. */
  64. void san_unhook ( unsigned int drive );
  65. /**
  66. * Attempt to boot from a SAN device
  67. *
  68. * @v drive Drive number
  69. * @ret rc Return status code
  70. */
  71. int san_boot ( unsigned int drive );
  72. /**
  73. * Describe SAN device for SAN-booted operating system
  74. *
  75. * @v drive Drive number
  76. * @ret rc Return status code
  77. */
  78. int san_describe ( unsigned int drive );
  79. #endif /* _IPXE_SANBOOT_H */