EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Functions | Variables

MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c File Reference

#include "UsbBus.h"

Go to the source code of this file.

Functions

EFI_STATUS UsbHubCtrlSetHubDepth (IN USB_DEVICE *HubDev, IN UINT16 Depth)
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)
EFI_STATUS UsbHubCtrlGetSuperSpeedHubDesc (IN USB_DEVICE *HubDev, OUT VOID *Buf)
EFI_STATUS UsbHubCtrlGetHubDesc (IN USB_DEVICE *HubDev, OUT VOID *Buf, IN UINTN Len)
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 UsbHubCtrlResetTT (IN USB_DEVICE *HubDev, IN UINT8 Port)
EFI_STATUS UsbHubCtrlSetHubFeature (IN USB_DEVICE *HubDev, IN UINT8 Feature)
EFI_STATUS UsbHubCtrlSetPortFeature (IN USB_DEVICE *HubDev, IN UINT8 Port, IN UINT8 Feature)
EFI_STATUS UsbHubReadDesc (IN USB_DEVICE *HubDev, OUT EFI_USB_HUB_DESCRIPTOR *HubDesc)
EFI_STATUS UsbHubAckHubStatus (IN USB_DEVICE *HubDev)
BOOLEAN UsbIsHubInterface (IN USB_INTERFACE *UsbIf)
EFI_STATUS EFIAPI UsbOnHubInterrupt (IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Result)
EFI_STATUS UsbHubInit (IN USB_INTERFACE *HubIf)
EFI_STATUS UsbHubGetPortStatus (IN USB_INTERFACE *HubIf, IN UINT8 Port, OUT EFI_USB_PORT_STATUS *PortState)
VOID UsbHubClearPortChange (IN USB_INTERFACE *HubIf, IN UINT8 Port)
EFI_STATUS UsbHubSetPortFeature (IN USB_INTERFACE *HubIf, IN UINT8 Port, IN EFI_USB_PORT_FEATURE Feature)
EFI_STATUS UsbHubClearPortFeature (IN USB_INTERFACE *HubIf, IN UINT8 Port, IN EFI_USB_PORT_FEATURE Feature)
EFI_STATUS UsbHubResetPort (IN USB_INTERFACE *HubIf, IN UINT8 Port)
EFI_STATUS UsbHubRelease (IN USB_INTERFACE *HubIf)
EFI_STATUS UsbRootHubInit (IN USB_INTERFACE *HubIf)
EFI_STATUS UsbRootHubGetPortStatus (IN USB_INTERFACE *HubIf, IN UINT8 Port, OUT EFI_USB_PORT_STATUS *PortState)
VOID UsbRootHubClearPortChange (IN USB_INTERFACE *HubIf, IN UINT8 Port)
EFI_STATUS UsbRootHubSetPortFeature (IN USB_INTERFACE *HubIf, IN UINT8 Port, IN EFI_USB_PORT_FEATURE Feature)
EFI_STATUS UsbRootHubClearPortFeature (IN USB_INTERFACE *HubIf, IN UINT8 Port, IN EFI_USB_PORT_FEATURE Feature)
EFI_STATUS UsbRootHubResetPort (IN USB_INTERFACE *RootIf, IN UINT8 Port)
EFI_STATUS UsbRootHubRelease (IN USB_INTERFACE *HubIf)

Variables

USB_CHANGE_FEATURE_MAP mHubFeatureMap []
USB_CHANGE_FEATURE_MAP mRootHubFeatureMap []
USB_HUB_API mUsbHubApi
USB_HUB_API mUsbRootHubApi

Detailed Description

Unified interface for RootHub and Hub.

Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file UsbHub.c.


Function Documentation

EFI_STATUS UsbHubAckHubStatus ( IN USB_DEVICE HubDev)

Ack the hub change bits. If these bits are not ACKed, Hub will always return changed bit map from its interrupt endpoint.

Parameters:
HubDevThe hub device.
Return values:
EFI_SUCCESSThe hub change status is ACKed.
OthersFailed to ACK the hub status.

Definition at line 516 of file UsbHub.c.

VOID UsbHubClearPortChange ( IN USB_INTERFACE HubIf,
IN UINT8  Port 
)

Clear the port change status.

Parameters:
HubIfThe hub interface.
PortThe hub port.

Definition at line 866 of file UsbHub.c.

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.

Parameters:
HubIfThe hub interface.
PortThe port of the hub to clear feature for.
FeatureThe feature to clear.
Return values:
EFI_SUCCESSThe port feature is cleared.
OthersFailed to clear the port feature.

Definition at line 937 of file UsbHub.c.

EFI_STATUS UsbHubCtrlClearHubFeature ( IN USB_DEVICE HubDev,
IN UINT16  Feature 
)

USB hub control transfer to clear the hub feature.

Parameters:
HubDevThe device of the hub.
FeatureThe feature to clear.
Return values:
EFI_SUCCESSFeature of the hub is cleared.
OthersFailed to clear the feature.

