TianoCore EDK2 master
|
#include "UsbMass.h"
Go to the source code of this file.
Functions | |
EFI_STATUS | UsbCbiInit (IN EFI_USB_IO_PROTOCOL *UsbIo, OUT VOID **Context OPTIONAL) |
EFI_STATUS | UsbCbiSendCommand (IN USB_CBI_PROTOCOL *UsbCbi, IN UINT8 *Cmd, IN UINT8 CmdLen, IN UINT32 Timeout) |
EFI_STATUS | UsbCbiDataTransfer (IN USB_CBI_PROTOCOL *UsbCbi, IN EFI_USB_DATA_DIRECTION DataDir, IN OUT UINT8 *Data, IN OUT UINTN *TransLen, IN UINT32 Timeout) |
EFI_STATUS | UsbCbiGetStatus (IN USB_CBI_PROTOCOL *UsbCbi, IN UINT32 Timeout, OUT USB_CBI_STATUS *Result) |
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 |
Implementation of the USB mass storage Control/Bulk/Interrupt transport, according to USB Mass Storage Class Control/Bulk/Interrupt (CBI) Transport, Revision 1.1. Notice: it is being obsoleted by the standard body in favor of the BOT (Bulk-Only Transport).
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UsbMassCbi.c.
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 UsbCbiDataTransfer | ( | IN USB_CBI_PROTOCOL * | UsbCbi, |
IN EFI_USB_DATA_DIRECTION | DataDir, | ||
IN OUT UINT8 * | Data, | ||
IN OUT UINTN * | TransLen, | ||
IN UINT32 | Timeout | ||
) |
Transfer data between the device and host.
This function transfers data between the device and host. The CBI contains three phases: Command, Data, and Status. This is Data phase.
UsbCbi | The USB CBI device |
DataDir | The direction of the data transfer |
Data | The buffer to hold the data for input or output. |
TransLen | On input, the expected transfer length. On output, the length of data actually transferred. |
Timeout | The time to wait for the command to execute |
EFI_SUCCESS | The data transferred successfully. |
EFI_SUCCESS | No data to transfer |
Others | Failed to transfer all the data |
Definition at line 247 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 UsbCbiGetStatus | ( | IN USB_CBI_PROTOCOL * | UsbCbi, |
IN UINT32 | Timeout, | ||
OUT USB_CBI_STATUS * | Result | ||
) |
Gets the result of high level command execution from interrupt endpoint.
This function returns the USB transfer status, and put the high level command execution result in Result. The CBI contains three phases: Command, Data, and Status. This is Status phase.
UsbCbi | The USB CBI protocol |
Timeout | The time to wait for the command to execute |
Result | The result of the command execution. |
EFI_SUCCESS | The high level command execution result is retrieved in Result. |
Others | Failed to retrieve the result. |
Definition at line 364 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.
EFI_STATUS UsbCbiSendCommand | ( | IN USB_CBI_PROTOCOL * | UsbCbi, |
IN UINT8 * | Cmd, | ||
IN UINT8 | CmdLen, | ||
IN UINT32 | Timeout | ||
) |
Send the command to the device using class specific control transfer.
This function sends command to the device using class specific control transfer. The CBI contains three phases: Command, Data, and Status. This is Command phase.
UsbCbi | The USB CBI protocol |
Cmd | The high level command to transfer to device |
CmdLen | The length of the command |
Timeout | The time to wait the command to finish |
EFI_SUCCESS | The command is sent to the device. |
Others | The command failed to transfer to device |
Definition at line 170 of file UsbMassCbi.c.
USB_MASS_TRANSPORT mUsbCbi0Transport |
Definition at line 17 of file UsbMassCbi.c.
USB_MASS_TRANSPORT mUsbCbi1Transport |
Definition at line 29 of file UsbMassCbi.c.