sl@0
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
/**
|
sl@0
|
17 |
@file
|
sl@0
|
18 |
@internalTechnology
|
sl@0
|
19 |
*/
|
sl@0
|
20 |
|
sl@0
|
21 |
#ifndef TSCSICLIENTREQ_H
|
sl@0
|
22 |
#define TSCSICLIENTREQ_H
|
sl@0
|
23 |
|
sl@0
|
24 |
/**
|
sl@0
|
25 |
Data type for GROUP CODE
|
sl@0
|
26 |
SAM-2 5.2.2
|
sl@0
|
27 |
SPC-3 4.3.4.1
|
sl@0
|
28 |
*/
|
sl@0
|
29 |
typedef TUint8 TGroupCode;
|
sl@0
|
30 |
|
sl@0
|
31 |
/**
|
sl@0
|
32 |
Data type for ALLOCATION LENGTH
|
sl@0
|
33 |
SPC-2 4.3.4.6
|
sl@0
|
34 |
SPC-3 4.3.4.6
|
sl@0
|
35 |
*/
|
sl@0
|
36 |
typedef TUint TAllocationLength; // 1 Byte
|
sl@0
|
37 |
|
sl@0
|
38 |
/**
|
sl@0
|
39 |
Base class to decode SCSI RESPONSE
|
sl@0
|
40 |
*/
|
sl@0
|
41 |
class TScsiClientResp: public MClientCommandServiceResp
|
sl@0
|
42 |
{
|
sl@0
|
43 |
public:
|
sl@0
|
44 |
TScsiClientResp() {};
|
sl@0
|
45 |
};
|
sl@0
|
46 |
|
sl@0
|
47 |
|
sl@0
|
48 |
/**
|
sl@0
|
49 |
Base class to encode a SCSI REQUEST which implements the SCSI header encoding
|
sl@0
|
50 |
*/
|
sl@0
|
51 |
class TScsiClientReq: public MClientCommandServiceReq
|
sl@0
|
52 |
{
|
sl@0
|
53 |
public:
|
sl@0
|
54 |
/** SCSI OPERATION CODE */
|
sl@0
|
55 |
enum TOperationCode
|
sl@0
|
56 |
{
|
sl@0
|
57 |
ETestUnitReady = 0x00,
|
sl@0
|
58 |
ERequestSense = 0x03,
|
sl@0
|
59 |
EInquiry = 0x12,
|
sl@0
|
60 |
EModeSense6 = 0x1A,
|
sl@0
|
61 |
EStartStopUnit = 0x1B,
|
sl@0
|
62 |
EPreventMediaRemoval = 0x1E,
|
sl@0
|
63 |
EReadFormatCapacities = 0x23,
|
sl@0
|
64 |
EReadCapacity10 = 0x25,
|
sl@0
|
65 |
ERead10 = 0x28,
|
sl@0
|
66 |
EWrite10 = 0x2A,
|
sl@0
|
67 |
EVerify10 = 0x2f,
|
sl@0
|
68 |
EModeSense10 = 0x5A,
|
sl@0
|
69 |
EUndefinedCommand = 0xFF
|
sl@0
|
70 |
};
|
sl@0
|
71 |
|
sl@0
|
72 |
TScsiClientReq(TOperationCode aOperationCode);
|
sl@0
|
73 |
|
sl@0
|
74 |
virtual TInt EncodeRequestL(TDes8& aBuffer) const;
|
sl@0
|
75 |
|
sl@0
|
76 |
private:
|
sl@0
|
77 |
TUint8 GetControlByte() const;
|
sl@0
|
78 |
TGroupCode GetGroupCode() const;
|
sl@0
|
79 |
|
sl@0
|
80 |
TBool IsDataDirectionOut() const;
|
sl@0
|
81 |
TUint32 DataLength() const;
|
sl@0
|
82 |
|
sl@0
|
83 |
public:
|
sl@0
|
84 |
/** SCSI OPERATION CODE of CDB byte, SAM-2 5.2.2 */
|
sl@0
|
85 |
const TOperationCode iOperationCode;
|
sl@0
|
86 |
/** SCSI NACA field of CDB CONTROL Byte. SAM-2 5.2.3 */
|
sl@0
|
87 |
TBool iNaca;
|
sl@0
|
88 |
/** SCSI LINK field of CDB CONTROL Byte. SAM-2 5.2.3 */
|
sl@0
|
89 |
TBool iLink;
|
sl@0
|
90 |
};
|
sl@0
|
91 |
|
sl@0
|
92 |
#include "tscsiclientreq.inl"
|
sl@0
|
93 |
|
sl@0
|
94 |
#endif // TSCSICLIENTREQ_H
|