TianoCore EDK2 master
Loading...
Searching...
No Matches
BotPeim.h File Reference

Go to the source code of this file.

Data Structures

struct  CBW
 
struct  CSW
 

Macros

#define CSWSIG   0x53425355
 
#define CBWSIG   0x43425355
 

Functions

EFI_STATUS PeiUsbInquiry (IN EFI_PEI_SERVICES **PeiServices, IN PEI_BOT_DEVICE *PeiBotDevice)
 
EFI_STATUS PeiUsbTestUnitReady (IN EFI_PEI_SERVICES **PeiServices, IN PEI_BOT_DEVICE *PeiBotDevice)
 
EFI_STATUS PeiUsbRequestSense (IN EFI_PEI_SERVICES **PeiServices, IN PEI_BOT_DEVICE *PeiBotDevice, OUT UINTN *SenseCounts, IN UINT8 *SenseKeyBuffer)
 
EFI_STATUS PeiUsbReadCapacity (IN EFI_PEI_SERVICES **PeiServices, IN PEI_BOT_DEVICE *PeiBotDevice)
 
EFI_STATUS PeiUsbReadFormattedCapacity (IN EFI_PEI_SERVICES **PeiServices, IN PEI_BOT_DEVICE *PeiBotDevice)
 
EFI_STATUS PeiUsbRead10 (IN EFI_PEI_SERVICES **PeiServices, IN PEI_BOT_DEVICE *PeiBotDevice, IN VOID *Buffer, IN EFI_PEI_LBA Lba, IN UINTN NumberOfBlocks)
 
BOOLEAN IsNoMedia (IN ATAPI_REQUEST_SENSE_DATA *SenseData, IN UINTN SenseCounts)
 
BOOLEAN IsMediaError (IN ATAPI_REQUEST_SENSE_DATA *SenseData, IN UINTN SenseCounts)
 
BOOLEAN IsMediaChange (IN ATAPI_REQUEST_SENSE_DATA *SenseData, IN UINTN SenseCounts)
 

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.h.

Macro Definition Documentation

◆ CBWSIG

#define CBWSIG   0x43425355

Definition at line 52 of file BotPeim.h.

◆ CSWSIG

#define CSWSIG   0x53425355

Definition at line 51 of file BotPeim.h.

Function Documentation

◆ IsMediaChange()

BOOLEAN IsMediaChange ( IN ATAPI_REQUEST_SENSE_DATA SenseData,
IN UINTN  SenseCounts 
)

Check if media is changed according to sense data.

Parameters
SenseDataPointer to sense data.
SenseCountsCount of sense data.
Return values
TRUEThere is media change event.
FALSEmedia is NOT changed.

Definition at line 603 of file PeiAtapi.c.

◆ IsMediaError()

BOOLEAN IsMediaError ( IN ATAPI_REQUEST_SENSE_DATA SenseData,
IN UINTN  SenseCounts 
)

Check if there is media error according to sense data.

Parameters
SenseDataPointer to sense data.
SenseCountsCount of sense data.
Return values
TRUEMedia error
FALSENo media error

Check if there is media error according to sense data.

Parameters
[in]SenseDataPointer to sense data.
[in]SenseCountsCount of sense data.
Return values
TRUEMedia error
FALSENo media error

Definition at line 2355 of file AtapiPeim.c.

◆ IsNoMedia()

BOOLEAN IsNoMedia ( IN ATAPI_REQUEST_SENSE_DATA SenseData,
IN UINTN  SenseCounts 
)

Check if there is media according to sense data.

Parameters
SenseDataPointer to sense data.
SenseCountsCount of sense data.
Return values
TRUENo media
FALSEMedia exists

Check if there is media according to sense data.

Parameters
[in]SenseDataPointer to sense data.
[in]SenseCountsCount of sense data.
Return values
TRUENo media
FALSEMedia exists

Definition at line 2280 of file AtapiPeim.c.

◆ PeiUsbInquiry()

