TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | USB_DESC_HEAD |
struct | USB_ENDPOINT_DESC |
struct | USB_INTERFACE_SETTING |
struct | USB_INTERFACE_DESC |
struct | USB_CONFIG_DESC |
struct | USB_DEVICE_DESC |
Macros | |
#define | USB_MAX_INTERFACE_SETTING 256 |
#define | USB_REQUEST_TYPE(Dir, Type, Target) ((UINT8)((((Dir) == EfiUsbDataIn ? 0x01 : 0) << 7) | (Type) | (Target))) |
Functions | |
EFI_STATUS | UsbCtrlRequest (IN USB_DEVICE *UsbDev, IN EFI_USB_DATA_DIRECTION Direction, IN UINTN Type, IN UINTN Target, IN UINTN Request, IN UINT16 Value, IN UINT16 Index, IN OUT VOID *Buf, IN UINTN Length) |
EFI_STATUS | UsbGetMaxPacketSize0 (IN USB_DEVICE *UsbDev) |
VOID | UsbFreeDevDesc (IN USB_DEVICE_DESC *DevDesc) |
EFI_USB_STRING_DESCRIPTOR * | UsbGetOneString (IN USB_DEVICE *UsbDev, IN UINT8 StringIndex, IN UINT16 LangId) |
EFI_STATUS | UsbBuildDescTable (IN USB_DEVICE *UsbDev) |
EFI_STATUS | UsbSetAddress (IN USB_DEVICE *UsbDev, IN UINT8 Address) |
EFI_STATUS | UsbSetConfig (IN USB_DEVICE *UsbDev, IN UINT8 ConfigIndex) |
EFI_STATUS | UsbIoClearFeature (IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINTN Target, IN UINT16 Feature, IN UINT16 Index) |
Manage Usb Descriptor List
Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UsbDesc.h.
#define USB_REQUEST_TYPE | ( | Dir, | |
Type, | |||
Target | |||
) | ((UINT8)((((Dir) == EfiUsbDataIn ? 0x01 : 0) << 7) | (Type) | (Target))) |
EFI_STATUS UsbBuildDescTable | ( | IN USB_DEVICE * | UsbDev | ) |
Build the whole array of descriptors. This function must be called after UsbGetMaxPacketSize0 returns the max packet size correctly for endpoint 0.
UsbDev | The Usb device. |
EFI_SUCCESS | The descriptor table is build. |
EFI_OUT_OF_RESOURCES | Failed to allocate resource for the descriptor. |
EFI_STATUS UsbCtrlRequest | ( | IN USB_DEVICE * | UsbDev, |
IN EFI_USB_DATA_DIRECTION | Direction, | ||
IN UINTN | Type, | ||
IN UINTN | Target, | ||
IN UINTN | Request, | ||
IN UINT16 | Value, | ||
IN UINT16 | Index, | ||
IN OUT VOID * | Buf, | ||
IN UINTN | Length | ||
) |
USB standard control transfer support routine. This function is used by USB device. It is possible that the device's interfaces are still waiting to be enumerated.
UsbDev | The usb device. |
Direction | The direction of data transfer. |
Type | Standard / class specific / vendor specific. |
Target | The receiving target. |
Request | Which request. |
Value | The wValue parameter of the request. |
Index | The wIndex parameter of the request. |
Buf | The buffer to receive data into / transmit from. |
Length | The length of the buffer. |
EFI_SUCCESS | The control request is executed. |
EFI_DEVICE_ERROR | Failed to execute the control transfer. |
VOID UsbFreeDevDesc | ( | IN USB_DEVICE_DESC * | DevDesc | ) |
EFI_STATUS UsbGetMaxPacketSize0 | ( | IN USB_DEVICE * | UsbDev | ) |
Return the max packet size for endpoint zero. This function is the first function called to get descriptors during bus enumeration.
UsbDev | The usb device. |
EFI_SUCCESS | The max packet size of endpoint zero is retrieved. |
EFI_DEVICE_ERROR | Failed to retrieve it. |
EFI_USB_STRING_DESCRIPTOR * UsbGetOneString | ( | IN USB_DEVICE * | UsbDev, |
IN UINT8 | Index, | ||
IN UINT16 | LangId | ||
) |
Retrieve the indexed string for the language. It requires two steps to get a string, first to get the string's length. Then the string itself.
UsbDev | The usb device. |
StringIndex | The index of the string to retrieve. |
LangId | Language ID. |
Retrieve the indexed string for the language. It requires two steps to get a string, first to get the string's length. Then the string itself.
UsbDev | The usb device. |
Index | The index the string to retrieve. |
LangId | Language ID. |
EFI_STATUS UsbIoClearFeature | ( | IN EFI_USB_IO_PROTOCOL * | UsbIo, |
IN UINTN | Target, | ||
IN UINT16 | Feature, | ||
IN UINT16 | Index | ||
) |
Usb UsbIo interface to clear the feature. This is should only be used by HUB which is considered a device driver on top of the UsbIo interface.
UsbIo | The UsbIo interface. |
Target | The target of the transfer: endpoint/device. |
Feature | The feature to clear. |
Index | The wIndex parameter. |
EFI_SUCCESS | The device feature is cleared. |
Others | Failed to clear the feature. |
EFI_STATUS UsbSetAddress | ( | IN USB_DEVICE * | UsbDev, |
IN UINT8 | Address | ||
) |
EFI_STATUS UsbSetConfig | ( | IN USB_DEVICE * | UsbDev, |
IN UINT8 | ConfigIndex | ||
) |
Set the device's configuration. This function changes the device's internal state. UsbSelectConfig changes the Usb bus's internal state.
UsbDev | The USB device to set configure to. |
ConfigIndex | The configure index to set. |
EFI_SUCCESS | The device is configured now. |
Others | Failed to set the device configure. |