TianoCore EDK2 master
|
#include "UsbBus.h"
Go to the source code of this file.
Usb bus enumeration support.
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UsbEnumer.c.
EFI_STATUS UsbConnectDriver | ( | IN USB_INTERFACE * | UsbIf | ) |
Connect the USB interface with its driver. EFI USB bus will create a USB interface for each separate interface descriptor.
UsbIf | The interface to connect driver to. |
Definition at line 250 of file UsbEnumer.c.
USB_DEVICE * UsbCreateDevice | ( | IN USB_INTERFACE * | ParentIf, |
IN UINT8 | ParentPort | ||
) |
Create a device which is on the parent's ParentPort port.
ParentIf | The parent HUB interface. |
ParentPort | The port on the HUB this device is connected to. |
Definition at line 215 of file UsbEnumer.c.
USB_INTERFACE * UsbCreateInterface | ( | IN USB_DEVICE * | Device, |
IN USB_INTERFACE_DESC * | IfDesc | ||
) |
Create an interface for the descriptor IfDesc. Each device's configuration can have several interfaces.
Device | The device has the interface descriptor. |
IfDesc | The interface descriptor. |
Definition at line 93 of file UsbEnumer.c.
EFI_STATUS UsbDisconnectDriver | ( | IN USB_INTERFACE * | UsbIf | ) |
Disconnect the USB interface with its driver.
UsbIf | The interface to disconnect driver from. |
Definition at line 461 of file UsbEnumer.c.
EFI_STATUS UsbEnumerateNewDev | ( | IN USB_INTERFACE * | HubIf, |
IN UINT8 | Port, | ||
IN BOOLEAN | ResetIsNeeded | ||
) |
Enumerate and configure the new device on the port of this HUB interface.
HubIf | The HUB that has the device connected. |
Port | The port index of the hub (started with zero). |
ResetIsNeeded | The boolean to control whether skip the reset of the port. |
EFI_SUCCESS | The device is enumerated (added or removed). |
EFI_OUT_OF_RESOURCES | Failed to allocate resource for the device. |
Others | Failed to enumerate the device. |
Definition at line 662 of file UsbEnumer.c.
EFI_STATUS UsbEnumeratePort | ( | IN USB_INTERFACE * | HubIf, |
IN UINT8 | Port | ||
) |
Process the events on the port.
HubIf | The HUB that has the device connected. |
Port | The port index of the hub (started with zero). |
EFI_SUCCESS | The device is enumerated (added or removed). |
EFI_OUT_OF_RESOURCES | Failed to allocate resource for the device. |
Others | Failed to enumerate the device. |
Definition at line 890 of file UsbEnumer.c.
USB_DEVICE * UsbFindChild | ( | IN USB_INTERFACE * | HubIf, |
IN UINT8 | Port | ||
) |
Find the child device on the hub's port.
HubIf | The hub interface. |
Port | The port of the hub this child is connected to. |
Definition at line 622 of file UsbEnumer.c.
VOID UsbFreeDevice | ( | IN USB_DEVICE * | Device | ) |
Free the resource used by this USB device.
Device | The USB device to free. |
Definition at line 194 of file UsbEnumer.c.
EFI_STATUS UsbFreeInterface | ( | IN USB_INTERFACE * | UsbIf | ) |
Free the resource used by USB interface.
UsbIf | The USB interface to free. |
EFI_ACCESS_DENIED | The interface is still occupied. |
EFI_SUCCESS | The interface is freed. |
Definition at line 53 of file UsbEnumer.c.
USB_ENDPOINT_DESC * UsbGetEndpointDesc | ( | IN USB_INTERFACE * | UsbIf, |
IN UINT8 | EpAddr | ||
) |
Return the endpoint descriptor in this interface.
UsbIf | The interface to search in. |
EpAddr | The address of the endpoint to return. |
Definition at line 22 of file UsbEnumer.c.
Enumerate all the changed hub ports.
Event | The event that is triggered. |
Context | The context to the event. |
Definition at line 1012 of file UsbEnumer.c.
EFI_STATUS UsbRemoveConfig | ( | IN USB_DEVICE * | Device | ) |
Remove the current device configuration.
Device | The USB device to remove configuration from. |
Definition at line 509 of file UsbEnumer.c.
EFI_STATUS UsbRemoveDevice | ( | IN USB_DEVICE * | Device | ) |
Remove the device and all its children from the bus.
Device | The device to remove. |
EFI_SUCCESS | The device is removed. |
Definition at line 558 of file UsbEnumer.c.
Enumerate all the changed hub ports.
Event | The event that is triggered. |
Context | The context to the event. |
Definition at line 1069 of file UsbEnumer.c.
EFI_STATUS UsbSelectConfig | ( | IN USB_DEVICE * | Device, |
IN UINT8 | ConfigValue | ||
) |
Select a new configuration for the device. Each device may support several configurations.
Device | The device to select configuration. |
ConfigValue | The index of the configuration ( != 0). |
EFI_NOT_FOUND | There is no configuration with the index. |
EFI_OUT_OF_RESOURCES | Failed to allocate resource. |
EFI_SUCCESS | The configuration is selected. |
Definition at line 370 of file UsbEnumer.c.
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.
IfDesc | The interface descriptor to set. |
Alternate | The alternate setting number to locate. |
EFI_NOT_FOUND | There is no setting with this alternate index. |
EFI_SUCCESS | The interface is set to Alternate setting. |
Definition at line 311 of file UsbEnumer.c.