VirtualBox

source: vbox/trunk/src/VBox/Devices/Storage/VSCSI/VSCSIVpdPages.h@ 98110

Last change on this file since 98110 was 98103, checked in by vboxsync, 2 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.0 KB
Line 
1/* $Id: VSCSIVpdPages.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * Virtual SCSI driver: Definitions for VPD pages.
4 */
5
6/*
7 * Copyright (C) 2011-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef VBOX_INCLUDED_SRC_Storage_VSCSI_VSCSIVpdPages_h
29#define VBOX_INCLUDED_SRC_Storage_VSCSI_VSCSIVpdPages_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include <iprt/stdint.h>
35
36/** VPD device identification page number. */
37#define VSCSI_VPD_DEVID_NUMBER 0x83
38/** VPD device identification size. */
39#define VSCSI_VPD_DEVID_SIZE 4
40/**
41 * Device identification VPD page data.
42 */
43#pragma pack(1)
44typedef struct VSCSIVPDPAGEDEVID
45{
46 /** Device type. */
47 unsigned u5PeripheralDeviceType : 5; /**< 0x00 / 00 */
48 /** Qualifier. */
49 unsigned u3PeripheralQualifier : 3;
50 /** Page number. */
51 unsigned u8PageCode : 8;
52 /** Page size (Big endian) */
53 unsigned u16PageLength : 16;
54} VSCSIVPDPAGEDEVID;
55#pragma pack()
56AssertCompileSize(VSCSIVPDPAGEDEVID, VSCSI_VPD_DEVID_SIZE);
57typedef VSCSIVPDPAGEDEVID *PVSCSIVPDPAGEDEVID;
58typedef const VSCSIVPDPAGEDEVID *PCVSCSIVPDPAGEDEVID;
59
60/** VPD supported VPD pages page number. */
61#define VSCSI_VPD_SUPPORTED_PAGES_NUMBER 0x00
62/** VPD supported VPD pages size. */
63#define VSCSI_VPD_SUPPORTED_PAGES_SIZE 4
64/**
65 * Block limits VPD page data.
66 */
67#pragma pack(1)
68typedef struct VSCSIVPDPAGESUPPORTEDPAGES
69{
70 /** Device type. */
71 unsigned u5PeripheralDeviceType : 5; /**< 0x00 / 00 */
72 /** Qualifier. */
73 unsigned u3PeripheralQualifier : 3;
74 /** Page number. */
75 unsigned u8PageCode : 8;
76 /** Page size (Big endian) */
77 unsigned u16PageLength : 16;
78 /** Supported pages array - variable. */
79 uint8_t abVpdPages[1];
80} VSCSIVPDPAGESUPPORTEDPAGES;
81#pragma pack()
82AssertCompileSize(VSCSIVPDPAGESUPPORTEDPAGES, VSCSI_VPD_SUPPORTED_PAGES_SIZE+1);
83typedef VSCSIVPDPAGESUPPORTEDPAGES *PVSCSIVPDPAGESUPPORTEDPAGES;
84typedef const VSCSIVPDPAGESUPPORTEDPAGES *PCVSCSIVPDPAGESUPPORTEDPAGES;
85
86/** VPD block characteristics page number. */
87#define VSCSI_VPD_BLOCK_CHARACTERISTICS_NUMBER 0xb1
88/** VPD block characteristics size. */
89#define VSCSI_VPD_BLOCK_CHARACTERISTICS_SIZE 64
90/**
91 * Block limits VPD page data.
92 */
93#pragma pack(1)
94typedef struct VSCSIVPDPAGEBLOCKCHARACTERISTICS
95{
96 /** Device type. */
97 unsigned u5PeripheralDeviceType : 5; /**< 0x00 / 00 */
98 /** Qualifier. */
99 unsigned u3PeripheralQualifier : 3;
100 /** Page number. */
101 unsigned u8PageCode : 8;
102 /** Page size (Big endian) */
103 unsigned u16PageLength : 16;
104 /** Medium rotation rate. */
105 unsigned u16MediumRotationRate : 16;
106 /** Reserved. */
107 unsigned u8Reserved : 8;
108 /** Nominal form factor. */
109 unsigned u4NominalFormFactor : 4;
110 /** Reserved */
111 unsigned u4Reserved : 4;
112 /** Reserved. */
113 uint8_t abReserved[56];
114} VSCSIVPDPAGEBLOCKCHARACTERISTICS;
115#pragma pack()
116AssertCompileSize(VSCSIVPDPAGEBLOCKCHARACTERISTICS, VSCSI_VPD_BLOCK_CHARACTERISTICS_SIZE);
117typedef VSCSIVPDPAGEBLOCKCHARACTERISTICS *PVSCSIVPDPAGEBLOCKCHARACTERISTICS;
118typedef const VSCSIVPDPAGEBLOCKCHARACTERISTICS *PCVSCSIVPDPAGEBLOCKCHARACTERISTICS;
119
120#define VSCSI_VPD_BLOCK_CHARACT_MEDIUM_ROTATION_RATE_NOT_REPORTED UINT16_C(0x0000)
121#define VSCSI_VPD_BLOCK_CHARACT_MEDIUM_ROTATION_RATE_NON_ROTATING UINT16_C(0x0001)
122
123/** VPD block limits page number. */
124#define VSCSI_VPD_BLOCK_LIMITS_NUMBER 0xb0
125/** VPD block limits size. */
126#define VSCSI_VPD_BLOCK_LIMITS_SIZE 64
127/**
128 * Block limits VPD page data.
129 */
130#pragma pack(1)
131typedef struct VSCSIVPDPAGEBLOCKLIMITS
132{
133 /** Device type. */
134 unsigned u5PeripheralDeviceType : 5; /**< 0x00 / 00 */
135 /** Qualifier. */
136 unsigned u3PeripheralQualifier : 3;
137 /** Page number. */
138 unsigned u8PageCode : 8;
139 /** Page size (Big endian) */
140 unsigned u16PageLength : 16;
141 /** Reserved. */
142 uint8_t u8Reserved;
143 /** Maximum compare and write length. */
144 uint8_t u8MaxCmpWriteLength;
145 /** Optimal transfer length granularity. */
146 uint16_t u16OptTrfLengthGran;
147 /** Maximum transfer length. */
148 uint32_t u32MaxTrfLength;
149 /** Optimal transfer length. */
150 uint32_t u32OptTrfLength;
151 /** Maximum PREFETCH, XDREAD and XDWRITE transfer length. */
152 uint32_t u32MaxPreXdTrfLength;
153 /** Maximum UNMAP LBA count. */
154 uint32_t u32MaxUnmapLbaCount;
155 /** Maximum UNMAP block descriptor count. */
156 uint32_t u32MaxUnmapBlkDescCount;
157 /** Optimal UNMAP granularity. */
158 uint32_t u32OptUnmapGranularity;
159 /** UNMAP granularity alignment. */
160 uint32_t u32UnmapGranularityAlignment;
161 /** Reserved. */
162 uint8_t abReserved[28];
163} VSCSIVPDPAGEBLOCKLIMITS;
164#pragma pack()
165AssertCompileSize(VSCSIVPDPAGEBLOCKLIMITS, VSCSI_VPD_BLOCK_LIMITS_SIZE);
166typedef VSCSIVPDPAGEBLOCKLIMITS *PVSCSIVPDPAGEBLOCKLIMITS;
167typedef const VSCSIVPDPAGEBLOCKLIMITS *PCVSCSIVPDPAGEBLOCKLIMITS;
168
169/** VPD block provisioning page number. */
170#define VSCSI_VPD_BLOCK_PROV_NUMBER 0xb2
171/** VPD block provisioning size. */
172#define VSCSI_VPD_BLOCK_PROV_SIZE 8
173/**
174 * Block provisioning VPD page data.
175 */
176#pragma pack(1)
177typedef struct VSCSIVPDPAGEBLOCKPROV
178{
179 /** Device type. */
180 unsigned u5PeripheralDeviceType : 5; /**< 0x00 / 00 */
181 /** Qualifier. */
182 unsigned u3PeripheralQualifier : 3;
183 /** Page number. */
184 unsigned u8PageCode : 8;
185 /** Page size (Big endian) */
186 unsigned u16PageLength : 16;
187 /** Threshold exponent. */
188 unsigned u8ThresholdExponent : 8;
189 /** Descriptor present. */
190 unsigned fDP : 1;
191 /** Anchored LBAs supported. */
192 unsigned fAncSup : 1;
193 /** Reserved. */
194 unsigned u4Reserved : 4;
195 /** WRITE SAME command supported. */
196 unsigned fLBPWS : 1;
197 /** UNMAP command supported. */
198 unsigned fLBPU : 1;
199 /** Provisioning type. */
200 unsigned u3ProvType : 3;
201 /** Reserved. */
202 unsigned u5Reserved : 5;
203 /** Reserved. */
204 unsigned u8Reserved : 8;
205} VSCSIVPDPAGEBLOCKPROV;
206#pragma pack()
207AssertCompileSize(VSCSIVPDPAGEBLOCKPROV, VSCSI_VPD_BLOCK_PROV_SIZE);
208typedef VSCSIVPDPAGEBLOCKPROV *PVSCSIVPDPAGEBLOCKPROV;
209typedef const VSCSIVPDPAGEBLOCKPROV *PCVSCSIVPDPAGEBLOCKPROVS;
210
211#endif /* !VBOX_INCLUDED_SRC_Storage_VSCSI_VSCSIVpdPages_h */
212
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette