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 FILE_SECBOOT ( PERMITTED );
12 
13 #include <ipxe/list.h>
14 #include <ipxe/netdevice.h>
15 #include <ipxe/efi/efi.h>
24 
25 /** SNP transmit completion ring size */
26 #define EFI_SNP_NUM_TX 32
27 
28 /** An SNP device */
30  /** List of SNP devices */
31  struct list_head list;
32  /** The underlying iPXE network device */
33  struct net_device *netdev;
34  /** EFI parent device handle (if any) */
36  /** EFI device handle */
38  /** The SNP structure itself */
40  /** The SNP "mode" (parameters) */
42  /** Started flag */
43  int started;
44  /** Pending interrupt status */
45  unsigned int interrupts;
46  /** Transmit completion ring */
48  /** Transmit completion ring producer counter */
49  unsigned int tx_prod;
50  /** Transmit completion ring consumer counter */
51  unsigned int tx_cons;
52  /** Receive queue */
53  struct list_head rx;
54  /** The network interface identifier */
56  /** VLAN configuration protocol */
58  /** Component name protocol */
60  /** Load file protocol handle */
62  /** HII configuration access protocol */
64  /** HII package list */
66  /** EFI child handle for HII association */
68  /** Device path of HII child handle */
70  /** HII handle */
72  /** Device name */
73  wchar_t name[ sizeof ( ( ( struct net_device * ) NULL )->name ) ];
74  /** Driver name */
75  wchar_t driver_name[16];
76  /** Controller name */
77  wchar_t controller_name[64];
78  /** The device path */
80 };
81 
82 extern int efi_snp_hii_install ( struct efi_snp_device *snpdev );
83 extern int efi_snp_hii_uninstall ( struct efi_snp_device *snpdev );
84 extern struct efi_snp_device * find_snpdev ( EFI_HANDLE handle );
85 extern struct efi_snp_device * last_opened_snpdev ( void );
86 extern void efi_snp_add_claim ( int delta );
87 
88 /**
89  * Claim network devices for use by iPXE
90  *
91  */
92 static inline void efi_snp_claim ( void ) {
93  efi_snp_add_claim ( +1 );
94 }
95 
96 /**
97  * Release network devices for use via SNP
98  *
99  */
100 static inline void efi_snp_release ( void ) {
101  efi_snp_add_claim ( -1 );
102 }
103 
104 #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:2104
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:57
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL nii
The network interface identifier.
Definition: efi_snp.h:55
EFI_COMPONENT_NAME2_PROTOCOL name2
Component name protocol.
Definition: efi_snp.h:59
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:43
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:46
static void efi_snp_claim(void)
Claim network devices for use by iPXE.
Definition: efi_snp.h:92
#define EFI_SNP_NUM_TX
SNP transmit completion ring size.
Definition: efi_snp.h:26
wchar_t controller_name[64]
Controller name.
Definition: efi_snp.h:77
FILE_LICENCE(GPL2_OR_LATER)
EFI_HANDLE hii_child_handle
EFI child handle for HII association.
Definition: efi_snp.h:67
EFI_HII_CONFIG_ACCESS_PROTOCOL hii
HII configuration access protocol.
Definition: efi_snp.h:63
EFI_HANDLE handle
EFI device handle.
Definition: efi_snp.h:37
A doubly-linked list entry (or list head)
Definition: list.h:19
This protocol provides a callable interface between the HII and drivers.
struct net_device * netdev
The underlying iPXE network device.
Definition: efi_snp.h:33
EFI_HII_HANDLE hii_handle
HII handle.
Definition: efi_snp.h:71
unsigned int tx_cons
Transmit completion ring consumer counter.
Definition: efi_snp.h:51
int efi_snp_hii_uninstall(struct efi_snp_device *snpdev)
Uninstall HII protocol and package for SNP device.
Definition: efi_snp_hii.c:797
EFI_HII_PACKAGE_LIST_HEADER * package_list
HII package list.
Definition: efi_snp.h:65
The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices.
Definition: LoadFile.h:79
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:47
wchar_t name[sizeof(((struct net_device *) NULL) ->name)]
Device name.
Definition: efi_snp.h:73
Linked lists.
EFI_SIMPLE_NETWORK_PROTOCOL snp
The SNP structure itself.
Definition: efi_snp.h:39
EFI_VLAN_CONFIG_PROTOCOL provide manageability interface for VLAN setting.
Definition: VlanConfig.h:129
struct efi_snp_device * last_opened_snpdev(void)
Get most recently opened SNP device.
Definition: efi_snp.c:2119
A network device.
Definition: netdevice.h:353
An SNP device.
Definition: efi_snp.h:29
static void efi_snp_release(void)
Release network devices for use via SNP.
Definition: efi_snp.h:100
FILE_SECBOOT(PERMITTED)
EFI_DEVICE_PATH_PROTOCOL * hii_child_path
Device path of HII child handle.
Definition: efi_snp.h:69
EFI VLAN Config protocol is to provide manageability interface for VLAN configuration.
#define VOID
Undeclared type.
Definition: Base.h:272
The file provides Database manager for HII-related data structures.
EFI API.
struct list_head rx
Receive queue.
Definition: efi_snp.h:53
unsigned int tx_prod
Transmit completion ring producer counter.
Definition: efi_snp.h:49
wchar_t driver_name[16]
Driver name.
Definition: efi_snp.h:75
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:2134
EFI_LOAD_FILE_PROTOCOL load_file
Load file protocol handle.
Definition: efi_snp.h:61
int efi_snp_hii_install(struct efi_snp_device *snpdev)
Install HII protocol and packages for SNP device.
Definition: efi_snp_hii.c:659
EFI_DEVICE_PATH_PROTOCOL * path
The device path.
Definition: efi_snp.h:79
uint16_t handle
Handle.
Definition: smbios.h:17
The header found at the start of each package list.
EFI_SIMPLE_NETWORK_MODE mode
The SNP "mode" (parameters)
Definition: efi_snp.h:41
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322
struct list_head list
List of SNP devices.
Definition: efi_snp.h:31
Definition: efi.h:62
EFI_HANDLE parent
EFI parent device handle (if any)
Definition: efi_snp.h:35
VOID * EFI_HII_HANDLE
The following types are currently defined:
unsigned int interrupts
Pending interrupt status.
Definition: efi_snp.h:45