1 #ifndef _IPXE_SANBOOT_H 2 #define _IPXE_SANBOOT_H 105 #define SANBOOT_INLINE( _subsys, _api_func ) \ 106 SINGLE_API_INLINE ( SANBOOT_PREFIX_ ## _subsys, _api_func ) 115 #define PROVIDE_SANBOOT( _subsys, _api_func, _func ) \ 116 PROVIDE_SINGLE_API ( SANBOOT_PREFIX_ ## _subsys, _api_func, _func ) 124 #define PROVIDE_SANBOOT_INLINE( _subsys, _api_func ) \ 125 PROVIDE_SINGLE_API_INLINE ( SANBOOT_PREFIX_ ## _subsys, _api_func ) 145 unsigned int flags );
173 #define for_each_sandev( sandev ) \ 174 list_for_each_entry ( (sandev), &san_devices, list ) 246 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.
uint32_t lba
Start address.
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.
int san_boot(unsigned int drive, const char *filename)
Attempt to boot from a SAN device.
struct list_head list
List of open/closed paths.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int command_rc
Command status.
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.
x86-specific sanboot API implementations
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.
unsigned int drive
Drive number.
static uint64_t sandev_capacity(struct san_device *sandev)
Calculate SAN device capacity.
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.
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 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.
void * priv
Driver private data.
uint16_t count
Number of entries.
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.
unsigned long userptr_t
A pointer to a user buffer.
struct san_device * alloc_sandev(struct uri **uris, unsigned int count, size_t priv_size)
Allocate SAN device.