VirtualBox

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

Last change on this file since 53426 was 38694, checked in by vboxsync, 13 years ago

VSCSI: Fix Solaris guests after adding support VPD pages, the device identification page is mandatory. Fix a crash for a read or write with a 0 transfer length

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