kerneltest/e32test/usb/t_usb_device/include/activecontrol.h
changeset 247 d8d70de2bd36
parent 90 947f0dc9f7a8
child 257 3e88ff8f41d5
equal deleted inserted replaced
201:43365a9b78a3 247:d8d70de2bd36
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    18 #ifndef __ACTIVECONSOLE_H__
    18 #ifndef __ACTIVECONSOLE_H__
    19 #define __ACTIVECONSOLE_H__
    19 #define __ACTIVECONSOLE_H__
    20 
    20 
    21 #include "activestallnotifier.h"
    21 #include "activestallnotifier.h"
    22 #include "activedevicestatenotifier.h"
    22 #include "activedevicestatenotifier.h"
       
    23 #include "transfersrv.h"
       
    24 #include "config.h"
    23 
    25 
    24 static const TInt KSetupPacketSize = 8;
    26 static const TInt KSetupPacketSize = 8;
    25 static const TInt KMaxControlBufferSize = 256;
    27 static const TInt KMaxControlBufferSize = 256;
    26 static const TInt KMaxControlPacketSize = 64;
    28 static const TInt KMaxControlPacketSize = 64;
    27 
    29 
    49 	EPendingCancel,
    51 	EPendingCancel,
    50 	};
    52 	};
    51 
    53 
    52 class CActiveRW;
    54 class CActiveRW;
    53 
    55 
       
    56 class CTranHandleServer;
       
    57 
    54 class CActiveControl : public CActive
    58 class CActiveControl : public CActive
    55 	{
    59 	{
    56 public:
    60 public:
    57 	static CActiveControl* NewLC(CConsoleBase* aConsole, TDes * aConfigFile, TDes * aScriptFile);
    61 	static CActiveControl* NewLC(CConsoleBase* aConsole, TDes * aConfigFile, TDes * aScriptFile);
    58 	static CActiveControl* NewL(CConsoleBase* aConsole, TDes * aConfigFile, TDes * aScriptFile);
    62 	static CActiveControl* NewL(CConsoleBase* aConsole, TDes * aConfigFile, TDes * aScriptFile);
    62 	void SetMSFinished(TBool aState);
    66 	void SetMSFinished(TBool aState);
    63 	void AllocateEndpointDMA(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint);
    67 	void AllocateEndpointDMA(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint);
    64 	void AllocateDoubleBuffering(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint);
    68 	void AllocateDoubleBuffering(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint);
    65 	void DeAllocateEndpointDMA(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint);
    69 	void DeAllocateEndpointDMA(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint);
    66 	void DeAllocateDoubleBuffering(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint);
    70 	void DeAllocateDoubleBuffering(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint);
       
    71 #ifdef USB_SC	
       
    72 	void ConstructLOnSharedLdd(const RMessagePtr2& aMsg);
       
    73 #endif
    67 
    74 
    68 private:
    75 private:
    69 	CActiveControl(CConsoleBase* aConsole, TDes * aConfigFile, TDes * aScriptFile);
    76 	CActiveControl(CConsoleBase* aConsole, TDes * aConfigFile, TDes * aScriptFile);
    70 	// Defined as pure virtual by CActive;
    77 	// Defined as pure virtual by CActive;
    71 	// implementation provided by this class.
    78 	// implementation provided by this class.
    81 	TInt ProcessEp0ControlPacket();
    88 	TInt ProcessEp0ControlPacket();
    82 	void PrintHostLog();
    89 	void PrintHostLog();
    83 	
    90 	
    84 	void FillEndpointsResourceAllocation(IFConfigPtr aIfCfg);
    91 	void FillEndpointsResourceAllocation(IFConfigPtr aIfCfg);
    85 	void PopulateInterfaceResourceAllocation(IFConfigPtr aFirstIfCfg, TInt aPortNumber);
    92 	void PopulateInterfaceResourceAllocation(IFConfigPtr aFirstIfCfg, TInt aPortNumber);
       
    93 #ifdef USB_SC	
       
    94 	void SetupTransferedInterface(IFConfigPtr* aIfPtr, TInt aPortNumber);
       
    95 #endif
    86 	
    96 	
    87 private:
    97 private:
    88 	CConsoleBase* iConsole;											// a console to read from
    98 	CConsoleBase* iConsole;											// a console to read from
    89 	CActiveStallNotifier* iStallNotifier[KMaxInterfaces];
    99 	CActiveStallNotifier* iStallNotifier[KMaxInterfaces];
    90 	CActiveDeviceStateNotifier* iDeviceStateNotifier[KMaxInterfaces];
   100 	CActiveDeviceStateNotifier* iDeviceStateNotifier[KMaxInterfaces];
   111 	TBuf8<KMaxControlBufferSize> iEp0DataBuffer;
   121 	TBuf8<KMaxControlBufferSize> iEp0DataBuffer;
   112 	TUint iEp0PacketSize;
   122 	TUint iEp0PacketSize;
   113 	RThread iIdleCounterThread;
   123 	RThread iIdleCounterThread;
   114 	RChunk iIdleCounterChunk;
   124 	RChunk iIdleCounterChunk;
   115 	struct TTestIdleCounter* iIdleCounter;
   125 	struct TTestIdleCounter* iIdleCounter;
       
   126 #ifdef USB_SC	
       
   127 	CTranHandleServer*        iTranHandleServer;
       
   128 #endif
   116 	};
   129 	};
   117 
   130 
   118 #endif	// __ACTIVECONTROL_H__
   131 #endif	// __ACTIVECONTROL_H__