1 #ifndef _IPXE_SANBOOT_H
2 #define _IPXE_SANBOOT_H
8 * The sanboot API provides methods for hooking, unhooking,
9 * describing, and booting from SAN devices.
11 * The standard methods (readl()/writel() etc.) do not strictly check
12 * the type of the address parameter; this is because traditional
13 * usage does not necessarily provide the correct pointer type. For
14 * example, code written for ISA devices at fixed I/O addresses (such
15 * as the keyboard controller) tend to use plain integer constants for
16 * the address parameter.
19 FILE_LICENCE ( GPL2_OR_LATER );
22 #include <config/sanboot.h>
27 * Calculate static inline sanboot API function name
29 * @v _prefix Subsystem prefix
30 * @v _api_func API function
31 * @ret _subsys_func Subsystem API function
33 #define SANBOOT_INLINE( _subsys, _api_func ) \
34 SINGLE_API_INLINE ( SANBOOT_PREFIX_ ## _subsys, _api_func )
37 * Provide a sanboot API implementation
39 * @v _prefix Subsystem prefix
40 * @v _api_func API function
41 * @v _func Implementing function
43 #define PROVIDE_SANBOOT( _subsys, _api_func, _func ) \
44 PROVIDE_SINGLE_API ( SANBOOT_PREFIX_ ## _subsys, _api_func, _func )
47 * Provide a static inline sanboot API implementation
49 * @v _prefix Subsystem prefix
50 * @v _api_func API function
52 #define PROVIDE_SANBOOT_INLINE( _subsys, _api_func ) \
53 PROVIDE_SINGLE_API_INLINE ( SANBOOT_PREFIX_ ## _subsys, _api_func )
55 /* Include all architecture-independent sanboot API headers */
56 #include <ipxe/null_sanboot.h>
58 /* Include all architecture-dependent sanboot API headers */
59 #include <bits/sanboot.h>
62 * Get default SAN drive number
64 * @ret drive Default drive number
66 unsigned int san_default_drive ( void );
72 * @v drive Drive number
73 * @ret rc Return status code
75 int san_hook ( struct uri *uri, unsigned int drive );
80 * @v drive Drive number
82 void san_unhook ( unsigned int drive );
85 * Attempt to boot from a SAN device
87 * @v drive Drive number
88 * @ret rc Return status code
90 int san_boot ( unsigned int drive );
93 * Describe SAN device for SAN-booted operating system
95 * @v drive Drive number
96 * @ret rc Return status code
98 int san_describe ( unsigned int drive );
100 #endif /* _IPXE_SANBOOT_H */