]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/PvScsiDxe/PvScsi.h
OvmfPkg/PvScsiDxe: Setup requests and completions rings
[mirror_edk2.git] / OvmfPkg / PvScsiDxe / PvScsi.h
1 /** @file
2
3 Internal definitions for the PVSCSI driver, which produces Extended SCSI
4 Pass Thru Protocol instances for pvscsi devices.
5
6 Copyright (C) 2020, Oracle and/or its affiliates.
7
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10 **/
11
12 #ifndef __PVSCSI_DXE_H_
13 #define __PVSCSI_DXE_H_
14
15 #include <Library/DebugLib.h>
16 #include <Protocol/ScsiPassThruExt.h>
17
18 typedef struct {
19 EFI_PHYSICAL_ADDRESS DeviceAddress;
20 VOID *Mapping;
21 } PVSCSI_DMA_DESC;
22
23 typedef struct {
24 PVSCSI_RINGS_STATE *RingState;
25 PVSCSI_DMA_DESC RingStateDmaDesc;
26
27 PVSCSI_RING_REQ_DESC *RingReqs;
28 PVSCSI_DMA_DESC RingReqsDmaDesc;
29
30 PVSCSI_RING_CMP_DESC *RingCmps;
31 PVSCSI_DMA_DESC RingCmpsDmaDesc;
32 } PVSCSI_RING_DESC;
33
34 #define PVSCSI_SIG SIGNATURE_32 ('P', 'S', 'C', 'S')
35
36 typedef struct {
37 UINT32 Signature;
38 EFI_PCI_IO_PROTOCOL *PciIo;
39 UINT64 OriginalPciAttributes;
40 PVSCSI_RING_DESC RingDesc;
41 UINT8 MaxTarget;
42 UINT8 MaxLun;
43 EFI_EXT_SCSI_PASS_THRU_PROTOCOL PassThru;
44 EFI_EXT_SCSI_PASS_THRU_MODE PassThruMode;
45 } PVSCSI_DEV;
46
47 #define PVSCSI_FROM_PASS_THRU(PassThruPointer) \
48 CR (PassThruPointer, PVSCSI_DEV, PassThru, PVSCSI_SIG)
49
50 #endif // __PVSCSI_DXE_H_