os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiblockcmds.h
Update contrib.
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 TSCSIBLOCKCMDS_H
22 #define TSCSIBLOCKCMDS_H
26 Data type for Logical Block Address
31 Data type for PROTECT filed used in READ (10) and WRITE (10)
32 SBC-3 5.6 Table 33 and 5.25 Table 68
34 typedef TUint TProtect; // 3 bits
40 Encode SCSI MODE SENSE(6) REQUEST
43 Ref SPC-3 7.4 Response format
44 Ref SBC-3 6.3 Response format for SBC
46 class TScsiClientModeSense6Req: public TScsiClientReq
49 /** SCSI PAGE CONTROL values */
52 ECurrentValues = 0x00,
53 EChangeableValues = 0x01,
54 EDefaultValues = 0x02,
58 /** Length of MODE SENSE (6) response */
59 static const TUint KResponseLength = 4;
61 TScsiClientModeSense6Req(TPageControl aPageControl,
63 TUint aSubPageCode = 0);
65 TInt EncodeRequestL(TDes8& aBuffer) const;
68 /** SCSI PAGE CONTROL field */
69 TPageControl iPageControl;
70 /** SCSI PAGE CODE field */
72 /** SCSI SUB PAGE CODE field */
74 /** SCSI ALLOCATION LENGTH field */
75 TAllocationLength iAllocationLength;
80 Encode SCSI MODE SENSE(6) RESPONSE
82 Ref SPC-3 7.4 Response format
83 Ref SBC-3 6.3 Response format for SBC
85 class TScsiClientModeSense6Resp: public TScsiClientResp
88 /** Length of MODE SENSE (6) response */
89 static const TUint KResponseLength = 4;
91 TScsiClientModeSense6Resp() {};
93 TInt DataLength() const {return KResponseLength;}
94 void DecodeL(const TDesC8& aPtr);
97 /** Returned SCSI WP flag */
98 TBool iWriteProtected;
103 Encode MODE SENSE (10) REQUEST
104 Ref SPC-2 7.9 Request
105 Ref SPC-3 6.10 Request
106 Ref SPC-2 8.2 Response format
107 Ref SPC-3 7.4 Response format
108 Ref SBC-3 6.3 Response format for SBC
110 class TScsiClientModeSense10Req: public TScsiClientReq
113 /** SCSI PAGE CONTROL values */
116 ECurrentValues = 0x00,
117 EChangeableValues = 0x01,
118 EDefaultValues = 0x02,
122 /** Length of MODE SENSE (10) response */
123 static const TUint KResponseLength = 8;
125 TScsiClientModeSense10Req(TPageControl aPageControl,
127 TUint aSubPageCode = 0);
129 TInt EncodeRequestL(TDes8& aBuffer) const;
132 /** SCSI PAGE CONTROL field */
133 TPageControl iPageControl;
134 /** SCSI PAGE CODE field */
136 /** SCSI SUB PAGE CODE field */
138 /** SCSI ALLOCATION LENGTH field */
139 TAllocationLength iAllocationLength;
144 Decode SCSI MODE SENSE (10) RESPONSE
145 Ref SPC-3 6.10 Request
146 Ref SPC-3 7.4 Response format
147 Ref SBC-3 6.3 Response format for SBC
149 class TScsiClientModeSense10Resp: public TScsiClientResp
152 /** Length of MODE SENSE (10) response */
153 static const TUint KResponseLength = 8;
155 TScsiClientModeSense10Resp() {};
157 TInt DataLength() const {return KResponseLength;}
158 void DecodeL(const TDesC8& aPtr);
161 /** Returned SCSI WP flag */
162 TBool iWriteProtected;
166 Encode READ CAPCAITY (10) REQUEST
170 class TScsiClientReadCapacity10Req: public TScsiClientReq
173 /** Length of READ CAPACITY (10) response */
174 static const TInt KResponseLength = 8;
175 TScsiClientReadCapacity10Req();
176 TScsiClientReadCapacity10Req(TLba aLba);
177 TInt EncodeRequestL(TDes8& aBuffer) const;
180 /** SCSI LOGICAL BLOCK ADDRESS */
185 Decode READ CAPCAITY (10) RESPONSE
187 class TScsiClientReadCapacity10Resp: public TScsiClientResp
190 /** Length of READ CAPACITY (10) response */
191 static const TInt KResponseLength = 8;
192 TScsiClientReadCapacity10Resp() {};
194 void DecodeL(const TDesC8& aPtr);
195 TInt DataLength() const {return KResponseLength;}
198 /** Returned SCSI LOGICAL BLOCK ADDRESS */
200 /** Returned SCSI BLOCK LENGTH IN BYTES */
206 Base class for encoding SCSI READ (10) and SCSI WRITE (10) requests
208 class TScsiClientRdWr10Req: public TScsiClientReq
211 TScsiClientRdWr10Req(TOperationCode aOperationCode);
212 TInt EncodeRequestL(TDes8& aBuffer) const;
215 /** SCSI LOGICAL BLOCK ADDRESS field */
216 TUint32 iLogicalBlockAddress;
217 /** SCSI TRANSFER LENGTH field */
218 TUint16 iBlockTransferLength;
219 /** SCSI RDPROTECT or SCSI WRPROTECT field */
225 Encode SCSI READ (10) REQUEST
227 class TScsiClientRead10Req: public TScsiClientRdWr10Req
230 TScsiClientRead10Req();
231 TInt EncodeRequestL(TDes8& aBuffer) const;
237 Encode START STOP UNIT REQUEST
240 class TScsiClientStartStopUnitReq: public TScsiClientReq
243 TScsiClientStartStopUnitReq();
244 TInt EncodeRequestL(TDes8& aBuffer) const;
247 /** SCSI IMMED flag */
249 /** SCSI START flag */
251 /** SCSI LOEJ flag */
257 Encode SCSI WRITE (10) REQUEST
259 class TScsiClientWrite10Req: public TScsiClientRdWr10Req
262 TScsiClientWrite10Req();
263 TInt EncodeRequestL(TDes8& aBuffer) const;
267 #include "tscsiblockcmds.inl"
269 #endif // TSCSIBLOCKCMDS_H