]>
git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/IndustryStandard/VirtioScsi.h
7969d41c1b8928ce377d9192da2e6753b349b13b
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>
19 // virtio-0.9.5, Appendix I: SCSI Host Device
36 #define OFFSET_OF_VSCSI(Field) OFFSET_OF (VIRTIO_SCSI_CONFIG, Field)
37 #define SIZE_OF_VSCSI(Field) (sizeof ((VIRTIO_SCSI_CONFIG *) 0)->Field)
39 #define VIRTIO_SCSI_F_INOUT BIT0
40 #define VIRTIO_SCSI_F_HOTPLUG BIT1
43 // We expect these maximum sizes from the host. Also we force the CdbLength and
44 // SenseDataLength parameters of EFI_EXT_SCSI_PASS_THRU_PROTOCOL.PassThru() not
45 // to exceed these limits. See UEFI 2.3.1 errata C 14.7.
47 #define VIRTIO_SCSI_CDB_SIZE 32
48 #define VIRTIO_SCSI_SENSE_SIZE 96
51 // We pass the dynamically sized buffers ("dataout", "datain") in separate ring
61 UINT8 Cdb
[VIRTIO_SCSI_CDB_SIZE
];
67 UINT16 StatusQualifier
;
70 UINT8 Sense
[VIRTIO_SCSI_SENSE_SIZE
];
75 // selector of first virtio queue usable for request transfer
77 #define VIRTIO_SCSI_REQUEST_QUEUE 2
80 // host response codes
82 #define VIRTIO_SCSI_S_OK 0
83 #define VIRTIO_SCSI_S_OVERRUN 1
84 #define VIRTIO_SCSI_S_ABORTED 2
85 #define VIRTIO_SCSI_S_BAD_TARGET 3
86 #define VIRTIO_SCSI_S_RESET 4
87 #define VIRTIO_SCSI_S_BUSY 5
88 #define VIRTIO_SCSI_S_TRANSPORT_FAILURE 6
89 #define VIRTIO_SCSI_S_TARGET_FAILURE 7
90 #define VIRTIO_SCSI_S_NEXUS_FAILURE 8
91 #define VIRTIO_SCSI_S_FAILURE 9
93 #endif // _VIRTIO_SCSI_H_