diff options
author | Liran Alon <liran.alon@oracle.com> | 2020-03-28 23:00:56 +0300 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-03-30 16:45:07 +0000 |
commit | b654edec034a5e5dcc440f2f30fd2aa6c31aef3c (patch) | |
tree | bfec94afe2c198aaff63e677c3c9c37593e18f23 /OvmfPkg/PvScsiDxe/PvScsi.h | |
parent | 5269c26e07381dcc7e9de4fe1f2a5b7ed1e5c78a (diff) | |
download | edk2-b654edec034a5e5dcc440f2f30fd2aa6c31aef3c.tar.gz edk2-b654edec034a5e5dcc440f2f30fd2aa6c31aef3c.tar.bz2 edk2-b654edec034a5e5dcc440f2f30fd2aa6c31aef3c.zip |
OvmfPkg/PvScsiDxe: Setup requests and completions rings
These rings are shared memory buffers between host and device in which
a cyclic buffer is managed to send request descriptors from host to
device and receive completion descriptors from device to host.
Note that because device may be constrained by IOMMU or guest may be run
under AMD SEV, we make sure to map these rings to device by using
PciIo->Map().
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567
Signed-off-by: Liran Alon <liran.alon@oracle.com>
Message-Id: <20200328200100.60786-14-liran.alon@oracle.com>
Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'OvmfPkg/PvScsiDxe/PvScsi.h')
-rw-r--r-- | OvmfPkg/PvScsiDxe/PvScsi.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/OvmfPkg/PvScsiDxe/PvScsi.h b/OvmfPkg/PvScsiDxe/PvScsi.h index 5f611dbbc9..6d23b6e1ec 100644 --- a/OvmfPkg/PvScsiDxe/PvScsi.h +++ b/OvmfPkg/PvScsiDxe/PvScsi.h @@ -15,12 +15,29 @@ #include <Library/DebugLib.h>
#include <Protocol/ScsiPassThruExt.h>
+typedef struct {
+ EFI_PHYSICAL_ADDRESS DeviceAddress;
+ VOID *Mapping;
+} PVSCSI_DMA_DESC;
+
+typedef struct {
+ PVSCSI_RINGS_STATE *RingState;
+ PVSCSI_DMA_DESC RingStateDmaDesc;
+
+ PVSCSI_RING_REQ_DESC *RingReqs;
+ PVSCSI_DMA_DESC RingReqsDmaDesc;
+
+ PVSCSI_RING_CMP_DESC *RingCmps;
+ PVSCSI_DMA_DESC RingCmpsDmaDesc;
+} PVSCSI_RING_DESC;
+
#define PVSCSI_SIG SIGNATURE_32 ('P', 'S', 'C', 'S')
typedef struct {
UINT32 Signature;
EFI_PCI_IO_PROTOCOL *PciIo;
UINT64 OriginalPciAttributes;
+ PVSCSI_RING_DESC RingDesc;
UINT8 MaxTarget;
UINT8 MaxLun;
EFI_EXT_SCSI_PASS_THRU_PROTOCOL PassThru;
|