/** @file\r
\r
-Copyright (c) 2006 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+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
#ifndef _SNP_NT32_H_\r
#define _SNP_NT32_H_\r
\r
-#include <PiDxe.h>\r
+#include <Uefi.h>\r
\r
#include <Protocol/SimpleNetwork.h>\r
#include <Protocol/DevicePath.h>\r
//\r
// Global data for this driver\r
//\r
-#define SNP_NT32_DRIVER_SIGNATURE EFI_SIGNATURE_32 ('W', 'S', 'N', 'P')\r
+#define SNP_NT32_DRIVER_SIGNATURE SIGNATURE_32 ('W', 'S', 'N', 'P')\r
\r
-typedef struct _SNPNT32_GLOBAL_DATA {\r
+struct _SNPNT32_GLOBAL_DATA {\r
UINT32 Signature;\r
\r
//\r
// List for all the fake SNP instance\r
//\r
- NET_LIST_ENTRY InstanceList;\r
+ LIST_ENTRY InstanceList;\r
\r
EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk;\r
HMODULE NetworkLibraryHandle;\r
\r
NT_NET_UTILITY_TABLE NtNetUtilityTable;\r
\r
- NET_LOCK Lock;\r
+ EFI_LOCK Lock;\r
\r
//\r
// Private functions\r
SNPNT32_INITIALIZE_GLOBAL_DATA InitializeGlobalData;\r
SNPNT32_INITIALIZE_INSTANCE_DATA InitializeInstanceData;\r
SNPNT32_CLOSE_INSTANCE CloseInstance;\r
-} SNPNT32_GLOBAL_DATA;\r
+};\r
\r
//\r
// Instance data for each fake SNP instance\r
//\r
-#define SNP_NT32_INSTANCE_SIGNATURE EFI_SIGNATURE_32 ('w', 'S', 'N', 'P')\r
+#define SNP_NT32_INSTANCE_SIGNATURE SIGNATURE_32 ('w', 'S', 'N', 'P')\r
\r
-typedef struct _SNPNT32_INSTANCE_DATA {\r
+struct _SNPNT32_INSTANCE_DATA {\r
UINT32 Signature;\r
\r
//\r
// List entry use for linking with other instance\r
//\r
- NET_LIST_ENTRY Entry;\r
+ LIST_ENTRY Entry;\r
\r
SNPNT32_GLOBAL_DATA *GlobalData;\r
\r
//\r
// Private functions\r
//\r
-} SNPNT32_INSTANCE_DATA;\r
+};\r
\r
#define SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS(a) \\r
CR ( \\r
SNP_NT32_INSTANCE_SIGNATURE \\r
)\r
\r
-extern EFI_DRIVER_BINDING_PROTOCOL gSnpNt32DriverBinding;\r
+extern EFI_DRIVER_BINDING_PROTOCOL gSnpNt32DriverBinding;\r
extern EFI_COMPONENT_NAME_PROTOCOL gSnpNt32DriverComponentName;\r
extern EFI_COMPONENT_NAME2_PROTOCOL gSnpNt32DriverComponentName2;\r
\r
+/**\r
+ Test to see if this driver supports ControllerHandle. This service\r
+ is called by the EFI boot service ConnectController(). In\r
+ order to make drivers as small as possible, there are a few calling\r
+ restrictions for this service. ConnectController() must\r
+ follow these calling restrictions. If any other agent wishes to call\r
+ Supported() it must also follow these calling restrictions.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param ControllerHandle Handle of device to test\r
+ @param RemainingDevicePath Optional parameter use to pick a specific child\r
+ device to start.\r
+\r
+ @retval EFI_SUCCESS This driver supports this device\r
+ @retval EFI_UNSUPPORTED This driver does not support this device\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
SnpNt32DriverBindingSupported (\r
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL\r
);\r
\r
+/**\r
+ Start this driver on ControllerHandle. This service is called by the\r
+ EFI boot service ConnectController(). In order to make\r
+ drivers as small as possible, there are a few calling restrictions for\r
+ this service. ConnectController() must follow these\r
+ calling restrictions. If any other agent wishes to call Start() it\r
+ must also follow these calling restrictions.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param ControllerHandle Handle of device to bind driver to\r
+ @param RemainingDevicePath Optional parameter use to pick a specific child\r
+ device to start.\r
+\r
+ @retval EFI_SUCCESS Always succeeds.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
SnpNt32DriverBindingStart (\r
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL\r
);\r
\r
+/**\r
+ Stop this driver on ControllerHandle. This service is called by the\r
+ EFI boot service DisconnectController(). In order to\r
+ make drivers as small as possible, there are a few calling\r
+ restrictions for this service. DisconnectController()\r
+ must follow these calling restrictions. If any other agent wishes\r
+ to call Stop() it must also follow these calling restrictions.\r
+ \r
+ @param This Protocol instance pointer.\r
+ @param ControllerHandle Handle of device to stop driver on\r
+ @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of\r
+ children is zero stop the entire bus driver.\r
+ @param ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+ @retval EFI_SUCCESS Always succeeds.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
SnpNt32DriverBindingStop (\r
IN EFI_HANDLE *ChildHandleBuffer\r
);\r
\r
+/**\r
+ Initialize the driver's global data.\r
+\r
+ @param This Pointer to the global context data.\r
+\r
+ @retval EFI_SUCCESS The global data is initialized.\r
+ @retval EFI_NOT_FOUND The required DLL is not found.\r
+ @retval EFI_DEVICE_ERROR Error initialize network utility library.\r
+ @retval EFI_OUT_OF_RESOURCES Out of resource.\r
+ @retval other Other errors.\r
+\r
+**/\r
EFI_STATUS\r
SnpNt32InitializeGlobalData (\r
- IN SNPNT32_GLOBAL_DATA *This\r
+ IN OUT SNPNT32_GLOBAL_DATA *This\r
);\r
\r
+/**\r
+ Initialize the snpnt32 driver instance.\r
+\r
+ @param This Pointer to the SnpNt32 global data.\r
+ @param Instance Pointer to the instance context data.\r
+\r
+ @retval EFI_SUCCESS The driver instance is initialized.\r
+ @retval other Initialization errors.\r
+\r
+**/\r
EFI_STATUS\r
SnpNt32InitializeInstanceData (\r
- IN SNPNT32_GLOBAL_DATA *This,\r
- IN SNPNT32_INSTANCE_DATA *Instance\r
+ IN SNPNT32_GLOBAL_DATA *This,\r
+ IN OUT SNPNT32_INSTANCE_DATA *Instance\r
);\r
\r
+/**\r
+ Close the SnpNt32 driver instance.\r
+\r
+ @param This Pointer to the SnpNt32 global data.\r
+ @param Instance Pointer to the instance context data.\r
+\r
+ @retval EFI_SUCCESS The instance is closed.\r
+\r
+**/\r
EFI_STATUS\r
SnpNt32CloseInstance (\r
- IN SNPNT32_GLOBAL_DATA *This,\r
- IN SNPNT32_INSTANCE_DATA *Instance\r
+ IN SNPNT32_GLOBAL_DATA *This,\r
+ IN OUT SNPNT32_INSTANCE_DATA *Instance\r
);\r
\r
#endif\r