|
1 /* |
|
2 * Copyright (c) 2008-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: Declaration of the WlanLightPsModePowerModeMgr class |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 3 % |
|
20 */ |
|
21 |
|
22 #ifndef WLAN_LIGHT_PS_MODE_POWER_MODE_MGR |
|
23 #define WLAN_LIGHT_PS_MODE_POWER_MODE_MGR |
|
24 |
|
25 #include "umacpowermodemgrbase.h" |
|
26 |
|
27 class WlanContextImpl; |
|
28 |
|
29 /** |
|
30 * Class implementing infrastructure mode dynamic power mode management |
|
31 * algorithm for Light PS mode |
|
32 */ |
|
33 class WlanLightPsModePowerModeMgr : public WlanPowerModeMgrBase |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 /** Ctor */ |
|
39 WlanLightPsModePowerModeMgr(); |
|
40 |
|
41 /** Dtor */ |
|
42 virtual ~WlanLightPsModePowerModeMgr(); |
|
43 |
|
44 /** |
|
45 * Sets the dynamic power mode transition algorithm parameters |
|
46 * |
|
47 * @since S60 5.1 |
|
48 * @param aToActiveFrameThreshold frame count threshold for changing to |
|
49 * active mode |
|
50 * @param aToDeepPsFrameThreshold frame count threshold for changing to |
|
51 * Deep PS mode |
|
52 * @param aUapsdRxFrameLengthThreshold received frame |
|
53 * payload length (in bytes) threshold in U-APSD network |
|
54 */ |
|
55 inline void SetParameters( |
|
56 TUint aToActiveFrameThreshold, |
|
57 TUint aToDeepPsFrameThreshold, |
|
58 TUint16 aUapsdRxFrameLengthThreshold ); |
|
59 |
|
60 /** |
|
61 * To be called when transmitting a frame |
|
62 * |
|
63 * @since S60 5.1 |
|
64 * Determines the need to make a power mode transition |
|
65 * @param aCtxImpl global statemachine context |
|
66 * @param aQueueId Id of the queue/AC via which the frame will be transmitted |
|
67 * @param aEtherType Ethernet type of the frame |
|
68 * @param aIgnoreThisFrame shall this frame be ignored from dynamic power |
|
69 * mode management perspective |
|
70 * @return To which power management mode to change; if any at all |
|
71 */ |
|
72 virtual TPowerMgmtModeChange OnFrameTx( |
|
73 WlanContextImpl& aCtxImpl, |
|
74 WHA::TQueueId aQueueId, |
|
75 TUint16 aEtherType, |
|
76 TBool aIgnoreThisFrame ); |
|
77 |
|
78 /** |
|
79 * To be called when accepting an Rx frame |
|
80 * |
|
81 * @since S60 5.1 |
|
82 * @param aCtxImpl global statemachine context |
|
83 * @param aAccessCategory AC/Queue via which the frame has beeen transmitted |
|
84 * @param aEtherType Ethernet type of the received frame |
|
85 * @param aIgnoreThisFrame shall this frame be ignored from dynamic power |
|
86 * mode management perspective |
|
87 * @param aPayloadLength length of the ethernet frame payload |
|
88 * @param aDaType DA type (Unicast, Multicast or Broadcast) of the frame |
|
89 * @return To which power management mode to change; if any at all |
|
90 */ |
|
91 virtual TPowerMgmtModeChange OnFrameRx( |
|
92 WlanContextImpl& aCtxImpl, |
|
93 WHA::TQueueId aAccessCategory, |
|
94 TUint16 aEtherType, |
|
95 TBool aIgnoreThisFrame, |
|
96 TUint aPayloadLength, |
|
97 TDaType aDaType ); |
|
98 |
|
99 /** |
|
100 * From WlanPowerModeMgrBase |
|
101 * To be called upon Light PS to Active timer timeout |
|
102 * |
|
103 * @since S60 5.1 |
|
104 * @param aCtxImpl global statemachine context |
|
105 * @return ETrue if power mode transition should be done, |
|
106 * EFalse otherwise |
|
107 */ |
|
108 virtual TBool OnLightPsToActiveTimerTimeout( WlanContextImpl& aCtxImpl ); |
|
109 |
|
110 /** |
|
111 * From WlanPowerModeMgrBase |
|
112 * To be called upon Light PS to Deep PS timer timeout |
|
113 * |
|
114 * @since S60 5.1 |
|
115 * @return ETrue if power mode transition should be done, |
|
116 * EFalse otherwise |
|
117 */ |
|
118 virtual TBool OnLightPsToDeepPsTimerTimeout(); |
|
119 |
|
120 /** |
|
121 * From WlanPowerModeMgrBase |
|
122 * Resets the state of the object |
|
123 * |
|
124 * @since S60 5.1 |
|
125 */ |
|
126 virtual void DoReset(); |
|
127 |
|
128 private: // Methods |
|
129 |
|
130 // Prohibit copy constructor |
|
131 WlanLightPsModePowerModeMgr( const WlanLightPsModePowerModeMgr& ); |
|
132 // Prohibit assigment operator |
|
133 WlanLightPsModePowerModeMgr& operator= ( |
|
134 const WlanLightPsModePowerModeMgr& ); |
|
135 |
|
136 private: // Data |
|
137 |
|
138 /** |
|
139 * Rx/Tx frame counter used when considering change to |
|
140 * Active mode |
|
141 */ |
|
142 TUint iToActiveFrameCount; |
|
143 |
|
144 /** |
|
145 * Rx/Tx frame count threshold used when considering change to |
|
146 * Active mode |
|
147 */ |
|
148 TUint iToActiveFrameThreshold; |
|
149 |
|
150 /** |
|
151 * Rx/Tx frame counter used when considering change to |
|
152 * Deep PS mode |
|
153 */ |
|
154 TUint iToDeepPsFrameCount; |
|
155 |
|
156 /** |
|
157 * Rx/Tx frame count threshold used when considering change to |
|
158 * Deep PS mode |
|
159 */ |
|
160 TUint iToDeepPsFrameThreshold; |
|
161 }; |
|
162 |
|
163 #include "umaclightpsmodepowermodemgr.inl" |
|
164 |
|
165 #endif // WLAN_LIGHT_PS_MODE_POWER_MODE_MGR |