os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tsbcclientinterface.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tsbcclientinterface.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,77 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @internalTechnology
1.22 +*/
1.23 +
1.24 +#ifndef TSBCCLIENTINTERFACE_H
1.25 +#define TSBCCLIENTINTERFACE_H
1.26 +
1.27 +/**
1.28 +Utility class to support SCSI BLOCK COMMAND (SBC) primitives.
1.29 +*/
1.30 +class TSbcClientInterface
1.31 + {
1.32 +public:
1.33 + /** SCSI MODE PAGE CODE values */
1.34 + enum ModePageCode
1.35 + {
1.36 + EReturnAllModePages = 0x3F
1.37 + };
1.38 +
1.39 + TSbcClientInterface(MTransport& aTransport);
1.40 + ~TSbcClientInterface();
1.41 +
1.42 + void InitBuffers(RBuf8* aHeadbuf, RBuf8* aTailbuf);
1.43 +
1.44 + TInt ModeSense6L(TUint aPageCode, TBool& aWriteProtected);
1.45 + TInt ModeSense10L(TUint aPageCode, TBool& aWriteProtected);
1.46 + TInt Read10L(TLba aLba, TDes8& aBuffer, TInt& aLen);
1.47 + TInt ReadCapacity10L(TLba& aLba, TUint32& aBlockSize);
1.48 + TInt StartStopUnitL(TBool aStart);
1.49 + TInt Write10L(TLba aLba, TDesC8& aBuffer, TUint aPos, TInt& aLen);
1.50 +
1.51 + void SetCapacityL(TUint32 aBlockLength, TUint32 aLastLba);
1.52 +
1.53 +public:
1.54 + /** Helper class for block boundary read/write */
1.55 + TBlockTransfer iBlockTransfer;
1.56 +
1.57 +private:
1.58 + /** Reference to the transport interface */
1.59 + MTransport& iTransport;
1.60 + };
1.61 +
1.62 +
1.63 +inline void TSbcClientInterface::InitBuffers(RBuf8* aHeadbuf, RBuf8* aTailbuf)
1.64 + {
1.65 + iBlockTransfer.InitBuffers(aHeadbuf, aTailbuf);
1.66 + }
1.67 +
1.68 +
1.69 +/**
1.70 +Initialise block transfer values
1.71 +
1.72 +@param aBlockLength Block Length of the media
1.73 +@param aLastLba Last Logical Block Address of the media
1.74 +*/
1.75 +inline void TSbcClientInterface::SetCapacityL(TUint32 aBlockLength, TUint32 aLastLba)
1.76 + {
1.77 + iBlockTransfer.SetCapacityL(aBlockLength, aLastLba);
1.78 + }
1.79 +
1.80 +#endif // TSBCCLIENTINTERFACE_H
1.81 \ No newline at end of file