|
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 USBDI_HUB_H |
|
22 #define USBDI_HUB_H |
|
23 |
|
24 class DUsbHubDriver; |
|
25 class DUsbDevice; |
|
26 |
|
27 |
|
28 const TUint32 KFunctionDriverFrameworkSid = 0x10282B48; |
|
29 |
|
30 /** |
|
31 Logical Device (factory class) for USB Hub Driver |
|
32 */ |
|
33 class DUsbHubDriverFactory : public DLogicalDevice |
|
34 { |
|
35 public: |
|
36 DUsbHubDriverFactory(); |
|
37 ~DUsbHubDriverFactory(); |
|
38 private: |
|
39 // Inherited from DLogicalDevice |
|
40 virtual TInt Install(); |
|
41 virtual void GetCaps(TDes8& aDes) const; |
|
42 virtual TInt Create(DLogicalChannelBase*& aChannel); |
|
43 }; |
|
44 |
|
45 /** |
|
46 */ |
|
47 class DUsbHubDriverChannel : public DLogicalChannel |
|
48 { |
|
49 public: |
|
50 DUsbHubDriverChannel(); |
|
51 virtual ~DUsbHubDriverChannel(); |
|
52 virtual TInt SendMsg(TMessageBase* aMsg); |
|
53 |
|
54 private: |
|
55 // Panic reasons |
|
56 enum TPanic |
|
57 { |
|
58 ERequestAlreadyPending = 1 |
|
59 }; |
|
60 |
|
61 // Inherited from DObject |
|
62 virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer); |
|
63 |
|
64 // Inherited from DLogicalChannel |
|
65 virtual void HandleMsg(TMessageBase* aMsg); |
|
66 |
|
67 // Implementation for the differnt kinds of messages sent through RBusLogicalChannel |
|
68 TInt DoControl(TInt aFunction, TAny* a1, TAny* a2); |
|
69 TInt DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2); |
|
70 void DoCancel(TUint aMask); |
|
71 TInt SendControl(TMessageBase* aMsg); |
|
72 TInt SendRequest(TMessageBase* aMsg); |
|
73 |
|
74 DUsbDevice* GetDeviceFromHandle(TAny* aSrc); |
|
75 |
|
76 private: |
|
77 DUsbHubDriver* iHubDriver; |
|
78 DThread* iClient; |
|
79 }; |
|
80 |
|
81 #endif // USBDI_HUB_H |
|
82 |