]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OptionRomPkg/UndiRuntimeDxe/Undi32.h
Add IPV6 support from UNDI
[mirror_edk2.git] / OptionRomPkg / UndiRuntimeDxe / Undi32.h
index d09761d59ddc319d9e8b7faad7bf6d8d44c38375..18341dd5128a70fa226a95e1b1d8bb7517eaf100 100644 (file)
@@ -21,6 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/PciIo.h>\r
 #include <Protocol/NetworkInterfaceIdentifier.h>\r
 #include <Protocol/DevicePath.h>\r
+#include <Protocol/AdapterInformation.h>\r
 \r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/UefiRuntimeLib.h>\r
@@ -30,6 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/DevicePathLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
 \r
 #include <IndustryStandard/Pci.h>\r
 \r
@@ -57,10 +59,12 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gUndiComponentName2;
 #define UNDI_DEV_SIGNATURE   SIGNATURE_32('u','n','d','i')\r
 #define UNDI_DEV_FROM_THIS(a) CR(a, UNDI32_DEV, NIIProtocol_31, UNDI_DEV_SIGNATURE)\r
 #define UNDI_DEV_FROM_NIC(a) CR(a, UNDI32_DEV, NicInfo, UNDI_DEV_SIGNATURE)\r
+#define UNDI_DEV_FROM_AIP(a) CR(a, UNDI32_DEV, Aip, UNDI_DEV_SIGNATURE)\r
 \r
 typedef struct {\r
   UINTN                                     Signature;\r
   EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL NIIProtocol_31;\r
+  EFI_ADAPTER_INFORMATION_PROTOCOL          Aip;\r
   EFI_HANDLE                                DeviceHandle;\r
   EFI_DEVICE_PATH_PROTOCOL                  *Undi32BaseDevPath;\r
   EFI_DEVICE_PATH_PROTOCOL                  *Undi32DevPath;\r
@@ -343,4 +347,99 @@ INT32 validate_mcip (PXE_MAC_ADDR *MCastAddr);
 VOID PxeStructInit (PXE_SW_UNDI *PxePtr);\r
 VOID PxeUpdate (NIC_DATA_INSTANCE *NicPtr, PXE_SW_UNDI *PxePtr);\r
 \r
+//\r
+// functions defined in UndiAipImpl.c\r
+//\r
+\r
+/**\r
+  Returns the current state information for the adapter.\r
+\r
+  This function returns information of type InformationType from the adapter.\r
+  If an adapter does not support the requested informational type, then\r
+  EFI_UNSUPPORTED is returned. \r
+\r
+  @param[in]  This                   A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.\r
+  @param[in]  InformationType        A pointer to an EFI_GUID that defines the contents of InformationBlock.\r
+  @param[out] InforamtionBlock       The service returns a pointer to the buffer with the InformationBlock\r
+                                     structure which contains details about the data specific to InformationType.\r
+  @param[out] InforamtionBlockSize   The driver returns the size of the InformationBlock in bytes.\r
+\r
+  @retval EFI_SUCCESS                The InformationType information was retrieved.\r
+  @retval EFI_UNSUPPORTED            The InformationType is not known.\r
+  @retval EFI_DEVICE_ERROR           The device reported an error.\r
+  @retval EFI_OUT_OF_RESOURCES       The request could not be completed due to a lack of resources.\r
+  @retval EFI_INVALID_PARAMETER      This is NULL. \r
+  @retval EFI_INVALID_PARAMETER      InformationBlock is NULL. \r
+  @retval EFI_INVALID_PARAMETER      InformationBlockSize is NULL.\r
+\r
+**/  \r
+EFI_STATUS\r
+EFIAPI\r
+UndiAipGetInfo (\r
+  IN   EFI_ADAPTER_INFORMATION_PROTOCOL *This,\r
+  IN   EFI_GUID                         *InformationType,\r
+  OUT  VOID                             **InformationBlock,\r
+  OUT  UINTN                            *InformationBlockSize\r
+  );\r
+\r
+/**\r
+  Sets state information for an adapter.\r
+\r
+  This function sends information of type InformationType for an adapter.\r
+  If an adapter does not support the requested information type, then EFI_UNSUPPORTED\r
+  is returned.\r
+\r
+  @param[in]  This                   A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.\r
+  @param[in]  InformationType        A pointer to an EFI_GUID that defines the contents of InformationBlock.\r
+  @param[in]  InforamtionBlock       A pointer to the InformationBlock structure which contains details\r
+                                     about the data specific to InformationType.\r
+  @param[in]  InforamtionBlockSize   The size of the InformationBlock in bytes.\r
+\r
+  @retval EFI_SUCCESS                The information was received and interpreted successfully.\r
+  @retval EFI_UNSUPPORTED            The InformationType is not known.\r
+  @retval EFI_DEVICE_ERROR           The device reported an error.\r
+  @retval EFI_INVALID_PARAMETER      This is NULL.\r
+  @retval EFI_INVALID_PARAMETER      InformationBlock is NULL.\r
+  @retval EFI_WRITE_PROTECTED        The InformationType cannot be modified using EFI_ADAPTER_INFO_SET_INFO().\r
+\r
+**/                        \r
+EFI_STATUS\r
+EFIAPI\r
+UndiAipSetInfo (\r
+  IN   EFI_ADAPTER_INFORMATION_PROTOCOL *This,\r
+  IN   EFI_GUID                         *InformationType,\r
+  IN   VOID                             *InformationBlock,\r
+  IN   UINTN                            InformationBlockSize\r
+  );\r
+\r
+/**\r
+  Get a list of supported information types for this instance of the protocol.\r
+\r
+  This function returns a list of InformationType GUIDs that are supported on an\r
+  adapter with this instance of EFI_ADAPTER_INFORMATION_PROTOCOL. The list is returned\r
+  in InfoTypesBuffer, and the number of GUID pointers in InfoTypesBuffer is returned in\r
+  InfoTypesBufferCount.\r
+\r
+  @param[in]  This                  A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.\r
+  @param[out] InfoTypesBuffer       A pointer to the list of InformationType GUID pointers that are supported\r
+                                    by This.\r
+  @param[out] InfoTypesBufferCount  A pointer to the number of GUID pointers present in InfoTypesBuffer.\r
+\r
+  @retval EFI_SUCCESS               The list of information type GUIDs that are supported on this adapter was\r
+                                    returned in InfoTypesBuffer. The number of information type GUIDs was\r
+                                    returned in InfoTypesBufferCount.\r
+  @retval EFI_INVALID_PARAMETER     This is NULL.\r
+  @retval EFI_INVALID_PARAMETER     InfoTypesBuffer is NULL.\r
+  @retval EFI_INVALID_PARAMETER     InfoTypesBufferCount is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES      There is not enough pool memory to store the results.\r
+\r
+**/                        \r
+EFI_STATUS\r
+EFIAPI\r
+UndiAipGetSupportedTypes (\r
+  IN    EFI_ADAPTER_INFORMATION_PROTOCOL *This,\r
+  OUT   EFI_GUID                         **InfoTypesBuffer,\r
+  OUT   UINTN                            *InfoTypesBufferCount\r
+  );\r
+\r
 #endif\r