-/** @file
-
-Copyright (c) 2005 - 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:
-
- Ip4Driver.h
-
-Abstract:
-
-
-**/
-
-#ifndef __EFI_IP4_DRIVER_H__
-#define __EFI_IP4_DRIVER_H__
-
-#include <Protocol/ServiceBinding.h>
-
-extern EFI_DRIVER_BINDING_PROTOCOL gIp4DriverBinding;
-extern EFI_COMPONENT_NAME_PROTOCOL gIp4ComponentName;
-
-//
-// Function prototype for the driver's entry point
-//
-EFI_STATUS
-EFIAPI
-Ip4DriverEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-//
-// Function prototypes for the Drivr Binding Protocol
-//
-EFI_STATUS
-EFIAPI
-Ip4DriverBindingSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
- );
-
-EFI_STATUS
-EFIAPI
-Ip4DriverBindingStart (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
- );
-
-EFI_STATUS
-EFIAPI
-Ip4DriverBindingStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer
- );
-
-//
-// Function ptototypes for the ServiceBinding Prococol
-//
-EFI_STATUS
-EFIAPI
-Ip4ServiceBindingCreateChild (
- IN EFI_SERVICE_BINDING_PROTOCOL *This,
- IN EFI_HANDLE *ChildHandle
- );
-
-EFI_STATUS
-EFIAPI
-Ip4ServiceBindingDestroyChild (
- IN EFI_SERVICE_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ChildHandle
- );
-#endif
+/** @file\r
+\r
+Copyright (c) 2005 - 2012, 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
+\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
+**/\r
+\r
+#ifndef __EFI_IP4_DRIVER_H__\r
+#define __EFI_IP4_DRIVER_H__\r
+\r
+#include <Protocol/ServiceBinding.h>\r
+\r
+extern EFI_DRIVER_BINDING_PROTOCOL gIp4DriverBinding;\r
+extern EFI_COMPONENT_NAME_PROTOCOL gIp4ComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL gIp4ComponentName2;\r
+extern EFI_UNICODE_STRING_TABLE *gIp4ControllerNameTable;\r
+\r
+typedef struct {\r
+ EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;\r
+ UINTN NumberOfChildren;\r
+ EFI_HANDLE *ChildHandleBuffer;\r
+} IP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT;\r
+\r
+//\r
+// Function prototype for the driver's entry point\r
+//\r
+/**\r
+ This is the declaration of an EFI image entry point. This entry point is\r
+ the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including\r
+ both device drivers and bus drivers.\r
+ \r
+ The entry point for IP4 driver which install the driver\r
+ binding and component name protocol on its image.\r
+\r
+ @param[in] ImageHandle The firmware allocated handle for the UEFI image.\r
+ @param[in] SystemTable A pointer to the EFI System Table.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Ip4DriverEntryPoint (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ );\r
+\r
+//\r
+// Function prototypes for the Drivr Binding Protocol\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[in] This Protocol instance pointer.\r
+ @param[in] ControllerHandle Handle of device to test\r
+ @param[in] 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_ALREADY_STARTED This driver is already running on this device\r
+ @retval other This driver does not support this device\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Ip4DriverBindingSupported (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL * This,\r
+ IN EFI_HANDLE ControllerHandle,\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[in] This Protocol instance pointer.\r
+ @param[in] ControllerHandle Handle of device to bind driver to\r
+ @param[in] RemainingDevicePath Optional parameter use to pick a specific child\r
+ device to start.\r
+\r
+ @retval EFI_SUCCESS This driver is added to ControllerHandle\r
+ @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle\r
+ @retval other This driver does not support this device\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Ip4DriverBindingStart (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL * This,\r
+ IN EFI_HANDLE ControllerHandle,\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[in] This Protocol instance pointer.\r
+ @param[in] ControllerHandle Handle of device to stop driver on\r
+ @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number\r
+ of children is zero stop the entire bus driver.\r
+ @param[in] ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+ @retval EFI_SUCCESS This driver is removed ControllerHandle\r
+ @retval other This driver was not removed from this device\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Ip4DriverBindingStop (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE ControllerHandle,\r
+ IN UINTN NumberOfChildren,\r
+ IN EFI_HANDLE *ChildHandleBuffer\r
+ );\r
+\r
+//\r
+// Function ptototypes for the ServiceBinding Prococol\r
+//\r
+/**\r
+ Creates a child handle and installs a protocol.\r
+ \r
+ The CreateChild() function installs a protocol on ChildHandle. \r
+ If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle. \r
+ If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r
+\r
+ @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
+ @param ChildHandle Pointer to the handle of the child to create. If it is NULL,\r
+ then a new handle is created. If it is a pointer to an existing UEFI handle, \r
+ then the protocol is added to the existing UEFI handle.\r
+\r
+ @retval EFI_SUCCES The protocol was added to ChildHandle.\r
+ @retval EFI_INVALID_PARAMETER ChildHandle is NULL.\r
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create\r
+ the child\r
+ @retval other The child handle was not created\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Ip4ServiceBindingCreateChild (\r
+ IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
+ IN OUT EFI_HANDLE *ChildHandle\r
+ );\r
+\r
+/**\r
+ Destroys a child handle with a protocol installed on it.\r
+ \r
+ The DestroyChild() function does the opposite of CreateChild(). It removes a protocol \r
+ that was installed by CreateChild() from ChildHandle. If the removed protocol is the \r
+ last protocol on ChildHandle, then ChildHandle is destroyed.\r
+\r
+ @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
+ @param ChildHandle Handle of the child to destroy\r
+\r
+ @retval EFI_SUCCES The protocol was removed from ChildHandle.\r
+ @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.\r
+ @retval EFI_INVALID_PARAMETER Child handle is NULL.\r
+ @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle\r
+ because its services are being used.\r
+ @retval other The child handle was not destroyed\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Ip4ServiceBindingDestroyChild (\r
+ IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE ChildHandle\r
+ );\r
+#endif\r