]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.h
MdeModulePkg/UsbBusDxe: Add UsbControlTransfer() error check
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusDxe / UsbEnumer.h
index e14b2d753c9240ce77b29dde2999ca0ee7b85ddd..ef7d4409173f4735f0801bc00a401a68b10be96e 100644 (file)
@@ -1,7 +1,9 @@
 /** @file\r
 \r
-Copyright (c) 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+    USB bus enumeration interface.\r
+\r
+Copyright (c) 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
@@ -9,17 +11,6 @@ http://opensource.org/licenses/bsd-license.php
 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
-  Module Name:\r
-\r
-    UsbEnumer.h\r
-\r
-  Abstract:\r
-\r
-    USB bus enumeration interface\r
-\r
-  Revision History\r
-\r
-\r
 **/\r
 \r
 #ifndef _USB_ENUMERATION_H_\r
@@ -100,52 +91,111 @@ EFI_STATUS
   IN USB_INTERFACE        *UsbIf\r
   );\r
 \r
-typedef struct _USB_HUB_API{\r
-  USB_HUB_INIT                Init;\r
-  USB_HUB_GET_PORT_STATUS     GetPortStatus;\r
-  USB_HUB_CLEAR_PORT_CHANGE   ClearPortChange;\r
-  USB_HUB_SET_PORT_FEATURE    SetPortFeature;\r
-  USB_HUB_CLEAR_PORT_FEATURE  ClearPortFeature;\r
-  USB_HUB_RESET_PORT          ResetPort;\r
-  USB_HUB_RELEASE             Release;\r
-} USB_HUB_API;\r
+/**\r
+  Return the endpoint descriptor in this interface.\r
+\r
+  @param  UsbIf                 The interface to search in.\r
+  @param  EpAddr                The address of the endpoint to return.\r
+\r
+  @return The endpoint descriptor or NULL.\r
 \r
+**/\r
 USB_ENDPOINT_DESC*\r
 UsbGetEndpointDesc (\r
   IN USB_INTERFACE        *UsbIf,\r
   IN UINT8                EpAddr\r
   );\r
 \r
+/**\r
+  Select an alternate setting for the interface.\r
+  Each interface can have several mutually exclusive\r
+  settings. Only one setting is active. It will\r
+  also reset its endpoints' toggle to zero.\r
+\r
+  @param  IfDesc                The interface descriptor to set.\r
+  @param  Alternate             The alternate setting number to locate.\r
+\r
+  @retval EFI_NOT_FOUND         There is no setting with this alternate index.\r
+  @retval EFI_SUCCESS           The interface is set to Alternate setting.\r
 \r
+**/\r
 EFI_STATUS\r
 UsbSelectSetting (\r
   IN USB_INTERFACE_DESC   *IfDesc,\r
   IN UINT8                Alternate\r
   );\r
 \r
+/**\r
+  Select a new configuration for the device. Each\r
+  device may support several configurations.\r
+\r
+  @param  Device                The device to select configuration.\r
+  @param  ConfigIndex           The index of the configuration ( != 0).\r
+\r
+  @retval EFI_NOT_FOUND         There is no configuration with the index.\r
+  @retval EFI_OUT_OF_RESOURCES  Failed to allocate resource.\r
+  @retval EFI_SUCCESS           The configuration is selected.\r
+\r
+**/\r
 EFI_STATUS\r
 UsbSelectConfig (\r
   IN USB_DEVICE           *Device,\r
   IN UINT8                ConfigIndex\r
   );\r
 \r
-VOID\r
+/**\r
+  Remove the current device configuration.\r
+\r
+  @param  Device                The USB device to remove configuration from.\r
+\r
+  @return None.\r
+\r
+**/\r
+EFI_STATUS\r
 UsbRemoveConfig (\r
   IN USB_DEVICE           *Device\r
   );\r
 \r
+/**\r
+  Remove the device and all its children from the bus.\r
+\r
+  @param  Device                The device to remove.\r
+\r
+  @retval EFI_SUCCESS           The device is removed.\r
+\r
+**/\r
 EFI_STATUS\r
 UsbRemoveDevice (\r
   IN USB_DEVICE           *Device\r
   );\r
 \r
+/**\r
+  Enumerate all the changed hub ports.\r
+\r
+  @param  Event                 The event that is triggered.\r
+  @param  Context               The context to the event.\r
+\r
+  @return None.\r
+\r
+**/\r
 VOID\r
+EFIAPI\r
 UsbHubEnumeration (\r
   IN EFI_EVENT            Event,\r
   IN VOID                 *Context\r
   );\r
 \r
+/**\r
+  Enumerate all the changed hub ports.\r
+\r
+  @param  Event                 The event that is triggered.\r
+  @param  Context               The context to the event.\r
+\r
+  @return None.\r
+\r
+**/\r
 VOID\r
+EFIAPI\r
 UsbRootHubEnumeration (\r
   IN EFI_EVENT            Event,\r
   IN VOID                 *Context\r