0
|
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".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
/**
|
|
17 |
@file
|
|
18 |
@internalTechnology
|
|
19 |
*/
|
|
20 |
|
|
21 |
#ifndef TSBCCLIENTINTERFACE_H
|
|
22 |
#define TSBCCLIENTINTERFACE_H
|
|
23 |
|
|
24 |
/**
|
|
25 |
Utility class to support SCSI BLOCK COMMAND (SBC) primitives.
|
|
26 |
*/
|
|
27 |
class TSbcClientInterface
|
|
28 |
{
|
|
29 |
public:
|
|
30 |
/** SCSI MODE PAGE CODE values */
|
|
31 |
enum ModePageCode
|
|
32 |
{
|
|
33 |
EReturnAllModePages = 0x3F
|
|
34 |
};
|
|
35 |
|
|
36 |
TSbcClientInterface(MTransport& aTransport);
|
|
37 |
~TSbcClientInterface();
|
|
38 |
|
|
39 |
TInt ModeSense6L(TUint aPageCode, TBool& aWriteProtected);
|
|
40 |
TInt ModeSense10L(TUint aPageCode, TBool& aWriteProtected);
|
|
41 |
TInt Read10L(TLba aLba, TDes8& aBuffer, TInt& aLen);
|
|
42 |
TInt ReadCapacity10L(TLba& aLba, TUint32& aBlockSize);
|
|
43 |
TInt StartStopUnitL(TBool aStart);
|
|
44 |
TInt Write10L(TLba aLba, TDesC8& aBuffer, TUint aPos, TInt& aLen);
|
|
45 |
|
|
46 |
void SetCapacity(TUint32 aBlockLength, TUint32 aLastLba);
|
|
47 |
|
|
48 |
public:
|
|
49 |
/** Helper class for block boundary read/write */
|
|
50 |
TBlockTransfer iBlockTransfer;
|
|
51 |
|
|
52 |
private:
|
|
53 |
/** Reference to the transport interface */
|
|
54 |
MTransport& iTransport;
|
|
55 |
};
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
/**
|
|
60 |
Initialise block transfer values
|
|
61 |
|
|
62 |
@param aBlockLength Block Length of the media
|
|
63 |
@param aLastLba Last Logical Block Address of the media
|
|
64 |
*/
|
|
65 |
inline void TSbcClientInterface::SetCapacity(TUint32 aBlockLength, TUint32 aLastLba)
|
|
66 |
{
|
|
67 |
iBlockTransfer.SetCapacity(aBlockLength, aLastLba);
|
|
68 |
}
|
|
69 |
|
|
70 |
#endif // TSBCCLIENTINTERFACE_H |