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 
12 #include <ipxe/interface.h>
13 #include <ipxe/efi/efi.h>
15 
16 struct net_device;
17 struct uri;
18 struct iscsi_session;
19 struct aoe_device;
20 struct fcp_description;
21 struct ib_srp_device;
22 struct usb_function;
23 union uuid;
24 
25 /**
26  * Terminate device path
27  *
28  * @v end End of device path to fill in
29  */
31 
32  end->Type = END_DEVICE_PATH_TYPE;
34  end->Length[0] = sizeof ( *end );
35  end->Length[1] = 0;
36 }
37 
45 extern size_t efi_path_len ( EFI_DEVICE_PATH_PROTOCOL *path );
46 extern int efi_path_check ( EFI_DEVICE_PATH_PROTOCOL *path, size_t max );
47 extern void * efi_path_mac ( EFI_DEVICE_PATH_PROTOCOL *path );
48 extern unsigned int efi_path_vlan ( EFI_DEVICE_PATH_PROTOCOL *path );
49 extern int efi_path_guid ( EFI_DEVICE_PATH_PROTOCOL *path, union uuid *uuid );
50 extern struct uri * efi_path_uri ( EFI_DEVICE_PATH_PROTOCOL *path );
52  ... );
54 extern EFI_DEVICE_PATH_PROTOCOL * efi_uri_path ( struct uri *uri );
56 efi_iscsi_path ( struct iscsi_session *iscsi );
57 extern EFI_DEVICE_PATH_PROTOCOL * efi_aoe_path ( struct aoe_device *aoedev );
60 efi_ib_srp_path ( struct ib_srp_device *ib_srp );
61 extern EFI_DEVICE_PATH_PROTOCOL * efi_usb_path ( struct usb_function *func );
63  size_t len );
64 extern EFI_DEVICE_PATH_PROTOCOL * efi_boot_path ( unsigned int number );
66 
68 #define efi_describe_TYPE( object_type ) \
69  typeof ( EFI_DEVICE_PATH_PROTOCOL * ( object_type ) )
70 
71 #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:505
#define max(x, y)
Definition: ath.h:40
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:162
An iSCSI session.
Definition: iscsi.h:544
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:144
#define END_DEVICE_PATH_TYPE
Definition: DevicePath.h:1393
uint32_t first
First block in range.
Definition: pccrr.h:14
A universally unique ID.
Definition: uuid.h:15
EFI_DEVICE_PATH_PROTOCOL * efi_boot_path(unsigned int number)
Get EFI device path for numbered boot option.
Definition: efi_path.c:813
This protocol can be used on any device handle to obtain generic path/location information concerning...
Definition: DevicePath.h:45
unsigned int efi_path_vlan(EFI_DEVICE_PATH_PROTOCOL *path)
Get VLAN tag from device path.
Definition: efi_path.c:236
size_t efi_path_len(EFI_DEVICE_PATH_PROTOCOL *path)
Find length of device path (excluding terminator)
Definition: efi_path.c:173
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:643
int efi_path_guid(EFI_DEVICE_PATH_PROTOCOL *path, union uuid *uuid)
Get partition GUID from device path.
Definition: efi_path.c:260
An AoE device.
Definition: aoe.h:115
static void efi_path_terminate(EFI_DEVICE_PATH_PROTOCOL *end)
Terminate device path.
Definition: efi_path.h:30
void * efi_path_mac(EFI_DEVICE_PATH_PROTOCOL *path)
Get MAC address from device path.
Definition: efi_path.c:212
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:886
EFI_DEVICE_PATH_PROTOCOL * efi_uri_path(struct uri *uri)
Construct EFI device path for URI.
Definition: efi_path.c:468
An object interface.
Definition: interface.h:124
EFI_DEVICE_PATH_PROTOCOL * efi_path_next(EFI_DEVICE_PATH_PROTOCOL *path)
Find next element in device path.
Definition: efi_path.c:118
Object interfaces.
ring len
Length.
Definition: dwmac.h:231
const char * path
Path (after URI decoding)
Definition: uri.h:80
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:919
EFI_DEVICE_PATH_PROTOCOL * efi_paths(EFI_DEVICE_PATH_PROTOCOL *first,...)
Concatenate EFI device paths.
Definition: efi_path.c:343
int efi_path_check(EFI_DEVICE_PATH_PROTOCOL *path, size_t max)
Check that device path is well-formed.
Definition: efi_path.c:186
A network device.
Definition: netdevice.h:352
EFI_DEVICE_PATH_PROTOCOL * efi_usb_path(struct usb_function *func)
Construct EFI device path for USB function.
Definition: efi_path.c:696
EFI_DEVICE_PATH_PROTOCOL * efi_aoe_path(struct aoe_device *aoedev)
Construct EFI device path for AoE device.
Definition: efi_path.c:571
An Infiniband SRP device.
Definition: ib_srp.h:75
An FCP device description.
Definition: fcp.h:167
EFI API.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define END_ENTIRE_DEVICE_PATH_SUBTYPE
Definition: DevicePath.h:1394
EFI_DEVICE_PATH_PROTOCOL * efi_fcp_path(struct fcp_description *desc)
Construct EFI device path for Fibre Channel device.
Definition: efi_path.c:615
struct uri * efi_path_uri(EFI_DEVICE_PATH_PROTOCOL *path)
Parse URI from device path.
Definition: efi_path.c:300
EFI_DEVICE_PATH_PROTOCOL * efi_netdev_path(struct net_device *netdev)
Construct EFI device path for network device.
Definition: efi_path.c:410
uint32_t end
Ending offset.
Definition: netvsc.h:18
A Uniform Resource Identifier.
Definition: uri.h:64
A USB function.
Definition: usb.h:673
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:749