os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiprimarycmds.h
First public contribution.
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #ifndef TSCSIPRIMARYCMDS_H
22 #define TSCSIPRIMARYCMDS_H
26 Encodes SCSI INQUIRY REQUEST
30 class TScsiClientInquiryReq: public TScsiClientReq
33 /** Length of INQUIRY response */
34 static const TUint KResponseLength = 36;
36 TScsiClientInquiryReq();
37 TInt EncodeRequestL(TDes8& aBuffer) const;
39 void SetEvpd(TUint8 aPageCode);
40 void SetCmdDt(TUint8 aOperationCode);
41 void SetAllocationLength(TAllocationLength aAllocationLength);
44 /** SCSI CmdDt field */
46 /** SCSI EVPD field */
48 /** SCSI PAGE field */
50 /** SCSI ALLOCATION LENGTH */
51 TAllocationLength iAllocationLength;
56 Represents the SCSI INQUIRY RESPONSE PRODUCT IDENTIFICATION information
58 class TMassStorageConfig
61 /** SCSI VENDOR ID field */
63 /** SCSI PRODUCT ID field */
65 /** SCSI PRODUCT REVISION field */
70 Represents the SCSI INQUIRY RESPONSE PERIPHERAL device information
75 /** Medium removable flag */
78 /** SCSI PERIPHERAL QUALIFIER */
79 TUint8 iPeripheralQualifier;
80 /** SCSI PERIPHEREAL DEVICE TYPE */
81 TUint8 iPeripheralDeviceType;
82 /** SCSI RESPONSE DATA FORMAT */
83 TUint8 iResponseDataFormat;
86 /** Device product information (vendor id, product id, revision) */
87 TMassStorageConfig iIdentification;
91 Decodes SCSI INQUIRY REQUEST
93 class TScsiClientInquiryResp: public TScsiClientResp
96 /** Length of INQUIRY response */
97 static const TInt KResponseLength = 36;
98 TScsiClientInquiryResp(TPeripheralInfo& aPeripheralInfo);
100 TInt DataLength() const {return KResponseLength;}
101 void DecodeL(const TDesC8& aPtr);
104 void DecodeInquiry(const TDesC8& aPtr);
107 /** Device peripheral info fields */
108 TPeripheralInfo& iPeripheralInfo;
112 Data type for PREVENT field
114 SPC-3, 6.13 Table 119
116 typedef TBool TPrevent;
119 Encodes SCSI PREVENT MEDIA REMOVAL REQUEST
123 class TScsiClientPreventMediaRemovalReq: public TScsiClientReq
126 TScsiClientPreventMediaRemovalReq(TPrevent aPrevent);
127 TInt EncodeRequestL(TDes8& aBuffer) const;
135 Encodes SCSI REQUEST SENSE REQUEST
137 class TScsiClientRequestSenseReq: public TScsiClientReq
140 /** Length of REQUEST SENSE request */
141 static const TUint KResponseLength = 18;
142 TScsiClientRequestSenseReq();
143 TInt EncodeRequestL(TDes8& aBuffer) const;
146 void SetAllocationLength(TAllocationLength aAllocationLength);
149 /** SCSI ALLOCATION LENGTH field */
150 TAllocationLength iAllocationLength;
155 Decodes SCSI SENSE RESPONSE
157 class TScsiClientRequestSenseResp: public TScsiClientResp
160 /** SCSI Response Code, SBC-3 4.5 */
163 ECurrentErrors = 0x70,
164 EDeferredErrors = 0x71
167 /** Length of the REQUEST SENSE response */
168 static const TInt KResponseLength = 18;
170 TScsiClientRequestSenseResp() {};
172 TInt DataLength() const {return KResponseLength;}
173 void DecodeL(const TDesC8& aPtr);
176 void DecodeSenseInfo(const TDesC8& aPtr);
179 /** Returned SCSI RESPONSE CODE */
180 TResponseCode iResponseCode;
181 /** Returned SCSI Sense Info */
182 TSenseInfo iSenseInfo;
183 /** Returned SCSI ADDITIONAL SENSE LENGTH */
184 TUint iAdditionalSenseLength;
189 Encodes SCSI TEST UNIT READY REQUEST
193 class TScsiClientTestUnitReadyReq: public TScsiClientReq
196 TScsiClientTestUnitReadyReq();
197 TInt EncodeRequestL(TDes8& aBuffer) const;
201 #include "tscsiprimarycmds.inl"
203 #endif // TSCSIPRIMARYCMDS_H