TianoCore EDK2 master
Loading...
Searching...
No Matches
UsbEnumer.h File Reference

Go to the source code of this file.

Macros

#define USB_NEXT_BIT(Byte, Bit)
 

Typedefs

typedef EFI_STATUS(* USB_HUB_INIT) (IN USB_INTERFACE *UsbIf)
 
typedef EFI_STATUS(* USB_HUB_GET_PORT_STATUS) (IN USB_INTERFACE *UsbIf, IN UINT8 Port, OUT EFI_USB_PORT_STATUS *PortState)
 
typedef VOID(* USB_HUB_CLEAR_PORT_CHANGE) (IN USB_INTERFACE *HubIf, IN UINT8 Port)
 
typedef EFI_STATUS(* USB_HUB_SET_PORT_FEATURE) (IN USB_INTERFACE *UsbIf, IN UINT8 Port, IN EFI_USB_PORT_FEATURE Feature)
 
typedef EFI_STATUS(* USB_HUB_CLEAR_PORT_FEATURE) (IN USB_INTERFACE *UsbIf, IN UINT8 Port, IN EFI_USB_PORT_FEATURE Feature)
 
typedef EFI_STATUS(* USB_HUB_RESET_PORT) (IN USB_INTERFACE *UsbIf, IN UINT8 Port)
 
typedef EFI_STATUS(* USB_HUB_RELEASE) (IN USB_INTERFACE *UsbIf)
 

Functions

USB_ENDPOINT_DESCUsbGetEndpointDesc (IN USB_INTERFACE *UsbIf, IN UINT8 EpAddr)
 
EFI_STATUS UsbSelectSetting (IN USB_INTERFACE_DESC *IfDesc, IN UINT8 Alternate)
 
EFI_STATUS UsbSelectConfig (IN USB_DEVICE *Device, IN UINT8 ConfigIndex)
 
EFI_STATUS UsbRemoveConfig (IN USB_DEVICE *Device)
 
EFI_STATUS UsbRemoveDevice (IN USB_DEVICE *Device)
 
VOID EFIAPI UsbHubEnumeration (IN EFI_EVENT Event, IN VOID *Context)
 
VOID EFIAPI UsbRootHubEnumeration (IN EFI_EVENT Event, IN VOID *Context)
 

Detailed Description

USB bus enumeration interface.

Copyright (c) 2007, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file UsbEnumer.h.

Macro Definition Documentation

◆ USB_NEXT_BIT

#define USB_NEXT_BIT (   Byte,
  Bit 
)
Value:
do { \
(Bit)++; \
if ((Bit) > 7) { \
(Byte)++; \
(Bit) = 0; \
} \
} while (0)

Definition at line 16 of file UsbEnumer.h.

Typedef Documentation

◆ USB_HUB_CLEAR_PORT_CHANGE

typedef VOID(* USB_HUB_CLEAR_PORT_CHANGE) (IN USB_INTERFACE *HubIf, IN UINT8 Port)

Definition at line 52 of file UsbEnumer.h.

◆ USB_HUB_CLEAR_PORT_FEATURE

typedef EFI_STATUS(* USB_HUB_CLEAR_PORT_FEATURE) (IN USB_INTERFACE *UsbIf, IN UINT8 Port, IN EFI_USB_PORT_FEATURE Feature)

Definition at line 67 of file UsbEnumer.h.

◆ USB_HUB_GET_PORT_STATUS

typedef EFI_STATUS(* USB_HUB_GET_PORT_STATUS) (IN USB_INTERFACE *UsbIf, IN UINT8 Port, OUT EFI_USB_PORT_STATUS *PortState)

Definition at line 44 of file UsbEnumer.h.

◆ USB_HUB_INIT

typedef EFI_STATUS(* USB_HUB_INIT) (IN USB_INTERFACE *UsbIf)

Definition at line 32 of file UsbEnumer.h.

◆ USB_HUB_RELEASE

typedef EFI_STATUS(* USB_HUB_RELEASE) (IN USB_INTERFACE *UsbIf)

