iPXE
|
EFI device paths. More...
Go to the source code of this file.
Macros | |
#define | efi_describe_TYPE(object_type) typeof ( EFI_DEVICE_PATH_PROTOCOL * ( object_type ) ) |
EFI device paths.
Definition in file efi_path.h.
#define efi_describe_TYPE | ( | object_type | ) | typeof ( EFI_DEVICE_PATH_PROTOCOL * ( object_type ) ) |
Definition at line 63 of file efi_path.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Terminate device path.
end | End of device path to fill in |
Definition at line 30 of file efi_path.h.
References end, END_DEVICE_PATH_TYPE, and END_ENTIRE_DEVICE_PATH_SUBTYPE.
Referenced by efi_aoe_path(), efi_block_exec(), efi_fcp_path(), efi_ib_srp_path(), efi_image_path(), efi_iscsi_path(), efi_locate_device(), efi_netdev_path(), efi_paths(), efi_snp_hii_install(), efi_uri_path(), and efi_usb_path().
EFI_DEVICE_PATH_PROTOCOL* efi_path_next | ( | EFI_DEVICE_PATH_PROTOCOL * | path | ) |
Find next element in device path.
path | Device path, or NULL |
next | Next element in device path, or NULL if at end |
Definition at line 89 of file efi_path.c.
References END_DEVICE_PATH_TYPE, EFI_DEVICE_PATH_PROTOCOL::Length, NULL, and EFI_DEVICE_PATH_PROTOCOL::Type.
Referenced by efi_local_open_path(), efi_path_fetch(), efi_path_guid(), efi_path_mac(), efi_path_prev(), efi_path_uri(), and efi_path_vlan().
EFI_DEVICE_PATH_PROTOCOL* efi_path_prev | ( | EFI_DEVICE_PATH_PROTOCOL * | path, |
EFI_DEVICE_PATH_PROTOCOL * | curr | ||
) |
Find previous element of device path.
path | Device path, or NULL for no path |
curr | Current element in device path, or NULL for end of path |
prev | Previous element in device path, or NULL |
Definition at line 115 of file efi_path.c.
References efi_path_next(), and tmp.
Referenced by efi_locate_device(), and efi_path_end().
EFI_DEVICE_PATH_PROTOCOL* efi_path_end | ( | EFI_DEVICE_PATH_PROTOCOL * | path | ) |
Find end of device path.
path | Device path, or NULL |
path_end | End of device path, or NULL |
Definition at line 133 of file efi_path.c.
References efi_path_prev(), and NULL.
Referenced by efi_block_exec(), efi_path_len(), and usbio_open().
size_t efi_path_len | ( | EFI_DEVICE_PATH_PROTOCOL * | path | ) |
Find length of device path (excluding terminator)
path | Device path, or NULL |
path_len | Length of device path |
Definition at line 144 of file efi_path.c.
References efi_path_end(), and end.
Referenced by efi_block_match(), efi_devpath_text(), efi_ib_srp_path(), efi_image_path(), efi_init(), efi_iscsi_path(), efi_local_open_path(), efi_locate_device(), efi_netdev_path(), efi_paths(), efi_snp_hii_install(), efi_usb_path(), efidev_alloc(), and usbio_path().
void* efi_path_mac | ( | EFI_DEVICE_PATH_PROTOCOL * | path | ) |
Get MAC address from device path.
path | Device path |
mac | MAC address, or NULL if not found |
Definition at line 156 of file efi_path.c.
References container_of, efi_path_next(), Header, mac, MESSAGING_DEVICE_PATH, MSG_MAC_ADDR_DP, next, NULL, EFI_DEVICE_PATH_PROTOCOL::SubType, and EFI_DEVICE_PATH_PROTOCOL::Type.
Referenced by efi_path_net_probe().
unsigned int efi_path_vlan | ( | EFI_DEVICE_PATH_PROTOCOL * | path | ) |
Get VLAN tag from device path.
path | Device path |
tag | VLAN tag, or 0 if not a VLAN |
Definition at line 180 of file efi_path.c.
References container_of, efi_path_next(), Header, MESSAGING_DEVICE_PATH, MSG_VLAN_DP, next, EFI_DEVICE_PATH_PROTOCOL::SubType, EFI_DEVICE_PATH_PROTOCOL::Type, and VLAN_DEVICE_PATH::VlanId.
Referenced by efi_cachedhcp_record(), efi_path_net_probe(), and efi_set_autoboot_ll_addr().
int efi_path_guid | ( | EFI_DEVICE_PATH_PROTOCOL * | path, |
union uuid * | guid | ||
) |
Get partition GUID from device path.
path | Device path |
guid | Partition GUID to fill in |
rc | Return status code |
Definition at line 204 of file efi_path.c.
References container_of, efi_path_next(), ENOENT, guid, Header, MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP, memcpy(), next, rc, HARDDRIVE_DEVICE_PATH::Signature, SIGNATURE_TYPE_GUID, HARDDRIVE_DEVICE_PATH::SignatureType, EFI_DEVICE_PATH_PROTOCOL::SubType, EFI_DEVICE_PATH_PROTOCOL::Type, and uuid_mangle().
Referenced by efi_block_match().
struct uri* efi_path_uri | ( | EFI_DEVICE_PATH_PROTOCOL * | path | ) |
Parse URI from device path.
path | Device path |
uri | URI, or NULL if not a URI |
Definition at line 244 of file efi_path.c.
References container_of, efi_path_next(), free, Header, len, memcpy(), MESSAGING_DEVICE_PATH, MSG_URI_DP, next, NULL, offsetof, parse_uri(), uri::path, typeof(), URI_DEVICE_PATH::Uri, and zalloc().
Referenced by efi_init_application().
EFI_DEVICE_PATH_PROTOCOL* efi_paths | ( | EFI_DEVICE_PATH_PROTOCOL * | first, |
... | |||
) |
Concatenate EFI device paths.
... | List of device paths (NULL terminated) |
path | Concatenated device path, or NULL on error |
The caller is responsible for eventually calling free() on the allocated device path.
Definition at line 287 of file efi_path.c.
References efi_path_len(), efi_path_terminate(), end, first, len, memcpy(), NULL, uri::path, src, va_arg, va_end, va_start, and zalloc().
Referenced by efi_aoe_path().
EFI_DEVICE_PATH_PROTOCOL* efi_netdev_path | ( | struct net_device * | netdev | ) |
Construct EFI device path for network device.
netdev | Network device |
path | EFI device path, or NULL on error |
The caller is responsible for eventually calling free() on the allocated device path.
Definition at line 336 of file efi_path.c.
References assert(), net_device::dev, efi_path_len(), efi_path_terminate(), efidev_parent(), end, MAC_ADDR_DEVICE_PATH::Header, VLAN_DEVICE_PATH::Header, MAC_ADDR_DEVICE_PATH::IfType, len, EFI_DEVICE_PATH_PROTOCOL::Length, net_device::ll_addr, ll_protocol::ll_addr_len, ll_protocol::ll_proto, net_device::ll_protocol, MAC_ADDR_DEVICE_PATH::MacAddress, memcpy(), MESSAGING_DEVICE_PATH, MSG_MAC_ADDR_DP, MSG_VLAN_DP, netdev, ntohs, NULL, efi_device::path, EFI_DEVICE_PATH_PROTOCOL::SubType, tag, EFI_DEVICE_PATH_PROTOCOL::Type, vlan_tag(), VLAN_DEVICE_PATH::VlanId, and zalloc().
Referenced by efi_aoe_path(), efi_iscsi_path(), and efi_snp_probe().
EFI_DEVICE_PATH_PROTOCOL* efi_uri_path | ( | struct uri * | uri | ) |
Construct EFI device path for URI.
uri | URI |
path | EFI device path, or NULL on error |
The caller is responsible for eventually calling free() on the allocated device path.
Definition at line 396 of file efi_path.c.
References efi_path_terminate(), end, format_uri(), URI_DEVICE_PATH::Header, len, EFI_DEVICE_PATH_PROTOCOL::Length, MESSAGING_DEVICE_PATH, MSG_URI_DP, NULL, efi_device::path, EFI_DEVICE_PATH_PROTOCOL::SubType, EFI_DEVICE_PATH_PROTOCOL::Type, URI_DEVICE_PATH::Uri, and zalloc().
Referenced by http_efi_describe().
EFI_DEVICE_PATH_PROTOCOL* efi_iscsi_path | ( | struct iscsi_session * | iscsi | ) |
Construct EFI device path for iSCSI device.
iscsi | iSCSI session |
path | EFI device path, or NULL on error |
Definition at line 433 of file efi_path.c.
References efi_netdev_path(), efi_path_len(), efi_path_terminate(), end, free, ISCSI_DEVICE_PATH::Header, ISCSI_LOGIN_OPTION_AUTHMETHOD_NON, len, EFI_DEVICE_PATH_PROTOCOL::Length, ISCSI_DEVICE_PATH::LoginOption, iscsi_session::lun, ISCSI_DEVICE_PATH::Lun, memcpy(), MESSAGING_DEVICE_PATH, MSG_ISCSI_DP, name, netdev, NULL, strlen(), EFI_DEVICE_PATH_PROTOCOL::SubType, iscsi_session::target_iqn, iscsi_session::target_sockaddr, tcpip_netdev(), EFI_DEVICE_PATH_PROTOCOL::Type, and zalloc().
EFI_DEVICE_PATH_PROTOCOL* efi_aoe_path | ( | struct aoe_device * | aoedev | ) |
Construct EFI device path for AoE device.
aoedev | AoE device |
path | EFI device path, or NULL on error |
Definition at line 499 of file efi_path.c.
References efi_netdev_path(), efi_path_terminate(), efi_paths(), end, free, aoe_device::major, memset(), MESSAGING_DEVICE_PATH, aoe_device::minor, MSG_SATA_DP, aoe_device::netdev, and NULL.
EFI_DEVICE_PATH_PROTOCOL* efi_fcp_path | ( | struct fcp_description * | desc | ) |
Construct EFI device path for Fibre Channel device.
desc | FCP device description |
path | EFI device path, or NULL on error |
Definition at line 543 of file efi_path.c.
References __attribute__, desc, efi_path_terminate(), end, fc, memcpy(), MESSAGING_DEVICE_PATH, MSG_FIBRECHANNELEX_DP, NULL, and zalloc().
Referenced by fcpdev_efi_describe().
EFI_DEVICE_PATH_PROTOCOL* efi_ib_srp_path | ( | struct ib_srp_device * | ib_srp | ) |
Construct EFI device path for Infiniband SRP device.
ib_srp | Infiniband SRP device |
path | EFI device path, or NULL on error |
Definition at line 571 of file efi_path.c.
References container_of, ib_device::dev, INFINIBAND_DEVICE_PATH::DeviceId, sbft_ib_subtable::dgid, efi_path_len(), efi_path_terminate(), efidev_parent(), end, INFINIBAND_DEVICE_PATH::Header, ipxe_ib_sbft::ib, ib_srp_device::ibdev, id, INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL, len, EFI_DEVICE_PATH_PROTOCOL::Length, memcpy(), MESSAGING_DEVICE_PATH, MSG_INFINIBAND_DP, NULL, efi_device::path, INFINIBAND_DEVICE_PATH::PortGid, INFINIBAND_DEVICE_PATH::ResourceFlags, ib_srp_device::sbft, sbft_ib_subtable::service_id, INFINIBAND_DEVICE_PATH::ServiceId, ib_srp_target_port_id::srp, ipxe_ib_sbft::srp, EFI_DEVICE_PATH_PROTOCOL::SubType, sbft_srp_subtable::target, INFINIBAND_DEVICE_PATH::TargetPortId, EFI_DEVICE_PATH_PROTOCOL::Type, and zalloc().
EFI_DEVICE_PATH_PROTOCOL* efi_usb_path | ( | struct usb_function * | func | ) |
Construct EFI device path for USB function.
func | USB function |
path | EFI device path, or NULL on error |
The caller is responsible for eventually calling free() on the allocated device path.
Definition at line 626 of file efi_path.c.
References assert(), count, usb_function_descriptor::count, usb_function::desc, usb_function::dev, efi_path_len(), efi_path_terminate(), efidev_parent(), end, USB_DEVICE_PATH::Header, usb_port::hub, usb_function::interface, USB_DEVICE_PATH::InterfaceNumber, len, EFI_DEVICE_PATH_PROTOCOL::Length, memcpy(), MESSAGING_DEVICE_PATH, MSG_USB_DP, NULL, USB_DEVICE_PATH::ParentPortNumber, efi_device::path, usb_device::port, EFI_DEVICE_PATH_PROTOCOL::SubType, EFI_DEVICE_PATH_PROTOCOL::Type, usb_function::usb, usb_hub::usb, usb_depth(), and zalloc().
Referenced by efi_usb_install(), and usbblk_efi_describe().
EFI_DEVICE_PATH_PROTOCOL* efi_describe | ( | struct interface * | intf | ) |
Describe object as an EFI device path.
intf | Interface |
path | EFI device path, or NULL |
The caller is responsible for eventually calling free() on the allocated device path.
Definition at line 680 of file efi_path.c.
References dest, efi_describe(), efi_describe_TYPE, interface::intf, intf_get_dest_op, intf_object(), intf_put(), NULL, and op.
Referenced by efi_block_hook(), and efi_describe().