author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 27 May 2010 14:17:14 +0300 | |
changeset 139 | 95f71bcdcdb7 |
parent 31 | 56f325a607ea |
permissions | -rw-r--r-- |
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 |
||
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
39 |
void InitBuffers(RBuf8* aHeadbuf, RBuf8* aTailbuf); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
40 |
|
0 | 41 |
TInt ModeSense6L(TUint aPageCode, TBool& aWriteProtected); |
42 |
TInt ModeSense10L(TUint aPageCode, TBool& aWriteProtected); |
|
43 |
TInt Read10L(TLba aLba, TDes8& aBuffer, TInt& aLen); |
|
44 |
TInt ReadCapacity10L(TLba& aLba, TUint32& aBlockSize); |
|
45 |
TInt StartStopUnitL(TBool aStart); |
|
46 |
TInt Write10L(TLba aLba, TDesC8& aBuffer, TUint aPos, TInt& aLen); |
|
47 |
||
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
48 |
void SetCapacityL(TUint32 aBlockLength, TUint32 aLastLba); |
0 | 49 |
|
50 |
public: |
|
51 |
/** Helper class for block boundary read/write */ |
|
52 |
TBlockTransfer iBlockTransfer; |
|
53 |
||
54 |
private: |
|
55 |
/** Reference to the transport interface */ |
|
56 |
MTransport& iTransport; |
|
57 |
}; |
|
58 |
||
59 |
||
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
60 |
inline void TSbcClientInterface::InitBuffers(RBuf8* aHeadbuf, RBuf8* aTailbuf) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
61 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
62 |
iBlockTransfer.InitBuffers(aHeadbuf, aTailbuf); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
63 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
64 |
|
0 | 65 |
|
66 |
/** |
|
67 |
Initialise block transfer values |
|
68 |
||
69 |
@param aBlockLength Block Length of the media |
|
70 |
@param aLastLba Last Logical Block Address of the media |
|
71 |
*/ |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
72 |
inline void TSbcClientInterface::SetCapacityL(TUint32 aBlockLength, TUint32 aLastLba) |
0 | 73 |
{ |
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
74 |
iBlockTransfer.SetCapacityL(aBlockLength, aLastLba); |
0 | 75 |
} |
76 |
||
77 |
#endif // TSBCCLIENTINTERFACE_H |