VirtualBox

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

Last change on this file since 77329 was 76565, checked in by vboxsync, 6 years ago

Devices: Use VBOX_INCLUDED_SRC_ as header guard prefix with scm.

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