/** @file\r
\r
+ The definition for USB hub.\r
+\r
Copyright (c) 2007, 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
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
- UsbHub.h\r
-\r
- Abstract:\r
-\r
- The definition for USB hub\r
-\r
- Revision History\r
-\r
-\r
**/\r
\r
#ifndef _USB_HUB_H_\r
#define USB_ENDPOINT_ADDR(EpAddr) ((EpAddr) & 0x7F)\r
#define USB_ENDPOINT_TYPE(Desc) ((Desc)->Attributes & USB_ENDPOINT_TYPE_MASK)\r
\r
-enum {\r
+typedef enum {\r
USB_DESC_TYPE_HUB = 0x29,\r
\r
//\r
// after 500ms(LOOP * STALL = 100 * 5ms), set by experience\r
//\r
USB_WAIT_PORT_STS_CHANGE_LOOP = 100\r
-};\r
+}USB_HUB_FLAGS_VALUE;\r
\r
#pragma pack(1)\r
//\r
} USB_CHANGE_FEATURE_MAP;\r
\r
\r
+/**\r
+ Clear the transaction translate buffer if full/low\r
+ speed control/bulk transfer failed and the transfer\r
+ uses this hub as translator.Remember to clear the TT\r
+ buffer of transaction translator, not that of the\r
+ parent.\r
+\r
+ @param UsbDev The Usb device.\r
+ @param Port The port of the hub.\r
+ @param DevAddr Address of the failed transaction.\r
+ @param EpNum The endpoint number of the failed transaction.\r
+ @param EpType The type of failed transaction.\r
+\r
+ @retval EFI_SUCCESS The TT buffer is cleared.\r
+ @retval Others Failed to clear the TT buffer.\r
+\r
+**/\r
EFI_STATUS\r
UsbHubCtrlClearTTBuffer (\r
IN USB_DEVICE *UsbDev,\r
);\r
\r
\r
+/**\r
+ Test whether the interface is a hub interface.\r
+\r
+ @param UsbIf The interface to test.\r
+\r
+ @retval TRUE The interface is a hub interface.\r
+ @retval FALSE The interface isn't a hub interface.\r
+\r
+**/\r
BOOLEAN\r
UsbIsHubInterface (\r
IN USB_INTERFACE *UsbIf\r
);\r
\r
+\r
+/**\r
+ Ack the hub change bits. If these bits are not ACKed, Hub will\r
+ always return changed bit map from its interrupt endpoint.\r
+\r
+ @param UsbDev The Usb device.\r
+\r
+ @retval EFI_SUCCESS The hub change status is ACKed.\r
+ @retval Others Failed to ACK the hub status.\r
+\r
+**/\r
EFI_STATUS\r
UsbHubAckHubStatus (\r
IN USB_DEVICE *UsbDev\r