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 void * efi_path_mac ( EFI_DEVICE_PATH_PROTOCOL *path );
47 extern unsigned int efi_path_vlan ( EFI_DEVICE_PATH_PROTOCOL *path );
48 extern int efi_path_guid ( EFI_DEVICE_PATH_PROTOCOL *path, union uuid *uuid );
49 extern struct uri * efi_path_uri ( EFI_DEVICE_PATH_PROTOCOL *path );
51  ... );
53 extern EFI_DEVICE_PATH_PROTOCOL * efi_uri_path ( struct uri *uri );
55 efi_iscsi_path ( struct iscsi_session *iscsi );
56 extern EFI_DEVICE_PATH_PROTOCOL * efi_aoe_path ( struct aoe_device *aoedev );
59 efi_ib_srp_path ( struct ib_srp_device *ib_srp );
60 extern EFI_DEVICE_PATH_PROTOCOL * efi_usb_path ( struct usb_function *func );
61 
63 #define efi_describe_TYPE( object_type ) \
64  typeof ( EFI_DEVICE_PATH_PROTOCOL * ( object_type ) )
65 
66 #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:433
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:133
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:115
#define END_DEVICE_PATH_TYPE
Definition: DevicePath.h:1371
A universally unique ID.
Definition: uuid.h:15
uint64_t desc
Microcode descriptor list physical address.
Definition: ucode.h:12
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:180
size_t efi_path_len(EFI_DEVICE_PATH_PROTOCOL *path)
Find length of device path (excluding terminator)
Definition: efi_path.c:144
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:571
int efi_path_guid(EFI_DEVICE_PATH_PROTOCOL *path, union uuid *uuid)
Get partition GUID from device path.
Definition: efi_path.c:204
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:156
EFI_DEVICE_PATH_PROTOCOL * efi_uri_path(struct uri *uri)
Construct EFI device path for URI.
Definition: efi_path.c:396
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:89
Object interfaces.
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:680
EFI_DEVICE_PATH_PROTOCOL * efi_paths(EFI_DEVICE_PATH_PROTOCOL *first,...)
Concatenate EFI device paths.
Definition: efi_path.c:287
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:626
EFI_DEVICE_PATH_PROTOCOL * efi_aoe_path(struct aoe_device *aoedev)
Construct EFI device path for AoE device.
Definition: efi_path.c:499
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:1372
EFI_DEVICE_PATH_PROTOCOL * efi_fcp_path(struct fcp_description *desc)
Construct EFI device path for Fibre Channel device.
Definition: efi_path.c:543
struct uri * efi_path_uri(EFI_DEVICE_PATH_PROTOCOL *path)
Parse URI from device path.
Definition: efi_path.c:244
EFI_DEVICE_PATH_PROTOCOL * efi_netdev_path(struct net_device *netdev)
Construct EFI device path for network device.
Definition: efi_path.c:336
uint32_t end
Ending offset.
Definition: netvsc.h:18
A Uniform Resource Identifier.
Definition: uri.h:64
A USB function.
Definition: usb.h:659
uint32_t first
Length to skip in first segment.
Definition: pccrc.h:23