A.3.8 BlockIo.c File
Example A-20-Block I/O, Block I/O 2, and Storage Security Protocols implementation template
#include "<<DriverName>>.h"
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_BLOCK_IO_MEDIA g<<DriverName>>BlockIoMedia = {
0,
FALSE,
FALSE,
TRUE,
FALSE,
FALSE,
512,
0,
0,
0,
0,
0
};
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_BLOCK_IO_PROTOCOL g<<DriverName>>BlockIo = {
EFI_BLOCK_IO_PROTOCOL_REVISION3,
&g<<DriverName>>BlockIoMedia,
(EFI_BLOCK_RESET) <<DriverName>>BlockIoReset,
<<DriverName>>BlockIoReadBlocks,
<<DriverName>>BlockIoWriteBlocks,
<<DriverName>>BlockIoFlushBlocks
};
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_BLOCK_IO2_PROTOCOL g<<DriverName>>BlockIo2 = {
&g<<DriverName>>BlockIoMedia,
<<DriverName>>BlockIoReset,
<<DriverName>>BlockIoReadBlocksEx,
<<DriverName>>BlockIoWriteBlocksEx,
<<DriverName>>BlockIoFlushBlocksEx
};
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_STORAGE_SECURITY_COMMAND_PROTOCOL g<<DriverName>>StorageSecurityCommand = {
<<DriverName>>StorageSecurityCommandReceiveData,
<<DriverName>>StorageSecurityCommandSendData
};
EFI_STATUS
EFIAPI
<<DriverName>>BlockIoReadBlocks (
IN EFI_BLOCK_IO_PROTOCOL *This,
IN UINT32 MediaId,
IN EFI_LBA Lba,
IN UINTN BufferSize,
OUT VOID *Buffer
)
{
}
EFI_STATUS
EFIAPI
<<DriverName>>BlockIoWriteBlocks (
IN EFI_BLOCK_IO_PROTOCOL *This,
IN UINT32 MediaId,
IN EFI_LBA Lba,
IN UINTN BufferSize,
IN VOID *Buffer
)
{
}
EFI_STATUS
EFIAPI
<<DriverName>>BlockIoFlushBlocks (
IN EFI_BLOCK_IO_PROTOCOL *This
)
{
}
EFI_STATUS
EFIAPI
<<DriverName>>BlockIoReset (
IN EFI_BLOCK_IO2_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
)
{
}
EFI_STATUS
EFIAPI
<<DriverName>>BlockIoReadBlocksEx (
IN EFI_BLOCK_IO2_PROTOCOL *This,
IN UINT32 MediaId,
IN EFI_LBA LBA,
IN OUT EFI_BLOCK_IO2_TOKEN *Token,
IN UINTN BufferSize,
OUT VOID *Buffer
)
{
}
EFI_STATUS
EFIAPI
<<DriverName>>BlockIoWriteBlocksEx (
IN EFI_BLOCK_IO2_PROTOCOL *This,
IN UINT32 MediaId,
IN EFI_LBA LBA,
IN OUT EFI_BLOCK_IO2_TOKEN *Token,
IN UINTN BufferSize,
IN VOID *Buffer
)
{
}
EFI_STATUS
EFIAPI
<<DriverName>>BlockIoFlushBlocksEx (
IN EFI_BLOCK_IO2_PROTOCOL *This,
IN OUT EFI_BLOCK_IO2_TOKEN *Token
)
{
}
EFI_STATUS
EFIAPI
<<DriverName>>StorageSecurityCommandReceiveData (
IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This,
IN UINT32 MediaId,
IN UINT64 Timeout,
IN UINT8 SecurityProtocolId,
IN UINT16 SecurityProtocolSpecificData,
IN UINTN PayloadBufferSize,
OUT VOID *PayloadBuffer
OUT UINTN *PayloadTransferSize
)
{
}
EFI_STATUS
EFIAPI
<<DriverName>>StorageSecurityCommandSendData (
IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This,
IN UINT32 MediaId,
IN UINT64 Timeout,
IN UINT8 SecurityProtocolId,
IN UINT16 SecurityProtocolSpecificData,
IN UINTN PayloadBufferSize,
IN VOID *PayloadBuffer
)
{
}