-/*++\r
+/** @file\r
+ Support functions to connect/disconnect UEFI Driver model Protocol\r
\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. 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
+Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
+All rights reserved. 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
-Module Name:\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
- DriverSupport.c\r
- \r
-Abstract:\r
-\r
- EFI Driver Support Protocol\r
-\r
-Revision History\r
-\r
---*/\r
+**/\r
\r
#include <DxeMain.h>\r
\r
//\r
// Driver Support Function Prototypes\r
-//\r
+// \r
+/**\r
+ Connects a controller to a driver.\r
+\r
+ @param ControllerHandle Handle of the controller to be \r
+ connected. \r
+ @param ContextDriverImageHandles DriverImageHandle A pointer to an \r
+ ordered list of driver image \r
+ handles. \r
+ @param RemainingDevicePath RemainingDevicePath A pointer to \r
+ the device path that specifies a \r
+ child of the controller \r
+ specified by ControllerHandle. \r
+\r
+ @retval EFI_SUCCESS One or more drivers were \r
+ connected to ControllerHandle. \r
+ @retval EFI_OUT_OF_RESOURCES No enough system resources to \r
+ complete the request. \r
+ @retval EFI_NOT_FOUND No drivers were connected to \r
+ ControllerHandle.\r
+\r
+**/\r
EFI_STATUS \r
CoreConnectSingleController (\r
IN EFI_HANDLE ControllerHandle,\r
- IN EFI_HANDLE *DriverImageHandle OPTIONAL,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
+ IN EFI_HANDLE *ContextDriverImageHandles OPTIONAL,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL \r
);\r
\r
//\r
// Driver Support Functions\r
//\r
+\r
+/**\r
+ Connects one or more drivers to a controller.\r
+\r
+ @param ControllerHandle Handle of the controller to be \r
+ connected. \r
+ @param DriverImageHandle DriverImageHandle A pointer to an \r
+ ordered list of driver image \r
+ handles. \r
+ @param RemainingDevicePath RemainingDevicePath A pointer to \r
+ the device path that specifies a \r
+ child of the controller specified \r
+ by ControllerHandle. \r
+ @param Recursive Whether the function would be \r
+ called recursively or not. \r
+\r
+ @return Status code.\r
+\r
+**/\r
EFI_STATUS \r
EFIAPI\r
CoreConnectController (\r
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,\r
IN BOOLEAN Recursive\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Connects one or more drivers to a controller.\r
-\r
-Arguments:\r
-\r
- ControllerHandle - Handle of the controller to be connected.\r
-\r
- DriverImageHandle - DriverImageHandle A pointer to an ordered list of driver image handles.\r
-\r
- RemainingDevicePath - RemainingDevicePath A pointer to the device path that specifies a child of the\r
- controller specified by ControllerHandle.\r
- \r
- Recursive - Whether the function would be called recursively or not.\r
-\r
-Returns:\r
-\r
- Status code.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
EFI_STATUS ReturnStatus;\r
return ReturnStatus;\r
}\r
\r
+\r
+/**\r
+ Add Driver Binding Protocols from Context Driver Image Handles to sorted\r
+ Driver Binding Protocol list.\r
+\r
+ @param DriverBindingHandle Handle of the driver binding \r
+ protocol. \r
+ @param NumberOfSortedDriverBindingProtocols Number Of sorted driver binding \r
+ protocols \r
+ @param SortedDriverBindingProtocols The sorted protocol list. \r
+ @param DriverBindingHandleCount Driver Binding Handle Count. \r
+ @param DriverBindingHandleBuffer The buffer of driver binding \r
+ protocol to be modified. \r
+ @param IsImageHandle Indicate whether \r
+ DriverBindingHandle is an image \r
+ handle \r
+\r
+ @return None.\r
+\r
+**/\r
VOID\r
AddSortedDriverBindingProtocol (\r
IN EFI_HANDLE DriverBindingHandle,\r
IN OUT EFI_HANDLE *DriverBindingHandleBuffer,\r
IN BOOLEAN IsImageHandle\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Add Driver Binding Protocols from Context Driver Image Handles to sorted \r
- Driver Binding Protocol list.\r
-\r
-Arguments:\r
-\r
- DriverBindingHandle - Handle of the driver binding protocol.\r
-\r
- NumberOfSortedDriverBindingProtocols - Number Of sorted driver binding protocols\r
-\r
- SortedDriverBindingProtocols - The sorted protocol list. \r
- \r
- DriverBindingHandleCount - Driver Binding Handle Count.\r
-\r
- DriverBindingHandleBuffer - The buffer of driver binding protocol to be modified.\r
-\r
- IsImageHandle - Indicate whether DriverBindingHandle is an image handle\r
- \r
-Returns:\r
-\r
- None.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;\r
}\r
}\r
\r
+\r
+/**\r
+ Connects a controller to a driver.\r
+\r
+ @param ControllerHandle Handle of the controller to be \r
+ connected. \r
+ @param ContextDriverImageHandles DriverImageHandle A pointer to an \r
+ ordered list of driver image \r
+ handles. \r
+ @param RemainingDevicePath RemainingDevicePath A pointer to \r
+ the device path that specifies a \r
+ child of the controller \r
+ specified by ControllerHandle. \r
+\r
+ @retval EFI_SUCCESS One or more drivers were \r
+ connected to ControllerHandle. \r
+ @retval EFI_OUT_OF_RESOURCES No enough system resources to \r
+ complete the request. \r
+ @retval EFI_NOT_FOUND No drivers were connected to \r
+ ControllerHandle.\r
+\r
+**/\r
EFI_STATUS \r
CoreConnectSingleController (\r
IN EFI_HANDLE ControllerHandle,\r
IN EFI_HANDLE *ContextDriverImageHandles OPTIONAL,\r
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL \r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Connects a controller to a driver.\r
-\r
-Arguments:\r
-\r
- ControllerHandle - Handle of the controller to be connected.\r
- ContextDriverImageHandles - DriverImageHandle A pointer to an ordered list of driver image handles.\r
- RemainingDevicePath - RemainingDevicePath A pointer to the device path that specifies a child \r
- of the controller specified by ControllerHandle.\r
- \r
-Returns:\r
-\r
- EFI_SUCCESS - One or more drivers were connected to ControllerHandle.\r
- EFI_OUT_OF_RESOURCES - No enough system resources to complete the request.\r
- EFI_NOT_FOUND - No drivers were connected to ControllerHandle.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
UINTN Index;\r
}\r
\r
\r
+\r
+/**\r
+ Disonnects a controller from a driver\r
+\r
+ @param ControllerHandle ControllerHandle The handle of \r
+ the controller from which \r
+ driver(s) are to be \r
+ disconnected. \r
+ @param DriverImageHandle DriverImageHandle The driver to \r
+ disconnect from ControllerHandle. \r
+ @param ChildHandle ChildHandle The handle of the \r
+ child to destroy. \r
+\r
+ @retval EFI_SUCCESS One or more drivers were \r
+ disconnected from the controller. \r
+ @retval EFI_SUCCESS On entry, no drivers are managing \r
+ ControllerHandle. \r
+ @retval EFI_SUCCESS DriverImageHandle is not NULL, \r
+ and on entry DriverImageHandle is \r
+ not managing ControllerHandle. \r
+ @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid \r
+ EFI_HANDLE. \r
+ @retval EFI_INVALID_PARAMETER DriverImageHandle is not NULL, \r
+ and it is not a valid EFI_HANDLE. \r
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL, and it \r
+ is not a valid EFI_HANDLE. \r
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources \r
+ available to disconnect any \r
+ drivers from ControllerHandle. \r
+ @retval EFI_DEVICE_ERROR The controller could not be \r
+ disconnected because of a device \r
+ error.\r
+\r
+**/\r
EFI_STATUS \r
EFIAPI\r
CoreDisconnectController (\r
IN EFI_HANDLE DriverImageHandle OPTIONAL,\r
IN EFI_HANDLE ChildHandle OPTIONAL\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Disonnects a controller from a driver\r
-\r
-Arguments:\r
-\r
- ControllerHandle - ControllerHandle The handle of the controller from which driver(s) \r
- are to be disconnected.\r
- DriverImageHandle - DriverImageHandle The driver to disconnect from ControllerHandle.\r
- ChildHandle - ChildHandle The handle of the child to destroy.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - One or more drivers were disconnected from the controller.\r
- EFI_SUCCESS - On entry, no drivers are managing ControllerHandle.\r
- EFI_SUCCESS - DriverImageHandle is not NULL, and on entry DriverImageHandle is not managing ControllerHandle.\r
- EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
- EFI_INVALID_PARAMETER - DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.\r
- EFI_INVALID_PARAMETER - ChildHandle is not NULL, and it is not a valid EFI_HANDLE.\r
- EFI_OUT_OF_RESOURCES - There are not enough resources available to disconnect any drivers from ControllerHandle.\r
- EFI_DEVICE_ERROR - The controller could not be disconnected because of a device error.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
IHANDLE *Handle;\r