Definition at line 90 of file UsbHub.c.

EFI_STATUS UsbHubCtrlClearPortFeature ( IN USB_DEVICE HubDev,
IN UINT8  Port,
IN UINT16  Feature 
)

Clear the feature of the device's port.

Parameters:
HubDevThe hub device.
PortThe port to clear feature.
FeatureThe feature to clear.
Return values:
EFI_SUCCESSThe feature of the port is cleared.
OthersFailed to clear the feature.

Definition at line 125 of file UsbHub.c.

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.

Parameters:
HubDevThe hub device.
PortThe port of the hub.
DevAddrAddress of the failed transaction.
EpNumThe endpoint number of the failed transaction.
EpTypeThe type of failed transaction.
Return values:
EFI_SUCCESSThe TT buffer is cleared.
OthersFailed to clear the TT buffer.

Definition at line 171 of file UsbHub.c.

EFI_STATUS UsbHubCtrlGetHubDesc ( IN USB_DEVICE HubDev,
OUT VOID *  Buf,
IN UINTN  Len 
)

Usb hub control transfer to get the hub descriptor.

Parameters:
HubDevThe hub device.
BufThe buffer to hold the descriptor.
LenThe length to retrieve.
Return values:
EFI_SUCCESSThe hub descriptor is retrieved.
OthersFailed to retrieve the hub descriptor.

Definition at line 250 of file UsbHub.c.

EFI_STATUS UsbHubCtrlGetHubStatus ( IN USB_DEVICE HubDev,
OUT UINT32 State 
)

Usb hub control transfer to get the hub status.

Parameters:
HubDevThe hub device.
StateThe variable to return the status.
Return values:
EFI_SUCCESSThe hub status is returned in State.
OthersFailed to get the hub status.

Definition at line 285 of file UsbHub.c.

EFI_STATUS UsbHubCtrlGetPortStatus ( IN USB_DEVICE HubDev,
IN UINT8  Port,
OUT VOID *  State 
)

Usb hub control transfer to get the port status.

Parameters:
HubDevThe hub device.
PortThe port of the hub.
StateVariable to return the hub port state.
Return values:
EFI_SUCCESSThe port state is returned in State.
OthersFailed to retrieve the port state.

Definition at line 320 of file UsbHub.c.

EFI_STATUS UsbHubCtrlGetSuperSpeedHubDesc ( IN USB_DEVICE HubDev,
OUT VOID *  Buf 
)

Usb hub control transfer to get the super speed hub descriptor.

Parameters:
HubDevThe hub device.
BufThe buffer to hold the descriptor.
Return values:
EFI_SUCCESSThe hub descriptor is retrieved.
OthersFailed to retrieve the hub descriptor.

Definition at line 214 of file UsbHub.c.

EFI_STATUS UsbHubCtrlResetTT ( IN USB_DEVICE HubDev,
IN UINT8  Port 
)

Usb hub control transfer to reset the TT (Transaction Transaltor).

Parameters:
HubDevThe hub device.
PortThe port of the hub.
Return values:
EFI_SUCCESSThe TT of the hub is reset.
OthersFailed to reset the port.

Definition at line 361 of file UsbHub.c.

EFI_STATUS UsbHubCtrlSetHubDepth ( IN USB_DEVICE HubDev,
IN UINT16  Depth 
)

USB hub control transfer to set the hub depth.

Parameters:
HubDevThe device of the hub.
DepthThe depth to set.
Return values:
EFI_SUCCESSDepth of the hub is set.
OthersFailed to set the depth.

Definition at line 57 of file UsbHub.c.

EFI_STATUS UsbHubCtrlSetHubFeature ( IN USB_DEVICE HubDev,
IN UINT8  Feature 
)

Usb hub control transfer to set the hub feature.

Parameters:
HubDevThe hub device.
FeatureThe feature to set.
Return values:
EFI_SUCESSThe feature is set for the hub.
OthersFailed to set the feature.

Definition at line 395 of file UsbHub.c.

EFI_STATUS UsbHubCtrlSetPortFeature ( IN USB_DEVICE HubDev,
IN UINT8  Port,
IN UINT8  Feature 
)

Usb hub control transfer to set the port feature.

Parameters:
HubDevThe Usb hub device.
PortThe Usb port to set feature for.
FeatureThe feature to set.
Return values:
EFI_SUCCESSThe feature is set for the port.
OthersFailed to set the feature.

Definition at line 430 of file UsbHub.c.

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.

Parameters:
HubIfThe hub interface.
PortThe port of the hub to get state.
PortStateVariable to return the port state.
Return values:
EFI_SUCCESSThe port status is successfully returned.
OthersFailed to return the status.

Definition at line 837 of file UsbHub.c.

EFI_STATUS UsbHubInit ( IN USB_INTERFACE HubIf)

Initialize the device for a non-root hub.

Parameters:
HubIfThe USB hub interface.
Return values:
EFI_SUCCESSThe hub is initialized.
EFI_DEVICE_ERRORFailed to initialize the hub.

