os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tsbcclientinterface.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 TSBCCLIENTINTERFACE_H
22 #define TSBCCLIENTINTERFACE_H
25 Utility class to support SCSI BLOCK COMMAND (SBC) primitives.
27 class TSbcClientInterface
30 /** SCSI MODE PAGE CODE values */
33 EReturnAllModePages = 0x3F
36 TSbcClientInterface(MTransport& aTransport);
37 ~TSbcClientInterface();
39 void InitBuffers(RBuf8* aHeadbuf, RBuf8* aTailbuf);
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);
48 void SetCapacityL(TUint32 aBlockLength, TUint32 aLastLba);
51 /** Helper class for block boundary read/write */
52 TBlockTransfer iBlockTransfer;
55 /** Reference to the transport interface */
56 MTransport& iTransport;
60 inline void TSbcClientInterface::InitBuffers(RBuf8* aHeadbuf, RBuf8* aTailbuf)
62 iBlockTransfer.InitBuffers(aHeadbuf, aTailbuf);
67 Initialise block transfer values
69 @param aBlockLength Block Length of the media
70 @param aLastLba Last Logical Block Address of the media
72 inline void TSbcClientInterface::SetCapacityL(TUint32 aBlockLength, TUint32 aLastLba)
74 iBlockTransfer.SetCapacityL(aBlockLength, aLastLba);
77 #endif // TSBCCLIENTINTERFACE_H