X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Nt32Pkg%2FSnpNt32Dxe%2FSnpNt32.h;h=cb95c5711c228d3f8c61642d33baf729025fd329;hb=aa5f60ae41f0fa1b4816071704ab6669b0fe94c1;hp=7769bbf295aaf76a9ea1730ece00009241811164;hpb=e90e87777cfefa3569b74bcd877ae2a391d96e7f;p=mirror_edk2.git diff --git a/Nt32Pkg/SnpNt32Dxe/SnpNt32.h b/Nt32Pkg/SnpNt32Dxe/SnpNt32.h index 7769bbf295..cb95c5711c 100644 --- a/Nt32Pkg/SnpNt32Dxe/SnpNt32.h +++ b/Nt32Pkg/SnpNt32Dxe/SnpNt32.h @@ -1,7 +1,7 @@ /** @file -Copyright (c) 2006 - 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2006 - 2016, 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 @@ -20,7 +20,7 @@ Abstract: #ifndef _SNP_NT32_H_ #define _SNP_NT32_H_ -#include +#include #include #include @@ -58,6 +58,12 @@ typedef struct _NT_NET_INTERFACE_INFO { #define MAX_INTERFACE_INFO_NUMBER 16 #define MAX_FILE_NAME_LENGTH 280 +#define SNP_MAX_TX_BUFFER_NUM 65536 +#define SNP_TX_BUFFER_INCREASEMENT 32 + + + + // // Functions in Net Library // @@ -137,9 +143,9 @@ EFI_STATUS // // Global data for this driver // -#define SNP_NT32_DRIVER_SIGNATURE EFI_SIGNATURE_32 ('W', 'S', 'N', 'P') +#define SNP_NT32_DRIVER_SIGNATURE SIGNATURE_32 ('W', 'S', 'N', 'P') -typedef struct _SNPNT32_GLOBAL_DATA { +struct _SNPNT32_GLOBAL_DATA { UINT32 Signature; // @@ -154,20 +160,34 @@ typedef struct _SNPNT32_GLOBAL_DATA { EFI_LOCK Lock; + // + // Array of the recycled transmit buffer address. + // + UINT64 *RecycledTxBuf; + + // + // Current number of recycled buffer pointers in RecycledTxBuf. + // + UINT32 RecycledTxBufCount; + + // The maximum number of recycled buffer pointers in RecycledTxBuf. + // + UINT32 MaxRecycledTxBuf; + // // Private functions // SNPNT32_INITIALIZE_GLOBAL_DATA InitializeGlobalData; SNPNT32_INITIALIZE_INSTANCE_DATA InitializeInstanceData; SNPNT32_CLOSE_INSTANCE CloseInstance; -} SNPNT32_GLOBAL_DATA; +}; // // Instance data for each fake SNP instance // -#define SNP_NT32_INSTANCE_SIGNATURE EFI_SIGNATURE_32 ('w', 'S', 'N', 'P') +#define SNP_NT32_INSTANCE_SIGNATURE SIGNATURE_32 ('w', 'S', 'N', 'P') -typedef struct _SNPNT32_INSTANCE_DATA { +struct _SNPNT32_INSTANCE_DATA { UINT32 Signature; // @@ -188,7 +208,7 @@ typedef struct _SNPNT32_INSTANCE_DATA { // // Private functions // -} SNPNT32_INSTANCE_DATA; +}; #define SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS(a) \ CR ( \ @@ -198,10 +218,27 @@ typedef struct _SNPNT32_INSTANCE_DATA { SNP_NT32_INSTANCE_SIGNATURE \ ) -extern EFI_DRIVER_BINDING_PROTOCOL gSnpNt32DriverBinding; +extern EFI_DRIVER_BINDING_PROTOCOL gSnpNt32DriverBinding; extern EFI_COMPONENT_NAME_PROTOCOL gSnpNt32DriverComponentName; extern EFI_COMPONENT_NAME2_PROTOCOL gSnpNt32DriverComponentName2; +/** + Test to see if this driver supports ControllerHandle. This service + is called by the EFI boot service ConnectController(). In + order to make drivers as small as possible, there are a few calling + restrictions for this service. ConnectController() must + follow these calling restrictions. If any other agent wishes to call + Supported() it must also follow these calling restrictions. + + @param This Protocol instance pointer. + @param ControllerHandle Handle of device to test + @param RemainingDevicePath Optional parameter use to pick a specific child + device to start. + + @retval EFI_SUCCESS This driver supports this device + @retval EFI_UNSUPPORTED This driver does not support this device + +**/ EFI_STATUS EFIAPI SnpNt32DriverBindingSupported ( @@ -210,6 +247,22 @@ SnpNt32DriverBindingSupported ( IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL ); +/** + Start this driver on ControllerHandle. This service is called by the + EFI boot service ConnectController(). In order to make + drivers as small as possible, there are a few calling restrictions for + this service. ConnectController() must follow these + calling restrictions. If any other agent wishes to call Start() it + must also follow these calling restrictions. + + @param This Protocol instance pointer. + @param ControllerHandle Handle of device to bind driver to + @param RemainingDevicePath Optional parameter use to pick a specific child + device to start. + + @retval EFI_SUCCESS Always succeeds. + +**/ EFI_STATUS EFIAPI SnpNt32DriverBindingStart ( @@ -218,6 +271,23 @@ SnpNt32DriverBindingStart ( IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL ); +/** + Stop this driver on ControllerHandle. This service is called by the + EFI boot service DisconnectController(). In order to + make drivers as small as possible, there are a few calling + restrictions for this service. DisconnectController() + must follow these calling restrictions. If any other agent wishes + to call Stop() it must also follow these calling restrictions. + + @param This Protocol instance pointer. + @param ControllerHandle Handle of device to stop driver on + @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of + children is zero stop the entire bus driver. + @param ChildHandleBuffer List of Child Handles to Stop. + + @retval EFI_SUCCESS Always succeeds. + +**/ EFI_STATUS EFIAPI SnpNt32DriverBindingStop ( @@ -227,21 +297,52 @@ SnpNt32DriverBindingStop ( IN EFI_HANDLE *ChildHandleBuffer ); +/** + Initialize the driver's global data. + + @param This Pointer to the global context data. + + @retval EFI_SUCCESS The global data is initialized. + @retval EFI_NOT_FOUND The required DLL is not found. + @retval EFI_DEVICE_ERROR Error initialize network utility library. + @retval EFI_OUT_OF_RESOURCES Out of resource. + @retval other Other errors. + +**/ EFI_STATUS SnpNt32InitializeGlobalData ( - IN SNPNT32_GLOBAL_DATA *This + IN OUT SNPNT32_GLOBAL_DATA *This ); +/** + Initialize the snpnt32 driver instance. + + @param This Pointer to the SnpNt32 global data. + @param Instance Pointer to the instance context data. + + @retval EFI_SUCCESS The driver instance is initialized. + @retval other Initialization errors. + +**/ EFI_STATUS SnpNt32InitializeInstanceData ( - IN SNPNT32_GLOBAL_DATA *This, - IN SNPNT32_INSTANCE_DATA *Instance + IN SNPNT32_GLOBAL_DATA *This, + IN OUT SNPNT32_INSTANCE_DATA *Instance ); +/** + Close the SnpNt32 driver instance. + + @param This Pointer to the SnpNt32 global data. + @param Instance Pointer to the instance context data. + + @retval EFI_SUCCESS The instance is closed. + +**/ EFI_STATUS SnpNt32CloseInstance ( - IN SNPNT32_GLOBAL_DATA *This, - IN SNPNT32_INSTANCE_DATA *Instance + IN SNPNT32_GLOBAL_DATA *This, + IN OUT SNPNT32_INSTANCE_DATA *Instance ); #endif