TianoCore EDK2 master
|
#include "UsbBus.h"
Go to the source code of this file.
Variables | |
USB_CHANGE_FEATURE_MAP | mHubFeatureMap [] |
USB_CHANGE_FEATURE_MAP | mRootHubFeatureMap [] |
USB_HUB_API | mUsbHubApi |
USB_HUB_API | mUsbRootHubApi |
Unified interface for RootHub and Hub.
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UsbHub.c.
EFI_STATUS UsbHubAckHubStatus | ( | IN USB_DEVICE * | HubDev | ) |
VOID UsbHubClearPortChange | ( | IN USB_INTERFACE * | HubIf, |
IN UINT8 | Port | ||
) |
EFI_STATUS UsbHubClearPortFeature | ( | IN USB_INTERFACE * | HubIf, |
IN UINT8 | Port, | ||
IN EFI_USB_PORT_FEATURE | Feature | ||
) |
Interface function to clear the port feature for non-root hub.
HubIf | The hub interface. |
Port | The port of the hub to clear feature for. |
Feature | The feature to clear. |
EFI_SUCCESS | The port feature is cleared. |
Others | Failed to clear the port feature. |
EFI_STATUS UsbHubCtrlClearHubFeature | ( | IN USB_DEVICE * | HubDev, |
IN UINT16 | Feature | ||
) |
EFI_STATUS UsbHubCtrlClearPortFeature | ( | IN USB_DEVICE * | HubDev, |
IN UINT8 | Port, | ||
IN UINT16 | Feature | ||
) |
EFI_STATUS UsbHubCtrlClearTTBuffer | ( | IN USB_DEVICE * | HubDev, |
IN UINT8 | Port, | ||
IN UINT16 | DevAddr, | ||
IN UINT16 | EpNum, | ||
IN UINT16 | EpType | ||
) |
Clear the transaction translate buffer if full/low speed control/bulk transfer failed and the transfer uses this hub as translator.Remember to clear the TT buffer of transaction translator, not that of the parent.
HubDev | The hub device. |
Port | The port of the hub. |
DevAddr | Address of the failed transaction. |
EpNum | The endpoint number of the failed transaction. |
EpType | The type of failed transaction. |
EFI_SUCCESS | The TT buffer is cleared. |
Others | Failed to clear the TT buffer. |
EFI_STATUS UsbHubCtrlGetHubDesc | ( | IN USB_DEVICE * | HubDev, |
OUT VOID * | Buf, | ||
IN UINTN | Len | ||
) |
Usb hub control transfer to get the (super speed) hub descriptor.
HubDev | The hub device. |
Buf | The buffer to hold the descriptor. |
Len | The length to retrieve. |
EFI_SUCCESS | The hub descriptor is retrieved. |
Others | Failed to retrieve the hub descriptor. |
EFI_STATUS UsbHubCtrlGetHubStatus | ( | IN USB_DEVICE * | HubDev, |
OUT UINT32 * | State | ||
) |
EFI_STATUS UsbHubCtrlGetPortStatus | ( | IN USB_DEVICE * | HubDev, |
IN UINT8 | Port, | ||
OUT VOID * | State | ||
) |
EFI_STATUS UsbHubCtrlSetHubDepth | ( | IN USB_DEVICE * | HubDev, |
IN UINT16 | Depth | ||
) |
EFI_STATUS UsbHubCtrlSetPortFeature | ( | IN USB_DEVICE * | HubDev, |
IN UINT8 | Port, | ||
IN UINT8 | Feature | ||
) |
EFI_STATUS UsbHubGetPortStatus | ( | IN USB_INTERFACE * | HubIf, |
IN UINT8 | Port, | ||
OUT EFI_USB_PORT_STATUS * | PortState | ||
) |
Get the port status. This function is required to ACK the port change bits although it will return the port changes in PortState. Bus enumeration code doesn't need to ACK the port change bits.
HubIf | The hub interface. |
Port | The port of the hub to get state. |
PortState | Variable to return the port state. |
EFI_SUCCESS | The port status is successfully returned. |
Others | Failed to return the status. |
EFI_STATUS UsbHubInit | ( | IN USB_INTERFACE * | HubIf | ) |
EFI_STATUS UsbHubReadDesc | ( | IN USB_DEVICE * | HubDev, |
OUT EFI_USB_HUB_DESCRIPTOR * | HubDesc | ||
) |
Read the whole usb hub descriptor. It is necessary to do it in two steps because hub descriptor is of variable length.
HubDev | The hub device. |
HubDesc | The variable to return the descriptor. |
EFI_SUCCESS | The hub descriptor is read. |
Others | Failed to read the hub descriptor. |
EFI_STATUS UsbHubRelease | ( | IN USB_INTERFACE * | HubIf | ) |
EFI_STATUS UsbHubResetPort | ( | IN USB_INTERFACE * | HubIf, |
IN UINT8 | Port | ||
) |
EFI_STATUS UsbHubSetPortFeature | ( | IN USB_INTERFACE * | HubIf, |
IN UINT8 | Port, | ||
IN EFI_USB_PORT_FEATURE | Feature | ||
) |
BOOLEAN UsbIsHubInterface | ( | IN USB_INTERFACE * | UsbIf | ) |
EFI_STATUS EFIAPI UsbOnHubInterrupt | ( | IN VOID * | Data, |
IN UINTN | DataLength, | ||
IN VOID * | Context, | ||
IN UINT32 | Result | ||
) |
The callback function to the USB hub status change interrupt endpoint. It is called periodically by the underlying host controller.
Data | The data read. |
DataLength | The length of the data read. |
Context | The context. |
Result | The result of the last interrupt transfer. |
EFI_SUCCESS | The process is OK. |
EFI_OUT_OF_RESOURCES | Failed to allocate resource. |
VOID UsbRootHubClearPortChange | ( | IN USB_INTERFACE * | HubIf, |
IN UINT8 | Port | ||
) |
EFI_STATUS UsbRootHubClearPortFeature | ( | IN USB_INTERFACE * | HubIf, |
IN UINT8 | Port, | ||
IN EFI_USB_PORT_FEATURE | Feature | ||
) |
EFI_STATUS UsbRootHubGetPortStatus | ( | IN USB_INTERFACE * | HubIf, |
IN UINT8 | Port, | ||
OUT EFI_USB_PORT_STATUS * | PortState | ||
) |
Get the port status. This function is required to ACK the port change bits although it will return the port changes in PortState. Bus enumeration code doesn't need to ACK the port change bits.
HubIf | The root hub interface. |
Port | The root hub port to get the state. |
PortState | Variable to return the port state. |
EFI_SUCCESS | The port state is returned. |
Others | Failed to retrieve the port state. |
EFI_STATUS UsbRootHubInit | ( | IN USB_INTERFACE * | HubIf | ) |
EFI_STATUS UsbRootHubRelease | ( | IN USB_INTERFACE * | HubIf | ) |
EFI_STATUS UsbRootHubResetPort | ( | IN USB_INTERFACE * | RootIf, |
IN UINT8 | Port | ||
) |
Interface function to reset the root hub port.
RootIf | The root hub interface. |
Port | The port to reset. |
EFI_SUCCESS | The hub port is reset. |
EFI_TIMEOUT | Failed to reset the port in time. |
EFI_NOT_FOUND | The low/full speed device connected to high speed. root hub is released to the companion UHCI. |
Others | Failed to reset the port. |
EFI_STATUS UsbRootHubSetPortFeature | ( | IN USB_INTERFACE * | HubIf, |
IN UINT8 | Port, | ||
IN EFI_USB_PORT_FEATURE | Feature | ||
) |
USB_CHANGE_FEATURE_MAP mHubFeatureMap[] |
USB_CHANGE_FEATURE_MAP mRootHubFeatureMap[] |
USB_HUB_API mUsbHubApi |
USB_HUB_API mUsbRootHubApi |