1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kernel/eka/include/drivers/otgdi.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,88 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @internalComponent
1.22 +*/
1.23 +
1.24 +#ifndef OTGDI_H
1.25 +#define OTGDI_H
1.26 +
1.27 +class DUsbOtgDriver;
1.28 +
1.29 +/**
1.30 + OTGDI is designed to be called solely from USBMAN
1.31 +*/
1.32 +const TUint32 KUsbmanSvrUid = {0x101FE1DB};
1.33 +
1.34 +/**
1.35 + Logical Device (Factory Class) for USB OTG Driver
1.36 +*/
1.37 +class DUsbOtgDriverFactory : public DLogicalDevice
1.38 + {
1.39 +public:
1.40 +
1.41 + DUsbOtgDriverFactory();
1.42 + ~DUsbOtgDriverFactory();
1.43 +
1.44 + // Inherited from DLogicalDevice
1.45 +
1.46 + virtual TInt Install();
1.47 + virtual void GetCaps( TDes8& aDes ) const;
1.48 + virtual TInt Create( DLogicalChannelBase*& aChannel );
1.49 + };
1.50 +
1.51 +/**
1.52 + Communication Channel between User and Kernel for USB OTG Driver
1.53 +*/
1.54 +class DUsbOtgDriverChannel : public DLogicalChannel
1.55 + {
1.56 +public:
1.57 +
1.58 + DUsbOtgDriverChannel();
1.59 + virtual ~DUsbOtgDriverChannel();
1.60 +
1.61 + // Inherited from DObject
1.62 +
1.63 + virtual TInt DoCreate( TInt aUnit, const TDesC8* anInfo, const TVersion& aVer );
1.64 +
1.65 + // Inherited from DLogicalChannel
1.66 +
1.67 + virtual void HandleMsg( TMessageBase* aMsg );
1.68 + virtual TInt SendMsg(TMessageBase* aMsg);
1.69 +
1.70 +private:
1.71 +
1.72 + // Implementation for the different kinds of messages sent through RBusLogicalChannel
1.73 +
1.74 + TInt DoControl( TInt aFunction, TAny* a1, TAny* a2 );
1.75 + TInt DoRequest( TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2 );
1.76 + void DoCancel( TUint aMask );
1.77 + TInt SendRequest(TMessageBase* aMsg);
1.78 +
1.79 +private:
1.80 +
1.81 + // Stack lock/unlock protected methods
1.82 +
1.83 + TInt ProtectedControl( TInt aFunction );
1.84 +
1.85 +private:
1.86 +
1.87 + DUsbOtgDriver* iOtgDriver;
1.88 + DThread* iClient;
1.89 + };
1.90 +
1.91 +#endif // OTGDI_H