Definition at line 82 of file UsbEnumer.h.

◆ USB_HUB_RESET_PORT

typedef EFI_STATUS(* USB_HUB_RESET_PORT) (IN USB_INTERFACE *UsbIf, IN UINT8 Port)

Definition at line 75 of file UsbEnumer.h.

◆ USB_HUB_SET_PORT_FEATURE

typedef EFI_STATUS(* USB_HUB_SET_PORT_FEATURE) (IN USB_INTERFACE *UsbIf, IN UINT8 Port, IN EFI_USB_PORT_FEATURE Feature)

Definition at line 59 of file UsbEnumer.h.

Function Documentation

◆ UsbGetEndpointDesc()

USB_ENDPOINT_DESC * UsbGetEndpointDesc ( IN USB_INTERFACE UsbIf,
IN UINT8  EpAddr 
)

Return the endpoint descriptor in this interface.

Parameters
UsbIfThe interface to search in.
EpAddrThe address of the endpoint to return.
Returns
The endpoint descriptor or NULL.

Definition at line 22 of file UsbEnumer.c.

◆ UsbHubEnumeration()

VOID EFIAPI UsbHubEnumeration ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Enumerate all the changed hub ports.

Parameters
EventThe event that is triggered.
ContextThe context to the event.
Returns
None.

Enumerate all the changed hub ports.

Parameters
EventThe event that is triggered.
ContextThe context to the event.

Definition at line 1012 of file UsbEnumer.c.

◆ UsbRemoveConfig()

EFI_STATUS UsbRemoveConfig ( IN USB_DEVICE Device)

Remove the current device configuration.

Parameters
DeviceThe USB device to remove configuration from.
Returns
None.

Remove the current device configuration.

Parameters
DeviceThe USB device to remove configuration from.

Definition at line 509 of file UsbEnumer.c.

◆ UsbRemoveDevice()

EFI_STATUS UsbRemoveDevice ( IN USB_DEVICE Device)

Remove the device and all its children from the bus.

Parameters
DeviceThe device to remove.
Return values
EFI_SUCCESSThe device is removed.

Definition at line 558 of file UsbEnumer.c.

◆ UsbRootHubEnumeration()

VOID EFIAPI UsbRootHubEnumeration ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Enumerate all the changed hub ports.

Parameters
EventThe event that is triggered.
ContextThe context to the event.
Returns
None.

Enumerate all the changed hub ports.

Parameters
EventThe event that is triggered.
ContextThe context to the event.

Definition at line 1069 of file UsbEnumer.c.

◆ UsbSelectConfig()

EFI_STATUS UsbSelectConfig ( IN USB_DEVICE Device,
IN UINT8  ConfigValue 
)

Select a new configuration for the device. Each device may support several configurations.

Parameters
DeviceThe device to select configuration.
ConfigIndexThe index of the configuration ( != 0).
Return values
EFI_NOT_FOUNDThere is no configuration with the index.
EFI_OUT_OF_RESOURCESFailed to allocate resource.
EFI_SUCCESSThe configuration is selected.

Select a new configuration for the device. Each device may support several configurations.

Parameters
DeviceThe device to select configuration.
ConfigValueThe index of the configuration ( != 0).
Return values
EFI_NOT_FOUNDThere is no configuration with the index.
EFI_OUT_OF_RESOURCESFailed to allocate resource.
EFI_SUCCESSThe configuration is selected.

Definition at line 370 of file UsbEnumer.c.

◆ UsbSelectSetting()

EFI_STATUS UsbSelectSetting ( IN USB_INTERFACE_DESC IfDesc,
IN UINT8  Alternate 
)

Select an alternate setting for the interface. Each interface can have several mutually exclusive settings. Only one setting is active. It will also reset its endpoints' toggle to zero.

Parameters
IfDescThe interface descriptor to set.
AlternateThe alternate setting number to locate.
Return values
EFI_NOT_FOUNDThere is no setting with this alternate index.
EFI_SUCCESSThe interface is set to Alternate setting.

Definition at line 311 of file UsbEnumer.c.