sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: */ sl@0: sl@0: #ifndef OTGDI_H sl@0: #define OTGDI_H sl@0: sl@0: class DUsbOtgDriver; sl@0: sl@0: /** sl@0: OTGDI is designed to be called solely from USBMAN sl@0: */ sl@0: const TUint32 KUsbmanSvrUid = {0x101FE1DB}; sl@0: sl@0: /** sl@0: Logical Device (Factory Class) for USB OTG Driver sl@0: */ sl@0: class DUsbOtgDriverFactory : public DLogicalDevice sl@0: { sl@0: public: sl@0: sl@0: DUsbOtgDriverFactory(); sl@0: ~DUsbOtgDriverFactory(); sl@0: sl@0: // Inherited from DLogicalDevice sl@0: sl@0: virtual TInt Install(); sl@0: virtual void GetCaps( TDes8& aDes ) const; sl@0: virtual TInt Create( DLogicalChannelBase*& aChannel ); sl@0: }; sl@0: sl@0: /** sl@0: Communication Channel between User and Kernel for USB OTG Driver sl@0: */ sl@0: class DUsbOtgDriverChannel : public DLogicalChannel sl@0: { sl@0: public: sl@0: sl@0: DUsbOtgDriverChannel(); sl@0: virtual ~DUsbOtgDriverChannel(); sl@0: sl@0: // Inherited from DObject sl@0: sl@0: virtual TInt DoCreate( TInt aUnit, const TDesC8* anInfo, const TVersion& aVer ); sl@0: sl@0: // Inherited from DLogicalChannel sl@0: sl@0: virtual void HandleMsg( TMessageBase* aMsg ); sl@0: virtual TInt SendMsg(TMessageBase* aMsg); sl@0: sl@0: private: sl@0: sl@0: // Implementation for the different kinds of messages sent through RBusLogicalChannel sl@0: sl@0: TInt DoControl( TInt aFunction, TAny* a1, TAny* a2 ); sl@0: TInt DoRequest( TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2 ); sl@0: void DoCancel( TUint aMask ); sl@0: TInt SendRequest(TMessageBase* aMsg); sl@0: sl@0: private: sl@0: sl@0: // Stack lock/unlock protected methods sl@0: sl@0: TInt ProtectedControl( TInt aFunction ); sl@0: sl@0: private: sl@0: sl@0: DUsbOtgDriver* iOtgDriver; sl@0: DThread* iClient; sl@0: }; sl@0: sl@0: #endif // OTGDI_H