iPXE
efi_path.h
Go to the documentation of this file.
1#ifndef _IPXE_EFI_PATH_H
2#define _IPXE_EFI_PATH_H
3
4/** @file
5 *
6 * EFI device paths
7 *
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <ipxe/interface.h>
14#include <ipxe/efi/efi.h>
16
17struct net_device;
18struct uri;
19struct iscsi_session;
20struct aoe_device;
21struct fcp_description;
22struct ib_srp_device;
23struct usb_function;
24union uuid;
25
26/**
27 * Terminate device path
28 *
29 * @v end End of device path to fill in
30 */
32
35 end->Length[0] = sizeof ( *end );
36 end->Length[1] = 0;
37}
38
46extern size_t efi_path_len ( EFI_DEVICE_PATH_PROTOCOL *path );
47extern int efi_path_check ( EFI_DEVICE_PATH_PROTOCOL *path, size_t max );
48extern void * efi_path_mac ( EFI_DEVICE_PATH_PROTOCOL *path );
49extern unsigned int efi_path_vlan ( EFI_DEVICE_PATH_PROTOCOL *path );
50extern int efi_path_guid ( EFI_DEVICE_PATH_PROTOCOL *path, union uuid *uuid );
53 ... );
55extern EFI_DEVICE_PATH_PROTOCOL * efi_uri_path ( struct uri *uri );
57efi_iscsi_path ( struct iscsi_session *iscsi );
58extern EFI_DEVICE_PATH_PROTOCOL * efi_aoe_path ( struct aoe_device *aoedev );
61efi_ib_srp_path ( struct ib_srp_device *ib_srp );
62extern EFI_DEVICE_PATH_PROTOCOL * efi_usb_path ( struct usb_function *func );
64 size_t len );
65extern EFI_DEVICE_PATH_PROTOCOL * efi_boot_path ( unsigned int number );
67
69#define efi_describe_TYPE( object_type ) \
70 typeof ( EFI_DEVICE_PATH_PROTOCOL * ( object_type ) )
71
72#endif /* _IPXE_EFI_PATH_H */
The device path protocol as defined in UEFI 2.0.
#define END_ENTIRE_DEVICE_PATH_SUBTYPE
#define END_DEVICE_PATH_TYPE
struct _EFI_LOAD_OPTION EFI_LOAD_OPTION
#define max(x, y)
Definition ath.h:41
ring len
Length.
Definition dwmac.h:226
EFI_DEVICE_PATH_PROTOCOL * efi_describe(struct interface *interface)
Describe object as an EFI device path.
Definition efi_path.c:920
unsigned int efi_path_vlan(EFI_DEVICE_PATH_PROTOCOL *path)
Get VLAN tag from device path.
Definition efi_path.c:237
EFI_DEVICE_PATH_PROTOCOL * efi_current_boot_path(void)
Get EFI device path for current boot option.
Definition efi_path.c:887
size_t efi_path_len(EFI_DEVICE_PATH_PROTOCOL *path)
Find length of device path (excluding terminator)
Definition efi_path.c:174
EFI_DEVICE_PATH_PROTOCOL * efi_paths(EFI_DEVICE_PATH_PROTOCOL *first,...)
Concatenate EFI device paths.
Definition efi_path.c:344
EFI_DEVICE_PATH_PROTOCOL * efi_usb_path(struct usb_function *func)
Construct EFI device path for USB function.
Definition efi_path.c:697
EFI_DEVICE_PATH_PROTOCOL * efi_load_path(EFI_LOAD_OPTION *load, size_t len)
Get EFI device path from load option.
Definition efi_path.c:750
EFI_DEVICE_PATH_PROTOCOL * efi_path_prev(EFI_DEVICE_PATH_PROTOCOL *path, EFI_DEVICE_PATH_PROTOCOL *curr)
Find previous element of device path.
Definition efi_path.c:145
EFI_DEVICE_PATH_PROTOCOL * efi_netdev_path(struct net_device *netdev)
Construct EFI device path for network device.
Definition efi_path.c:411
static void efi_path_terminate(EFI_DEVICE_PATH_PROTOCOL *end)
Terminate device path.
Definition efi_path.h:31
EFI_DEVICE_PATH_PROTOCOL * efi_fcp_path(struct fcp_description *desc)
Construct EFI device path for Fibre Channel device.
Definition efi_path.c:616
EFI_DEVICE_PATH_PROTOCOL * efi_iscsi_path(struct iscsi_session *iscsi)
Construct EFI device path for iSCSI device.
Definition efi_path.c:506
EFI_DEVICE_PATH_PROTOCOL * efi_aoe_path(struct aoe_device *aoedev)
Construct EFI device path for AoE device.
Definition efi_path.c:572
EFI_DEVICE_PATH_PROTOCOL * efi_path_next(EFI_DEVICE_PATH_PROTOCOL *path)
Find next element in device path.
Definition efi_path.c:119
EFI_DEVICE_PATH_PROTOCOL * efi_uri_path(struct uri *uri)
Construct EFI device path for URI.
Definition efi_path.c:469
struct uri * efi_path_uri(EFI_DEVICE_PATH_PROTOCOL *path)
Parse URI from device path.
Definition efi_path.c:301
int efi_path_check(EFI_DEVICE_PATH_PROTOCOL *path, size_t max)
Check that device path is well-formed.
Definition efi_path.c:187
EFI_DEVICE_PATH_PROTOCOL * efi_ib_srp_path(struct ib_srp_device *ib_srp)
Construct EFI device path for Infiniband SRP device.
Definition efi_path.c:644
int efi_path_guid(EFI_DEVICE_PATH_PROTOCOL *path, union uuid *uuid)
Get partition GUID from device path.
Definition efi_path.c:261
EFI_DEVICE_PATH_PROTOCOL * efi_boot_path(unsigned int number)
Get EFI device path for numbered boot option.
Definition efi_path.c:814
void * efi_path_mac(EFI_DEVICE_PATH_PROTOCOL *path)
Get MAC address from device path.
Definition efi_path.c:213
EFI_DEVICE_PATH_PROTOCOL * efi_path_end(EFI_DEVICE_PATH_PROTOCOL *path)
Find end of device path.
Definition efi_path.c:163
struct ena_llq_option desc
Descriptor counts.
Definition ena.h:9
static struct net_device * netdev
Definition gdbudp.c:53
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
EFI API.
Object interfaces.
uint32_t end
Ending offset.
Definition netvsc.h:7
uint32_t first
First block in range.
Definition pccrr.h:1
This protocol can be used on any device handle to obtain generic path/location information concerning...
Definition DevicePath.h:46
An AoE device.
Definition aoe.h:116
An FCP device description.
Definition fcp.h:168
An Infiniband SRP device.
Definition ib_srp.h:76
An object interface.
Definition interface.h:125
An iSCSI session.
Definition iscsi.h:545
A network device.
Definition netdevice.h:353
A Uniform Resource Identifier.
Definition uri.h:65
const char * path
Path (after URI decoding)
Definition uri.h:81
A USB function.
Definition usb.h:674
A universally unique ID.
Definition uuid.h:16