1 /* |
1 /* |
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
64 * Determines the need to make a power mode transition |
64 * Determines the need to make a power mode transition |
65 * |
65 * |
66 * @since S60 3.1 |
66 * @since S60 3.1 |
67 * @param aQueueId Id of the queue/AC via which the frame will be transmitted |
67 * @param aQueueId Id of the queue/AC via which the frame will be transmitted |
68 * @param aEtherType Ethernet type of the frame |
68 * @param aEtherType Ethernet type of the frame |
|
69 * @param aDot11FrameType 802.11 frame type |
69 * @return To which power management mode to change; if any at all |
70 * @return To which power management mode to change; if any at all |
70 */ |
71 */ |
71 TPowerMgmtModeChange OnFrameTx( |
72 TPowerMgmtModeChange OnFrameTx( |
72 WHA::TQueueId aQueueId, |
73 WHA::TQueueId aQueueId, |
73 TUint16 aEtherType ); |
74 TUint16 aEtherType, |
|
75 T802Dot11FrameControlTypeMask aDot11FrameType ); |
74 |
76 |
75 /** |
77 /** |
76 * To be called when accepting an Rx frame |
78 * To be called when accepting an Rx frame |
77 * |
79 * |
78 * @since S60 3.1 |
80 * @since S60 3.1 |
86 WHA::TQueueId aAccessCategory, |
88 WHA::TQueueId aAccessCategory, |
87 TUint16 aEtherType, |
89 TUint16 aEtherType, |
88 TUint aPayloadLength, |
90 TUint aPayloadLength, |
89 TDaType aDaType ); |
91 TDaType aDaType ); |
90 |
92 |
|
93 /** |
|
94 * To be called upon receiving the PS Mode Error indication |
|
95 * Determines the need to make a power mode transition |
|
96 * |
|
97 * @return To which power management mode to change; if any at all |
|
98 */ |
|
99 TPowerMgmtModeChange OnPsModeErrorIndication(); |
|
100 |
91 /** |
101 /** |
92 * To be called upon Active to Light PS timer timeout |
102 * To be called upon Active to Light PS timer timeout |
93 * |
103 * |
94 * @since S60 v5.1 |
104 * @since S60 v5.1 |
95 * @return ETrue if power mode transition should be done, |
105 * @return ETrue if power mode transition should be done, |
320 * |
336 * |
321 * @since S60 3.1 |
337 * @since S60 3.1 |
322 * @return ETrue if Background AC traffic shall be ignored |
338 * @return ETrue if Background AC traffic shall be ignored |
323 */ |
339 */ |
324 inline TBool StayInPsDespiteLegacyBackgroundTraffic() const; |
340 inline TBool StayInPsDespiteLegacyBackgroundTraffic() const; |
325 |
341 |
|
342 /** |
|
343 * Sets special parameters for the Active mode. |
|
344 * To be used when switching to Active upen receiving PsModeError |
|
345 * indication from WHA layer. |
|
346 * The Wlan Mgmt Client provided Active mode parameters can be restored |
|
347 * with RestoreActiveModeParameters() |
|
348 */ |
|
349 inline void SetPsModeErrorActiveModeParameters(); |
|
350 |
|
351 /** |
|
352 * Sets special parameters for the Active mode. |
|
353 * To be used when switching to Active upon transmitting our keep alive |
|
354 * frame or an ARP frame. |
|
355 * The Wlan Mgmt Client provided Active mode parameters can be restored |
|
356 * with RestoreActiveModeParameters() |
|
357 */ |
|
358 inline void SetKeepAliveActiveModeParameters(); |
|
359 |
326 // Prohibit copy constructor |
360 // Prohibit copy constructor |
327 WlanDynamicPowerModeMgmtCntx( |
361 WlanDynamicPowerModeMgmtCntx( |
328 const WlanDynamicPowerModeMgmtCntx& ); |
362 const WlanDynamicPowerModeMgmtCntx& ); |
329 // Prohibit assigment operator |
363 // Prohibit assigment operator |
330 WlanDynamicPowerModeMgmtCntx& operator= |
364 WlanDynamicPowerModeMgmtCntx& operator= |
331 ( const WlanDynamicPowerModeMgmtCntx& ); |
365 ( const WlanDynamicPowerModeMgmtCntx& ); |
332 |
366 |
333 private: // Data |
367 private: // Data |
334 |
368 |
|
369 /** for backing up the parameters related to Active mode */ |
|
370 struct SActiveParamsBackup |
|
371 { |
|
372 TUint32 iToLightPsTimeout; |
|
373 TUint16 iToLightPsFrameThreshold; |
|
374 TUint16 iUapsdRxFrameLengthThreshold; |
|
375 }; |
|
376 |
335 /** flag value to store state transition need internally */ |
377 /** flag value to store state transition need internally */ |
336 TBool iStateChange; |
378 TBool iStateChange; |
337 /** stores the flags defined below */ |
379 /** stores the flags defined below */ |
338 TUint32 iFlags; |
380 TUint32 iFlags; |
339 /** |
381 /** |
381 /** ToActiveTimer started */ |
423 /** ToActiveTimer started */ |
382 static const TUint32 KToActiveTimerStarted = ( 1 << 9 ); |
424 static const TUint32 KToActiveTimerStarted = ( 1 << 9 ); |
383 /** ToDeepPsTimer started */ |
425 /** ToDeepPsTimer started */ |
384 static const TUint32 KToDeepPsTimerStarted = ( 1 << 10 ); |
426 static const TUint32 KToDeepPsTimerStarted = ( 1 << 10 ); |
385 |
427 |
386 // time interval in microseconds after which transition from Active |
428 /** |
387 // mode to Light PS mode is considered. |
429 * time interval in microseconds after which transition from Active |
|
430 * mode to Light PS mode is considered. |
|
431 */ |
388 TUint32 iToLightPsTimeout; |
432 TUint32 iToLightPsTimeout; |
389 |
433 |
390 // time interval in microseconds after which the frame counter |
434 /** |
391 // used when considering transition from Light PS to Active mode is reset. |
435 * time interval in microseconds after which the frame counter |
|
436 * used when considering transition from Light PS to Active mode is reset. |
|
437 */ |
392 TUint32 iToActiveTimeout; |
438 TUint32 iToActiveTimeout; |
393 |
439 |
394 // time interval in microseconds after which transition from Light PS |
440 /** |
395 // mode to Deep PS mode is considered. |
441 * time interval in microseconds after which transition from Light PS |
|
442 * mode to Deep PS mode is considered. |
|
443 */ |
396 TUint32 iToDeepPsTimeout; |
444 TUint32 iToDeepPsTimeout; |
397 |
445 |
|
446 /** for backing up the parameters related to Active mode */ |
|
447 SActiveParamsBackup iActiveParamsBackup; |
|
448 |
398 /** currently active power management mode context */ |
449 /** currently active power management mode context */ |
399 WlanPowerModeMgrBase* iActiveCntx; |
450 WlanPowerModeMgrBase* iActiveCntx; |
400 /** context for active mode */ |
451 /** context for active mode */ |
401 WlanActiveModePowerModeMgr iActiveModeCntx; |
452 WlanActiveModePowerModeMgr iActiveModeCntx; |
402 /** context for Light PS mode */ |
453 /** context for Light PS mode */ |