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