kernel/eka/include/drivers/otgdi.h
changeset 9 96e5fb8b040d
equal deleted inserted replaced
-1:000000000000 9:96e5fb8b040d
       
     1 // Copyright (c) 2007-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  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef OTGDI_H
       
    22 #define OTGDI_H
       
    23 
       
    24 class DUsbOtgDriver;
       
    25 
       
    26 /**
       
    27   OTGDI is designed to be called solely from USBMAN
       
    28 */
       
    29 const TUint32 KUsbmanSvrUid = {0x101FE1DB};
       
    30 
       
    31 /**
       
    32   Logical Device (Factory Class) for USB OTG Driver
       
    33 */
       
    34 class DUsbOtgDriverFactory : public DLogicalDevice
       
    35 	{
       
    36 public:
       
    37 
       
    38 	DUsbOtgDriverFactory();
       
    39 	~DUsbOtgDriverFactory();
       
    40 
       
    41 	// Inherited from DLogicalDevice
       
    42 
       
    43 	virtual TInt Install();
       
    44 	virtual void GetCaps( TDes8& aDes ) const;
       
    45 	virtual TInt Create( DLogicalChannelBase*& aChannel );
       
    46 	};
       
    47 
       
    48 /**
       
    49   Communication Channel between User and Kernel for USB OTG Driver
       
    50 */
       
    51 class DUsbOtgDriverChannel : public DLogicalChannel
       
    52 	{
       
    53 public:
       
    54 
       
    55 	DUsbOtgDriverChannel();
       
    56 	virtual ~DUsbOtgDriverChannel();
       
    57 
       
    58 	// Inherited from DObject
       
    59 
       
    60 	virtual TInt DoCreate( TInt aUnit, const TDesC8* anInfo, const TVersion& aVer );
       
    61 
       
    62 	// Inherited from DLogicalChannel
       
    63 
       
    64 	virtual void HandleMsg( TMessageBase* aMsg );
       
    65 	virtual TInt SendMsg(TMessageBase* aMsg);
       
    66 
       
    67 private:
       
    68 
       
    69 	// Implementation for the different kinds of messages sent through RBusLogicalChannel
       
    70 
       
    71 	TInt DoControl( TInt aFunction, TAny* a1, TAny* a2 );
       
    72 	TInt DoRequest( TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2 );
       
    73 	void DoCancel( TUint aMask );
       
    74 	TInt SendRequest(TMessageBase* aMsg);
       
    75 
       
    76 private:
       
    77 
       
    78 	// Stack lock/unlock protected methods
       
    79 
       
    80 	TInt ProtectedControl( TInt aFunction );
       
    81 
       
    82 private:
       
    83 
       
    84 	DUsbOtgDriver*	iOtgDriver;
       
    85 	DThread*		iClient;
       
    86 	};
       
    87 
       
    88 #endif // OTGDI_H