Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[efi] Split SNP HII functionality into a separate file
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Oct 16, 2012
1 parent 0fd29e1 commit 41ea18a
Show file tree
Hide file tree
Showing 4 changed files with 508 additions and 418 deletions.
68 changes: 68 additions & 0 deletions src/include/ipxe/efi/efi_snp.h
@@ -0,0 +1,68 @@
#ifndef _IPXE_EFI_SNP_H
#define _IPXE_EFI_SNP_H

/** @file
*
* iPXE EFI SNP interface
*
*/

#include <ipxe/list.h>
#include <ipxe/netdevice.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/Protocol/SimpleNetwork.h>
#include <ipxe/efi/Protocol/NetworkInterfaceIdentifier.h>
#include <ipxe/efi/Protocol/DevicePath.h>
#include <ipxe/efi/Protocol/HiiConfigAccess.h>
#include <ipxe/efi/Protocol/HiiDatabase.h>

/** An SNP device */
struct efi_snp_device {
/** List of SNP devices */
struct list_head list;
/** The underlying iPXE network device */
struct net_device *netdev;
/** The underlying EFI PCI device */
struct efi_pci_device *efipci;
/** EFI device handle */
EFI_HANDLE handle;
/** The SNP structure itself */
EFI_SIMPLE_NETWORK_PROTOCOL snp;
/** The SNP "mode" (parameters) */
EFI_SIMPLE_NETWORK_MODE mode;
/** Outstanding TX packet count (via "interrupt status")
*
* Used in order to generate TX completions.
*/
unsigned int tx_count_interrupts;
/** Outstanding TX packet count (via "recycled tx buffers")
*
* Used in order to generate TX completions.
*/
unsigned int tx_count_txbufs;
/** Outstanding RX packet count (via "interrupt status") */
unsigned int rx_count_interrupts;
/** Outstanding RX packet count (via WaitForPacket event) */
unsigned int rx_count_events;
/** The network interface identifier */
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL nii;
/** HII configuration access protocol */
EFI_HII_CONFIG_ACCESS_PROTOCOL hii;
/** HII package list */
EFI_HII_PACKAGE_LIST_HEADER *package_list;
/** HII handle */
EFI_HII_HANDLE hii_handle;
/** Device name */
wchar_t name[ sizeof ( ( ( struct net_device * ) NULL )->name ) ];
/** The device path
*
* This field is variable in size and must appear at the end
* of the structure.
*/
EFI_DEVICE_PATH_PROTOCOL path;
};

extern int efi_snp_hii_install ( struct efi_snp_device *snpdev );
extern void efi_snp_hii_uninstall ( struct efi_snp_device *snpdev );

#endif /* _IPXE_EFI_SNP_H */
1 change: 1 addition & 0 deletions src/include/ipxe/errfile.h
Expand Up @@ -263,6 +263,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#define ERRFILE_validator ( ERRFILE_OTHER | 0x002e0000 )
#define ERRFILE_ocsp ( ERRFILE_OTHER | 0x002f0000 )
#define ERRFILE_nslookup ( ERRFILE_OTHER | 0x00300000 )
#define ERRFILE_efi_snp_hii ( ERRFILE_OTHER | 0x00310000 )

/** @} */

Expand Down

0 comments on commit 41ea18a

Please sign in to comment.