]>
git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/IndustryStandard/VirtioScsi.h
3 Virtio SCSI Host Device specific type and macro definitions corresponding to
4 the virtio-0.9.5 specification.
6 Copyright (C) 2012, Red Hat, Inc.
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef _VIRTIO_SCSI_H_
13 #define _VIRTIO_SCSI_H_
15 #include <IndustryStandard/Virtio.h>
18 // virtio-0.9.5, Appendix I: SCSI Host Device
35 #define OFFSET_OF_VSCSI(Field) OFFSET_OF (VIRTIO_SCSI_CONFIG, Field)
36 #define SIZE_OF_VSCSI(Field) (sizeof ((VIRTIO_SCSI_CONFIG *) 0)->Field)
38 #define VIRTIO_SCSI_F_INOUT BIT0
39 #define VIRTIO_SCSI_F_HOTPLUG BIT1
42 // We expect these maximum sizes from the host. Also we force the CdbLength and
43 // SenseDataLength parameters of EFI_EXT_SCSI_PASS_THRU_PROTOCOL.PassThru() not
44 // to exceed these limits. See UEFI 2.3.1 errata C 14.7.
46 #define VIRTIO_SCSI_CDB_SIZE 32
47 #define VIRTIO_SCSI_SENSE_SIZE 96
50 // We pass the dynamically sized buffers ("dataout", "datain") in separate ring
60 UINT8 Cdb
[VIRTIO_SCSI_CDB_SIZE
];
66 UINT16 StatusQualifier
;
69 UINT8 Sense
[VIRTIO_SCSI_SENSE_SIZE
];
74 // selector of first virtio queue usable for request transfer
76 #define VIRTIO_SCSI_REQUEST_QUEUE 2
79 // host response codes
81 #define VIRTIO_SCSI_S_OK 0
82 #define VIRTIO_SCSI_S_OVERRUN 1
83 #define VIRTIO_SCSI_S_ABORTED 2
84 #define VIRTIO_SCSI_S_BAD_TARGET 3
85 #define VIRTIO_SCSI_S_RESET 4
86 #define VIRTIO_SCSI_S_BUSY 5
87 #define VIRTIO_SCSI_S_TRANSPORT_FAILURE 6
88 #define VIRTIO_SCSI_S_TARGET_FAILURE 7
89 #define VIRTIO_SCSI_S_NEXUS_FAILURE 8
90 #define VIRTIO_SCSI_S_FAILURE 9
92 #endif // _VIRTIO_SCSI_H_