Definition at line 689 of file UsbHub.c.

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.

Parameters:
HubDevThe hub device.
HubDescThe variable to return the descriptor.
Return values:
EFI_SUCCESSThe hub descriptor is read.
OthersFailed to read the hub descriptor.

Definition at line 471 of file UsbHub.c.

EFI_STATUS UsbHubRelease ( IN USB_INTERFACE HubIf)

Release the hub's control of the interface.

Parameters:
HubIfThe hub interface.
Return values:
EFI_SUCCESSThe interface is release of hub control.

Definition at line 1014 of file UsbHub.c.

EFI_STATUS UsbHubResetPort ( IN USB_INTERFACE HubIf,
IN UINT8  Port 
)

Interface function to reset the port.

Parameters:
HubIfThe hub interface.
PortThe port to reset.
Return values:
EFI_SUCCESSThe hub port is reset.
EFI_TIMEOUTFailed to reset the port in time.
OthersFailed to reset the port.

Definition at line 963 of file UsbHub.c.

EFI_STATUS UsbHubSetPortFeature ( IN USB_INTERFACE HubIf,
IN UINT8  Port,
IN EFI_USB_PORT_FEATURE  Feature 
)

Function to set the port feature for non-root hub.

Parameters:
HubIfThe hub interface.
PortThe port of the hub.
FeatureThe feature of the port to set.
Return values:
EFI_SUCCESSThe hub port feature is set.
OthersFailed to set the port feature.

Definition at line 911 of file UsbHub.c.

BOOLEAN UsbIsHubInterface ( IN USB_INTERFACE UsbIf)

Test whether the interface is a hub interface.

Parameters:
UsbIfThe interface to test.
Return values:
TRUEThe interface is a hub interface.
FALSEThe interface isn't a hub interface.

Definition at line 551 of file UsbHub.c.

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.

Parameters:
DataThe data read.
DataLengthThe length of the data read.
ContextThe context.
ResultThe result of the last interrupt transfer.
Return values:
EFI_SUCCESSThe process is OK.
EFI_OUT_OF_RESOURCESFailed to allocate resource.

Definition at line 589 of file UsbHub.c.

VOID UsbRootHubClearPortChange ( IN USB_INTERFACE HubIf,
IN UINT8  Port 
)

Clear the port change status.

Parameters:
HubIfThe root hub interface.
PortThe root hub port.

Definition at line 1158 of file UsbHub.c.

EFI_STATUS UsbRootHubClearPortFeature ( IN USB_INTERFACE HubIf,
IN UINT8  Port,
IN EFI_USB_PORT_FEATURE  Feature 
)

Clear the root hub port feature.

Parameters:
HubIfThe root hub interface.
PortThe root hub port.
FeatureThe feature to clear.
Return values:
EFI_SUCCESSThe root hub port is cleared of the feature.
OthersFailed to clear the feature.

Definition at line 1228 of file UsbHub.c.

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.

Parameters:
HubIfThe root hub interface.
PortThe root hub port to get the state.
PortStateVariable to return the port state.
Return values:
EFI_SUCCESSThe port state is returned.
OthersFailed to retrieve the port state.

Definition at line 1134 of file UsbHub.c.

EFI_STATUS UsbRootHubInit ( IN USB_INTERFACE HubIf)

Initialize the interface for root hub.

Parameters:
HubIfThe root hub interface.
Return values:
EFI_SUCCESSThe interface is initialized for root hub.
OthersFailed to initialize the hub.

Definition at line 1059 of file UsbHub.c.

EFI_STATUS UsbRootHubRelease ( IN USB_INTERFACE HubIf)

Release the root hub's control of the interface.

Parameters:
HubIfThe root hub interface.
Return values:
EFI_SUCCESSThe root hub's control of the interface is released.

Definition at line 1359 of file UsbHub.c.

EFI_STATUS UsbRootHubResetPort ( IN USB_INTERFACE RootIf,
IN UINT8  Port 
)

Interface function to reset the root hub port.

Parameters:
RootIfThe root hub interface.
PortThe port to reset.
Return values:
EFI_SUCCESSThe hub port is reset.
EFI_TIMEOUTFailed to reset the port in time.
EFI_NOT_FOUNDThe low/full speed device connected to high speed. root hub is released to the companion UHCI.
OthersFailed to reset the port.

Definition at line 1256 of file UsbHub.c.

EFI_STATUS UsbRootHubSetPortFeature ( IN USB_INTERFACE HubIf,
IN UINT8  Port,
IN EFI_USB_PORT_FEATURE  Feature 
)

Set the root hub port feature.

Parameters:
HubIfThe Usb hub interface.
PortThe hub port.
FeatureThe feature to set.
Return values:
EFI_SUCCESSThe root hub port is set with the feature.
OthersFailed to set the feature.

Definition at line 1202 of file UsbHub.c.


Variable Documentation

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines