-/** @file
-
-Copyright (c) 2004 - 2007, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module name:
- snp.h
-
-Abstract:
-
-Revision history:
-
-
-**/
-#ifndef _SNP_H
-#define _SNP_H
-
-
+/** @file\r
+\r
+Copyright (c) 2004 - 2007, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module name:\r
+ snp.h\r
+\r
+Abstract:\r
+\r
+Revision history:\r
+\r
+\r
+**/\r
+#ifndef _SNP_H\r
+#define _SNP_H\r
+\r
+\r
#include <PiDxe.h>\r
\r
#include <Protocol/SimpleNetwork.h>\r
#include <Library/UefiDriverEntryPoint.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/BaseLib.h>\r
-#include <Library/UefiLib.h>
-#include <Library/MemoryAllocationLib.h>
-
-#include <IndustryStandard/Pci22.h>
-
-#define FOUR_GIGABYTES (UINT64) 0x100000000ULL
-
-
-#define SNP_DRIVER_SIGNATURE EFI_SIGNATURE_32 ('s', 'n', 'd', 's')
-#define MAX_MAP_LENGTH 100
-
-#define PCI_BAR_IO_MASK 0x00000003
-#define PCI_BAR_IO_MODE 0x00000001
-
-#define PCI_BAR_MEM_MASK 0x0000000F
-#define PCI_BAR_MEM_MODE 0x00000000
-#define PCI_BAR_MEM_64BIT 0x00000004
-
-typedef struct {
- UINT32 Signature;
- EFI_LOCK lock;
-
- EFI_SIMPLE_NETWORK_PROTOCOL snp;
- EFI_SIMPLE_NETWORK_MODE mode;
-
- EFI_HANDLE device_handle;
- EFI_DEVICE_PATH_PROTOCOL *device_path;
-
- //
- // Local instance data needed by SNP driver
- //
- // Pointer to S/W UNDI API entry point
- // This will be NULL for H/W UNDI
- //
- EFI_STATUS (*issue_undi32_command) (UINT64 cdb);
-
- BOOLEAN is_swundi;
-
- //
- // undi interface number, if one undi manages more nics
- //
- PXE_IFNUM if_num;
-
- //
- // Allocated tx/rx buffer that was passed to UNDI Initialize.
- //
- UINT32 tx_rx_bufsize;
- VOID *tx_rx_buffer;
- //
- // mappable buffers for receive and fill header for undi3.0
- // these will be used if the user buffers are above 4GB limit (instead of
- // mapping the user buffers)
- //
- UINT8 *receive_buf;
- VOID *ReceiveBufUnmap;
- UINT8 *fill_hdr_buf;
- VOID *FillHdrBufUnmap;
-
- EFI_PCI_IO_PROTOCOL *IoFncs;
- UINT8 IoBarIndex;
- UINT8 MemoryBarIndex;
- BOOLEAN IsOldUndi; // true for EFI1.0 UNDI (3.0) drivers
- //
- // Buffers for command descriptor block, command parameter block
- // and data block.
- //
- PXE_CDB cdb;
- VOID *cpb;
- VOID *CpbUnmap;
- VOID *db;
-
- //
- // UNDI structure, we need to remember the init info for a long time!
- //
- PXE_DB_GET_INIT_INFO init_info;
-
- VOID *SnpDriverUnmap;
- //
- // when ever we map an address, we must remember it's address and the un-map
- // cookie so that we can unmap later
- //
- struct s_map_list {
- EFI_PHYSICAL_ADDRESS virt;
- VOID *map_cookie;
- } map_list[MAX_MAP_LENGTH];
-}
-SNP_DRIVER;
-
-#define EFI_SIMPLE_NETWORK_DEV_FROM_THIS(a) CR (a, SNP_DRIVER, snp, SNP_DRIVER_SIGNATURE)
-
-//
-// Global Variables
-//
-extern EFI_COMPONENT_NAME_PROTOCOL gSimpleNetworkComponentName;
-
-//
-// Virtual to physical mapping for all UNDI 3.0s.
-//
-extern struct s_v2p {
- struct s_v2p *next;
- VOID *vaddr;
- UINTN bsize;
- EFI_PHYSICAL_ADDRESS paddr;
- VOID *unmap;
-}
-*_v2p;
-
-EFI_STATUS
-add_v2p (
- struct s_v2p **v2p,
- EFI_PCI_IO_PROTOCOL_OPERATION type,
- VOID *vaddr,
- UINTN bsize
- )
-;
-
-EFI_STATUS
-find_v2p (
- struct s_v2p **v2p,
- VOID *vaddr
- )
-;
-
-EFI_STATUS
-del_v2p (
- VOID *vaddr
- )
-;
-
-extern
-VOID
-snp_undi32_callback_block_30 (
- IN UINT32 Enable
- )
-;
-
-extern
-VOID
-snp_undi32_callback_delay_30 (
- IN UINT64 MicroSeconds
- )
-;
-
-extern
-VOID
-snp_undi32_callback_memio_30 (
- IN UINT8 ReadOrWrite,
- IN UINT8 NumBytes,
- IN UINT64 MemOrPortAddress,
- IN OUT UINT64 BufferPtr
- )
-;
-
-extern
-VOID
-snp_undi32_callback_v2p_30 (
- IN UINT64 CpuAddr,
- IN OUT UINT64 DeviceAddrPtr
- )
-;
-
-extern
-VOID
-snp_undi32_callback_block (
- IN UINT64 UniqueId,
- IN UINT32 Enable
- )
-;
-
-extern
-VOID
-snp_undi32_callback_delay (
- IN UINT64 UniqueId,
- IN UINT64 MicroSeconds
- )
-;
-
-extern
-VOID
-snp_undi32_callback_memio (
- IN UINT64 UniqueId,
- IN UINT8 ReadOrWrite,
- IN UINT8 NumBytes,
- IN UINT64 MemOrPortAddr,
- IN OUT UINT64 BufferPtr
- )
-;
-
-extern
-VOID
-snp_undi32_callback_map (
- IN UINT64 UniqueId,
- IN UINT64 CpuAddr,
- IN UINT32 NumBytes,
- IN UINT32 Direction,
- IN OUT UINT64 DeviceAddrPtr
- )
-;
-
-extern
-VOID
-snp_undi32_callback_unmap (
- IN UINT64 UniqueId,
- IN UINT64 CpuAddr,
- IN UINT32 NumBytes,
- IN UINT32 Direction,
- IN UINT64 DeviceAddr // not a pointer to device address
- )
-;
-
-extern
-VOID
-snp_undi32_callback_sync (
- IN UINT64 UniqueId,
- IN UINT64 CpuAddr,
- IN UINT32 NumBytes,
- IN UINT32 Direction,
- IN UINT64 DeviceAddr // not a pointer to device address
- )
-;
-
-extern
-EFI_STATUS
-EFIAPI
-snp_undi32_start (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *this
- )
-;
-
-extern
-EFI_STATUS
-EFIAPI
-snp_undi32_stop (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *this
- )
-;
-
-extern
-EFI_STATUS
-EFIAPI
-snp_undi32_initialize (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *this,
- IN UINTN extra_rx_buffer_size OPTIONAL,
- IN UINTN extra_tx_buffer_size OPTIONAL
- )
-;
-
-extern
-EFI_STATUS
-EFIAPI
-snp_undi32_reset (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *this,
- IN BOOLEAN ExtendedVerification
- )
-;
-
-extern
-EFI_STATUS
-EFIAPI
-snp_undi32_shutdown (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *this
- )
-;
-
-extern
-EFI_STATUS
-EFIAPI
-snp_undi32_receive_filters (
- IN EFI_SIMPLE_NETWORK_PROTOCOL * this,
- IN UINT32 enable,
- IN UINT32 disable,
- IN BOOLEAN reset_mcast_filter,
- IN UINTN mcast_filter_count OPTIONAL,
- IN EFI_MAC_ADDRESS * mcast_filter OPTIONAL
- )
-;
-
-extern
-EFI_STATUS
-EFIAPI
-snp_undi32_station_address (
- IN EFI_SIMPLE_NETWORK_PROTOCOL * this,
- IN BOOLEAN reset,
- IN EFI_MAC_ADDRESS *new OPTIONAL
- )
-;
-
-extern
-EFI_STATUS
-EFIAPI
-snp_undi32_statistics (
- IN EFI_SIMPLE_NETWORK_PROTOCOL * this,
- IN BOOLEAN reset,
- IN OUT UINTN *statistics_size OPTIONAL,
- IN OUT EFI_NETWORK_STATISTICS * statistics_table OPTIONAL
- )
-;
-
-extern
-EFI_STATUS
-EFIAPI
-snp_undi32_mcast_ip_to_mac (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *this,
- IN BOOLEAN IPv6,
- IN EFI_IP_ADDRESS *IP,
- OUT EFI_MAC_ADDRESS *MAC
- )
-;
-
-extern
-EFI_STATUS
-EFIAPI
-snp_undi32_nvdata (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *this,
- IN BOOLEAN read_write,
- IN UINTN offset,
- IN UINTN buffer_size,
- IN OUT VOID *buffer
- )
-;
-
-extern
-EFI_STATUS
-EFIAPI
-snp_undi32_get_status (
- IN EFI_SIMPLE_NETWORK_PROTOCOL * this,
- OUT UINT32 *interrupt_status OPTIONAL,
- OUT VOID **tx_buffer OPTIONAL
- )
-;
-
-extern
-EFI_STATUS
-EFIAPI
-snp_undi32_transmit (
- IN EFI_SIMPLE_NETWORK_PROTOCOL * this,
- IN UINTN header_size,
- IN UINTN buffer_size,
- IN VOID *buffer,
- IN EFI_MAC_ADDRESS * src_addr OPTIONAL,
- IN EFI_MAC_ADDRESS * dest_addr OPTIONAL,
- IN UINT16 *protocol OPTIONAL
- )
-;
-
-extern
-EFI_STATUS
-EFIAPI
-snp_undi32_receive (
- IN EFI_SIMPLE_NETWORK_PROTOCOL * this,
- OUT UINTN *header_size OPTIONAL,
- IN OUT UINTN *buffer_size,
- OUT VOID *buffer,
- OUT EFI_MAC_ADDRESS * src_addr OPTIONAL,
- OUT EFI_MAC_ADDRESS * dest_addr OPTIONAL,
- OUT UINT16 *protocol OPTIONAL
- )
-;
-
-typedef
-EFI_STATUS
-(*issue_undi32_command) (
- UINT64 cdb
- );
-typedef
-VOID
-(*ptr) (
- VOID
- );
-
-
-/**
- Install all the driver protocol
-
- @param ImageHandle Driver image handle
- @param SystemTable System services table
-
- @retval EFI_SUCEESS Initialization routine has found UNDI hardware, loaded it's
- ROM, and installed a notify event for the Network
- Indentifier Interface Protocol successfully.
- @retval Other Return value from HandleProtocol for DeviceIoProtocol or
- LoadedImageProtocol
-
-**/
-EFI_STATUS
-EFIAPI
-InitializeSnpNiiDriver (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-;
-
-#ifdef EFI_SIZE_REDUCTION_APPLIED
- #define COMPONENT_NAME_CODE(code)
- #define COMPONENT_NAME NULL
-#else
- #define COMPONENT_NAME_CODE(code) code
- #define COMPONENT_NAME &gSimpleNetworkComponentName
-#endif
-
-#define SNP_MEM_PAGES(x) (((x) - 1) / 4096 + 1)
-
-
-#endif /* _SNP_H */
+#include <Library/UefiLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+\r
+#include <IndustryStandard/Pci22.h>\r
+\r
+#define FOUR_GIGABYTES (UINT64) 0x100000000ULL\r
+\r
+\r
+#define SNP_DRIVER_SIGNATURE EFI_SIGNATURE_32 ('s', 'n', 'd', 's')\r
+#define MAX_MAP_LENGTH 100\r
+\r
+#define PCI_BAR_IO_MASK 0x00000003\r
+#define PCI_BAR_IO_MODE 0x00000001\r
+\r
+#define PCI_BAR_MEM_MASK 0x0000000F\r
+#define PCI_BAR_MEM_MODE 0x00000000\r
+#define PCI_BAR_MEM_64BIT 0x00000004\r
+\r
+typedef struct {\r
+ UINT32 Signature;\r
+ EFI_LOCK lock;\r
+\r
+ EFI_SIMPLE_NETWORK_PROTOCOL snp;\r
+ EFI_SIMPLE_NETWORK_MODE mode;\r
+\r
+ EFI_HANDLE device_handle;\r
+ EFI_DEVICE_PATH_PROTOCOL *device_path;\r
+\r
+ //\r
+ // Local instance data needed by SNP driver\r
+ //\r
+ // Pointer to S/W UNDI API entry point\r
+ // This will be NULL for H/W UNDI\r
+ //\r
+ EFI_STATUS (*issue_undi32_command) (UINT64 cdb);\r
+\r
+ BOOLEAN is_swundi;\r
+\r
+ //\r
+ // undi interface number, if one undi manages more nics\r
+ //\r
+ PXE_IFNUM if_num;\r
+\r
+ //\r
+ // Allocated tx/rx buffer that was passed to UNDI Initialize.\r
+ //\r
+ UINT32 tx_rx_bufsize;\r
+ VOID *tx_rx_buffer;\r
+ //\r
+ // mappable buffers for receive and fill header for undi3.0\r
+ // these will be used if the user buffers are above 4GB limit (instead of\r
+ // mapping the user buffers)\r
+ //\r
+ UINT8 *receive_buf;\r
+ VOID *ReceiveBufUnmap;\r
+ UINT8 *fill_hdr_buf;\r
+ VOID *FillHdrBufUnmap;\r
+\r
+ EFI_PCI_IO_PROTOCOL *IoFncs;\r
+ UINT8 IoBarIndex;\r
+ UINT8 MemoryBarIndex;\r
+ BOOLEAN IsOldUndi; // true for EFI1.0 UNDI (3.0) drivers\r
+ //\r
+ // Buffers for command descriptor block, command parameter block\r
+ // and data block.\r
+ //\r
+ PXE_CDB cdb;\r
+ VOID *cpb;\r
+ VOID *CpbUnmap;\r
+ VOID *db;\r
+\r
+ //\r
+ // UNDI structure, we need to remember the init info for a long time!\r
+ //\r
+ PXE_DB_GET_INIT_INFO init_info;\r
+\r
+ VOID *SnpDriverUnmap;\r
+ //\r
+ // when ever we map an address, we must remember it's address and the un-map\r
+ // cookie so that we can unmap later\r
+ //\r
+ struct s_map_list {\r
+ EFI_PHYSICAL_ADDRESS virt;\r
+ VOID *map_cookie;\r
+ } map_list[MAX_MAP_LENGTH];\r
+}\r
+SNP_DRIVER;\r
+\r
+#define EFI_SIMPLE_NETWORK_DEV_FROM_THIS(a) CR (a, SNP_DRIVER, snp, SNP_DRIVER_SIGNATURE)\r
+\r
+//\r
+// Global Variables\r
+//\r
+extern EFI_COMPONENT_NAME_PROTOCOL gSimpleNetworkComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL gSimpleNetworkComponentName2;\r
+\r
+//\r
+// Virtual to physical mapping for all UNDI 3.0s.\r
+//\r
+extern struct s_v2p {\r
+ struct s_v2p *next;\r
+ VOID *vaddr;\r
+ UINTN bsize;\r
+ EFI_PHYSICAL_ADDRESS paddr;\r
+ VOID *unmap;\r
+}\r
+*_v2p;\r
+\r
+EFI_STATUS\r
+add_v2p (\r
+ struct s_v2p **v2p,\r
+ EFI_PCI_IO_PROTOCOL_OPERATION type,\r
+ VOID *vaddr,\r
+ UINTN bsize\r
+ )\r
+;\r
+\r
+EFI_STATUS\r
+find_v2p (\r
+ struct s_v2p **v2p,\r
+ VOID *vaddr\r
+ )\r
+;\r
+\r
+EFI_STATUS\r
+del_v2p (\r
+ VOID *vaddr\r
+ )\r
+;\r
+\r
+extern\r
+VOID \r
+snp_undi32_callback_block_30 (\r
+ IN UINT32 Enable\r
+ )\r
+;\r
+\r
+extern\r
+VOID \r
+snp_undi32_callback_delay_30 (\r
+ IN UINT64 MicroSeconds\r
+ )\r
+;\r
+\r
+extern\r
+VOID \r
+snp_undi32_callback_memio_30 (\r
+ IN UINT8 ReadOrWrite,\r
+ IN UINT8 NumBytes,\r
+ IN UINT64 MemOrPortAddress,\r
+ IN OUT UINT64 BufferPtr\r
+ )\r
+;\r
+\r
+extern\r
+VOID \r
+snp_undi32_callback_v2p_30 (\r
+ IN UINT64 CpuAddr,\r
+ IN OUT UINT64 DeviceAddrPtr\r
+ )\r
+;\r
+\r
+extern\r
+VOID \r
+snp_undi32_callback_block (\r
+ IN UINT64 UniqueId,\r
+ IN UINT32 Enable\r
+ )\r
+;\r
+\r
+extern\r
+VOID \r
+snp_undi32_callback_delay (\r
+ IN UINT64 UniqueId,\r
+ IN UINT64 MicroSeconds\r
+ )\r
+;\r
+\r
+extern\r
+VOID \r
+snp_undi32_callback_memio (\r
+ IN UINT64 UniqueId,\r
+ IN UINT8 ReadOrWrite,\r
+ IN UINT8 NumBytes,\r
+ IN UINT64 MemOrPortAddr,\r
+ IN OUT UINT64 BufferPtr\r
+ )\r
+;\r
+\r
+extern\r
+VOID \r
+snp_undi32_callback_map (\r
+ IN UINT64 UniqueId,\r
+ IN UINT64 CpuAddr,\r
+ IN UINT32 NumBytes,\r
+ IN UINT32 Direction,\r
+ IN OUT UINT64 DeviceAddrPtr\r
+ )\r
+;\r
+\r
+extern\r
+VOID \r
+snp_undi32_callback_unmap (\r
+ IN UINT64 UniqueId,\r
+ IN UINT64 CpuAddr,\r
+ IN UINT32 NumBytes,\r
+ IN UINT32 Direction,\r
+ IN UINT64 DeviceAddr // not a pointer to device address\r
+ )\r
+;\r
+\r
+extern\r
+VOID \r
+snp_undi32_callback_sync (\r
+ IN UINT64 UniqueId,\r
+ IN UINT64 CpuAddr,\r
+ IN UINT32 NumBytes,\r
+ IN UINT32 Direction,\r
+ IN UINT64 DeviceAddr // not a pointer to device address\r
+ )\r
+;\r
+\r
+extern\r
+EFI_STATUS \r
+EFIAPI\r
+snp_undi32_start (\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *this\r
+ )\r
+;\r
+\r
+extern\r
+EFI_STATUS \r
+EFIAPI\r
+snp_undi32_stop (\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *this\r
+ )\r
+;\r
+\r
+extern\r
+EFI_STATUS \r
+EFIAPI\r
+snp_undi32_initialize (\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *this,\r
+ IN UINTN extra_rx_buffer_size OPTIONAL,\r
+ IN UINTN extra_tx_buffer_size OPTIONAL\r
+ )\r
+;\r
+\r
+extern\r
+EFI_STATUS \r
+EFIAPI\r
+snp_undi32_reset (\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *this,\r
+ IN BOOLEAN ExtendedVerification\r
+ )\r
+;\r
+\r
+extern\r
+EFI_STATUS \r
+EFIAPI\r
+snp_undi32_shutdown (\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *this\r
+ )\r
+;\r
+\r
+extern\r
+EFI_STATUS \r
+EFIAPI\r
+snp_undi32_receive_filters (\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL * this,\r
+ IN UINT32 enable,\r
+ IN UINT32 disable,\r
+ IN BOOLEAN reset_mcast_filter,\r
+ IN UINTN mcast_filter_count OPTIONAL,\r
+ IN EFI_MAC_ADDRESS * mcast_filter OPTIONAL\r
+ )\r
+;\r
+\r
+extern\r
+EFI_STATUS \r
+EFIAPI\r
+snp_undi32_station_address (\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL * this,\r
+ IN BOOLEAN reset,\r
+ IN EFI_MAC_ADDRESS *new OPTIONAL\r
+ )\r
+;\r
+\r
+extern\r
+EFI_STATUS \r
+EFIAPI\r
+snp_undi32_statistics (\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL * this,\r
+ IN BOOLEAN reset,\r
+ IN OUT UINTN *statistics_size OPTIONAL,\r
+ IN OUT EFI_NETWORK_STATISTICS * statistics_table OPTIONAL\r
+ )\r
+;\r
+\r
+extern\r
+EFI_STATUS \r
+EFIAPI\r
+snp_undi32_mcast_ip_to_mac (\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *this,\r
+ IN BOOLEAN IPv6,\r
+ IN EFI_IP_ADDRESS *IP,\r
+ OUT EFI_MAC_ADDRESS *MAC\r
+ )\r
+;\r
+\r
+extern\r
+EFI_STATUS \r
+EFIAPI\r
+snp_undi32_nvdata (\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *this,\r
+ IN BOOLEAN read_write,\r
+ IN UINTN offset,\r
+ IN UINTN buffer_size,\r
+ IN OUT VOID *buffer\r
+ )\r
+;\r
+\r
+extern\r
+EFI_STATUS \r
+EFIAPI\r
+snp_undi32_get_status (\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL * this,\r
+ OUT UINT32 *interrupt_status OPTIONAL,\r
+ OUT VOID **tx_buffer OPTIONAL\r
+ )\r
+;\r
+\r
+extern\r
+EFI_STATUS \r
+EFIAPI\r
+snp_undi32_transmit (\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL * this,\r
+ IN UINTN header_size,\r
+ IN UINTN buffer_size,\r
+ IN VOID *buffer,\r
+ IN EFI_MAC_ADDRESS * src_addr OPTIONAL,\r
+ IN EFI_MAC_ADDRESS * dest_addr OPTIONAL,\r
+ IN UINT16 *protocol OPTIONAL\r
+ )\r
+;\r
+\r
+extern\r
+EFI_STATUS \r
+EFIAPI\r
+snp_undi32_receive (\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL * this,\r
+ OUT UINTN *header_size OPTIONAL,\r
+ IN OUT UINTN *buffer_size,\r
+ OUT VOID *buffer,\r
+ OUT EFI_MAC_ADDRESS * src_addr OPTIONAL,\r
+ OUT EFI_MAC_ADDRESS * dest_addr OPTIONAL,\r
+ OUT UINT16 *protocol OPTIONAL\r
+ )\r
+;\r
+\r
+typedef\r
+EFI_STATUS\r
+(*issue_undi32_command) (\r
+ UINT64 cdb\r
+ );\r
+typedef\r
+VOID\r
+(*ptr) (\r
+ VOID\r
+ );\r
+\r
+\r
+/**\r
+ Install all the driver protocol\r
+\r
+ @param ImageHandle Driver image handle\r
+ @param SystemTable System services table\r
+\r
+ @retval EFI_SUCEESS Initialization routine has found UNDI hardware, loaded it's\r
+ ROM, and installed a notify event for the Network\r
+ Indentifier Interface Protocol successfully.\r
+ @retval Other Return value from HandleProtocol for DeviceIoProtocol or\r
+ LoadedImageProtocol\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+InitializeSnpNiiDriver (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ )\r
+;\r
+\r
+#define SNP_MEM_PAGES(x) (((x) - 1) / 4096 + 1)\r
+\r
+\r
+#endif /* _SNP_H */\r