os/kernelhwsrv/userlibandfileserver/fileserver/smassstorage/inc/protocol.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/smassstorage/inc/protocol.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,68 @@
     1.4 +// Copyright (c) 2004-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 __PROTOCOL_H__
    1.25 +#define __PROTOCOL_H__
    1.26 +
    1.27 +#include <e32base.h>			// C Class Definitions, Cleanup Stack
    1.28 +#include <e32def.h>				// T Type  Definitions
    1.29 +#include <e32std.h>    			// ELeave definition
    1.30 +#include "usbmsshared.h"
    1.31 +
    1.32 +
    1.33 +class MProtocolBase;
    1.34 +
    1.35 +class MTransportBase
    1.36 +	{
    1.37 +	public:
    1.38 +	virtual void SetupWriteData(TPtrC8& aData) = 0;
    1.39 +	virtual TInt Start() = 0;
    1.40 +	virtual TInt Stop() = 0;
    1.41 +	virtual void RegisterProtocol(MProtocolBase& aProtocol) = 0;
    1.42 +	virtual TInt BytesAvailable() = 0;
    1.43 +	virtual ~MTransportBase() {};
    1.44 +	virtual TInt InitialiseTransportL(TInt aTransportLddFlag) = 0;
    1.45 +	virtual void SetupReadData(TUint aLength) = 0;
    1.46 +	virtual void GetCommandBufPtr(TPtr8& aDes, TUint aLength) = 0; 
    1.47 +	virtual void GetReadDataBufPtr(TPtr8& aDes) = 0;
    1.48 +	virtual void GetWriteDataBufPtr(TPtrC8& aDes) = 0; 
    1.49 +#ifdef MSDC_MULTITHREADED
    1.50 +	virtual void ProcessReadData(TAny* aAddress) = 0;
    1.51 +#endif
    1.52 +	};
    1.53 +
    1.54 +
    1.55 +class MProtocolBase
    1.56 +	{
    1.57 +	public:
    1.58 +	virtual void RegisterTransport(MTransportBase* aTransport) = 0;
    1.59 +	virtual TBool DecodePacket(TPtrC8& aData, TUint aLun) = 0;
    1.60 +	virtual TInt ReadComplete(TInt aError) = 0;
    1.61 +	virtual TInt Cancel() = 0;
    1.62 +	virtual void ReportHighSpeedDevice() {};
    1.63 +	virtual ~MProtocolBase() {};
    1.64 +#ifdef MSDC_MULTITHREADED
    1.65 +	virtual void InitializeBufferPointers(TPtr8& aDes1, TPtr8& aDes2) = 0;
    1.66 +#endif
    1.67 +	};
    1.68 +
    1.69 +
    1.70 +#endif // __PROTOCOL_H__
    1.71 +