TianoCore EDK2 master
|
#include <Protocol/BlockIo.h>
#include <Protocol/ComponentName.h>
#include <Protocol/DriverBinding.h>
#include <IndustryStandard/Virtio.h>
Go to the source code of this file.
Data Structures | |
struct | VBLK_DEV |
Macros | |
#define | VBLK_SIG SIGNATURE_32 ('V', 'B', 'L', 'K') |
#define | VIRTIO_BLK_FROM_BLOCK_IO(BlockIoPointer) CR (BlockIoPointer, VBLK_DEV, BlockIo, VBLK_SIG) |
Internal definitions for the virtio-blk driver, which produces Block I/O Protocol instances for virtio-blk devices.
Copyright (C) 2012, Red Hat, Inc.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file VirtioBlk.h.
#define VBLK_SIG SIGNATURE_32 ('V', 'B', 'L', 'K') |
Definition at line 21 of file VirtioBlk.h.
Definition at line 40 of file VirtioBlk.h.
EFI_STATUS EFIAPI VirtioBlkDriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | DeviceHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
After we've pronounced support for a specific device in DriverBindingSupported(), we start managing said device (passed in by the Driver Execution Environment) with the following service.
See DriverBindingSupported() for specification references.
[in] | This | The EFI_DRIVER_BINDING_PROTOCOL object incorporating this driver (independently of any device). |
[in] | DeviceHandle | The supported device to drive. |
[in] | RemainingDevicePath | Relevant only for bus drivers, ignored. |
EFI_SUCCESS | Driver instance has been created and initialized for the virtio-blk device, it is now accessible via EFI_BLOCK_IO_PROTOCOL. |
EFI_OUT_OF_RESOURCES | Memory allocation failed. |
After we've pronounced support for a specific device in DriverBindingSupported(), we start managing said device (passed in by the Driver Execution Environment) with the following service.
See DriverBindingSupported() for specification references.
[in] | This | The EFI_DRIVER_BINDING_PROTOCOL object incorporating this driver (independently of any device). |
[in] | DeviceHandle | The supported device to drive. |
[in] | RemainingDevicePath | Relevant only for bus drivers, ignored. |
EFI_SUCCESS | Driver instance has been created and initialized for the virtio-blk device, it is now accessible via EFI_BLOCK_IO_PROTOCOL. |
EFI_OUT_OF_RESOURCES | Memory allocation failed. |
Definition at line 1092 of file VirtioBlk.c.
EFI_STATUS EFIAPI VirtioBlkDriverBindingStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | DeviceHandle, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE * | ChildHandleBuffer | ||
) |
Stop driving a virtio-blk device and remove its BlockIo interface.
This function replays the success path of DriverBindingStart() in reverse. The host side virtio-blk device is reset, so that the OS boot loader or the OS may reinitialize it.
[in] | This | The EFI_DRIVER_BINDING_PROTOCOL object incorporating this driver (independently of any device). |
[in] | DeviceHandle | Stop driving this device. |
[in] | NumberOfChildren | Since this function belongs to a device driver only (as opposed to a bus driver), the caller environment sets NumberOfChildren to zero, and we ignore it. |
[in] | ChildHandleBuffer | Ignored (corresponding to NumberOfChildren). |
Definition at line 1197 of file VirtioBlk.c.
EFI_STATUS EFIAPI VirtioBlkDriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | DeviceHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Device probe function for this driver.
The DXE core calls this function for any given device in order to see if the driver can drive the device.
Specs relevant in the general sense:
[in] | This | The EFI_DRIVER_BINDING_PROTOCOL object incorporating this driver (independently of any device). |
[in] | DeviceHandle | The device to probe. |
[in] | RemainingDevicePath | Relevant only for bus drivers, ignored. |
EFI_SUCCESS | The driver supports the device being probed. |
EFI_UNSUPPORTED | Based on virtio-blk discovery, we do not support the device. |
Device probe function for this driver.
The DXE core calls this function for any given device in order to see if the driver can drive the device.
Specs relevant in the general sense:
[in] | This | The EFI_DRIVER_BINDING_PROTOCOL object incorporating this driver (independently of any device). |
[in] | DeviceHandle | The device to probe. |
[in] | RemainingDevicePath | Relevant only for bus drivers, ignored. |
EFI_SUCCESS | The driver supports the device being probed. |
EFI_UNSUPPORTED | Based on virtio-blk discovery, we do not support the device. |
Definition at line 652 of file VirtioBlk.c.
EFI_STATUS EFIAPI VirtioBlkFlushBlocks | ( | IN EFI_BLOCK_IO_PROTOCOL * | This | ) |
FlushBlocks() operation for virtio-blk.
See
If the underlying virtio-blk device doesn't support flushing (ie. write-caching), then this function should not be called by higher layers, according to EFI_BLOCK_IO_MEDIA characteristics set in VirtioBlkInit(). Should they do nonetheless, we do nothing, successfully.
Definition at line 596 of file VirtioBlk.c.
EFI_STATUS EFIAPI VirtioBlkGetDeviceName | ( | IN EFI_COMPONENT_NAME_PROTOCOL * | This, |
IN EFI_HANDLE | DeviceHandle, | ||
IN EFI_HANDLE | ChildHandle, | ||
IN CHAR8 * | Language, | ||
OUT CHAR16 ** | ControllerName | ||
) |
Definition at line 1305 of file VirtioBlk.c.
EFI_STATUS EFIAPI VirtioBlkGetDriverName | ( | IN EFI_COMPONENT_NAME_PROTOCOL * | This, |
IN CHAR8 * | Language, | ||
OUT CHAR16 ** | DriverName | ||
) |
Definition at line 1288 of file VirtioBlk.c.
EFI_STATUS EFIAPI VirtioBlkReadBlocks | ( | IN EFI_BLOCK_IO_PROTOCOL * | This, |
IN UINT32 | MediaId, | ||
IN EFI_LBA | Lba, | ||
IN UINTN | BufferSize, | ||
OUT VOID * | Buffer | ||
) |
ReadBlocks() operation for virtio-blk.
See
Parameter checks and conformant return values are implemented in VerifyReadWriteRequest() and SynchronousRequest().
A zero BufferSize doesn't seem to be prohibited, so do nothing in that case, successfully.
Definition at line 489 of file VirtioBlk.c.
EFI_STATUS EFIAPI VirtioBlkReset | ( | IN EFI_BLOCK_IO_PROTOCOL * | This, |
IN BOOLEAN | ExtendedVerification | ||
) |
Definition at line 82 of file VirtioBlk.c.
EFI_STATUS EFIAPI VirtioBlkWriteBlocks | ( | IN EFI_BLOCK_IO_PROTOCOL * | This, |
IN UINT32 | MediaId, | ||
IN EFI_LBA | Lba, | ||
IN UINTN | BufferSize, | ||
IN VOID * | Buffer | ||
) |
WriteBlocks() operation for virtio-blk.
See
Parameter checks and conformant return values are implemented in VerifyReadWriteRequest() and SynchronousRequest().
A zero BufferSize doesn't seem to be prohibited, so do nothing in that case, successfully.
Definition at line 543 of file VirtioBlk.c.