/** @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
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
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