TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | USB_CBI_PROTOCOL |
struct | USB_CBI_STATUS |
Macros | |
#define | USB_CBI_MAX_PACKET_NUM 16 |
#define | USB_CBI_RESET_CMD_LEN 12 |
#define | USB_CBI_MAX_RETRY 3 |
#define | USB_CBI_RESET_DEVICE_STALL (50 * USB_MASS_1_MILLISECOND) |
#define | USB_CBI_RESET_DEVICE_TIMEOUT (1 * USB_MASS_1_SECOND) |
Functions | |
EFI_STATUS | UsbCbiInit (IN EFI_USB_IO_PROTOCOL *UsbIo, OUT VOID **Context OPTIONAL) |
EFI_STATUS | UsbCbiExecCommand (IN VOID *Context, IN VOID *Cmd, IN UINT8 CmdLen, IN EFI_USB_DATA_DIRECTION DataDir, IN VOID *Data, IN UINT32 DataLen, IN UINT8 Lun, IN UINT32 Timeout, OUT UINT32 *CmdStatus) |
EFI_STATUS | UsbCbiResetDevice (IN VOID *Context, IN BOOLEAN ExtendedVerification) |
EFI_STATUS | UsbCbiCleanUp (IN VOID *Context) |
Variables | |
USB_MASS_TRANSPORT | mUsbCbi0Transport |
USB_MASS_TRANSPORT | mUsbCbi1Transport |
Definition for the USB mass storage Control/Bulk/Interrupt (CBI) transport, according to USB Mass Storage Class Control/Bulk/Interrupt (CBI) Transport, Revision 1.1.
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UsbMassCbi.h.
#define USB_CBI_MAX_PACKET_NUM 16 |
Definition at line 16 of file UsbMassCbi.h.
#define USB_CBI_MAX_RETRY 3 |
Definition at line 21 of file UsbMassCbi.h.
#define USB_CBI_RESET_CMD_LEN 12 |
Definition at line 17 of file UsbMassCbi.h.
#define USB_CBI_RESET_DEVICE_STALL (50 * USB_MASS_1_MILLISECOND) |
Definition at line 25 of file UsbMassCbi.h.
#define USB_CBI_RESET_DEVICE_TIMEOUT (1 * USB_MASS_1_SECOND) |
Definition at line 29 of file UsbMassCbi.h.
EFI_STATUS UsbCbiCleanUp | ( | IN VOID * | Context | ) |
Clean up the CBI protocol's resource.
Context | The instance of CBI protocol. |
EFI_SUCCESS | The resource is cleaned up. |
Definition at line 597 of file UsbMassCbi.c.
EFI_STATUS UsbCbiExecCommand | ( | IN VOID * | Context, |
IN VOID * | Cmd, | ||
IN UINT8 | CmdLen, | ||
IN EFI_USB_DATA_DIRECTION | DataDir, | ||
IN VOID * | Data, | ||
IN UINT32 | DataLen, | ||
IN UINT8 | Lun, | ||
IN UINT32 | Timeout, | ||
OUT UINT32 * | CmdStatus | ||
) |
Execute USB mass storage command through the CBI0/CBI1 transport protocol.
Context | The USB CBI Protocol. |
Cmd | The command to transfer to device |
CmdLen | The length of the command |
DataDir | The direction of data transfer |
Data | The buffer to hold the data |
DataLen | The length of the buffer |
Lun | Should be 0, this field for bot only |
Timeout | The time to wait |
CmdStatus | The result of the command execution |
EFI_SUCCESS | The command is executed successfully. |
Other | Failed to execute the command |
Definition at line 426 of file UsbMassCbi.c.
EFI_STATUS UsbCbiInit | ( | IN EFI_USB_IO_PROTOCOL * | UsbIo, |
OUT VOID **Context | OPTIONAL | ||
) |
Initializes USB CBI protocol.
This function initializes the USB mass storage class CBI protocol. It will save its context which is a USB_CBI_PROTOCOL structure in the Context if Context isn't NULL.
UsbIo | The USB I/O Protocol instance |
Context | The buffer to save the context to |
EFI_SUCCESS | The device is successfully initialized. |
EFI_UNSUPPORTED | The transport protocol doesn't support the device. |
Other | The USB CBI initialization fails. |
Definition at line 54 of file UsbMassCbi.c.
EFI_STATUS UsbCbiResetDevice | ( | IN VOID * | Context, |
IN BOOLEAN | ExtendedVerification | ||
) |
Reset the USB mass storage device by CBI protocol.
This function resets the USB mass storage device by CBI protocol. The reset is defined as a non-data command. Don't use UsbCbiExecCommand to send the command to device because that may introduce recursive loop.
Context | The USB CBI protocol |
ExtendedVerification | The flag controlling the rule of reset. Not used here. |
EFI_SUCCESS | The device is reset. |
Others | Failed to reset the device. |
Definition at line 542 of file UsbMassCbi.c.
|
extern |
Definition at line 17 of file UsbMassCbi.c.
|
extern |
Definition at line 29 of file UsbMassCbi.c.