TianoCore EDK2 master
|
#include "UsbMass.h"
Go to the source code of this file.
Functions | |
EFI_STATUS | UsbBotInit (IN EFI_USB_IO_PROTOCOL *UsbIo, OUT VOID **Context OPTIONAL) |
EFI_STATUS | UsbBotSendCommand (IN USB_BOT_PROTOCOL *UsbBot, IN UINT8 *Cmd, IN UINT8 CmdLen, IN EFI_USB_DATA_DIRECTION DataDir, IN UINT32 TransLen, IN UINT8 Lun) |
EFI_STATUS | UsbBotDataTransfer (IN USB_BOT_PROTOCOL *UsbBot, IN EFI_USB_DATA_DIRECTION DataDir, IN OUT UINT8 *Data, IN OUT UINTN *TransLen, IN UINT32 Timeout) |
EFI_STATUS | UsbBotGetStatus (IN USB_BOT_PROTOCOL *UsbBot, IN UINT32 TransLen, OUT UINT8 *CmdStatus) |
EFI_STATUS | UsbBotExecCommand (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 | UsbBotResetDevice (IN VOID *Context, IN BOOLEAN ExtendedVerification) |
EFI_STATUS | UsbBotGetMaxLun (IN VOID *Context, OUT UINT8 *MaxLun) |
EFI_STATUS | UsbBotCleanUp (IN VOID *Context) |
Variables | |
USB_MASS_TRANSPORT | mUsbBotTransport |
Implementation of the USB mass storage Bulk-Only Transport protocol, according to USB Mass Storage Class Bulk-Only Transport, Revision 1.0.
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UsbMassBot.c.
EFI_STATUS UsbBotCleanUp | ( | IN VOID * | Context | ) |
Clean up the resource used by this BOT protocol.
Context | The context of the BOT protocol, that is, USB_BOT_PROTOCOL. |
EFI_SUCCESS | The resource is cleaned up. |
Definition at line 598 of file UsbMassBot.c.
EFI_STATUS UsbBotDataTransfer | ( | IN USB_BOT_PROTOCOL * | UsbBot, |
IN EFI_USB_DATA_DIRECTION | DataDir, | ||
IN OUT UINT8 * | Data, | ||
IN OUT UINTN * | TransLen, | ||
IN UINT32 | Timeout | ||
) |
Transfer the data between the device and host.
This function transfers the data between the device and host. BOT transfer is composed of three phases: Command, Data, and Status. This is the Data phase.
UsbBot | The USB BOT device |
DataDir | The direction of the data |
Data | The buffer to hold data |
TransLen | The expected length of the data |
Timeout | The time to wait the command to complete |
EFI_SUCCESS | The data is transferred |
EFI_SUCCESS | No data to transfer |
EFI_NOT_READY | The device return NAK to the transfer |
Others | Failed to transfer data |
Definition at line 227 of file UsbMassBot.c.
EFI_STATUS UsbBotExecCommand | ( | 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 | ||
) |
Call the USB Mass Storage Class BOT protocol to issue the command/data/status circle to execute the commands.
Context | The context of the BOT protocol, that is, USB_BOT_PROTOCOL |
Cmd | The high level command |
CmdLen | The command length |
DataDir | The direction of the data transfer |
Data | The buffer to hold data |
DataLen | The length of the data |
Lun | The number of logic unit |
Timeout | The time to wait command |
CmdStatus | The result of high level command execution |
EFI_SUCCESS | The command is executed successfully. |
Other | Failed to execute command |
Definition at line 393 of file UsbMassBot.c.
EFI_STATUS UsbBotGetMaxLun | ( | IN VOID * | Context, |
OUT UINT8 * | MaxLun | ||
) |
Get the max LUN (Logical Unit Number) of USB mass storage device.
Context | The context of the BOT protocol, that is, USB_BOT_PROTOCOL |
MaxLun | Return pointer to the max number of LUN. (e.g. MaxLun=1 means LUN0 and LUN1 in all.) |
EFI_SUCCESS | Max LUN is got successfully. |
Others | Fail to execute this request. |
Definition at line 536 of file UsbMassBot.c.
EFI_STATUS UsbBotGetStatus | ( | IN USB_BOT_PROTOCOL * | UsbBot, |
IN UINT32 | TransLen, | ||
OUT UINT8 * | CmdStatus | ||
) |
Get the command execution status from device.
This function gets the command execution status from device. BOT transfer is composed of three phases: Command, Data, and Status. This is the Status phase.
This function returns the transfer status of the BOT's CSW status, and returns the high level command execution result in Result. So even if EFI_SUCCESS is returned, the command may still have failed.
UsbBot | The USB BOT device. |
TransLen | The expected length of the data. |
CmdStatus | The result of the command execution. |
EFI_SUCCESS | Command execute result is retrieved and in the Result. |
Other | Error occurred when trying to get status. |
Definition at line 305 of file UsbMassBot.c.
EFI_STATUS UsbBotInit | ( | IN EFI_USB_IO_PROTOCOL * | UsbIo, |
OUT VOID **Context | OPTIONAL | ||
) |
Initializes USB BOT protocol.
This function initializes the USB mass storage class BOT protocol. It will save its context which is a USB_BOT_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 BOT initialization fails. |
Definition at line 40 of file UsbMassBot.c.
EFI_STATUS UsbBotResetDevice | ( | IN VOID * | Context, |
IN BOOLEAN | ExtendedVerification | ||
) |
Reset the USB mass storage device by BOT protocol.
Context | The context of the BOT protocol, that is, USB_BOT_PROTOCOL. |
ExtendedVerification | If FALSE, just issue Bulk-Only Mass Storage Reset request. If TRUE, additionally reset parent hub port. |
EFI_SUCCESS | The device is reset. |
Others | Failed to reset the device.. |
Definition at line 460 of file UsbMassBot.c.
EFI_STATUS UsbBotSendCommand | ( | IN USB_BOT_PROTOCOL * | UsbBot, |
IN UINT8 * | Cmd, | ||
IN UINT8 | CmdLen, | ||
IN EFI_USB_DATA_DIRECTION | DataDir, | ||
IN UINT32 | TransLen, | ||
IN UINT8 | Lun | ||
) |
Send the command to the device using Bulk-Out endpoint.
This function sends the command to the device using Bulk-Out endpoint. BOT transfer is composed of three phases: Command, Data, and Status. This is the Command phase.
UsbBot | The USB BOT device |
Cmd | The command to transfer to device |
CmdLen | The length of the command |
DataDir | The direction of the data |
TransLen | The expected length of the data |
Lun | The number of logic unit |
EFI_SUCCESS | The command is sent to the device. |
EFI_NOT_READY | The device return NAK to the transfer |
Others | Failed to send the command to device |
Definition at line 147 of file UsbMassBot.c.
USB_MASS_TRANSPORT mUsbBotTransport |
Definition at line 15 of file UsbMassBot.c.