os/kernelhwsrv/userlibandfileserver/fileserver/smassstorage/inc/protocol.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2004-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 __PROTOCOL_H__
    22 #define __PROTOCOL_H__
    23 
    24 #include <e32base.h>			// C Class Definitions, Cleanup Stack
    25 #include <e32def.h>				// T Type  Definitions
    26 #include <e32std.h>    			// ELeave definition
    27 #include "usbmsshared.h"
    28 
    29 
    30 class MProtocolBase;
    31 
    32 class MTransportBase
    33 	{
    34 	public:
    35 	virtual void SetupWriteData(TPtrC8& aData) = 0;
    36 	virtual TInt Start() = 0;
    37 	virtual TInt Stop() = 0;
    38 	virtual void RegisterProtocol(MProtocolBase& aProtocol) = 0;
    39 	virtual TInt BytesAvailable() = 0;
    40 	virtual ~MTransportBase() {};
    41 	virtual TInt InitialiseTransportL(TInt aTransportLddFlag) = 0;
    42 	virtual void SetupReadData(TUint aLength) = 0;
    43 	virtual void GetCommandBufPtr(TPtr8& aDes, TUint aLength) = 0; 
    44 	virtual void GetReadDataBufPtr(TPtr8& aDes) = 0;
    45 	virtual void GetWriteDataBufPtr(TPtrC8& aDes) = 0; 
    46 #ifdef MSDC_MULTITHREADED
    47 	virtual void ProcessReadData(TAny* aAddress) = 0;
    48 #endif
    49 	};
    50 
    51 
    52 class MProtocolBase
    53 	{
    54 	public:
    55 	virtual void RegisterTransport(MTransportBase* aTransport) = 0;
    56 	virtual TBool DecodePacket(TPtrC8& aData, TUint aLun) = 0;
    57 	virtual TInt ReadComplete(TInt aError) = 0;
    58 	virtual TInt Cancel() = 0;
    59 	virtual void ReportHighSpeedDevice() {};
    60 	virtual ~MProtocolBase() {};
    61 #ifdef MSDC_MULTITHREADED
    62 	virtual void InitializeBufferPointers(TPtr8& aDes1, TPtr8& aDes2) = 0;
    63 #endif
    64 	};
    65 
    66 
    67 #endif // __PROTOCOL_H__
    68