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 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 FILE_SECBOOT ( PERMITTED );
12 
13 #include <ipxe/interface.h>
14 #include <ipxe/efi/efi.h>
16 
17 struct net_device;
18 struct uri;
19 struct iscsi_session;
20 struct aoe_device;
21 struct fcp_description;
22 struct ib_srp_device;
23 struct usb_function;
24 union uuid;
25 
26 /**
27  * Terminate device path
28  *
29  * @v end End of device path to fill in
30  */
32 
33  end->Type = END_DEVICE_PATH_TYPE;
35  end->Length[0] = sizeof ( *end );
36  end->Length[1] = 0;
37 }
38 
46 extern size_t efi_path_len ( EFI_DEVICE_PATH_PROTOCOL *path );
47 extern int efi_path_check ( EFI_DEVICE_PATH_PROTOCOL *path, size_t max );
48 extern void * efi_path_mac ( EFI_DEVICE_PATH_PROTOCOL *path );
49 extern unsigned int efi_path_vlan ( EFI_DEVICE_PATH_PROTOCOL *path );
50 extern int efi_path_guid ( EFI_DEVICE_PATH_PROTOCOL *path, union uuid *uuid );
51 extern struct uri * efi_path_uri ( EFI_DEVICE_PATH_PROTOCOL *path );
53  ... );
55 extern EFI_DEVICE_PATH_PROTOCOL * efi_uri_path ( struct uri *uri );
57 efi_iscsi_path ( struct iscsi_session *iscsi );
58 extern EFI_DEVICE_PATH_PROTOCOL * efi_aoe_path ( struct aoe_device *aoedev );
61 efi_ib_srp_path ( struct ib_srp_device *ib_srp );
62 extern EFI_DEVICE_PATH_PROTOCOL * efi_usb_path ( struct usb_function *func );
64  size_t len );
65 extern 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 */
EFI_DEVICE_PATH_PROTOCOL * efi_iscsi_path(struct iscsi_session *iscsi)
Construct EFI device path for iSCSI device.
Definition: efi_path.c:506
#define max(x, y)
Definition: ath.h:41
The device path protocol as defined in UEFI 2.0.
EFI_DEVICE_PATH_PROTOCOL * efi_path_end(EFI_DEVICE_PATH_PROTOCOL *path)
Find end of device path.
Definition: efi_path.c:163
An iSCSI session.
Definition: iscsi.h:545
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
#define END_DEVICE_PATH_TYPE
Definition: DevicePath.h:1394
uint32_t first
First block in range.
Definition: pccrr.h:15
A universally unique ID.
Definition: uuid.h:16
EFI_DEVICE_PATH_PROTOCOL * efi_boot_path(unsigned int number)
Get EFI device path for numbered boot option.
Definition: efi_path.c:814
This protocol can be used on any device handle to obtain generic path/location information concerning...
Definition: DevicePath.h:46
unsigned int efi_path_vlan(EFI_DEVICE_PATH_PROTOCOL *path)
Get VLAN tag from device path.
Definition: efi_path.c:237
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_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
An AoE device.
Definition: aoe.h:116
static void efi_path_terminate(EFI_DEVICE_PATH_PROTOCOL *end)
Terminate device path.
Definition: efi_path.h:31
void * efi_path_mac(EFI_DEVICE_PATH_PROTOCOL *path)
Get MAC address from device path.
Definition: efi_path.c:213
struct ena_llq_option desc
Descriptor counts.
Definition: ena.h:20
EFI_DEVICE_PATH_PROTOCOL * efi_current_boot_path(void)
Get EFI device path for current boot option.
Definition: efi_path.c:887
EFI_DEVICE_PATH_PROTOCOL * efi_uri_path(struct uri *uri)
Construct EFI device path for URI.
Definition: efi_path.c:469
An object interface.
Definition: interface.h:125
EFI_DEVICE_PATH_PROTOCOL * efi_path_next(EFI_DEVICE_PATH_PROTOCOL *path)
Find next element in device path.
Definition: efi_path.c:119
Object interfaces.
ring len
Length.
Definition: dwmac.h:231
const char * path
Path (after URI decoding)
Definition: uri.h:81
static struct net_device * netdev
Definition: gdbudp.c:52
EFI_DEVICE_PATH_PROTOCOL * efi_describe(struct interface *interface)
Describe object as an EFI device path.
Definition: efi_path.c:920
EFI_DEVICE_PATH_PROTOCOL * efi_paths(EFI_DEVICE_PATH_PROTOCOL *first,...)
Concatenate EFI device paths.
Definition: efi_path.c:344
int efi_path_check(EFI_DEVICE_PATH_PROTOCOL *path, size_t max)
Check that device path is well-formed.
Definition: efi_path.c:187
A network device.
Definition: netdevice.h:353
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_aoe_path(struct aoe_device *aoedev)
Construct EFI device path for AoE device.
Definition: efi_path.c:572
An Infiniband SRP device.
Definition: ib_srp.h:76
An FCP device description.
Definition: fcp.h:168
EFI API.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
FILE_SECBOOT(PERMITTED)
#define END_ENTIRE_DEVICE_PATH_SUBTYPE
Definition: DevicePath.h:1395
EFI_DEVICE_PATH_PROTOCOL * efi_fcp_path(struct fcp_description *desc)
Construct EFI device path for Fibre Channel device.
Definition: efi_path.c:616
struct uri * efi_path_uri(EFI_DEVICE_PATH_PROTOCOL *path)
Parse URI from device path.
Definition: efi_path.c:301
EFI_DEVICE_PATH_PROTOCOL * efi_netdev_path(struct net_device *netdev)
Construct EFI device path for network device.
Definition: efi_path.c:411
uint32_t end
Ending offset.
Definition: netvsc.h:18
A Uniform Resource Identifier.
Definition: uri.h:65
A USB function.
Definition: usb.h:674
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