1 #ifndef _IPXE_SANBOOT_H 2 #define _IPXE_SANBOOT_H 33 #define SAN_DEFAULT_DRIVE 0x80 128 #define SANBOOT_INLINE( _subsys, _api_func ) \ 129 SINGLE_API_INLINE ( SANBOOT_PREFIX_ ## _subsys, _api_func ) 138 #define PROVIDE_SANBOOT( _subsys, _api_func, _func ) \ 139 PROVIDE_SINGLE_API ( SANBOOT_PREFIX_ ## _subsys, _api_func, _func ) 147 #define PROVIDE_SANBOOT_INLINE( _subsys, _api_func ) \ 148 PROVIDE_SINGLE_API_INLINE ( SANBOOT_PREFIX_ ## _subsys, _api_func ) 156 #include <bits/sanboot.h> 168 unsigned int flags );
196 #define for_each_sandev( sandev ) \ 197 list_for_each_entry ( (sandev), &san_devices, list ) 270 unsigned int flags );
static struct san_device * sandev_get(struct san_device *sandev)
Get reference to SAN device.
int san_describe(void)
Describe SAN devices for SAN-booted operating system.
int san_hook(unsigned int drive, struct uri **uris, unsigned int count, unsigned int flags)
Hook SAN device.
struct san_path path[0]
SAN paths.
struct list_head list
List of open/closed paths.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int command_rc
Command status.
int san_boot(unsigned int drive, struct san_boot_config *config)
Attempt to boot from a SAN device.
struct interface block
Underlying block device interface.
unsigned long long uint64_t
struct list_head san_devices
static void sandev_put(struct san_device *sandev)
Drop reference to SAN device.
static int sandev_needs_reopen(struct san_device *sandev)
Check if SAN device needs to be reopened.
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
int register_sandev(struct san_device *sandev, unsigned int drive, unsigned int flags)
Register SAN device.
Standard do-nothing sanboot interface.
uint8_t drive
Drive number.
struct list_head opened
List of opened SAN paths.
Uniform Resource Identifiers.
void unregister_sandev(struct san_device *sandev)
Unregister SAN device.
unsigned int san_default_drive(void)
Get default SAN drive number.
unsigned int index
Path index.
A doubly-linked list entry (or list head)
static int have_sandevs(void)
There exist some SAN devices.
#define list_empty(list)
Test whether a list is empty.
uint32_t userptr_t
A pointer to a user buffer.
unsigned int drive
Drive number.
SAN boot configuration parameters.
union uuid * uuid
UUID (or NULL to ignore UUID)
static uint64_t sandev_capacity(struct san_device *sandev)
Calculate SAN device capacity.
uint16_t count
Number of entries.
const char * filename
Boot filename (or NULL to use default)
unsigned int blksize_shift
Block size shift.
uint64_t blocks
Total number of blocks.
sanboot API configuration
struct list_head closed
List of closed SAN paths.
int is_cdrom
Drive is a CD-ROM.
#define ref_get(refcnt)
Get additional reference to object.
struct list_head list
List of SAN devices.
const char * label
Filesystem label (or NULL to ignore volume label)
uint64_t lba
Starting block number.
Device should not be included in description tables.
unsigned int paths
Number of paths.
struct uri * uri
SAN device URI.
struct block_device_capacity capacity
Raw block device capacity.
void san_unhook(unsigned int drive)
Unhook SAN device.
An ACPI descriptor (used to construct ACPI tables)
struct san_device * sandev_next(unsigned int drive)
Find next SAN device by drive number.
struct refcnt refcnt
Reference count.
int sandev_reset(struct san_device *sandev)
Reset SAN device.
int sandev_write(struct san_device *sandev, uint64_t lba, unsigned int count, userptr_t buffer)
Write to SAN device.
const char * extra
Required extra filename (or NULL to ignore)
void * priv
Driver private data.
static size_t sandev_blksize(struct san_device *sandev)
Calculate SAN device block size.
int sandev_reopen(struct san_device *sandev)
(Re)open SAN device
A Uniform Resource Identifier.
struct san_path * active
Current active path.
int sandev_read(struct san_device *sandev, uint64_t lba, unsigned int count, userptr_t buffer)
Read from SAN device.
struct acpi_descriptor * desc
ACPI descriptor (if applicable)
#define NULL
NULL pointer (VOID *)
struct san_device * sandev
Containing SAN device.
struct san_device * sandev_find(unsigned int drive)
Find SAN device by drive number.
#define ref_put(refcnt)
Drop reference to object.
size_t blksize
Block size.
san_device_flags
SAN device flags.
struct san_device * alloc_sandev(struct uri **uris, unsigned int count, size_t priv_size)
Allocate SAN device.