129 path = ( ( (
void * ) path ) +
176 return ( ( (
void * )
end ) - ( (
void * ) path ) );
188 size_t remaining =
max;
192 for ( ; ; path =
next ) {
193 if ( remaining <
sizeof ( *path ) )
198 len = ( ( (
void * )
next ) - ( (
void * ) path ) );
199 if ( remaining <
len )
222 return &
mac->MacAddress;
315 len = ( ( (
path->Length[1] << 8 ) |
path->Length[0] )
373 dst = ( ( (
void * ) dst ) +
len );
425 len = ( prefix_len +
sizeof ( *macpath ) +
sizeof ( *vlanpath ) +
435 macpath = ( ( (
void * )
path ) + prefix_len );
445 vlanpath = ( ( (
void * ) macpath ) +
sizeof ( *macpath ) );
450 end = ( ( (
void * ) vlanpath ) +
sizeof ( *vlanpath ) );
452 end = ( ( (
void * ) macpath ) +
sizeof ( *macpath ) );
478 uripath_len = (
sizeof ( *uripath ) + uri_len );
479 len = ( uripath_len +
sizeof ( *end ) );
487 uripath = ( (
void * )
path );
493 end = ( ( (
void * )
path ) + uripath_len );
532 iscsi_len = (
sizeof ( *iscsipath ) + name_len );
533 len = ( prefix_len + iscsi_len +
sizeof ( *end ) );
541 memcpy ( path, netpath, prefix_len );
542 iscsipath = ( ( (
void * ) path ) + prefix_len );
548 name = ( ( (
void * ) iscsipath ) +
sizeof ( *iscsipath ) );
550 end = ( ( (
void * )
name ) + name_len );
585 memset ( &satapath, 0,
sizeof ( satapath ) );
588 satapath.sata.Header.Length[0] =
sizeof ( satapath.sata );
589 satapath.sata.HBAPortNumber = aoedev->
major;
590 satapath.sata.PortMultiplierPortNumber = aoedev->
minor;
622 path =
zalloc (
sizeof ( *path ) );
629 path->fc.Header.Length[0] =
sizeof ( path->fc );
630 memcpy ( path->fc.WWN, &
desc->wwn, sizeof ( path->fc.WWN ) );
631 memcpy ( path->fc.Lun, &
desc->lun, sizeof ( path->fc.Lun ) );
634 return &path->fc.Header;
660 len = ( prefix_len +
sizeof ( *ibpath ) +
sizeof ( *end ) );
668 memcpy ( path, parent, prefix_len );
669 ibpath = ( ( (
void * ) path ) + prefix_len );
681 end = ( ( (
void * ) ibpath ) +
sizeof ( *ibpath ) );
715 len = ( prefix_len + (
count *
sizeof ( *usbpath ) ) +
724 memcpy ( path, parent, prefix_len );
725 end = ( ( (
void * ) path ) +
len -
sizeof ( *end ) );
727 usbpath = ( ( (
void * )
end ) -
sizeof ( *usbpath ) );
729 for ( ; usb ; usbpath--, usb = usb->
port->
hub->
usb ) {
759 if (
len <
sizeof ( *load ) ) {
760 DBGC ( load,
"EFI load option too short for header:\n" );
766 wdesc = ( ( (
void * ) load ) +
sizeof ( *load ) );
767 wmax = ( (
len -
sizeof ( *load ) ) /
sizeof ( wdesc[0] ) );
768 wlen =
wcsnlen ( wdesc, wmax );
769 if ( wlen == wmax ) {
770 DBGC ( load,
"EFI load option has unterminated " 777 path = ( ( (
void * ) load ) +
sizeof ( *load ) +
778 ( wlen *
sizeof ( wdesc[0] ) ) + 2 );
779 path_max = (
len -
sizeof ( *load ) - ( wlen *
sizeof ( wdesc[0] ) )
782 DBGC ( load,
"EFI load option too short for path(s):\n" );
789 DBGC ( load,
"EFI load option has unterminated device " 796 copy =
malloc ( path_max );
799 memcpy ( copy, path, path_max );
825 efi_snprintf ( wname, (
sizeof ( wname ) /
sizeof ( wname[0] ) ),
826 "Boot%04X", number );
833 DBGC ( rs,
"EFI could not get size of %ls: %s\n",
849 DBGC ( rs,
"EFI could not read %ls: %s\n",
853 DBGC2 ( rs,
"EFI boot option %ls is:\n", wname );
860 DBGC ( rs,
"EFI could not parse %ls: %s\n",
889 CHAR16 wname[] = L
"BootCurrent";
897 size =
sizeof ( current );
899 ¤t ) != 0 ) ) {
901 DBGC ( rs,
"EFI could not read %ls: %s\n",
927 path =
op (
object );
975 if ( ( !! dns->
IsIPv6 ) !=
984 for ( i = 0 ; i <
count ; i++ ) {
986 if ( frag_len > pathset->
len )
987 frag_len = pathset->
len;
1056 if ( ( path->
Type != pathset->
type ) ||
1061 if ( ( ret = pathset->
fetch ( pathset, path,
1098 pathsets->
path = path;
1123 DBGC (
settings,
"EFI path %s could not register for %s: %s\n",
#define BBS_BBS_DP
BIOS Boot Specification Device Path SubType.
static int efi_path_fetch(struct settings *settings, struct setting *setting, void *data, size_t len)
Fetch value of EFI device path setting.
#define MSG_FIBRECHANNELEX_DP
Fibre Channel Ex SubType.
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
unsigned int efi_path_vlan(EFI_DEVICE_PATH_PROTOCOL *path)
Get VLAN tag from device path.
union srp_port_id srp
SRP version of port identifier.
Dynamic Host Configuration Protocol.
UINT16 FilePathListLength
Length in bytes of the FilePathList.
struct net_device * tcpip_netdev(struct sockaddr_tcpip *st_dest)
Determine transmitting network device.
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON
uint8_t ll_addr_len
Link-layer address length.
struct ipxe_ib_sbft sbft
Boot firmware table parameters.
uint8_t interface[0]
List of interface numbers.
static EFI_DEVICE_PATH_PROTOCOL * efi_parent_path(struct device *dev)
Construct EFI parent device path.
size_t wcsnlen(const wchar_t *string, size_t max)
Calculate length of wide-character string.
#define END_DEVICE_PATH_TYPE
struct sockaddr target_sockaddr
Target socket address (for boot firmware table)
uint8_t offset
Offset within device path.
unsigned int count
Number of interfaces.
128 bit buffer containing a unique identifier value.
uint32_t first
First block in range.
UINT8 IfType
Network interface type(i.e.
int(* fetch)(struct efi_path_setting *pathset, EFI_DEVICE_PATH_PROTOCOL *path, void *data, size_t len)
Fetch setting.
UINT8 SignatureType
Type of Disk Signature: (Unused values reserved).
u16 fc
802.11 Frame Control field
#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL
SRP target port identifier for Infiniband.
EFI_MAC_ADDRESS MacAddress
The MAC address for a network interface padded with 0s.
uint16_t size
Buffer size.
uint16_t major
Major number.
EFI_DEVICE_PATH_PROTOCOL * path
Device path.
#define ENOENT
No such file or directory.
struct device * dev
Underlying device.
union srp_port_id target
Target port identifier.
static struct settings_operations efi_path_settings_operations
EFI device path settings operations.
struct settings settings
Settings interface.
static int efi_path_fetch_fixed(struct efi_path_setting *pathset, EFI_DEVICE_PATH_PROTOCOL *path, void *data, size_t len)
Fetch an EFI device path fixed-size setting.
#define MSG_MAC_ADDR_DP
MAC Address Device Path SubType.
size_t efi_path_len(EFI_DEVICE_PATH_PROTOCOL *path)
Find length of device path (excluding terminator)
EFI_DEVICE_PATH_PROTOCOL Header
EFI_DEVICE_PATH_PROTOCOL Header
struct net_driver efi_path_net_driver __net_driver
EFI path settings per-netdevice driver.
union ib_gid dgid
Destination GID.
This protocol can be used on any device handle to obtain generic path/location information concerning...
EFI_DEVICE_PATH_PROTOCOL * efi_uri_path(struct uri *uri)
Construct EFI device path for URI.
#define offsetof(type, field)
Get offset of a field within a structure.
uint8_t mac[ETH_ALEN]
MAC address.
UINT16 LoginOption
iSCSI Login Options.
#define EFI_BUFFER_TOO_SMALL
Enumeration of EFI_STATUS.
static struct @438 efi_dummy_parent_path
Dummy parent device path.
Uniform Resource Identifiers.
An EFI device path settings block.
EFI_DEVICE_PATH_PROTOCOL * efi_boot_path(unsigned int number)
Get EFI device path for numbered boot option.
#define MESSAGING_DEVICE_PATH
Messaging Device Paths.
An EFI device path setting.
UINT32 ResourceFlags
Flags to help identify/manage InfiniBand device path elements: Bit 0 - IOC/Service (0b = IOC,...
A network upper-layer driver.
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
static void settings_init(struct settings *settings, struct settings_operations *op, struct refcnt *refcnt, const struct settings_scope *default_scope)
Initialise a settings block.
void * intf_object(struct interface *intf)
Get pointer to object containing object interface.
static void efi_path_terminate(EFI_DEVICE_PATH_PROTOCOL *end)
Terminate device path.
EFI_DEVICE_PATH_PROTOCOL * efi_path_prev(EFI_DEVICE_PATH_PROTOCOL *path, EFI_DEVICE_PATH_PROTOCOL *curr)
Find previous element of device path.
struct interface * intf
Original interface.
static void uuid_mangle(union uuid *uuid)
Change UUID endianness.
EFI_DEVICE_PATH_PROTOCOL * efi_paths(EFI_DEVICE_PATH_PROTOCOL *first,...)
Concatenate EFI device paths.
struct ena_llq_option desc
Descriptor counts.
EFI_IP_ADDRESS DnsServerIp[]
Instance of the DNS server address.
#define ENOMEM
Not enough space.
struct usb_device * usb
Underlying USB device, if any.
#define MSG_URI_DP
Uniform Resource Identifiers (URI) Device Path SubType.
EFI_DEVICE_PATH_PROTOCOL * efi_loaded_image_path
Device path for the loaded image's device handle.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
EFI_DEVICE_PATH_PROTOCOL Header
struct usb_port * port
USB port.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define container_of(ptr, type, field)
Get containing structure.
EFI_DEVICE_PATH_PROTOCOL * efi_current_boot_path(void)
Get EFI device path for current boot option.
#define MEDIA_HARDDRIVE_DP
Hard Drive Media Device Path SubType.
int efi_path_check(EFI_DEVICE_PATH_PROTOCOL *path, size_t max)
Check that device path is well-formed.
#define DHCP_SETTINGS_NAME
Settings block name used for DHCP responses.
struct sbft_srp_subtable srp
The SRP subtable.
const char * path
Path (after URI decoding)
#define MSG_SATA_DP
SATA Device Path SubType.
static struct net_device * netdev
UINT8 ParentPortNumber
USB Parent Port Number.
int efi_snprintf(wchar_t *wbuf, size_t wsize, const char *fmt,...)
Write a formatted string to a buffer.
This Device Path is used to describe the booting of non-EFI-aware operating systems.
Transport-network layer interface.
static unsigned int count
Number of entries.
void * efi_path_mac(EFI_DEVICE_PATH_PROTOCOL *path)
Get MAC address from device path.
UINT16 VlanId
VLAN identifier (0-4094).
EFI_GUID efi_global_variable
Global variable GUID.
size_t format_uri(const struct uri *uri, char *buf, size_t len)
Format URI.
const struct setting_type * type
Setting type.
An Infiniband SRP sBFT created by iPXE.
#define MSG_IPv4_DP
IPv4 Device Path SubType.
EFI_DEVICE_PATH_PROTOCOL * efi_fcp_path(struct fcp_description *desc)
Construct EFI device path for Fibre Channel device.
EFI_GET_VARIABLE GetVariable
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
UINT64 Lun
iSCSI Logical Unit Number.
#define BBS_DEVICE_PATH
BIOS Boot Specification Device Path.
EFI_DEVICE_PATH_PROTOCOL end
union ib_guid service_id
Service ID.
uint8_t id
Request identifier.
static unsigned int usb_depth(struct usb_device *usb)
Get USB depth.
CHAR8 Uri[]
Instance of the URI pursuant to RFC 3986.
EFI_DEVICE_PATH_PROTOCOL * efi_ib_srp_path(struct ib_srp_device *ib_srp)
Construct EFI device path for Infiniband SRP device.
EFI_DEVICE_PATH_PROTOCOL Header
EFI Runtime Services Table.
char * strerror(int errno)
Retrieve string representation of error number.
EFI_DEVICE_PATH_PROTOCOL * efi_netdev_path(struct net_device *netdev)
Construct EFI device path for network device.
struct refcnt refcnt
Reference counter.
static void(* free)(struct refcnt *refcnt))
EFI_DEVICE_PATH_PROTOCOL * efi_usb_path(struct usb_function *func)
Construct EFI device path for USB function.
struct scsi_lun lun
SCSI LUN (for boot firmware table)
void * zalloc(size_t size)
Allocate cleared memory.
UINT8 InterfaceNumber
USB Interface Number.
static int efi_path_net_probe(struct net_device *netdev, void *priv)
Create per-netdevice EFI path settings.
#define MSG_ISCSI_DP
iSCSI Device Path SubType
#define MSG_IPv6_DP
IPv6 Device Path SubType.
size_t strlen(const char *src)
Get length of string.
Settings block operations.
UINT64 DeviceId
64-bit persistent ID of remote device.
#define MSG_INFINIBAND_DP
InfiniBand Device Path SubType.
#define MSG_DNS_DP
DNS Device Path SubType.
#define MEDIA_DEVICE_PATH
UINT64 UINTN
Unsigned value of native width.
struct usb_device * usb
USB device.
An Infiniband SRP device.
uint16_t ll_proto
Link-layer protocol.
uint32_t next
Next descriptor address.
void * malloc(size_t size)
Allocate memory.
EFI_DEVICE_PATH_PROTOCOL * efi_path_next(EFI_DEVICE_PATH_PROTOCOL *path)
Find next element in device path.
An FCP device description.
EFI_DEVICE_PATH_PROTOCOL * efi_iscsi_path(struct iscsi_session *iscsi)
Construct EFI device path for iSCSI device.
static int efi_path_fetch_dns(struct efi_path_setting *pathset, EFI_DEVICE_PATH_PROTOCOL *path, void *data, size_t len)
Fetch an EFI device path DNS setting.
uint8_t len
Length (if fixed)
struct device * dev
Underlying hardware device.
UINT64 TargetPortId
64-bit persistent ID of remote IOC port.
Network device management.
UINT8 Signature[16]
Signature unique to this partition: If SignatureType is 0, this field has to be initialized with 16 z...
#define MSG_VLAN_DP
VLAN Device Path SubType.
static uint16_t struct vmbus_xfer_pages_operations * op
UINT64 ServiceId
64-bit unique identifier to remote IOC or server process.
#define END_ENTIRE_DEVICE_PATH_SUBTYPE
char * target_iqn
Target IQN.
EFI_DEVICE_PATH_PROTOCOL * efi_describe(struct interface *intf)
Describe object as an EFI device path.
EFI_RUNTIME_SERVICES * RuntimeServices
A pointer to the EFI Runtime Services Table.
char name[NETDEV_NAME_LEN]
Name of this network device.
static struct efi_path_setting efi_path_settings[]
EFI device path settings.
EFI_DEVICE_PATH_PROTOCOL Header
UINT8 Length[2]
Specific Device Path data.
SCSI RDMA Protocol over Infiniband.
UINT8 PortGid[16]
128-bit Global Identifier for remote fabric port.
static struct tlan_private * priv
__builtin_va_list va_list
Universal Serial Bus (USB)
EFI_DEVICE_PATH_PROTOCOL * efi_aoe_path(struct aoe_device *aoedev)
Construct EFI device path for AoE device.
struct uri * efi_path_uri(EFI_DEVICE_PATH_PROTOCOL *path)
Parse URI from device path.
struct ib_device * ibdev
Infiniband device.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
struct usb_hub * hub
USB hub.
UINT8 SubType
Varies by Type 0xFF End Entire Device Path, or 0x01 End This Instance of a Device Path and start a ne...
int(* fetch)(struct settings *settings, struct setting *setting, void *data, size_t len)
Fetch value of setting.
The Hard Drive Media Device Path is used to represent a partition on a hard drive.
const struct setting * setting
Setting.
void intf_put(struct interface *intf)
Decrement reference count on an object interface.
uint8_t minor
Minor number.
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" return dest
struct net_device * netdev
Network device.
uint8_t data[48]
Additional event data.
struct sbft_ib_subtable ib
The Infiniband subtable.
UINT8 Type
0x01 Hardware Device Path.
struct usb_function_descriptor desc
Function descriptor.
A Uniform Resource Identifier.
int register_settings(struct settings *settings, struct settings *parent, const char *name)
Register settings block.
EFI_SYSTEM_TABLE * efi_systab
EFI_DEVICE_PATH_PROTOCOL * path
EFI device path copy.
struct efi_device * efidev_parent(struct device *dev)
Get parent EFI device.
typeof(acpi_finder=acpi_find)
ACPI table finder.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
#define SIGNATURE_TYPE_GUID
static unsigned int vlan_tag(struct net_device *netdev)
Get the VLAN tag.
#define va_start(ap, last)
UINT8 IsIPv6
Indicates the DNS server address is IPv4 or IPv6 address.
struct settings * find_child_settings(struct settings *parent, const char *name)
Find child settings block.
struct device dev
Generic device.
FILE_LICENCE(GPL2_OR_LATER)
uint64_t tag
Identity tag.
struct device dev
Generic device.
EFI_DEVICE_PATH_PROTOCOL * efi_load_path(EFI_LOAD_OPTION *load, size_t len)
Get EFI device path from load option.
uint8_t subtype
Path subtype.
int setting_cmp(const struct setting *a, const struct setting *b)
Compare two settings.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
#define NULL
NULL pointer (VOID *)
EFI_DEVICE_PATH_PROTOCOL * efi_path_end(EFI_DEVICE_PATH_PROTOCOL *path)
Find end of device path.
#define intf_get_dest_op(intf, type, dest)
Get object interface destination and operation method.
int efi_path_guid(EFI_DEVICE_PATH_PROTOCOL *path, union uuid *guid)
Get partition GUID from device path.
EFI_DEVICE_PATH_PROTOCOL Header
#define MSG_USB_DP
USB Device Path SubType.
struct ll_protocol * ll_protocol
Link-layer protocol.
struct uri * parse_uri(const char *uri_string)
Parse URI.
void * memset(void *dest, int character, size_t len) __nonnull
PACKED union @541::@555 Header
#define efi_describe_TYPE(object_type)