]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/SnpDxe/Snp.h
1. Use the PciIo->GetBarAttributes to find the logical bar index of the memory mapped...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / SnpDxe / Snp.h
index 4211b4dfc7771a4055f874f5dfaeb383c8099c34..f1d0ab36dbcfa79c73a997e3f1dcafe3a29550a3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
     Declaration of strctures and functions for SnpDxe driver.\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed\r
 and made available under the terms and conditions of the BSD License which\r
 accompanies this distribution. The full text of the license may be found at\r
@@ -34,6 +34,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/PrintLib.h>\r
 \r
 #include <IndustryStandard/Pci.h>\r
+#include <IndustryStandard/Acpi.h>\r
 \r
 #define FOUR_GIGABYTES  (UINT64) 0x100000000ULL\r
 \r
@@ -140,62 +141,6 @@ extern EFI_DRIVER_BINDING_PROTOCOL    gSimpleNetworkDriverBinding;
 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
-typedef struct _V2P V2P;\r
-\r
-struct _V2P {\r
-  V2P                   *Next;\r
-  VOID                  *VirtualAddress;\r
-  UINTN                 BufferSize;\r
-  EFI_PHYSICAL_ADDRESS  PhysicalAddress;\r
-  VOID                  *Unmap;\r
-};\r
-\r
-/**\r
-  This routine maps the given CPU address to a Device address. It creates a\r
-  an entry in the map list with the virtual and physical addresses and the\r
-  un map cookie.\r
-\r
-  @param  V2p                  pointer to return a map list node pointer.\r
-  @param  Type                 the direction in which the data flows from the given\r
-                               virtual address device->cpu or cpu->device or both\r
-                               ways.\r
-  @param  VirtualAddress       virtual address (or CPU address) to be mapped.\r
-  @param  BufferSize           size of the buffer to be mapped.\r
-\r
-  @retval EFI_SUCEESS          routine has completed the mapping.\r
-  @retval other                error as indicated.\r
-\r
-**/\r
-EFI_STATUS\r
-AddV2p (\r
-  V2P                           **V2p,\r
-  EFI_PCI_IO_PROTOCOL_OPERATION Type,\r
-  VOID                          *VirtualAddress,\r
-  UINTN                         BufferSize\r
-  );\r
-\r
-/**\r
-  This routine searches the linked list of mapped address nodes (for undi3.0\r
-  interface) to find the node that corresponds to the given virtual address and\r
-  returns a pointer to that node.\r
-\r
-  @param  V2p                  pointer to return a map list node pointer.\r
-  @param  VirtualAddress                virtual address (or CPU address) to be searched in\r
-                               the map list\r
-\r
-  @retval EFI_SUCEESS          if a match found!\r
-  @retval Other                match not found\r
-\r
-**/\r
-EFI_STATUS\r
-FindV2p (\r
-  V2P          **V2p,\r
-  VOID         *VirtualAddress\r
-  );\r
-\r
 /**\r
   this routine calls undi to start the interface and changes the snp state.\r
 \r
@@ -272,100 +217,6 @@ PxeGetStnAddr (
   SNP_DRIVER *Snp\r
   );\r
 \r
-/**\r
-  This routine unmaps the given virtual address and frees the memory allocated\r
-  for the map list node corresponding to that address.\r
-\r
-  @param  VirtualAddress       virtual address (or CPU address) to be unmapped\r
-\r
-  @retval EFI_SUCEESS          if successfully unmapped\r
-  @retval Other                as indicated by the error\r
-\r
-**/\r
-EFI_STATUS\r
-DelV2p (\r
-  VOID *VirtualAddress\r
-  );\r
-\r
-/**\r
-  This is a callback routine supplied to UNDI at undi_start time.\r
-  UNDI call this routine when it wants to have exclusive access to a critical\r
-  section of the code/data.\r
-\r
-  @param Enable   non-zero indicates acquire\r
-                  zero indicates release\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-SnpUndi32CallbackBlock30 (\r
-  IN UINT32 Enable\r
-  );\r
-\r
-/**\r
-  This is a callback routine supplied to UNDI at undi_start time.\r
-  UNDI call this routine with the number of micro seconds when it wants to\r
-  pause.\r
-\r
-  @param MicroSeconds  number of micro seconds to pause, ususlly multiple of 10.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-SnpUndi32CallbackDelay30 (\r
-  IN UINT64 MicroSeconds\r
-  );\r
-\r
-/**\r
-  This is a callback routine supplied to UNDI at undi_start time.\r
-  This is the IO routine for UNDI. This is not currently being used by UNDI3.0\r
-  because Undi3.0 uses io/mem offsets relative to the beginning of the device\r
-  io/mem address and so it needs to use the PCI_IO_FUNCTION that abstracts the\r
-  start of the device's io/mem addresses. Since SNP cannot retrive the context\r
-  of the undi3.0 interface it cannot use the PCI_IO_FUNCTION that specific for\r
-  that NIC and uses one global IO functions structure, this does not work.\r
-  This however works fine for EFI1.0 Undis because they use absolute addresses\r
-  for io/mem access.\r
-\r
-  @param ReadOrWrite  indicates read or write, IO or Memory\r
-  @param NumBytes     number of bytes to read or write\r
-  @param Address      IO or memory address to read from or write to\r
-  @param BufferAddr   memory location to read into or that contains the bytes to\r
-                      write\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-SnpUndi32CallbackMemio30 (\r
-  IN UINT8      ReadOrWrite,\r
-  IN UINT8      NumBytes,\r
-  IN UINT64     Address,\r
-  IN OUT UINT64 BufferAddr\r
-  );\r
-\r
-/**\r
-  This is a callback routine supplied to UNDI at undi_start time.\r
-  UNDI call this routine with a virtual or CPU address that SNP provided to\r
-  convert it to a physical or device address. Since EFI uses the identical\r
-  mapping, this routine returns the physical address same as the virtual address\r
-  for most of the addresses. an address above 4GB cannot generally be used as a\r
-  device address, it needs to be mapped to a lower physical address. This\r
-  routine does not call the map routine itself, but it assumes that the mapping\r
-  was done at the time of providing the address to UNDI. This routine just\r
-  looks up the address in a map table (which is the v2p structure chain).\r
-\r
-  @param  CpuAddr        virtual address of a buffer.\r
-  @param  DeviceAddrPtr  pointer to the physical address.\r
-                         The DeviceAddrPtr will contain 0 in case of any error.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-SnpUndi32CallbackV2p30 (\r
-  IN UINT64     CpuAddr,\r
-  IN OUT UINT64 DeviceAddrPtr\r
-  );\r
-\r
 /**\r
   This is a callback routine supplied to UNDI3.1 at undi_start time.\r
   UNDI call this routine when it wants to have exclusive access to a critical\r