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
10FILE_LICENCE ( GPL2_OR_LATER );
11FILE_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 */
32 /** The underlying iPXE network device */
34 /** EFI parent device handle (if any) */
36 /** EFI device handle */
38 /** The SNP structure itself */
40 /** The SNP "mode" (parameters) */
42 /** Started flag */
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
82extern int efi_snp_hii_install ( struct efi_snp_device *snpdev );
83extern int efi_snp_hii_uninstall ( struct efi_snp_device *snpdev );
85extern struct efi_snp_device * last_opened_snpdev ( void );
86extern void efi_snp_add_claim ( int delta );
87
88/**
89 * Claim network devices for use by iPXE
90 *
91 */
92static 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 */
100static inline void efi_snp_release ( void ) {
101 efi_snp_add_claim ( -1 );
102}
103
104#endif /* _IPXE_EFI_SNP_H */
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
#define VOID
Undeclared type.
Definition Base.h:272
UEFI Component Name 2 Protocol as defined in the UEFI 2.1 specification.
struct _EFI_COMPONENT_NAME2_PROTOCOL EFI_COMPONENT_NAME2_PROTOCOL
The device path protocol as defined in UEFI 2.0.
The EFI HII results processing protocol invokes this type of protocol when it needs to forward result...
struct _EFI_HII_CONFIG_ACCESS_PROTOCOL EFI_HII_CONFIG_ACCESS_PROTOCOL
The file provides Database manager for HII-related data structures.
Load File protocol as defined in the UEFI 2.0 specification.
struct _EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL
Definition LoadFile.h:31
EFI Network Interface Identifier Protocol.
struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL
Forward reference for pure ANSI compatability.
The EFI_SIMPLE_NETWORK_PROTOCOL provides services to initialize a network interface,...
struct _EFI_SIMPLE_NETWORK_PROTOCOL EFI_SIMPLE_NETWORK_PROTOCOL
VOID * EFI_HII_HANDLE
The following types are currently defined:
EFI VLAN Config protocol is to provide manageability interface for VLAN configuration.
struct _EFI_VLAN_CONFIG_PROTOCOL EFI_VLAN_CONFIG_PROTOCOL
Definition VlanConfig.h:23
static void efi_snp_claim(void)
Claim network devices for use by iPXE.
Definition efi_snp.h:92
struct efi_snp_device * find_snpdev(EFI_HANDLE handle)
Find SNP device by EFI device handle.
Definition efi_snp.c:2104
static void efi_snp_release(void)
Release network devices for use via SNP.
Definition efi_snp.h:100
struct efi_snp_device * last_opened_snpdev(void)
Get most recently opened SNP device.
Definition efi_snp.c:2119
void efi_snp_add_claim(int delta)
Add to SNP claimed/released count.
Definition efi_snp.c:2134
int efi_snp_hii_install(struct efi_snp_device *snpdev)
Install HII protocol and packages for SNP device.
#define EFI_SNP_NUM_TX
SNP transmit completion ring size.
Definition efi_snp.h:26
int efi_snp_hii_uninstall(struct efi_snp_device *snpdev)
Uninstall HII protocol and package for SNP device.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
EFI API.
#define EFI_HANDLE
Definition efi.h:53
uint16_t handle
Handle.
Definition smbios.h:5
Linked lists.
Network device management.
This protocol can be used on any device handle to obtain generic path/location information concerning...
Definition DevicePath.h:46
The header found at the start of each package list.
An SNP device.
Definition efi_snp.h:29
EFI_HANDLE handle
EFI device handle.
Definition efi_snp.h:37
int started
Started flag.
Definition efi_snp.h:43
EFI_VLAN_CONFIG_PROTOCOL vcfg
VLAN configuration protocol.
Definition efi_snp.h:57
wchar_t controller_name[64]
Controller name.
Definition efi_snp.h:77
EFI_DEVICE_PATH_PROTOCOL * hii_child_path
Device path of HII child handle.
Definition efi_snp.h:69
struct list_head rx
Receive queue.
Definition efi_snp.h:53
EFI_HANDLE parent
EFI parent device handle (if any)
Definition efi_snp.h:35
unsigned int interrupts
Pending interrupt status.
Definition efi_snp.h:45
EFI_HII_PACKAGE_LIST_HEADER * package_list
HII package list.
Definition efi_snp.h:65
EFI_DEVICE_PATH_PROTOCOL * path
The device path.
Definition efi_snp.h:79
struct net_device * netdev
The underlying iPXE network device.
Definition efi_snp.h:33
wchar_t name[sizeof(((struct net_device *) NULL) ->name)]
Device name.
Definition efi_snp.h:73
EFI_COMPONENT_NAME2_PROTOCOL name2
Component name protocol.
Definition efi_snp.h:59
unsigned int tx_prod
Transmit completion ring producer counter.
Definition efi_snp.h:49
unsigned int tx_cons
Transmit completion ring consumer counter.
Definition efi_snp.h:51
EFI_HII_CONFIG_ACCESS_PROTOCOL hii
HII configuration access protocol.
Definition efi_snp.h:63
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL nii
The network interface identifier.
Definition efi_snp.h:55
EFI_SIMPLE_NETWORK_MODE mode
The SNP "mode" (parameters)
Definition efi_snp.h:41
EFI_LOAD_FILE_PROTOCOL load_file
Load file protocol handle.
Definition efi_snp.h:61
EFI_HII_HANDLE hii_handle
HII handle.
Definition efi_snp.h:71
wchar_t driver_name[16]
Driver name.
Definition efi_snp.h:75
VOID * tx[EFI_SNP_NUM_TX]
Transmit completion ring.
Definition efi_snp.h:47
EFI_SIMPLE_NETWORK_PROTOCOL snp
The SNP structure itself.
Definition efi_snp.h:39
struct list_head list
List of SNP devices.
Definition efi_snp.h:31
EFI_HANDLE hii_child_handle
EFI child handle for HII association.
Definition efi_snp.h:67
A doubly-linked list entry (or list head)
Definition list.h:19
A network device.
Definition netdevice.h:353