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 USBDI_HUB_H sl@0: #define USBDI_HUB_H sl@0: sl@0: class DUsbHubDriver; sl@0: class DUsbDevice; sl@0: sl@0: sl@0: const TUint32 KFunctionDriverFrameworkSid = 0x10282B48; sl@0: sl@0: /** sl@0: Logical Device (factory class) for USB Hub Driver sl@0: */ sl@0: class DUsbHubDriverFactory : public DLogicalDevice sl@0: { sl@0: public: sl@0: DUsbHubDriverFactory(); sl@0: ~DUsbHubDriverFactory(); sl@0: private: sl@0: // Inherited from DLogicalDevice 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: */ sl@0: class DUsbHubDriverChannel : public DLogicalChannel sl@0: { sl@0: public: sl@0: DUsbHubDriverChannel(); sl@0: virtual ~DUsbHubDriverChannel(); sl@0: virtual TInt SendMsg(TMessageBase* aMsg); sl@0: sl@0: private: sl@0: // Panic reasons sl@0: enum TPanic sl@0: { sl@0: ERequestAlreadyPending = 1 sl@0: }; sl@0: sl@0: // Inherited from DObject sl@0: virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer); sl@0: sl@0: // Inherited from DLogicalChannel sl@0: virtual void HandleMsg(TMessageBase* aMsg); sl@0: sl@0: // Implementation for the differnt kinds of messages sent through RBusLogicalChannel 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 SendControl(TMessageBase* aMsg); sl@0: TInt SendRequest(TMessageBase* aMsg); sl@0: sl@0: DUsbDevice* GetDeviceFromHandle(TAny* aSrc); sl@0: sl@0: private: sl@0: DUsbHubDriver* iHubDriver; sl@0: DThread* iClient; sl@0: }; sl@0: sl@0: #endif // USBDI_HUB_H sl@0: