]>
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 This program and the accompanying materials are licensed and made available
9 under the terms and conditions of the BSD License which accompanies this
10 distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
14 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #ifndef _VIRTIO_SCSI_H_
19 #define _VIRTIO_SCSI_H_
21 #include <IndustryStandard/Virtio.h>
25 // virtio-0.9.5, Appendix I: SCSI Host Device
42 #define OFFSET_OF_VSCSI(Field) OFFSET_OF (VIRTIO_SCSI_CONFIG, Field)
43 #define SIZE_OF_VSCSI(Field) (sizeof ((VIRTIO_SCSI_CONFIG *) 0)->Field)
45 #define VIRTIO_SCSI_F_INOUT BIT0
46 #define VIRTIO_SCSI_F_HOTPLUG BIT1
49 // We expect these maximum sizes from the host. Also we force the CdbLength and
50 // SenseDataLength parameters of EFI_EXT_SCSI_PASS_THRU_PROTOCOL.PassThru() not
51 // to exceed these limits. See UEFI 2.3.1 errata C 14.7.
53 #define VIRTIO_SCSI_CDB_SIZE 32
54 #define VIRTIO_SCSI_SENSE_SIZE 96
57 // We pass the dynamically sized buffers ("dataout", "datain") in separate ring
67 UINT8 Cdb
[VIRTIO_SCSI_CDB_SIZE
];
73 UINT16 StatusQualifier
;
76 UINT8 Sense
[VIRTIO_SCSI_SENSE_SIZE
];
81 // selector of first virtio queue usable for request transfer
83 #define VIRTIO_SCSI_REQUEST_QUEUE 2
86 // host response codes
88 #define VIRTIO_SCSI_S_OK 0
89 #define VIRTIO_SCSI_S_OVERRUN 1
90 #define VIRTIO_SCSI_S_ABORTED 2
91 #define VIRTIO_SCSI_S_BAD_TARGET 3
92 #define VIRTIO_SCSI_S_RESET 4
93 #define VIRTIO_SCSI_S_BUSY 5
94 #define VIRTIO_SCSI_S_TRANSPORT_FAILURE 6
95 #define VIRTIO_SCSI_S_TARGET_FAILURE 7
96 #define VIRTIO_SCSI_S_NEXUS_FAILURE 8
97 #define VIRTIO_SCSI_S_FAILURE 9
99 #endif // _VIRTIO_SCSI_H_