iPXE
Data Structures | Macros | Typedefs | Functions | Variables
BlockIo.h File Reference

Block IO protocol as defined in the UEFI 2.0 specification. More...

Go to the source code of this file.

Data Structures

struct  EFI_BLOCK_IO_MEDIA
 Block IO read only mode data and updated only via members of BlockIO. More...
 
struct  _EFI_BLOCK_IO_PROTOCOL
 This protocol provides control over block devices. More...
 

Macros

#define EFI_BLOCK_IO_PROTOCOL_GUID
 
#define BLOCK_IO_PROTOCOL   EFI_BLOCK_IO_PROTOCOL_GUID
 Protocol GUID name defined in EFI1.1. More...
 
#define EFI_BLOCK_IO_PROTOCOL_REVISION   0x00010000
 
#define EFI_BLOCK_IO_PROTOCOL_REVISION2   0x00020001
 
#define EFI_BLOCK_IO_PROTOCOL_REVISION3   0x0002001F
 
#define EFI_BLOCK_IO_INTERFACE_REVISION   EFI_BLOCK_IO_PROTOCOL_REVISION
 Revision defined in EFI1.1. More...
 

Typedefs

typedef struct _EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL
 
typedef EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO
 Protocol defined in EFI1.1. More...
 
typedef EFI_STATUS(EFIAPIEFI_BLOCK_RESET) (IN EFI_BLOCK_IO_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
 Reset the Block Device. More...
 
typedef EFI_STATUS(EFIAPIEFI_BLOCK_READ) (IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer)
 Read BufferSize bytes from Lba into Buffer. More...
 
typedef EFI_STATUS(EFIAPIEFI_BLOCK_WRITE) (IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer)
 Write BufferSize bytes from Lba into Buffer. More...
 
typedef EFI_STATUS(EFIAPIEFI_BLOCK_FLUSH) (IN EFI_BLOCK_IO_PROTOCOL *This)
 Flush the Block Device. More...
 

Functions

 FILE_LICENCE (BSD2_PATENT)
 

Variables

EFI_GUID gEfiBlockIoProtocolGuid
 

Detailed Description

Block IO protocol as defined in the UEFI 2.0 specification.

The Block IO protocol is used to abstract block devices like hard drives, DVD-ROMs and floppy drives.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file BlockIo.h.

Macro Definition Documentation

◆ EFI_BLOCK_IO_PROTOCOL_GUID

#define EFI_BLOCK_IO_PROTOCOL_GUID
Value:
{ \
0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
}

Definition at line 17 of file BlockIo.h.

◆ BLOCK_IO_PROTOCOL

#define BLOCK_IO_PROTOCOL   EFI_BLOCK_IO_PROTOCOL_GUID

Protocol GUID name defined in EFI1.1.

Definition at line 27 of file BlockIo.h.

◆ EFI_BLOCK_IO_PROTOCOL_REVISION

#define EFI_BLOCK_IO_PROTOCOL_REVISION   0x00010000

Definition at line 204 of file BlockIo.h.

◆ EFI_BLOCK_IO_PROTOCOL_REVISION2

#define EFI_BLOCK_IO_PROTOCOL_REVISION2   0x00020001

Definition at line 205 of file BlockIo.h.

◆ EFI_BLOCK_IO_PROTOCOL_REVISION3

#define EFI_BLOCK_IO_PROTOCOL_REVISION3   0x0002001F

Definition at line 206 of file BlockIo.h.

◆ EFI_BLOCK_IO_INTERFACE_REVISION

#define EFI_BLOCK_IO_INTERFACE_REVISION   EFI_BLOCK_IO_PROTOCOL_REVISION

Revision defined in EFI1.1.

Definition at line 211 of file BlockIo.h.

Typedef Documentation

◆ EFI_BLOCK_IO_PROTOCOL

Definition at line 22 of file BlockIo.h.

◆ EFI_BLOCK_IO

Protocol defined in EFI1.1.

Definition at line 32 of file BlockIo.h.

◆ EFI_BLOCK_RESET

typedef EFI_STATUS(EFIAPI * EFI_BLOCK_RESET) (IN EFI_BLOCK_IO_PROTOCOL *This, IN BOOLEAN ExtendedVerification)

Reset the Block Device.

Parameters
ThisIndicates a pointer to the calling context.
ExtendedVerificationDriver may perform diagnostics on reset.
Return values
EFI_SUCCESSThe device was reset.
EFI_DEVICE_ERRORThe device is not functioning properly and could not be reset.

Definition at line 47 of file BlockIo.h.

◆ EFI_BLOCK_READ

typedef EFI_STATUS(EFIAPI * EFI_BLOCK_READ) (IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer)

Read BufferSize bytes from Lba into Buffer.

Parameters
ThisIndicates a pointer to the calling context.
MediaIdId of the media, changes every time the media is replaced.
LbaThe starting Logical Block Address to read from
BufferSizeSize of Buffer, must be a multiple of device block size.
BufferA pointer to the destination buffer for the data. The caller is responsible for either having implicit or explicit ownership of the buffer.
Return values
EFI_SUCCESSThe data was read correctly from the device.
EFI_DEVICE_ERRORThe device reported an error while performing the read.
EFI_NO_MEDIAThere is no media in the device.
EFI_MEDIA_CHANGEDThe MediaId does not matched the current device.
EFI_BAD_BUFFER_SIZEThe Buffer was not a multiple of the block size of the device.
EFI_INVALID_PARAMETERThe read request contains LBAs that are not valid, or the buffer is not on proper alignment.

Definition at line 73 of file BlockIo.h.

◆ EFI_BLOCK_WRITE

typedef EFI_STATUS(EFIAPI * EFI_BLOCK_WRITE) (IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer)

Write BufferSize bytes from Lba into Buffer.

Parameters
ThisIndicates a pointer to the calling context.
MediaIdThe media ID that the write request is for.
LbaThe starting logical block address to be written. The caller is responsible for writing to only legitimate locations.
BufferSizeSize of Buffer, must be a multiple of device block size.
BufferA pointer to the source buffer for the data.
Return values
EFI_SUCCESSThe data was written correctly to the device.
EFI_WRITE_PROTECTEDThe device can not be written to.
EFI_DEVICE_ERRORThe device reported an error while performing the write.
EFI_NO_MEDIAThere is no media in the device.
EFI_MEDIA_CHNAGEDThe MediaId does not matched the current device.
EFI_BAD_BUFFER_SIZEThe Buffer was not a multiple of the block size of the device.
EFI_INVALID_PARAMETERThe write request contains LBAs that are not valid, or the buffer is not on proper alignment.

Definition at line 103 of file BlockIo.h.

◆ EFI_BLOCK_FLUSH

typedef EFI_STATUS(EFIAPI * EFI_BLOCK_FLUSH) (IN EFI_BLOCK_IO_PROTOCOL *This)

Flush the Block Device.

Parameters
ThisIndicates a pointer to the calling context.
Return values
EFI_SUCCESSAll outstanding data was written to the device
EFI_DEVICE_ERRORThe device reported an error while writting back the data
EFI_NO_MEDIAThere is no media in the device.

Definition at line 123 of file BlockIo.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( BSD2_PATENT  )

Variable Documentation

◆ gEfiBlockIoProtocolGuid

EFI_GUID gEfiBlockIoProtocolGuid