equal
deleted
inserted
replaced
32 #ifdef OST_TRACE_COMPILER_IN_USE |
32 #ifdef OST_TRACE_COMPILER_IN_USE |
33 #include "CUsbOtgTraces.h" |
33 #include "CUsbOtgTraces.h" |
34 #endif |
34 #endif |
35 |
35 |
36 |
36 |
|
37 #ifndef __OVER_DUMMYUSBDI__ |
37 //Name used in call to User::LoadLogicalDevice/User::FreeLogicalDevice |
38 //Name used in call to User::LoadLogicalDevice/User::FreeLogicalDevice |
38 _LIT(KUsbOtgLDDName,"otgdi"); |
39 _LIT(KUsbOtgLDDName,"otgdi"); |
|
40 #endif |
39 |
41 |
40 |
42 |
41 |
43 |
42 CUsbOtg* CUsbOtg::NewL() |
44 CUsbOtg* CUsbOtg::NewL() |
43 /** |
45 /** |
143 { |
145 { |
144 OstTrace0( TRACE_NORMAL, CUSBOTG_CUSBOTG_DUP12, "CUsbOtg::~CUsbOtg; No OTG Driver session was opened, nothing to do" ); |
146 OstTrace0( TRACE_NORMAL, CUSBOTG_CUSBOTG_DUP12, "CUsbOtg::~CUsbOtg; No OTG Driver session was opened, nothing to do" ); |
145 |
147 |
146 } |
148 } |
147 |
149 |
|
150 #ifndef __OVER_DUMMYUSBDI__ |
148 OstTrace0( TRACE_NORMAL, CUSBOTG_CUSBOTG_DUP13, "CUsbOtg::~CUsbOtg; Freeing logical device" ); |
151 OstTrace0( TRACE_NORMAL, CUSBOTG_CUSBOTG_DUP13, "CUsbOtg::~CUsbOtg; Freeing logical device" ); |
149 |
152 |
150 TInt err = User::FreeLogicalDevice(KUsbOtgLDDName); |
153 TInt err = User::FreeLogicalDevice(KUsbOtgLDDName); |
151 //Putting the LOGTEXT2 inside the if statement prevents a compiler |
154 //Putting the LOGTEXT2 inside the if statement prevents a compiler |
152 //warning about err being unused in UREL builds. |
155 //warning about err being unused in UREL builds. |
153 if(err) |
156 if(err) |
154 { |
157 { |
155 OstTrace1( TRACE_NORMAL, CUSBOTG_CUSBOTG_DUP14, "CUsbOtg::~CUsbOtg; User::FreeLogicalDevice returned %d", err ); |
158 OstTrace1( TRACE_NORMAL, CUSBOTG_CUSBOTG_DUP14, "CUsbOtg::~CUsbOtg; User::FreeLogicalDevice returned %d", err ); |
156 |
159 |
157 } |
160 } |
|
161 #endif |
158 |
162 |
159 iCriticalSection.Close(); |
163 iCriticalSection.Close(); |
160 OstTraceFunctionExit0( CUSBOTG_CUSBOTG_DES_EXIT ); |
164 OstTraceFunctionExit0( CUSBOTG_CUSBOTG_DES_EXIT ); |
161 } |
165 } |
162 |
166 |
177 * Performs 2nd phase construction of the OTG object. |
181 * Performs 2nd phase construction of the OTG object. |
178 */ |
182 */ |
179 { |
183 { |
180 OstTraceFunctionEntry0( CUSBOTG_CONSTRUCTL_ENTRY ); |
184 OstTraceFunctionEntry0( CUSBOTG_CONSTRUCTL_ENTRY ); |
181 |
185 |
|
186 #ifndef __OVER_DUMMYUSBDI__ |
182 OstTrace0( TRACE_NORMAL, CUSBOTG_CONSTRUCTL, "CUsbOtg::ConstructL; About to open LDD" ); |
187 OstTrace0( TRACE_NORMAL, CUSBOTG_CONSTRUCTL, "CUsbOtg::ConstructL; About to open LDD" ); |
183 |
188 |
184 iLastError = User::LoadLogicalDevice(KUsbOtgLDDName); |
189 iLastError = User::LoadLogicalDevice(KUsbOtgLDDName); |
185 if ( (iLastError != KErrNone) && (iLastError != KErrAlreadyExists) ) |
190 if ( (iLastError != KErrNone) && (iLastError != KErrAlreadyExists) ) |
186 { |
191 { |
188 { |
193 { |
189 OstTraceExt2( TRACE_NORMAL, CUSBOTG_CONSTRUCTL_DUP1, "CUsbOtg::ConstructL; Error %d: Unable to load driver: %S", iLastError, KUsbOtgLDDName ); |
194 OstTraceExt2( TRACE_NORMAL, CUSBOTG_CONSTRUCTL_DUP1, "CUsbOtg::ConstructL; Error %d: Unable to load driver: %S", iLastError, KUsbOtgLDDName ); |
190 User::Leave(iLastError); |
195 User::Leave(iLastError); |
191 } |
196 } |
192 } |
197 } |
|
198 #endif |
|
199 |
193 OstTrace0( TRACE_NORMAL, CUSBOTG_CONSTRUCTL_DUP3, "CUsbOtg::ConstructL; About to open RUsbOtgDriver" ); |
200 OstTrace0( TRACE_NORMAL, CUSBOTG_CONSTRUCTL_DUP3, "CUsbOtg::ConstructL; About to open RUsbOtgDriver" ); |
194 |
201 |
195 iLastError = iOtgDriver.Open(); |
202 iLastError = iOtgDriver.Open(); |
196 if ( (iLastError != KErrNone) && (iLastError != KErrAlreadyExists) ) |
203 if ( (iLastError != KErrNone) && (iLastError != KErrAlreadyExists) ) |
197 { |
204 { |