TianoCore EDK2 master
|
#include "UsbBus.h"
Go to the source code of this file.
Variables | |
EFI_USB_IO_PROTOCOL | mUsbIoProtocol |
EFI_DRIVER_BINDING_PROTOCOL | mUsbBusDriverBinding |
Usb Bus Driver Binding and Bus IO Protocol.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UsbBus.c.
EFI_STATUS EFIAPI UsbBusBuildProtocol | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Install Usb Bus Protocol on host controller, and start the Usb bus.
This | The USB bus driver binding instance. |
Controller | The controller to check. |
RemainingDevicePath | The remaining device patch. |
EFI_SUCCESS | The controller is controlled by the usb bus. |
EFI_ALREADY_STARTED | The controller is already controlled by the usb bus. |
EFI_OUT_OF_RESOURCES | Failed to allocate resources. |
EFI_STATUS EFIAPI UsbBusControllerDriverStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Start to process the controller.
This | The USB bus driver binding instance. |
Controller | The controller to check. |
RemainingDevicePath | The remaining device patch. |
EFI_SUCCESS | The controller is controlled by the usb bus. |
EFI_ALREADY_STARTED | The controller is already controlled by the usb bus. |
EFI_OUT_OF_RESOURCES | Failed to allocate resources. |
EFI_STATUS EFIAPI UsbBusControllerDriverStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE * | ChildHandleBuffer | ||
) |
Stop handle the controller by this USB bus driver.
This | The USB bus driver binding protocol. |
Controller | The controller to release. |
NumberOfChildren | The child of USB bus that opened controller BY_CHILD. |
ChildHandleBuffer | The array of child handle. |
EFI_SUCCESS | The controller or children are stopped. |
EFI_DEVICE_ERROR | Failed to stop the driver. |
EFI_STATUS EFIAPI UsbBusControllerDriverSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Check whether USB bus driver support this device.
This | The USB bus driver binding protocol. |
Controller | The controller handle to check. |
RemainingDevicePath | The remaining device path. |
EFI_SUCCESS | The bus supports this controller. |
EFI_UNSUPPORTED | This device isn't supported. |
EFI_STATUS EFIAPI UsbBusDriverEntryPoint | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
EFI_STATUS EFIAPI UsbIoAsyncInterruptTransfer | ( | IN EFI_USB_IO_PROTOCOL * | This, |
IN UINT8 | Endpoint, | ||
IN BOOLEAN | IsNewTransfer, | ||
IN UINTN PollInterval | OPTIONAL, | ||
IN UINTN DataLength | OPTIONAL, | ||
IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback | OPTIONAL, | ||
IN VOID *Context | OPTIONAL | ||
) |
Queue a new asynchronous interrupt transfer, or remove the old request if (IsNewTransfer == FALSE).
This | The USB_IO instance. |
Endpoint | The device endpoint. |
IsNewTransfer | Whether this is a new request, if it's old, remove the request. |
PollInterval | The interval to poll the transfer result, (in ms). |
DataLength | The length of perodic data transfer. |
Callback | The function to call periodically when transfer is ready. |
Context | The context to the callback. |
EFI_SUCCESS | New transfer is queued or old request is removed. |
EFI_INVALID_PARAMETER | Some parameters are invalid. |
Others | Failed to queue the new request or remove the old request. |
EFI_STATUS EFIAPI UsbIoAsyncIsochronousTransfer | ( | IN EFI_USB_IO_PROTOCOL * | This, |
IN UINT8 | DeviceEndpoint, | ||
IN OUT VOID * | Data, | ||
IN UINTN | DataLength, | ||
IN EFI_ASYNC_USB_TRANSFER_CALLBACK | IsochronousCallBack, | ||
IN VOID *Context | OPTIONAL | ||
) |
Queue an asynchronous isochronous transfer.
This | The USB_IO instance. |
DeviceEndpoint | The device endpoint. |
Data | The data to transfer. |
DataLength | The length of perodic data transfer. |
IsochronousCallBack | The function to call periodically when transfer is ready. |
Context | The context to the callback. |
EFI_UNSUPPORTED | Currently isochronous transfer isn't supported. |
EFI_STATUS EFIAPI UsbIoBulkTransfer | ( | IN EFI_USB_IO_PROTOCOL * | This, |
IN UINT8 | Endpoint, | ||
IN OUT VOID * | Data, | ||
IN OUT UINTN * | DataLength, | ||
IN UINTN | Timeout, | ||
OUT UINT32 * | UsbStatus | ||
) |
Execute a bulk transfer to the device endpoint.
This | The USB IO instance. |
Endpoint | The device endpoint. |
Data | The data to transfer. |
DataLength | The length of the data to transfer. |
Timeout | Time to wait before timeout. |
UsbStatus | The result of USB transfer. |
EFI_SUCCESS | The bulk transfer is OK. |
EFI_INVALID_PARAMETER | Some parameters are invalid. |
Others | Failed to execute transfer, reason returned in UsbStatus. |
EFI_STATUS EFIAPI UsbIoControlTransfer | ( | IN EFI_USB_IO_PROTOCOL * | This, |
IN EFI_USB_DEVICE_REQUEST * | Request, | ||
IN EFI_USB_DATA_DIRECTION | Direction, | ||
IN UINT32 | Timeout, | ||
IN OUT VOID *Data | OPTIONAL, | ||
IN UINTN DataLength | OPTIONAL, | ||
OUT UINT32 * | UsbStatus | ||
) |
USB_IO function to execute a control transfer. This function will execute the USB transfer. If transfer successes, it will sync the internal state of USB bus with device state.
This | The USB_IO instance |
Request | The control transfer request |
Direction | Direction for data stage |
Timeout | The time to wait before timeout |
Data | The buffer holding the data |
DataLength | Then length of the data |
UsbStatus | USB result |
EFI_INVALID_PARAMETER | The parameters are invalid |
EFI_SUCCESS | The control transfer succeeded. |
Others | Failed to execute the transfer |
EFI_STATUS EFIAPI UsbIoGetActiveConfigDescriptor | ( | IN EFI_USB_IO_PROTOCOL * | This, |
OUT EFI_USB_CONFIG_DESCRIPTOR * | Descriptor | ||
) |
Return the configuration descriptor of the current active configuration.
This | The USB IO instance. |
Descriptor | The USB configuration descriptor. |
EFI_SUCCESS | The active configuration descriptor is returned. |
EFI_INVALID_PARAMETER | Some parameter is invalid. |
EFI_NOT_FOUND | Currently no active configuration is selected. |
EFI_STATUS EFIAPI UsbIoGetDeviceDescriptor | ( | IN EFI_USB_IO_PROTOCOL * | This, |
OUT EFI_USB_DEVICE_DESCRIPTOR * | Descriptor | ||
) |
EFI_STATUS EFIAPI UsbIoGetEndpointDescriptor | ( | IN EFI_USB_IO_PROTOCOL * | This, |
IN UINT8 | Index, | ||
OUT EFI_USB_ENDPOINT_DESCRIPTOR * | Descriptor | ||
) |
Retrieve the endpoint descriptor from this interface setting.
This | The USB IO instance. |
Index | The index (start from zero) of the endpoint to retrieve. |
Descriptor | The variable to receive the descriptor. |
EFI_SUCCESS | The endpoint descriptor is returned. |
EFI_INVALID_PARAMETER | Some parameter is invalid. |
EFI_STATUS EFIAPI UsbIoGetInterfaceDescriptor | ( | IN EFI_USB_IO_PROTOCOL * | This, |
OUT EFI_USB_INTERFACE_DESCRIPTOR * | Descriptor | ||
) |
Retrieve the active interface setting descriptor for this USB IO instance.
This | The USB IO instance. |
Descriptor | The variable to receive active interface setting. |
EFI_SUCCESS | The active interface setting is returned. |
EFI_INVALID_PARAMETER | Some parameter is invalid. |
EFI_STATUS EFIAPI UsbIoGetStringDescriptor | ( | IN EFI_USB_IO_PROTOCOL * | This, |
IN UINT16 | LangID, | ||
IN UINT8 | StringIndex, | ||
OUT CHAR16 ** | String | ||
) |
Retrieve an indexed string in the language of LangID.
This | The USB IO instance. |
LangID | The language ID of the string to retrieve. |
StringIndex | The index of the string. |
String | The variable to receive the string. |
EFI_SUCCESS | The string is returned. |
EFI_NOT_FOUND | No such string existed. |
EFI_STATUS EFIAPI UsbIoGetSupportedLanguages | ( | IN EFI_USB_IO_PROTOCOL * | This, |
OUT UINT16 ** | LangIDTable, | ||
OUT UINT16 * | TableSize | ||
) |
EFI_STATUS EFIAPI UsbIoIsochronousTransfer | ( | IN EFI_USB_IO_PROTOCOL * | This, |
IN UINT8 | DeviceEndpoint, | ||
IN OUT VOID * | Data, | ||
IN UINTN | DataLength, | ||
OUT UINT32 * | Status | ||
) |
Execute a synchronous isochronous transfer.
This | The USB IO instance. |
DeviceEndpoint | The device endpoint. |
Data | The data to transfer. |
DataLength | The length of the data to transfer. |
UsbStatus | The result of USB transfer. |
EFI_UNSUPPORTED | Currently isochronous transfer isn't supported. |
EFI_STATUS EFIAPI UsbIoPortReset | ( | IN EFI_USB_IO_PROTOCOL * | This | ) |
EFI_STATUS EFIAPI UsbIoSyncInterruptTransfer | ( | IN EFI_USB_IO_PROTOCOL * | This, |
IN UINT8 | Endpoint, | ||
IN OUT VOID * | Data, | ||
IN OUT UINTN * | DataLength, | ||
IN UINTN | Timeout, | ||
OUT UINT32 * | UsbStatus | ||
) |
Execute a synchronous interrupt transfer.
This | The USB IO instance. |
Endpoint | The device endpoint. |
Data | The data to transfer. |
DataLength | The length of the data to transfer. |
Timeout | Time to wait before timeout. |
UsbStatus | The result of USB transfer. |
EFI_SUCCESS | The synchronous interrupt transfer is OK. |
EFI_INVALID_PARAMETER | Some parameters are invalid. |
Others | Failed to execute transfer, reason returned in UsbStatus. |
EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding |
EFI_USB_IO_PROTOCOL mUsbIoProtocol |