253
|
1 |
// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
|
0
|
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 |
// e32/drivers/usbcc/misc.cpp
|
|
15 |
// Platform independent layer (PIL) of the USB Device controller driver:
|
|
16 |
// Implementations of misc. classes defined in usbc.h.
|
|
17 |
//
|
|
18 |
//
|
|
19 |
|
|
20 |
/**
|
|
21 |
@file misc.cpp
|
|
22 |
@internalTechnology
|
|
23 |
*/
|
|
24 |
|
|
25 |
#include <drivers/usbc.h>
|
253
|
26 |
#include "OstTraceDefinitions.h"
|
|
27 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
28 |
#include "miscTraces.h"
|
|
29 |
#endif
|
|
30 |
|
0
|
31 |
|
|
32 |
|
|
33 |
/** Helper function for logical endpoints and endpoint descriptors:
|
|
34 |
Split single Ep size into separate FS/HS sizes.
|
|
35 |
This function modifies its arguments.
|
|
36 |
*/
|
|
37 |
TInt TUsbcEndpointInfo::AdjustEpSizes(TInt& aEpSize_Fs, TInt& aEpSize_Hs) const
|
|
38 |
{
|
|
39 |
if (iType == KUsbEpTypeBulk)
|
|
40 |
{
|
|
41 |
// FS: [8|16|32|64] HS: 512
|
|
42 |
if (iSize < 64)
|
|
43 |
{
|
|
44 |
aEpSize_Fs = iSize;
|
|
45 |
}
|
|
46 |
else
|
|
47 |
{
|
|
48 |
aEpSize_Fs = 64;
|
|
49 |
}
|
|
50 |
aEpSize_Hs = 512;
|
|
51 |
}
|
|
52 |
else if (iType == KUsbEpTypeInterrupt)
|
|
53 |
{
|
|
54 |
// FS: [0..64] HS: [0..1024]
|
|
55 |
if (iSize < 64)
|
|
56 |
{
|
|
57 |
aEpSize_Fs = iSize;
|
|
58 |
}
|
|
59 |
else
|
|
60 |
{
|
|
61 |
aEpSize_Fs = 64;
|
|
62 |
}
|
|
63 |
aEpSize_Hs = iSize;
|
|
64 |
}
|
|
65 |
else if (iType == KUsbEpTypeIsochronous)
|
|
66 |
{
|
|
67 |
// FS: [0..1023] HS: [0..1024]
|
|
68 |
if (iSize < 1023)
|
|
69 |
{
|
|
70 |
aEpSize_Fs = iSize;
|
|
71 |
}
|
|
72 |
else
|
|
73 |
{
|
|
74 |
aEpSize_Fs = 1023;
|
|
75 |
}
|
|
76 |
aEpSize_Hs = iSize;
|
|
77 |
}
|
|
78 |
else if (iType == KUsbEpTypeControl)
|
|
79 |
{
|
|
80 |
// FS: [8|16|32|64] HS: 64
|
|
81 |
if (iSize < 64)
|
|
82 |
{
|
|
83 |
aEpSize_Fs = iSize;
|
|
84 |
}
|
|
85 |
else
|
|
86 |
{
|
|
87 |
aEpSize_Fs = 64;
|
|
88 |
}
|
|
89 |
aEpSize_Hs = 64;
|
|
90 |
}
|
|
91 |
else
|
|
92 |
{
|
|
93 |
aEpSize_Fs = aEpSize_Hs = 0;
|
|
94 |
return KErrGeneral;
|
|
95 |
}
|
|
96 |
|
|
97 |
// For the reason of the following checks see Table 9-14. "Allowed wMaxPacketSize
|
|
98 |
// Values for Different Numbers of Transactions per Microframe".
|
|
99 |
if ((iType == KUsbEpTypeInterrupt) || (iType == KUsbEpTypeIsochronous))
|
|
100 |
{
|
|
101 |
if (iTransactions == 1)
|
|
102 |
{
|
|
103 |
if (aEpSize_Hs < 513)
|
|
104 |
{
|
253
|
105 |
OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTINFO_ADJUSTEPSIZES,
|
|
106 |
" Warning: Ep size too small: %d < 513. Correcting...", aEpSize_Hs );
|
0
|
107 |
aEpSize_Hs = 513;
|
|
108 |
}
|
|
109 |
}
|
|
110 |
else if (iTransactions == 2)
|
|
111 |
{
|
|
112 |
if (aEpSize_Hs < 683)
|
|
113 |
{
|
253
|
114 |
OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTINFO_ADJUSTEPSIZES_DUP1,
|
|
115 |
" Warning: Ep size too small: %d < 683. Correcting...", aEpSize_Hs );
|
0
|
116 |
aEpSize_Hs = 683;
|
|
117 |
}
|
|
118 |
}
|
|
119 |
}
|
|
120 |
return KErrNone;
|
|
121 |
}
|
|
122 |
|
|
123 |
|
|
124 |
/** Helper function for logical endpoints and endpoint descriptors:
|
|
125 |
If not set, assign a valid and meaningful value to iInterval_Hs, deriving from iInterval.
|
|
126 |
This function modifies the objects's data member(s).
|
|
127 |
*/
|
|
128 |
TInt TUsbcEndpointInfo::AdjustPollInterval()
|
|
129 |
{
|
|
130 |
if (iInterval_Hs != -1)
|
|
131 |
{
|
|
132 |
// Already done.
|
|
133 |
return KErrNone;
|
|
134 |
}
|
|
135 |
if ((iType == KUsbEpTypeBulk) || (iType == KUsbEpTypeControl))
|
|
136 |
{
|
|
137 |
// Valid range: 0..255 (maximum NAK rate).
|
|
138 |
// (The host controller will probably ignore this value though -
|
|
139 |
// see the last sentence of section 9.6.6 for details.)
|
|
140 |
iInterval_Hs = 255;
|
|
141 |
}
|
|
142 |
else if (iType == KUsbEpTypeInterrupt)
|
|
143 |
{
|
|
144 |
// HS interval = 2^(iInterval_Hs-1) with a valid iInterval_Hs range of 1..16.
|
|
145 |
// The following table shows the mapping of HS values to actual intervals (and
|
|
146 |
// thus FS values) for the range of possible FS values (1..255).
|
|
147 |
// There is not always a 1:1 mapping possible, but we want at least to make sure
|
|
148 |
// that the HS polling interval is never longer than the FS one (except for 255).
|
|
149 |
//
|
|
150 |
// 1 = 1
|
|
151 |
// 2 = 2
|
|
152 |
// 3 = 4
|
|
153 |
// 4 = 8
|
|
154 |
// 5 = 16
|
|
155 |
// 6 = 32
|
|
156 |
// 7 = 64
|
|
157 |
// 8 = 128
|
|
158 |
// 9 = 256
|
|
159 |
if (iInterval == 255)
|
|
160 |
iInterval_Hs = 9;
|
|
161 |
else if (iInterval >= 128)
|
|
162 |
iInterval_Hs = 8;
|
|
163 |
else if (iInterval >= 64)
|
|
164 |
iInterval_Hs = 7;
|
|
165 |
else if (iInterval >= 32)
|
|
166 |
iInterval_Hs = 6;
|
|
167 |
else if (iInterval >= 16)
|
|
168 |
iInterval_Hs = 5;
|
|
169 |
else if (iInterval >= 8)
|
|
170 |
iInterval_Hs = 4;
|
|
171 |
else if (iInterval >= 4)
|
|
172 |
iInterval_Hs = 3;
|
|
173 |
else if (iInterval >= 2)
|
|
174 |
iInterval_Hs = 2;
|
|
175 |
else if (iInterval == 1)
|
|
176 |
iInterval_Hs = 1;
|
|
177 |
else
|
|
178 |
{
|
|
179 |
// iInterval wasn't set properly by the user
|
|
180 |
iInterval_Hs = 1;
|
|
181 |
return KErrGeneral;
|
|
182 |
}
|
|
183 |
}
|
|
184 |
else if (iType == KUsbEpTypeIsochronous)
|
|
185 |
{
|
|
186 |
// Interpretation is the same for FS and HS.
|
|
187 |
iInterval_Hs = iInterval;
|
|
188 |
}
|
|
189 |
else
|
|
190 |
{
|
|
191 |
// '1' is a valid value for all endpoint types...
|
|
192 |
iInterval_Hs = 1;
|
|
193 |
return KErrGeneral;
|
|
194 |
}
|
|
195 |
return KErrNone;
|
|
196 |
}
|
|
197 |
|
|
198 |
|
|
199 |
TUsbcPhysicalEndpoint::TUsbcPhysicalEndpoint()
|
|
200 |
: iEndpointAddr(0), iIfcNumber(NULL), iLEndpoint(NULL), iSettingReserve(EFalse), iHalt(EFalse)
|
|
201 |
{
|
253
|
202 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_TUSBCPHYSICALENDPOINT_CONS,
|
|
203 |
"TUsbcPhysicalEndpoint::TUsbcPhysicalEndpoint()" );
|
0
|
204 |
}
|
|
205 |
|
|
206 |
|
|
207 |
TInt TUsbcPhysicalEndpoint::TypeAvailable(TUint aType) const
|
|
208 |
{
|
253
|
209 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_TYPEAVAILABLE,
|
|
210 |
"TUsbcPhysicalEndpoint::TypeAvailable" );
|
0
|
211 |
switch (aType)
|
|
212 |
{
|
|
213 |
case KUsbEpTypeControl:
|
|
214 |
return (iCaps.iTypesAndDir & KUsbEpTypeControl);
|
|
215 |
case KUsbEpTypeIsochronous:
|
|
216 |
return (iCaps.iTypesAndDir & KUsbEpTypeIsochronous);
|
|
217 |
case KUsbEpTypeBulk:
|
|
218 |
return (iCaps.iTypesAndDir & KUsbEpTypeBulk);
|
|
219 |
case KUsbEpTypeInterrupt:
|
|
220 |
return (iCaps.iTypesAndDir & KUsbEpTypeInterrupt);
|
|
221 |
default:
|
253
|
222 |
OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCPHYSICALENDPOINT_TYPEAVAILABLE_DUP1,
|
|
223 |
" Error: invalid EP type: %d", aType );
|
0
|
224 |
return 0;
|
|
225 |
}
|
|
226 |
}
|
|
227 |
|
|
228 |
|
|
229 |
TInt TUsbcPhysicalEndpoint::DirAvailable(TUint aDir) const
|
|
230 |
{
|
253
|
231 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_DIRAVAILABLE,
|
|
232 |
"TUsbcPhysicalEndpoint::DirAvailable" );
|
0
|
233 |
switch (aDir)
|
|
234 |
{
|
|
235 |
case KUsbEpDirIn:
|
|
236 |
return (iCaps.iTypesAndDir & KUsbEpDirIn);
|
|
237 |
case KUsbEpDirOut:
|
|
238 |
return (iCaps.iTypesAndDir & KUsbEpDirOut);
|
|
239 |
default:
|
253
|
240 |
OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCPHYSICALENDPOINT_DIRAVAILABLE_DUP1,
|
|
241 |
" Error: invalid EP direction: %d", aDir );
|
0
|
242 |
return 0;
|
|
243 |
}
|
|
244 |
}
|
|
245 |
|
|
246 |
|
|
247 |
TInt TUsbcPhysicalEndpoint::EndpointSuitable(const TUsbcEndpointInfo* aEpInfo, TInt aIfcNumber) const
|
|
248 |
{
|
253
|
249 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE,
|
|
250 |
"TUsbcPhysicalEndpoint::EndpointSuitable" );
|
|
251 |
OstTraceDefExt4( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP1,
|
|
252 |
" looking for EP: type=0x%x dir=0x%x size=%d (ifc_num=%d)",
|
|
253 |
aEpInfo->iType, aEpInfo->iDir, aEpInfo->iSize, aIfcNumber );
|
0
|
254 |
if (iSettingReserve)
|
|
255 |
{
|
253
|
256 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP2,
|
|
257 |
" -> setting conflict" );
|
0
|
258 |
return 0;
|
|
259 |
}
|
|
260 |
// (aIfcNumber == -1) means the ep is for a new default interface setting
|
|
261 |
else if (iIfcNumber && (*iIfcNumber != aIfcNumber))
|
|
262 |
{
|
|
263 |
// If this endpoint has already been claimed (iIfcNumber != NULL),
|
|
264 |
// but by a different interface(-set) than the currently looking one
|
|
265 |
// (*iIfcNumber != aIfcNumber), then it's not available.
|
|
266 |
// This works because we can assign the same physical endpoint
|
|
267 |
// to different alternate settings of the *same* interface, and
|
|
268 |
// because we check for available endpoints for every alternate setting
|
|
269 |
// as a whole.
|
253
|
270 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP3,
|
|
271 |
" -> ifc conflict" );
|
0
|
272 |
return 0;
|
|
273 |
}
|
|
274 |
else if (!TypeAvailable(aEpInfo->iType))
|
|
275 |
{
|
253
|
276 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP4,
|
|
277 |
" -> type conflict" );
|
0
|
278 |
return 0;
|
|
279 |
}
|
|
280 |
else if (!DirAvailable(aEpInfo->iDir))
|
|
281 |
{
|
253
|
282 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP5,
|
|
283 |
" -> direction conflict" );
|
0
|
284 |
return 0;
|
|
285 |
}
|
|
286 |
else if (!(iCaps.iSizes & PacketSize2Mask(aEpInfo->iSize)) && !(iCaps.iSizes & KUsbEpSizeCont))
|
|
287 |
{
|
253
|
288 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP6,
|
|
289 |
" -> size conflict" );
|
0
|
290 |
return 0;
|
|
291 |
}
|
|
292 |
else
|
|
293 |
return 1;
|
|
294 |
}
|
|
295 |
|
|
296 |
|
|
297 |
TUsbcPhysicalEndpoint::~TUsbcPhysicalEndpoint()
|
|
298 |
{
|
253
|
299 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_TUSBCPHYSICALENDPOINT_DES,
|
|
300 |
"TUsbcPhysicalEndpoint::~TUsbcPhysicalEndpoint()" );
|
0
|
301 |
iLEndpoint = NULL;
|
|
302 |
}
|
|
303 |
|
|
304 |
|
|
305 |
TUsbcLogicalEndpoint::TUsbcLogicalEndpoint(DUsbClientController* aController, TUint aEndpointNum,
|
|
306 |
const TUsbcEndpointInfo& aEpInfo, TUsbcInterface* aInterface,
|
|
307 |
TUsbcPhysicalEndpoint* aPEndpoint)
|
|
308 |
: iController(aController), iLEndpointNum(aEndpointNum), iInfo(aEpInfo), iInterface(aInterface),
|
|
309 |
iPEndpoint(aPEndpoint)
|
|
310 |
{
|
253
|
311 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS,
|
|
312 |
"TUsbcLogicalEndpoint::TUsbcLogicalEndpoint()" );
|
0
|
313 |
// Adjust FS/HS endpoint sizes
|
|
314 |
if (iInfo.AdjustEpSizes(iEpSize_Fs, iEpSize_Hs) != KErrNone)
|
|
315 |
{
|
253
|
316 |
OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP1,
|
|
317 |
" Error: Unknown endpoint type: %d", iInfo.iType );
|
0
|
318 |
}
|
253
|
319 |
OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP2,
|
|
320 |
" Now set: iEpSize_Fs=%d iEpSize_Hs=%d (iInfo.iSize=%d)", iEpSize_Fs, iEpSize_Hs, iInfo.iSize );
|
0
|
321 |
// Adjust HS polling interval
|
|
322 |
if (iInfo.AdjustPollInterval() != KErrNone)
|
|
323 |
{
|
253
|
324 |
OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP3,
|
|
325 |
" Error: Unknown ep type (%d) or invalid interval value (%d)", iInfo.iType, iInfo.iInterval );
|
0
|
326 |
}
|
253
|
327 |
OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP4,
|
|
328 |
" Now set: iInfo.iInterval=%d iInfo.iInterval_Hs=%d", iInfo.iInterval, iInfo.iInterval_Hs );
|
0
|
329 |
// Additional transactions requested on a non High Bandwidth ep?
|
|
330 |
if ((iInfo.iTransactions > 0) && !aPEndpoint->iCaps.iHighBandwidth)
|
|
331 |
{
|
253
|
332 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP5,
|
|
333 |
" Warning: Additional transactions requested but not a High Bandwidth ep" );
|
0
|
334 |
}
|
|
335 |
}
|
|
336 |
|
|
337 |
|
|
338 |
TUsbcLogicalEndpoint::~TUsbcLogicalEndpoint()
|
|
339 |
{
|
253
|
340 |
OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES,
|
|
341 |
"TUsbcLogicalEndpoint::~TUsbcLogicalEndpoint: #%d", iLEndpointNum );
|
0
|
342 |
// If the real endpoint this endpoint points to is also used by
|
|
343 |
// any other logical endpoint in any other setting of this interface
|
|
344 |
// then we leave the real endpoint marked as used. Otherwise we mark
|
|
345 |
// it as available (set its ifc number pointer to NULL).
|
|
346 |
const TInt n = iInterface->iInterfaceSet->iInterfaces.Count();
|
|
347 |
for (TInt i = 0; i < n; ++i)
|
|
348 |
{
|
|
349 |
const TUsbcInterface* const ifc = iInterface->iInterfaceSet->iInterfaces[i];
|
|
350 |
const TInt m = ifc->iEndpoints.Count();
|
|
351 |
for (TInt j = 0; j < m; ++j)
|
|
352 |
{
|
|
353 |
const TUsbcLogicalEndpoint* const ep = ifc->iEndpoints[j];
|
|
354 |
if ((ep->iPEndpoint == iPEndpoint) && (ep != this))
|
|
355 |
{
|
253
|
356 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP1,
|
|
357 |
" Physical endpoint still in use -> we leave it as is" );
|
0
|
358 |
return;
|
|
359 |
}
|
|
360 |
}
|
|
361 |
}
|
253
|
362 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP2,
|
|
363 |
" Closing DMA channel" );
|
0
|
364 |
const TInt idx = iController->EpAddr2Idx(iPEndpoint->iEndpointAddr);
|
|
365 |
// If the endpoint doesn't support DMA (now or ever) the next operation will be a no-op.
|
|
366 |
iController->CloseDmaChannel(idx);
|
253
|
367 |
OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP3,
|
|
368 |
" Setting physical ep 0x%02x ifc number to NULL (was %d)",
|
|
369 |
iPEndpoint->iEndpointAddr, *iPEndpoint->iIfcNumber );
|
0
|
370 |
iPEndpoint->iIfcNumber = NULL;
|
|
371 |
}
|
|
372 |
|
|
373 |
|
|
374 |
TUsbcInterface::TUsbcInterface(TUsbcInterfaceSet* aIfcSet, TUint8 aSetting, TBool aNoEp0Requests)
|
|
375 |
: iEndpoints(2), iInterfaceSet(aIfcSet), iSettingCode(aSetting), iNoEp0Requests(aNoEp0Requests)
|
|
376 |
{
|
253
|
377 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACE_TUSBCINTERFACE_CONS,
|
|
378 |
"TUsbcInterface::TUsbcInterface()" );
|
0
|
379 |
}
|
|
380 |
|
|
381 |
|
|
382 |
TUsbcInterface::~TUsbcInterface()
|
|
383 |
{
|
253
|
384 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACE_TUSBCINTERFACE_DES,
|
|
385 |
"TUsbcInterface::~TUsbcInterface()" );
|
0
|
386 |
iEndpoints.ResetAndDestroy();
|
|
387 |
}
|
|
388 |
|
|
389 |
|
|
390 |
TUsbcInterfaceSet::TUsbcInterfaceSet(const DBase* aClientId, TUint8 aIfcNum)
|
|
391 |
: iInterfaces(2), iClientId(aClientId), iInterfaceNumber(aIfcNum), iCurrentInterface(0)
|
|
392 |
{
|
253
|
393 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACESET_TUSBCINTERFACESET_CONS,
|
|
394 |
"TUsbcInterfaceSet::TUsbcInterfaceSet()" );
|
0
|
395 |
}
|
|
396 |
|
|
397 |
|
|
398 |
TUsbcInterfaceSet::~TUsbcInterfaceSet()
|
|
399 |
{
|
253
|
400 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACESET_TUSBCINTERFACESET_DES,
|
|
401 |
"TUsbcInterfaceSet::~TUsbcInterfaceSet()" );
|
0
|
402 |
iInterfaces.ResetAndDestroy();
|
|
403 |
}
|
|
404 |
|
|
405 |
|
|
406 |
TUsbcConfiguration::TUsbcConfiguration(TUint8 aConfigVal)
|
|
407 |
: iInterfaceSets(1), iConfigValue(aConfigVal) // iInterfaceSets(1): granularity
|
|
408 |
{
|
253
|
409 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCONFIGURATION_TUSBCCONFIGURATION_CONS,
|
|
410 |
"TUsbcConfiguration::TUsbcConfiguration()" );
|
0
|
411 |
}
|
|
412 |
|
|
413 |
|
|
414 |
TUsbcConfiguration::~TUsbcConfiguration()
|
|
415 |
{
|
253
|
416 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCONFIGURATION_TUSBCCONFIGURATION_DES,
|
|
417 |
"TUsbcConfiguration::~TUsbcConfiguration()" );
|
0
|
418 |
iInterfaceSets.ResetAndDestroy();
|
|
419 |
}
|
|
420 |
|
|
421 |
|
|
422 |
_LIT(KDriverName, "Usbcc");
|
|
423 |
|
|
424 |
DUsbcPowerHandler::DUsbcPowerHandler(DUsbClientController* aController)
|
|
425 |
: DPowerHandler(KDriverName), iController(aController)
|
|
426 |
{}
|
|
427 |
|
|
428 |
|
|
429 |
void DUsbcPowerHandler::PowerUp()
|
|
430 |
{
|
|
431 |
if (iController)
|
|
432 |
iController->iPowerUpDfc.Enque();
|
|
433 |
}
|
|
434 |
|
|
435 |
|
|
436 |
void DUsbcPowerHandler::PowerDown(TPowerState)
|
|
437 |
{
|
|
438 |
if (iController)
|
|
439 |
iController->iPowerDownDfc.Enque();
|
|
440 |
}
|
|
441 |
|
|
442 |
|
|
443 |
// -eof-
|