TianoCore EDK2 master
Loading...
Searching...
No Matches
BotPeim.c File Reference
#include "UsbBotPeim.h"
#include "BotPeim.h"
#include "PeiUsbLib.h"

Go to the source code of this file.

Functions

EFI_STATUS BotRecoveryReset (IN EFI_PEI_SERVICES **PeiServices, IN PEI_BOT_DEVICE *PeiBotDev)
 
EFI_STATUS BotCommandPhase (IN EFI_PEI_SERVICES **PeiServices, IN PEI_BOT_DEVICE *PeiBotDev, IN VOID *Command, IN UINT8 CommandSize, IN UINT32 DataTransferLength, IN EFI_USB_DATA_DIRECTION Direction, IN UINT16 Timeout)
 
EFI_STATUS BotDataPhase (IN EFI_PEI_SERVICES **PeiServices, IN PEI_BOT_DEVICE *PeiBotDev, IN UINT32 *DataSize, IN OUT VOID *DataBuffer, IN EFI_USB_DATA_DIRECTION Direction, IN UINT16 Timeout)
 
EFI_STATUS BotStatusPhase (IN EFI_PEI_SERVICES **PeiServices, IN PEI_BOT_DEVICE *PeiBotDev, OUT UINT8 *TransferStatus, IN UINT16 Timeout)
 
EFI_STATUS PeiAtapiCommand (IN EFI_PEI_SERVICES **PeiServices, IN PEI_BOT_DEVICE *PeiBotDev, IN VOID *Command, IN UINT8 CommandSize, IN VOID *DataBuffer, IN UINT32 BufferLength, IN EFI_USB_DATA_DIRECTION Direction, IN UINT16 TimeOutInMilliSeconds)
 

Detailed Description

BOT Transportation implementation.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file BotPeim.c.

Function Documentation

◆ BotCommandPhase()

EFI_STATUS BotCommandPhase ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_BOT_DEVICE PeiBotDev,
IN VOID *  Command,
IN UINT8  CommandSize,
IN UINT32  DataTransferLength,
IN EFI_USB_DATA_DIRECTION  Direction,
IN UINT16  Timeout 
)

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.

Parameters
PeiServicesThe pointer of EFI_PEI_SERVICES.
PeiBotDevThe instance to PEI_BOT_DEVICE.
CommandThe command to transfer to device.
CommandSizeThe length of the command.
DataTransferLengthThe expected length of the data.
DirectionThe direction of the data.
TimeoutIndicates the maximum time, in millisecond, which the transfer is allowed to complete.
Return values
EFI_DEVICE_ERRORSuccessful to send the command to device.
EFI_SUCCESSFailed to send the command to device.

Definition at line 98 of file BotPeim.c.

◆ BotDataPhase()

EFI_STATUS BotDataPhase ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_BOT_DEVICE PeiBotDev,
IN UINT32 *  DataSize,
IN OUT VOID *  DataBuffer,
IN EFI_USB_DATA_DIRECTION  Direction,
IN UINT16  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.

Parameters
PeiServicesThe pointer of EFI_PEI_SERVICES.
PeiBotDevThe instance to PEI_BOT_DEVICE.
DataSizeThe length of the data.
DataBufferThe pointer to the data.
DirectionThe direction of the data.
TimeoutIndicates the maximum time, in millisecond, which the transfer is allowed to complete.
Return values
EFI_DEVICE_ERRORSuccessful to send the data to device.
EFI_SUCCESSFailed to send the data to device.

Definition at line 170 of file BotPeim.c.

◆ BotRecoveryReset()

EFI_STATUS BotRecoveryReset ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_BOT_DEVICE PeiBotDev 
)

Reset the given usb device.

Parameters
PeiServicesThe pointer of EFI_PEI_SERVICES.
PeiBotDevThe instance to PEI_BOT_DEVICE.
Return values
EFI_INVALID_PARAMETERCan not get usb io ppi.
EFI_SUCCESSFailed to reset the given usb device.

Definition at line 25 of file BotPeim.c.

◆ BotStatusPhase()

EFI_STATUS BotStatusPhase ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_BOT_DEVICE PeiBotDev,
OUT UINT8 *  TransferStatus,
IN UINT16  Timeout 
)

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.

Parameters
PeiServicesThe pointer of EFI_PEI_SERVICES.
PeiBotDevThe instance to PEI_BOT_DEVICE.
TransferStatusThe status of the transaction.
TimeoutIndicates the maximum time, in millisecond, which the transfer is allowed to complete.
Return values
EFI_DEVICE_ERRORSuccessful to get the status of device.
EFI_SUCCESSFailed to get the status of device.

Definition at line 258 of file BotPeim.c.

◆ PeiAtapiCommand()

EFI_STATUS PeiAtapiCommand ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_BOT_DEVICE PeiBotDev,
IN VOID *  Command,
IN UINT8  CommandSize,
IN VOID *  DataBuffer,
IN UINT32  BufferLength,
IN EFI_USB_DATA_DIRECTION  Direction,
IN UINT16  TimeOutInMilliSeconds 
)

Send ATAPI command using BOT protocol.

Parameters
PeiServicesThe pointer of EFI_PEI_SERVICES.
PeiBotDevThe instance to PEI_BOT_DEVICE.
CommandThe command to be sent to ATAPI device.
CommandSizeThe length of the data to be sent.
DataBufferThe pointer to the data.
BufferLengthThe length of the data.
DirectionThe direction of the data.
TimeOutInMilliSecondsIndicates the maximum time, in millisecond, which the transfer is allowed to complete.
Return values
EFI_DEVICE_ERRORSuccessful to get the status of device.
EFI_SUCCESSFailed to get the status of device.

Definition at line 321 of file BotPeim.c.