EFI_STATUS PeiUsbInquiry ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_BOT_DEVICE PeiBotDevice 
)

Sends out ATAPI Inquiry Packet Command to the specified device. This command will return INQUIRY data of the device.

Parameters
PeiServicesThe pointer of EFI_PEI_SERVICES.
PeiBotDeviceThe pointer to PEI_BOT_DEVICE instance.
Return values
EFI_SUCCESSInquiry command completes successfully.
EFI_DEVICE_ERRORInquiry command failed.

Definition at line 28 of file PeiAtapi.c.

◆ PeiUsbRead10()

EFI_STATUS PeiUsbRead10 ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_BOT_DEVICE PeiBotDevice,
IN VOID *  Buffer,
IN EFI_PEI_LBA  Lba,
IN UINTN  NumberOfBlocks 
)

Execute Read(10) ATAPI command on a specific SCSI target.

Executes the ATAPI Read(10) command on the ATAPI target specified by PeiBotDevice.

Parameters
PeiServicesThe pointer of EFI_PEI_SERVICES.
PeiBotDeviceThe pointer to PEI_BOT_DEVICE instance.
BufferThe pointer to data buffer.
LbaThe start logic block address of reading.
NumberOfBlocksThe block number of reading.
Return values
EFI_SUCCESSCommand executed successfully.
EFI_DEVICE_ERRORSome device errors happen.

Definition at line 375 of file PeiAtapi.c.

◆ PeiUsbReadCapacity()

EFI_STATUS PeiUsbReadCapacity ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_BOT_DEVICE PeiBotDevice 
)

Sends out ATAPI Read Capacity Packet Command to the specified device. This command will return the information regarding the capacity of the media in the device.

Parameters
PeiServicesThe pointer of EFI_PEI_SERVICES.
PeiBotDeviceThe pointer to PEI_BOT_DEVICE instance.
Return values
EFI_SUCCESSCommand executed successfully.
EFI_DEVICE_ERRORSome device errors happen.

Definition at line 237 of file PeiAtapi.c.

◆ PeiUsbReadFormattedCapacity()

EFI_STATUS PeiUsbReadFormattedCapacity ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_BOT_DEVICE PeiBotDevice 
)

Sends out ATAPI Read Format Capacity Data Command to the specified device. This command will return the information regarding the capacity of the media in the device.

Parameters
PeiServicesThe pointer of EFI_PEI_SERVICES.
PeiBotDeviceThe pointer to PEI_BOT_DEVICE instance.
Return values
EFI_SUCCESSCommand executed successfully.
EFI_DEVICE_ERRORSome device errors happen.

Definition at line 298 of file PeiAtapi.c.

◆ PeiUsbRequestSense()

EFI_STATUS PeiUsbRequestSense ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_BOT_DEVICE PeiBotDevice,
OUT UINTN SenseCounts,
IN UINT8 *  SenseKeyBuffer 
)

Sends out ATAPI Request Sense Packet Command to the specified device.

Parameters
PeiServicesThe pointer of EFI_PEI_SERVICES.
PeiBotDeviceThe pointer to PEI_BOT_DEVICE instance.
SenseCountsLength of sense buffer.
SenseKeyBufferPointer to sense buffer.
Return values
EFI_SUCCESSCommand executed successfully.
EFI_DEVICE_ERRORSome device errors happen.

Definition at line 144 of file PeiAtapi.c.

◆ PeiUsbTestUnitReady()

EFI_STATUS PeiUsbTestUnitReady ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_BOT_DEVICE PeiBotDevice 
)

Sends out ATAPI Test Unit Ready Packet Command to the specified device to find out whether device is accessible.

Parameters
PeiServicesThe pointer of EFI_PEI_SERVICES.
PeiBotDeviceThe pointer to PEI_BOT_DEVICE instance.
Return values
EFI_SUCCESSTestUnit command executed successfully.
EFI_DEVICE_ERRORDevice cannot be executed TestUnit command successfully.

Definition at line 96 of file PeiAtapi.c.