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.
sl@0
     1
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @internalTechnology
sl@0
    19
*/
sl@0
    20
sl@0
    21
#ifndef __PROTOCOL_H__
sl@0
    22
#define __PROTOCOL_H__
sl@0
    23
sl@0
    24
#include <e32base.h>			// C Class Definitions, Cleanup Stack
sl@0
    25
#include <e32def.h>				// T Type  Definitions
sl@0
    26
#include <e32std.h>    			// ELeave definition
sl@0
    27
#include "usbmsshared.h"
sl@0
    28
sl@0
    29
sl@0
    30
class MProtocolBase;
sl@0
    31
sl@0
    32
class MTransportBase
sl@0
    33
	{
sl@0
    34
	public:
sl@0
    35
	virtual void SetupWriteData(TPtrC8& aData) = 0;
sl@0
    36
	virtual TInt Start() = 0;
sl@0
    37
	virtual TInt Stop() = 0;
sl@0
    38
	virtual void RegisterProtocol(MProtocolBase& aProtocol) = 0;
sl@0
    39
	virtual TInt BytesAvailable() = 0;
sl@0
    40
	virtual ~MTransportBase() {};
sl@0
    41
	virtual TInt InitialiseTransportL(TInt aTransportLddFlag) = 0;
sl@0
    42
	virtual void SetupReadData(TUint aLength) = 0;
sl@0
    43
	virtual void GetCommandBufPtr(TPtr8& aDes, TUint aLength) = 0; 
sl@0
    44
	virtual void GetReadDataBufPtr(TPtr8& aDes) = 0;
sl@0
    45
	virtual void GetWriteDataBufPtr(TPtrC8& aDes) = 0; 
sl@0
    46
#ifdef MSDC_MULTITHREADED
sl@0
    47
	virtual void ProcessReadData(TAny* aAddress) = 0;
sl@0
    48
#endif
sl@0
    49
	};
sl@0
    50
sl@0
    51
sl@0
    52
class MProtocolBase
sl@0
    53
	{
sl@0
    54
	public:
sl@0
    55
	virtual void RegisterTransport(MTransportBase* aTransport) = 0;
sl@0
    56
	virtual TBool DecodePacket(TPtrC8& aData, TUint aLun) = 0;
sl@0
    57
	virtual TInt ReadComplete(TInt aError) = 0;
sl@0
    58
	virtual TInt Cancel() = 0;
sl@0
    59
	virtual void ReportHighSpeedDevice() {};
sl@0
    60
	virtual ~MProtocolBase() {};
sl@0
    61
#ifdef MSDC_MULTITHREADED
sl@0
    62
	virtual void InitializeBufferPointers(TPtr8& aDes1, TPtr8& aDes2) = 0;
sl@0
    63
#endif
sl@0
    64
	};
sl@0
    65
sl@0
    66
sl@0
    67
#endif // __PROTOCOL_H__
sl@0
    68