equal
deleted
inserted
replaced
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of the License "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
22 #include <e32base_private.h> |
22 #include <e32base_private.h> |
23 #include <e32std.h> |
23 #include <e32std.h> |
24 #include <e32std_private.h> |
24 #include <e32std_private.h> |
25 |
25 |
26 #include "t_otgdi_fdfactor.h" |
26 #include "t_otgdi_fdfactor.h" |
|
27 #include "OstTraceDefinitions.h" |
|
28 #ifdef OST_TRACE_COMPILER_IN_USE |
|
29 #include "t_otgdi_fdfactor_mainTraces.h" |
|
30 #endif |
27 |
31 |
28 LOCAL_C void DoStartL() |
32 LOCAL_C void DoStartL() |
29 { |
33 { |
30 _LIT(KDriverLddFileName,"usbhubdriver"); |
34 _LIT(KDriverLddFileName,"usbhubdriver"); |
31 TInt err = User::LoadLogicalDevice(KDriverLddFileName); |
35 TInt err = User::LoadLogicalDevice(KDriverLddFileName); |
32 if(err) |
36 if(err) |
33 { |
37 { |
34 RDebug::Print(_L("FDFActor failed to load LDD %d"),err); |
38 OstTrace1(TRACE_NORMAL, DOSTARTL_DOSTARTL, "FDFActor failed to load LDD %d",err); |
35 } |
39 } |
36 |
40 |
37 // Create active scheduler (to run active objects) |
41 // Create active scheduler (to run active objects) |
38 CActiveScheduler* scheduler = new (ELeave) CActiveScheduler(); |
42 CActiveScheduler* scheduler = new (ELeave) CActiveScheduler(); |
39 CleanupStack::PushL(scheduler); |
43 CleanupStack::PushL(scheduler); |
61 CleanupStack::PopAndDestroy(3, scheduler); |
65 CleanupStack::PopAndDestroy(3, scheduler); |
62 |
66 |
63 err = User::FreeLogicalDevice(RUsbHubDriver::Name()); |
67 err = User::FreeLogicalDevice(RUsbHubDriver::Name()); |
64 if(err) |
68 if(err) |
65 { |
69 { |
66 RDebug::Print(_L("FDFActor failed to unload LDD %d"),err); |
70 OstTrace1(TRACE_NORMAL, DOSTARTL_DOSTARTL_DUP01, "FDFActor failed to unload LDD %d",err); |
67 } |
71 } |
68 } |
72 } |
69 |
73 |
70 |
74 |
71 // Global Functions |
75 // Global Functions |
79 TRAPD(mainError,DoStartL()); |
83 TRAPD(mainError,DoStartL()); |
80 |
84 |
81 |
85 |
82 if (mainError) |
86 if (mainError) |
83 { |
87 { |
84 RDebug::Print(_L("FDF Actor left with %d"), mainError); |
88 OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN, "FDF Actor left with %d", mainError); |
85 // Also means that we left before we did a Rendezvous(KErrNone) to free up t_otgdi.exe |
89 // Also means that we left before we did a Rendezvous(KErrNone) to free up t_otgdi.exe |
86 // Rendezvous with KErrAbort to indicate we couldn't start up properly. |
90 // Rendezvous with KErrAbort to indicate we couldn't start up properly. |
87 RProcess::Rendezvous(KErrAbort); |
91 RProcess::Rendezvous(KErrAbort); |
88 } |
92 } |
89 |
93 |
90 delete cleanup; |
94 delete cleanup; |
91 __UHEAP_MARKEND; |
95 __UHEAP_MARKEND; |
92 |
96 |
93 RDebug::Print(_L("About to end FDFActor process")); |
97 OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "About to end FDFActor process"); |
94 return KErrNone; |
98 return KErrNone; |
95 } |
99 } |
96 |
100 |
97 |
101 |
98 |
102 |