iPXE
Functions
efi_autoboot.h File Reference

EFI autoboot device. More...

#include <ipxe/efi/efi.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
 FILE_SECBOOT (PERMITTED)
 
int efi_set_autoboot_ll_addr (EFI_HANDLE device, EFI_DEVICE_PATH_PROTOCOL *path)
 Identify autoboot device. More...
 

Detailed Description

EFI autoboot device.

Definition in file efi_autoboot.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED  )

◆ efi_set_autoboot_ll_addr()

int efi_set_autoboot_ll_addr ( EFI_HANDLE  device,
EFI_DEVICE_PATH_PROTOCOL path 
)

Identify autoboot device.

Parameters
deviceDevice handle
pathDevice path
Return values
rcReturn status code

Definition at line 50 of file efi_autoboot.c.

51  {
54  unsigned int vlan;
55  int rc;
56 
57  /* Look for an SNP instance on the image's device handle */
59  &snp ) ) != 0 ) {
60  DBGC ( device, "EFI %s has no SNP instance: %s\n",
61  efi_handle_name ( device ), strerror ( rc ) );
62  return rc;
63  }
64 
65  /* Record autoboot device */
66  mode = snp->Mode;
67  vlan = efi_path_vlan ( path );
68  set_autoboot_ll_addr ( &mode->CurrentAddress, mode->HwAddressSize,
69  vlan );
70  DBGC ( device, "EFI %s found autoboot link-layer address:\n",
71  efi_handle_name ( device ) );
72  DBGC_HDA ( device, 0, &mode->CurrentAddress, mode->HwAddressSize );
73  if ( vlan ) {
74  DBGC ( device, "EFI %s found autoboot VLAN %d\n",
75  efi_handle_name ( device ), vlan );
76  }
77 
78  /* Configure automatic VLAN device, if applicable */
79  if ( vlan && ( mode->HwAddressSize == ETH_ALEN ) ) {
80  vlan_auto ( &mode->CurrentAddress, vlan );
81  DBGC ( device, "EFI %s configured automatic VLAN %d\n",
82  efi_handle_name ( device ), vlan );
83  }
84 
85  return 0;
86 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
unsigned int efi_path_vlan(EFI_DEVICE_PATH_PROTOCOL *path)
Get VLAN tag from device path.
Definition: efi_path.c:237
The EFI_SIMPLE_NETWORK_PROTOCOL protocol is used to initialize access to a network adapter.
uint16_t mode
Acceleration mode.
Definition: ena.h:26
EFI_GUID efi_simple_network_protocol_guid
Simple network protocol GUID.
Definition: efi_guid.c:341
#define DBGC(...)
Definition: compiler.h:505
EFI_SIMPLE_NETWORK_MODE * Mode
Pointer to the EFI_SIMPLE_NETWORK_MODE data for the device.
A hardware device.
Definition: device.h:77
void vlan_auto(const void *ll_addr, unsigned int tag)
Configure automatic VLAN device.
Definition: vlan.c:463
#define DBGC_HDA(...)
Definition: compiler.h:506
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:79
#define efi_open(handle, protocol, interface)
Open protocol for ephemeral use.
Definition: efi.h:444
void set_autoboot_ll_addr(const void *ll_addr, size_t len, unsigned int vlan)
Identify autoboot device by link-layer address.
Definition: autoboot.c:521
#define ETH_ALEN
Definition: if_ether.h:9

References DBGC, DBGC_HDA, efi_handle_name(), efi_open, efi_path_vlan(), efi_simple_network_protocol_guid, ETH_ALEN, mode, _EFI_SIMPLE_NETWORK_PROTOCOL::Mode, rc, set_autoboot_ll_addr(), strerror(), and vlan_auto().

Referenced by efi_init_application().