iPXE
efi_snp.h
Go to the documentation of this file.
1 #ifndef _IPXE_EFI_SNP_H
2 #define _IPXE_EFI_SNP_H
3 
4 /** @file
5  *
6  * iPXE EFI SNP interface
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER );
11 
12 #include <ipxe/list.h>
13 #include <ipxe/netdevice.h>
14 #include <ipxe/efi/efi.h>
23 
24 /** SNP transmit completion ring size */
25 #define EFI_SNP_NUM_TX 32
26 
27 /** An SNP device */
29  /** List of SNP devices */
30  struct list_head list;
31  /** The underlying iPXE network device */
32  struct net_device *netdev;
33  /** The underlying EFI device */
34  struct efi_device *efidev;
35  /** EFI device handle */
37  /** The SNP structure itself */
39  /** The SNP "mode" (parameters) */
41  /** Started flag */
42  int started;
43  /** Pending interrupt status */
44  unsigned int interrupts;
45  /** Transmit completion ring */
47  /** Transmit completion ring producer counter */
48  unsigned int tx_prod;
49  /** Transmit completion ring consumer counter */
50  unsigned int tx_cons;
51  /** Receive queue */
52  struct list_head rx;
53  /** The network interface identifier */
55  /** VLAN configuration protocol */
57  /** Component name protocol */
59  /** Load file protocol handle */
61  /** HII configuration access protocol */
63  /** HII package list */
65  /** EFI child handle for HII association */
67  /** Device path of HII child handle */
69  /** HII handle */
71  /** Device name */
72  wchar_t name[ sizeof ( ( ( struct net_device * ) NULL )->name ) ];
73  /** Driver name */
74  wchar_t driver_name[16];
75  /** Controller name */
76  wchar_t controller_name[64];
77  /** The device path */
79 };
80 
81 extern int efi_snp_hii_install ( struct efi_snp_device *snpdev );
82 extern int efi_snp_hii_uninstall ( struct efi_snp_device *snpdev );
83 extern struct efi_snp_device * find_snpdev ( EFI_HANDLE handle );
84 extern struct efi_snp_device * last_opened_snpdev ( void );
85 extern void efi_snp_add_claim ( int delta );
86 
87 /**
88  * Claim network devices for use by iPXE
89  *
90  */
91 static inline void efi_snp_claim ( void ) {
92  efi_snp_add_claim ( +1 );
93 }
94 
95 /**
96  * Release network devices for use via SNP
97  *
98  */
99 static inline void efi_snp_release ( void ) {
100  efi_snp_add_claim ( -1 );
101 }
102 
103 #endif /* _IPXE_EFI_SNP_H */
struct efi_snp_device * find_snpdev(EFI_HANDLE handle)
Find SNP device by EFI device handle.
Definition: efi_snp.c:2118
The EFI_SIMPLE_NETWORK_PROTOCOL protocol is used to initialize access to a network adapter.
The device path protocol as defined in UEFI 2.0.
This protocol is used to retrieve user readable names of drivers and controllers managed by UEFI Driv...
EFI_VLAN_CONFIG_PROTOCOL vcfg
VLAN configuration protocol.
Definition: efi_snp.h:56
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL nii
The network interface identifier.
Definition: efi_snp.h:54
EFI_COMPONENT_NAME2_PROTOCOL name2
Component name protocol.
Definition: efi_snp.h:58
An optional protocol that is used to describe details about the software layer that is used to produc...
int started
Started flag.
Definition: efi_snp.h:42
Load File protocol as defined in the UEFI 2.0 specification.
EFI Network Interface Identifier Protocol.
This protocol can be used on any device handle to obtain generic path/location information concerning...
Definition: DevicePath.h:45
static void efi_snp_claim(void)
Claim network devices for use by iPXE.
Definition: efi_snp.h:91
#define EFI_SNP_NUM_TX
SNP transmit completion ring size.
Definition: efi_snp.h:25
wchar_t controller_name[64]
Controller name.
Definition: efi_snp.h:76
FILE_LICENCE(GPL2_OR_LATER)
EFI_HANDLE hii_child_handle
EFI child handle for HII association.
Definition: efi_snp.h:66
EFI_HII_CONFIG_ACCESS_PROTOCOL hii
HII configuration access protocol.
Definition: efi_snp.h:62
EFI_HANDLE handle
EFI device handle.
Definition: efi_snp.h:36
A doubly-linked list entry (or list head)
Definition: list.h:18
This protocol provides a callable interface between the HII and drivers.
struct net_device * netdev
The underlying iPXE network device.
Definition: efi_snp.h:32
EFI_HII_HANDLE hii_handle
HII handle.
Definition: efi_snp.h:70
unsigned int tx_cons
Transmit completion ring consumer counter.
Definition: efi_snp.h:50
int efi_snp_hii_uninstall(struct efi_snp_device *snpdev)
Uninstall HII protocol and package for SNP device.
Definition: efi_snp_hii.c:796
EFI_HII_PACKAGE_LIST_HEADER * package_list
HII package list.
Definition: efi_snp.h:64
The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices.
Definition: LoadFile.h:78
UEFI Component Name 2 Protocol as defined in the UEFI 2.1 specification.
The EFI_SIMPLE_NETWORK_PROTOCOL provides services to initialize a network interface,...
VOID * tx[EFI_SNP_NUM_TX]
Transmit completion ring.
Definition: efi_snp.h:46
wchar_t name[sizeof(((struct net_device *) NULL) ->name)]
Device name.
Definition: efi_snp.h:72
Linked lists.
EFI_SIMPLE_NETWORK_PROTOCOL snp
The SNP structure itself.
Definition: efi_snp.h:38
EFI_VLAN_CONFIG_PROTOCOL provide manageability interface for VLAN setting.
Definition: VlanConfig.h:128
struct efi_snp_device * last_opened_snpdev(void)
Get most recently opened SNP device.
Definition: efi_snp.c:2133
A network device.
Definition: netdevice.h:352
An SNP device.
Definition: efi_snp.h:28
static void efi_snp_release(void)
Release network devices for use via SNP.
Definition: efi_snp.h:99
struct efi_device * efidev
The underlying EFI device.
Definition: efi_snp.h:34
An EFI device.
Definition: efi_driver.h:17
EFI_DEVICE_PATH_PROTOCOL * hii_child_path
Device path of HII child handle.
Definition: efi_snp.h:68
EFI VLAN Config protocol is to provide manageability interface for VLAN configuration.
#define VOID
Undeclared type.
Definition: Base.h:271
The file provides Database manager for HII-related data structures.
EFI API.
struct list_head rx
Receive queue.
Definition: efi_snp.h:52
unsigned int tx_prod
Transmit completion ring producer counter.
Definition: efi_snp.h:48
wchar_t driver_name[16]
Driver name.
Definition: efi_snp.h:74
Network device management.
The EFI HII results processing protocol invokes this type of protocol when it needs to forward result...
void efi_snp_add_claim(int delta)
Add to SNP claimed/released count.
Definition: efi_snp.c:2148
EFI_LOAD_FILE_PROTOCOL load_file
Load file protocol handle.
Definition: efi_snp.h:60
int efi_snp_hii_install(struct efi_snp_device *snpdev)
Install HII protocol and packages for SNP device.
Definition: efi_snp_hii.c:658
EFI_DEVICE_PATH_PROTOCOL * path
The device path.
Definition: efi_snp.h:78
uint16_t handle
Handle.
Definition: smbios.h:16
The header found at the start of each package list.
EFI_SIMPLE_NETWORK_MODE mode
The SNP "mode" (parameters)
Definition: efi_snp.h:40
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
struct list_head list
List of SNP devices.
Definition: efi_snp.h:30
Definition: efi.h:59
VOID * EFI_HII_HANDLE
The following types are currently defined:
unsigned int interrupts
Pending interrupt status.
Definition: efi_snp.h:44