|
1 /* |
|
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of the WlanDynamicPowerModeMgmtCntx class |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 14 % |
|
20 */ |
|
21 |
|
22 #include "config.h" |
|
23 #include "umacdynamicpowermodemgmtcntx.h" |
|
24 #include "UmacContextImpl.h" |
|
25 |
|
26 // default time interval in microseconds after which transition from Active |
|
27 // mode to Light PS mode is considered. |
|
28 // This value is used if another value hasn't been provided |
|
29 const TUint32 KDefaultToLightPsTimeout = 100000; // 100ms |
|
30 |
|
31 // default time interval in microseconds after which the frame counter |
|
32 // used when considering transition from Light PS to Active mode is reset. |
|
33 // This value is used if another value hasn't been provided |
|
34 const TUint32 KDefaultToActiveTimeout = 300000; // 300ms |
|
35 |
|
36 // default time interval in microseconds after which transition from Light PS |
|
37 // mode to Deep PS mode is considered. |
|
38 // This value is used if another value hasn't been provided |
|
39 const TUint32 KDefaultToDeepPsTimeout = 1000000; // 1s |
|
40 |
|
41 |
|
42 // ================= MEMBER FUNCTIONS ======================= |
|
43 |
|
44 // --------------------------------------------------------------------------- |
|
45 // |
|
46 // --------------------------------------------------------------------------- |
|
47 // |
|
48 WlanDynamicPowerModeMgmtCntx::WlanDynamicPowerModeMgmtCntx( |
|
49 WlanContextImpl& aWlanCtxImpl ) : |
|
50 iStateChange( EFalse ), |
|
51 iFlags( 0 | KStayInPsDespiteUapsdVoiceTraffic ), |
|
52 iToLightPsTimeout( KDefaultToLightPsTimeout ), |
|
53 iToActiveTimeout( KDefaultToActiveTimeout ), |
|
54 iToDeepPsTimeout( KDefaultToDeepPsTimeout ), |
|
55 iActiveCntx( NULL ), |
|
56 iWlanContextImpl( aWlanCtxImpl ) |
|
57 { |
|
58 os_memset( iIgnoreTraffic, 0, sizeof( iIgnoreTraffic ) ); |
|
59 } |
|
60 |
|
61 // --------------------------------------------------------------------------- |
|
62 // |
|
63 // --------------------------------------------------------------------------- |
|
64 // |
|
65 WlanDynamicPowerModeMgmtCntx::~WlanDynamicPowerModeMgmtCntx() |
|
66 { |
|
67 CancelTimeouts(); |
|
68 iActiveCntx = NULL; |
|
69 } |
|
70 |
|
71 // --------------------------------------------------------------------------- |
|
72 // |
|
73 // --------------------------------------------------------------------------- |
|
74 // |
|
75 void WlanDynamicPowerModeMgmtCntx::StartPowerModeManagement() |
|
76 { |
|
77 if ( !iActiveCntx ) |
|
78 { |
|
79 const TPowerMgmtMode KCurrentPwrMgmtMode ( |
|
80 iWlanContextImpl.CurrentPwrMgmtMode() ); |
|
81 |
|
82 switch ( KCurrentPwrMgmtMode ) |
|
83 { |
|
84 case EActive: |
|
85 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
86 ("UMAC: WlanDynamicPowerModeMgmtCntx::StartPowerModeManagement: Activating Active mode context") ); |
|
87 |
|
88 iActiveCntx = &iActiveModeCntx; |
|
89 RegisterToLightPsTimeout(); |
|
90 break; |
|
91 case ELightPs: |
|
92 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
93 ("UMAC: WlanDynamicPowerModeMgmtCntx::StartPowerModeManagement: Activating Light PS mode context") ); |
|
94 |
|
95 iActiveCntx = &iLightPsModeCntx; |
|
96 |
|
97 if ( // we have roamed to the current AP |
|
98 iWlanContextImpl.Reassociate() && |
|
99 // we have not yet indicated to WLAN Mgmt Client the |
|
100 // opportunity to perform tests on the current AP |
|
101 !iWlanContextImpl.ApTestOpportunityIndicated() ) |
|
102 { |
|
103 // start to seek for the test opportunity |
|
104 iWlanContextImpl.ApTestOpportunitySeekStarted( ETrue ); |
|
105 |
|
106 OsTracePrint( KUmacDetails, (TUint8*) |
|
107 ("UMAC: WlanDynamicPowerModeMgmtCntx::StartPowerModeManagement: Start AP test opportunity seek") ); |
|
108 } |
|
109 |
|
110 RegisterToActiveTimeout(); |
|
111 RegisterToDeepPsTimeout(); |
|
112 break; |
|
113 case EDeepPs: |
|
114 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
115 ("UMAC: WlanDynamicPowerModeMgmtCntx::StartPowerModeManagement: Activating Deep PS mode context") ); |
|
116 |
|
117 iActiveCntx = &iDeepPsModeCntx; |
|
118 break; |
|
119 default: |
|
120 // implementation error |
|
121 OsAssert( |
|
122 (TUint8*)("UMAC: panic"), |
|
123 (TUint8*)(WLAN_FILE), |
|
124 __LINE__ ); |
|
125 } |
|
126 |
|
127 // reset active context prior use |
|
128 iActiveCntx->Reset(); |
|
129 // and also reset the state change flag |
|
130 iStateChange = EFalse; |
|
131 } |
|
132 else |
|
133 { |
|
134 // we already have an active context, so no action needed |
|
135 } |
|
136 } |
|
137 |
|
138 // --------------------------------------------------------------------------- |
|
139 // |
|
140 // --------------------------------------------------------------------------- |
|
141 // |
|
142 void WlanDynamicPowerModeMgmtCntx::StopPowerModeManagement() |
|
143 { |
|
144 if ( iActiveCntx ) |
|
145 { |
|
146 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
147 ("UMAC: WlanDynamicPowerModeMgmtCntx::StopPowerModeManagement: dynamic power mode mgmt stopped") ); |
|
148 |
|
149 CancelTimeouts(); |
|
150 iStateChange = EFalse; |
|
151 iActiveCntx = NULL; // no active context any more |
|
152 } |
|
153 } |
|
154 |
|
155 // --------------------------------------------------------------------------- |
|
156 // |
|
157 // --------------------------------------------------------------------------- |
|
158 // |
|
159 TPowerMgmtModeChange WlanDynamicPowerModeMgmtCntx::OnFrameTx( |
|
160 WHA::TQueueId aQueueId, |
|
161 TUint16 aEtherType ) |
|
162 { |
|
163 TPowerMgmtModeChange powerMgmtModeChange( ENoChange ); |
|
164 |
|
165 if ( iActiveCntx ) |
|
166 { |
|
167 // we have an active context, i.e. we are doing power mode mgmt |
|
168 |
|
169 if ( !iStateChange ) |
|
170 { |
|
171 powerMgmtModeChange = iActiveCntx->OnFrameTx( |
|
172 iWlanContextImpl, |
|
173 aQueueId, |
|
174 aEtherType, |
|
175 iIgnoreTraffic[aQueueId] ); |
|
176 |
|
177 if ( powerMgmtModeChange != ENoChange ) |
|
178 { |
|
179 // as we will do a mode change, cancel any possibly running |
|
180 // power mode management timers |
|
181 CancelTimeouts(); |
|
182 } |
|
183 } |
|
184 else |
|
185 { |
|
186 // state change already signalled from this power mode context, |
|
187 // don't do it more than once. No action needed |
|
188 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
189 ("UMAC: WlanDynamicPowerModeMgmtCntx::OnFrameTx: statechange already signalled") ); |
|
190 } |
|
191 } |
|
192 else |
|
193 { |
|
194 // dynamic power mode mgmt is not active => "No change" will be |
|
195 // returned. No action needed |
|
196 } |
|
197 |
|
198 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
199 ("UMAC: WlanDynamicPowerModeMgmtCntx::OnFrameTx: statechange: %d"), |
|
200 powerMgmtModeChange ); |
|
201 |
|
202 return powerMgmtModeChange; |
|
203 } |
|
204 |
|
205 // --------------------------------------------------------------------------- |
|
206 // |
|
207 // --------------------------------------------------------------------------- |
|
208 // |
|
209 TPowerMgmtModeChange WlanDynamicPowerModeMgmtCntx::OnFrameRx( |
|
210 WHA::TQueueId aAccessCategory, |
|
211 TUint16 aEtherType, |
|
212 TUint aPayloadLength, |
|
213 TDaType aDaType ) |
|
214 { |
|
215 TPowerMgmtModeChange powerMgmtModeChange( ENoChange ); |
|
216 |
|
217 if ( iActiveCntx ) |
|
218 { |
|
219 // we have an active context, i.e. we are doing power mode mgmt |
|
220 |
|
221 if ( !iStateChange ) |
|
222 { |
|
223 powerMgmtModeChange = iActiveCntx->OnFrameRx( |
|
224 iWlanContextImpl, |
|
225 aAccessCategory, |
|
226 aEtherType, |
|
227 iIgnoreTraffic[aAccessCategory], |
|
228 aPayloadLength, |
|
229 aDaType ); |
|
230 |
|
231 if ( powerMgmtModeChange != ENoChange ) |
|
232 { |
|
233 // as we will do a mode change, cancel any possibly running |
|
234 // power mode management timers |
|
235 CancelTimeouts(); |
|
236 } |
|
237 } |
|
238 else |
|
239 { |
|
240 // state change already signalled from this power mode context, |
|
241 // don't do it more than once. No action needed |
|
242 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
243 ("UMAC: WlanDynamicPowerModeMgmtCntx::OnFrameRx: statechange already signalled") ); |
|
244 } |
|
245 } |
|
246 else |
|
247 { |
|
248 // dynamic power mode mgmt is not active => "No change" will be |
|
249 // returned. No action needed |
|
250 } |
|
251 |
|
252 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
253 ("UMAC: WlanDynamicPowerModeMgmtCntx::OnFrameRx: statechange: %d"), |
|
254 powerMgmtModeChange ); |
|
255 |
|
256 return powerMgmtModeChange; |
|
257 } |
|
258 |
|
259 // --------------------------------------------------------------------------- |
|
260 // |
|
261 // --------------------------------------------------------------------------- |
|
262 // |
|
263 TBool WlanDynamicPowerModeMgmtCntx::OnActiveToLightPsTimerTimeout() |
|
264 { |
|
265 if ( ( iActiveCntx == &iActiveModeCntx ) && |
|
266 ( iFlags & KToLightPsTimerStarted ) && |
|
267 ( !iStateChange ) ) |
|
268 { |
|
269 iFlags &= ~KToLightPsTimerStarted; |
|
270 |
|
271 iStateChange = iActiveCntx->OnActiveToLightPsTimerTimeout(); |
|
272 |
|
273 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
274 ("UMAC: WlanDynamicPowerModeMgmtCntx::OnActiveToLightPsTimerTimeout: change state: %d"), |
|
275 iStateChange ); |
|
276 |
|
277 if ( !iStateChange ) |
|
278 { |
|
279 RegisterToLightPsTimeout(); |
|
280 } |
|
281 } |
|
282 else |
|
283 { |
|
284 // either |
|
285 // the timeout occurred in a wrong context or totally without an active |
|
286 // context (i.e. when we are not doing dynamic power mode mgmt) OR |
|
287 // the timer is not started, i.e. the timeout occurred when we weren't |
|
288 // expecting it (which means that the timeout callback had already been |
|
289 // registered when we tried to cancel this timer the previous time) OR |
|
290 // a state change has already been signalled from this power mode |
|
291 // context. |
|
292 // In all these cases the timeout is not relevant and we take no action |
|
293 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
294 ("UMAC: WlanDynamicPowerModeMgmtCntx::OnActiveToLightPsTimerTimeout: not relevant timeout") ); |
|
295 } |
|
296 |
|
297 return iStateChange; |
|
298 } |
|
299 |
|
300 // --------------------------------------------------------------------------- |
|
301 // |
|
302 // --------------------------------------------------------------------------- |
|
303 // |
|
304 TBool WlanDynamicPowerModeMgmtCntx::OnLightPsToActiveTimerTimeout() |
|
305 { |
|
306 if ( ( iActiveCntx == &iLightPsModeCntx ) && |
|
307 ( iFlags & KToActiveTimerStarted ) && |
|
308 ( !iStateChange ) ) |
|
309 { |
|
310 iFlags &= ~KToActiveTimerStarted; |
|
311 |
|
312 iStateChange = iActiveCntx->OnLightPsToActiveTimerTimeout( |
|
313 iWlanContextImpl ); |
|
314 |
|
315 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
316 ("UMAC: WlanDynamicPowerModeMgmtCntx::OnLightPsToActiveTimerTimeout: change state: %d"), |
|
317 iStateChange ); |
|
318 |
|
319 // as we currently never do a mode change when this timeout occurs, |
|
320 // we arm the timer again |
|
321 RegisterToActiveTimeout(); |
|
322 } |
|
323 else |
|
324 { |
|
325 // either |
|
326 // the timeout occurred in a wrong context or totally without an active |
|
327 // context (i.e. when we are not doing dynamic power mode mgmt) OR |
|
328 // the timer is not started, i.e. the timeout occurred when we weren't |
|
329 // expecting it (which means that the timeout callback had already been |
|
330 // registered when we tried to cancel this timer the previous time) OR |
|
331 // a state change has already been signalled from this power mode |
|
332 // context. |
|
333 // In all these cases the timeout is not relevant and we take no action |
|
334 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
335 ("UMAC: WlanDynamicPowerModeMgmtCntx::OnLightPsToActiveTimerTimeout: not relevant timeout") ); |
|
336 } |
|
337 |
|
338 return iStateChange; |
|
339 } |
|
340 |
|
341 // --------------------------------------------------------------------------- |
|
342 // |
|
343 // --------------------------------------------------------------------------- |
|
344 // |
|
345 TBool WlanDynamicPowerModeMgmtCntx::OnLightPsToDeepPsTimerTimeout() |
|
346 { |
|
347 if ( ( iActiveCntx == &iLightPsModeCntx ) && |
|
348 ( iFlags & KToDeepPsTimerStarted ) && |
|
349 ( !iStateChange ) ) |
|
350 { |
|
351 iFlags &= ~KToDeepPsTimerStarted; |
|
352 |
|
353 iStateChange = iActiveCntx->OnLightPsToDeepPsTimerTimeout(); |
|
354 |
|
355 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
356 ("UMAC: WlanDynamicPowerModeMgmtCntx::OnLightPsToDeepPsTimerTimeout: change state: %d"), |
|
357 iStateChange ); |
|
358 |
|
359 if ( !iStateChange ) |
|
360 { |
|
361 RegisterToDeepPsTimeout(); |
|
362 } |
|
363 } |
|
364 else |
|
365 { |
|
366 // either |
|
367 // the timeout occurred in a wrong context or totally without an active |
|
368 // context (i.e. when we are not doing dynamic power mode mgmt) OR |
|
369 // the timer is not started, i.e. the timeout occurred when we weren't |
|
370 // expecting it (which means that the timeout callback had already been |
|
371 // registered when we tried to cancel this timer the previous time) OR |
|
372 // a state change has already been signalled from this power mode |
|
373 // context. |
|
374 // In all these cases the timeout is not relevant and we take no action |
|
375 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
376 ("UMAC: WlanDynamicPowerModeMgmtCntx::OnLightPsToDeepPsTimerTimeout: not relevant timeout") ); |
|
377 } |
|
378 |
|
379 return iStateChange; |
|
380 } |
|
381 |
|
382 // --------------------------------------------------------------------------- |
|
383 // |
|
384 // --------------------------------------------------------------------------- |
|
385 // |
|
386 void WlanDynamicPowerModeMgmtCntx::SetParameters( |
|
387 TUint32 aToLightPsTimeout, |
|
388 TUint16 aToLightPsFrameThreshold, |
|
389 TUint32 aToActiveTimeout, |
|
390 TUint16 aToActiveFrameThreshold, |
|
391 TUint32 aToDeepPsTimeout, |
|
392 TUint16 aToDeepPsFrameThreshold, |
|
393 TUint16 aUapsdRxFrameLengthThreshold ) |
|
394 { |
|
395 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
396 ("UMAC: WlanDynamicPowerModeMgmtCntx::SetParameters") ); |
|
397 |
|
398 iToLightPsTimeout = aToLightPsTimeout; |
|
399 iActiveModeCntx.SetParameters( |
|
400 aToLightPsFrameThreshold, |
|
401 aUapsdRxFrameLengthThreshold ); |
|
402 |
|
403 iToActiveTimeout = aToActiveTimeout; |
|
404 iToDeepPsTimeout = aToDeepPsTimeout; |
|
405 iLightPsModeCntx.SetParameters( |
|
406 aToActiveFrameThreshold, |
|
407 aToDeepPsFrameThreshold, |
|
408 aUapsdRxFrameLengthThreshold ); |
|
409 } |
|
410 |
|
411 // --------------------------------------------------------------------------- |
|
412 // |
|
413 // --------------------------------------------------------------------------- |
|
414 // |
|
415 void WlanDynamicPowerModeMgmtCntx::ConfigureTrafficOverride( |
|
416 TBool aStayInPsDespiteUapsdVoiceTraffic, |
|
417 TBool aStayInPsDespiteUapsdVideoTraffic, |
|
418 TBool aStayInPsDespiteUapsdBestEffortTraffic, |
|
419 TBool aStayInPsDespiteUapsdBackgroundTraffic, |
|
420 TBool aStayInPsDespiteLegacyVoiceTraffic, |
|
421 TBool aStayInPsDespiteLegacyVideoTraffic, |
|
422 TBool aStayInPsDespiteLegacyBestEffortTraffic, |
|
423 TBool aStayInPsDespiteLegacyBackgroundTraffic ) |
|
424 { |
|
425 if ( aStayInPsDespiteUapsdVoiceTraffic ) |
|
426 { |
|
427 iFlags |= KStayInPsDespiteUapsdVoiceTraffic; |
|
428 } |
|
429 else |
|
430 { |
|
431 iFlags &= ~KStayInPsDespiteUapsdVoiceTraffic; |
|
432 } |
|
433 |
|
434 if ( aStayInPsDespiteUapsdVideoTraffic ) |
|
435 { |
|
436 iFlags |= KStayInPsDespiteUapsdVideoTraffic; |
|
437 } |
|
438 else |
|
439 { |
|
440 iFlags &= ~KStayInPsDespiteUapsdVideoTraffic; |
|
441 } |
|
442 |
|
443 if ( aStayInPsDespiteUapsdBestEffortTraffic ) |
|
444 { |
|
445 iFlags |= KStayInPsDespiteUapsdBestEffortTraffic; |
|
446 } |
|
447 else |
|
448 { |
|
449 iFlags &= ~KStayInPsDespiteUapsdBestEffortTraffic; |
|
450 } |
|
451 |
|
452 if ( aStayInPsDespiteUapsdBackgroundTraffic ) |
|
453 { |
|
454 iFlags |= KStayInPsDespiteUapsdBackgroundTraffic; |
|
455 } |
|
456 else |
|
457 { |
|
458 iFlags &= ~KStayInPsDespiteUapsdBackgroundTraffic; |
|
459 } |
|
460 |
|
461 if ( aStayInPsDespiteLegacyVoiceTraffic ) |
|
462 { |
|
463 iFlags |= KStayInPsDespiteLegacyVoiceTraffic; |
|
464 } |
|
465 else |
|
466 { |
|
467 iFlags &= ~KStayInPsDespiteLegacyVoiceTraffic; |
|
468 } |
|
469 |
|
470 if ( aStayInPsDespiteLegacyVideoTraffic ) |
|
471 { |
|
472 iFlags |= KStayInPsDespiteLegacyVideoTraffic; |
|
473 } |
|
474 else |
|
475 { |
|
476 iFlags &= ~KStayInPsDespiteLegacyVideoTraffic; |
|
477 } |
|
478 |
|
479 if ( aStayInPsDespiteLegacyBestEffortTraffic ) |
|
480 { |
|
481 iFlags |= KStayInPsDespiteLegacyBestEffortTraffic; |
|
482 } |
|
483 else |
|
484 { |
|
485 iFlags &= ~KStayInPsDespiteLegacyBestEffortTraffic; |
|
486 } |
|
487 |
|
488 if ( aStayInPsDespiteLegacyBackgroundTraffic ) |
|
489 { |
|
490 iFlags |= KStayInPsDespiteLegacyBackgroundTraffic; |
|
491 } |
|
492 else |
|
493 { |
|
494 iFlags &= ~KStayInPsDespiteLegacyBackgroundTraffic; |
|
495 } |
|
496 } |
|
497 |
|
498 // --------------------------------------------------------------------------- |
|
499 // |
|
500 // --------------------------------------------------------------------------- |
|
501 // |
|
502 void WlanDynamicPowerModeMgmtCntx::FreezeTrafficOverride() |
|
503 { |
|
504 if ( iWlanContextImpl.UapsdUsedForBestEffort() ) |
|
505 { |
|
506 iIgnoreTraffic[WHA::ELegacy] = StayInPsDespiteUapsdBestEffortTraffic() ? |
|
507 ETrue : EFalse; |
|
508 } |
|
509 else |
|
510 { |
|
511 iIgnoreTraffic[WHA::ELegacy] = StayInPsDespiteLegacyBestEffortTraffic() ? |
|
512 ETrue : EFalse; |
|
513 } |
|
514 |
|
515 if ( iWlanContextImpl.UapsdUsedForBackground() ) |
|
516 { |
|
517 iIgnoreTraffic[WHA::EBackGround] = StayInPsDespiteUapsdBackgroundTraffic() ? |
|
518 ETrue : EFalse; |
|
519 } |
|
520 else |
|
521 { |
|
522 iIgnoreTraffic[WHA::EBackGround] = StayInPsDespiteLegacyBackgroundTraffic() ? |
|
523 ETrue : EFalse; |
|
524 } |
|
525 |
|
526 if ( iWlanContextImpl.UapsdUsedForVideo() ) |
|
527 { |
|
528 iIgnoreTraffic[WHA::EVideo] = StayInPsDespiteUapsdVideoTraffic() ? |
|
529 ETrue : EFalse; |
|
530 } |
|
531 else |
|
532 { |
|
533 iIgnoreTraffic[WHA::EVideo] = StayInPsDespiteLegacyVideoTraffic() ? |
|
534 ETrue : EFalse; |
|
535 } |
|
536 |
|
537 if ( iWlanContextImpl.UapsdUsedForVoice() ) |
|
538 { |
|
539 iIgnoreTraffic[WHA::EVoice] = StayInPsDespiteUapsdVoiceTraffic() ? |
|
540 ETrue : EFalse; |
|
541 } |
|
542 else |
|
543 { |
|
544 iIgnoreTraffic[WHA::EVoice] = StayInPsDespiteLegacyVoiceTraffic() ? |
|
545 ETrue : EFalse; |
|
546 } |
|
547 |
|
548 #ifndef NDEBUG |
|
549 OsTracePrint( KPwrStateTransition | KQos, (TUint8*) |
|
550 ("UMAC: WlanDynamicPowerModeMgmtCntx::FreezeTrafficOverride: traffic ignoration for BE, BG, VI, VO, HCCA frozen to:") ); |
|
551 |
|
552 for ( TUint accessCategory = WHA::ELegacy; |
|
553 accessCategory < WHA::EQueueIdMax; |
|
554 ++accessCategory ) |
|
555 { |
|
556 OsTracePrint( KPwrStateTransition | KQos, (TUint8*) |
|
557 ("UMAC: WlanDynamicPowerModeMgmtCntx::FreezeTrafficOverride: ignore traffic: %d"), |
|
558 iIgnoreTraffic[accessCategory] ); |
|
559 } |
|
560 #endif // !NDEBUG |
|
561 } |
|
562 |
|
563 // --------------------------------------------------------------------------- |
|
564 // |
|
565 // --------------------------------------------------------------------------- |
|
566 // |
|
567 void WlanDynamicPowerModeMgmtCntx::RegisterToLightPsTimeout() |
|
568 { |
|
569 if ( !( iFlags & KToLightPsTimerStarted ) ) |
|
570 { |
|
571 iFlags |= KToLightPsTimerStarted; |
|
572 |
|
573 iWlanContextImpl.iUmac.RegisterTimeout( |
|
574 iToLightPsTimeout, |
|
575 EWlanActiveToLightPsTimer ); |
|
576 } |
|
577 else |
|
578 { |
|
579 // timer already running; no action needed |
|
580 } |
|
581 } |
|
582 |
|
583 // --------------------------------------------------------------------------- |
|
584 // |
|
585 // --------------------------------------------------------------------------- |
|
586 // |
|
587 void WlanDynamicPowerModeMgmtCntx::RegisterToActiveTimeout() |
|
588 { |
|
589 if ( !( iFlags & KToActiveTimerStarted ) ) |
|
590 { |
|
591 iFlags |= KToActiveTimerStarted; |
|
592 |
|
593 iWlanContextImpl.iUmac.RegisterTimeout( |
|
594 iToActiveTimeout, |
|
595 EWlanLightPsToActiveTimer ); |
|
596 } |
|
597 else |
|
598 { |
|
599 // timer already running; no action needed |
|
600 } |
|
601 } |
|
602 |
|
603 // --------------------------------------------------------------------------- |
|
604 // |
|
605 // --------------------------------------------------------------------------- |
|
606 // |
|
607 void WlanDynamicPowerModeMgmtCntx::RegisterToDeepPsTimeout() |
|
608 { |
|
609 if ( !( iFlags & KToDeepPsTimerStarted ) ) |
|
610 { |
|
611 iFlags |= KToDeepPsTimerStarted; |
|
612 |
|
613 iWlanContextImpl.iUmac.RegisterTimeout( |
|
614 iToDeepPsTimeout, |
|
615 EWlanLightPsToDeepPsTimer ); |
|
616 } |
|
617 else |
|
618 { |
|
619 // timer already running; no action needed |
|
620 } |
|
621 } |
|
622 |
|
623 // --------------------------------------------------------------------------- |
|
624 // |
|
625 // --------------------------------------------------------------------------- |
|
626 // |
|
627 void WlanDynamicPowerModeMgmtCntx::CancelToLightPsTimeout() |
|
628 { |
|
629 if ( iFlags & KToLightPsTimerStarted ) |
|
630 { |
|
631 iFlags &= ~KToLightPsTimerStarted; |
|
632 iWlanContextImpl.iUmac.CancelTimeout( EWlanActiveToLightPsTimer ); |
|
633 } |
|
634 } |
|
635 |
|
636 // --------------------------------------------------------------------------- |
|
637 // |
|
638 // --------------------------------------------------------------------------- |
|
639 // |
|
640 void WlanDynamicPowerModeMgmtCntx::CancelToActiveTimeout() |
|
641 { |
|
642 if ( iFlags & KToActiveTimerStarted ) |
|
643 { |
|
644 iFlags &= ~KToActiveTimerStarted; |
|
645 iWlanContextImpl.iUmac.CancelTimeout( EWlanLightPsToActiveTimer ); |
|
646 } |
|
647 } |
|
648 |
|
649 // --------------------------------------------------------------------------- |
|
650 // |
|
651 // --------------------------------------------------------------------------- |
|
652 // |
|
653 void WlanDynamicPowerModeMgmtCntx::CancelToDeepPsTimeout() |
|
654 { |
|
655 if ( iFlags & KToDeepPsTimerStarted ) |
|
656 { |
|
657 iFlags &= ~KToDeepPsTimerStarted; |
|
658 iWlanContextImpl.iUmac.CancelTimeout( EWlanLightPsToDeepPsTimer ); |
|
659 } |
|
660 } |