|
1 /* |
|
2 * Copyright (c) 2005-2008 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 WlanDot11InitPhase1 class |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 18 % |
|
20 */ |
|
21 |
|
22 #ifndef WLANDOT11INITPHASE1_H |
|
23 #define WLANDOT11INITPHASE1_H |
|
24 |
|
25 // INCLUDES |
|
26 #include "UmacDot11State.h" |
|
27 |
|
28 /** |
|
29 * This is the start (first level initialization) state of the statemachine |
|
30 */ |
|
31 class WlanDot11InitPhase1 : public WlanDot11State |
|
32 { |
|
33 // events for the FSM |
|
34 enum TEvent |
|
35 { |
|
36 ESTATEENTRY, // state entry action to be executed |
|
37 ETXCOMPLETE, // tx process complete event |
|
38 EOIDCONFIGURE, // recv: OID-configure |
|
39 EABORT, // abort event |
|
40 EEVENTMAX // defined as an upper bound |
|
41 }; |
|
42 |
|
43 // states of the FSM |
|
44 enum TState |
|
45 { |
|
46 EINIT, // start state of the fsm |
|
47 EINITILIAZE, // execute WHA-Initialize |
|
48 ECOMPLETEBOOTUP, // complete bootup oid |
|
49 EWAIT4OIDCONFIGURE, // wait 4 OID-configure |
|
50 EHANDLEOIDCONFIGURE, // handle OID-configure |
|
51 ECONFIGURE, // execute WHA-Configure |
|
52 EREADSTATIONID, // read station ID mib |
|
53 ECONFTXQUEUE, // configure tx-queue |
|
54 ECONTINUEDOT11TRAVERSE, // entry: traverse dot11 state |
|
55 ESTATEMAX // defined as an upper bound |
|
56 }; |
|
57 |
|
58 public: |
|
59 |
|
60 /** |
|
61 * C++ default constructor. |
|
62 */ |
|
63 WlanDot11InitPhase1() |
|
64 : iState( EINIT ), |
|
65 iRTSThreshold( 0 ), |
|
66 iMaxTxMSDULifetime( 0 ), iPda( NULL ), iPdaLen( 0 ) {}; |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 virtual ~WlanDot11InitPhase1(); |
|
72 |
|
73 void BootUp( |
|
74 WlanContextImpl& aCtxImpl, |
|
75 const TUint8* aPda, |
|
76 TUint32 aPdaLength, |
|
77 const TUint8* aFw, |
|
78 TUint32 aFwLength ); |
|
79 |
|
80 protected: |
|
81 |
|
82 /** |
|
83 * Returns the states name |
|
84 * @param aLength (OUT) length of the name of the state |
|
85 * @return name of the state |
|
86 */ |
|
87 #ifndef NDEBUG |
|
88 virtual const TInt8* GetStateName( TUint8& aLength ) const; |
|
89 #endif // !NDEBUG |
|
90 |
|
91 private: |
|
92 |
|
93 /** |
|
94 * State entry action |
|
95 * @param aCtxImpl statemachine context |
|
96 */ |
|
97 virtual void Entry( WlanContextImpl& aCtxImpl ); |
|
98 virtual void Exit( WlanContextImpl& aCtxImpl ); |
|
99 |
|
100 /** |
|
101 * ?member_description. |
|
102 * @since S60 3.1 |
|
103 * @param ?arg1 ?description |
|
104 * @return ?description |
|
105 */ |
|
106 inline void ChangeInternalState( |
|
107 WlanContextImpl& aCtxImpl, |
|
108 TState aNewState ); |
|
109 |
|
110 /** |
|
111 * ?member_description. |
|
112 * @since S60 3.1 |
|
113 * @param ?arg1 ?description |
|
114 * @return ?description |
|
115 */ |
|
116 void Fsm( |
|
117 WlanContextImpl& aCtxImpl, |
|
118 TEvent aEvent ); |
|
119 |
|
120 /** |
|
121 * ?member_description. |
|
122 * @since Series 60 3.1 |
|
123 * @param aCtxImpl global statemachine context |
|
124 */ |
|
125 void OnStateEntryEvent( WlanContextImpl& aCtxImpl ); |
|
126 |
|
127 /** |
|
128 * ?member_description. |
|
129 * @since Series 60 3.1 |
|
130 * @param aCtxImpl global statemachine context |
|
131 */ |
|
132 void OnTxCompleteEvent( WlanContextImpl& aCtxImpl ); |
|
133 |
|
134 /** |
|
135 * ?member_description. |
|
136 * @since S60 3.1 |
|
137 * @param aCtxImpl global statemachine context |
|
138 */ |
|
139 void OnAbortEvent( WlanContextImpl& aCtxImpl ); |
|
140 |
|
141 /** |
|
142 * ?member_description. |
|
143 * @since Series 60 3.1 |
|
144 * @param aCtxImpl global statemachine context |
|
145 */ |
|
146 void OnOIDConfigureEvent( WlanContextImpl& aCtxImpl ); |
|
147 |
|
148 /** |
|
149 * ?member_description. |
|
150 * @since Series 60 3.1 |
|
151 * @param aCtxImpl global statemachine context |
|
152 */ |
|
153 void Initialize( WlanContextImpl& aCtxImpl ); |
|
154 |
|
155 /** |
|
156 * ?member_description. |
|
157 * @since Series 60 3.1 |
|
158 * @param aCtxImpl global statemachine context |
|
159 */ |
|
160 void Configure( WlanContextImpl& aCtxImpl ); |
|
161 |
|
162 /** |
|
163 * ?member_description. |
|
164 * @since Series 60 3.1 |
|
165 * @param aCtxImpl global statemachine context |
|
166 */ |
|
167 void ReadStationID( WlanContextImpl& aCtxImpl ); |
|
168 |
|
169 /** |
|
170 * ?member_description. |
|
171 * @since Series 60 3.1 |
|
172 * @param aCtxImpl global statemachine context |
|
173 */ |
|
174 void CompleteOid( WlanContextImpl& aCtxImpl ) const; |
|
175 |
|
176 /** |
|
177 * ?member_description. |
|
178 * |
|
179 * @since Series 60 3.1 |
|
180 * @param aCtxImpl global statemachine context |
|
181 */ |
|
182 void HandleOIDConfigure( WlanContextImpl& aCtxImpl ); |
|
183 |
|
184 /** |
|
185 * ?member_description. |
|
186 * |
|
187 * @since Series 60 3.1 |
|
188 * @param aCtxImpl global statemachine context |
|
189 */ |
|
190 void ConfigureQueue( |
|
191 WlanContextImpl& aCtxImpl ); |
|
192 |
|
193 /** |
|
194 * ?member_description. |
|
195 * |
|
196 * @since Series 60 3.1 |
|
197 * @param aCtxImpl global statemachine context |
|
198 */ |
|
199 void ConfigureUmacFrameTemplates( WlanContextImpl& aCtxImpl ) const; |
|
200 |
|
201 /** |
|
202 * Configures our own HT capabilities element |
|
203 * |
|
204 * @param aCtxImpl global statemachine context |
|
205 */ |
|
206 void ConfigureOurHtCapabilitiesElement( WlanContextImpl& aCtxImpl ) const; |
|
207 // Methods from base classes |
|
208 |
|
209 /** |
|
210 * Set inital WLAN specific parameters. |
|
211 * @param aCtxImpl statemachine context |
|
212 * @param aRTSThreshold |
|
213 * Limit for packet size when to use RTS/CTS protocol. |
|
214 * @param aMaxTxMSDULifetime |
|
215 * Limit for packet size when to use RTS/CTS protocol. |
|
216 * @param aVoiceCallEntryTimeout when we are not in Voice over WLAN Call |
|
217 * state and we transmit at least aVoiceCallEntryTxThreshold |
|
218 * Voice priority frames during the time period (microseconds) |
|
219 * denoted by this parameter, we enter Voice over WLAN Call state |
|
220 * @param aVoiceCallEntryTxThreshold Threshold value for the number of |
|
221 * Voice priority Tx frames to enter Voice over WLAN Call state |
|
222 * @param aVoiceNullTimeout NULL frame sending interval during a Voice over |
|
223 * WLAN call in U-APSD power save mode |
|
224 * @param aNoVoiceTimeout after this long time of no Voice priority data |
|
225 * Tx, exit Voice over WLAN call state |
|
226 * @param aKeepAliveTimeout Keep Alive frame sending interval in |
|
227 * infrastructure mode |
|
228 * @param aSpRcpiIndicationLevel If this RCPI level is predicted to be |
|
229 * reached within the time specified by aSpTimeToCountPrediction, |
|
230 * a signal loss prediction indication is sent. |
|
231 * @param aSpTimeToCountPrediction Specifies the time (in microseconds) |
|
232 * how far into the future signal prediction is done. |
|
233 * @param aSpMinIndicationInterval The minimum time difference (in |
|
234 * microseconds) between two signal loss prediction indications. |
|
235 * @return 0 = success, any other failure |
|
236 */ |
|
237 virtual TBool Configure( |
|
238 WlanContextImpl& aCtxImpl, |
|
239 TUint32 aRTSThreshold, |
|
240 TUint32 aMaxTxMSDULifetime, |
|
241 TUint32 aVoiceCallEntryTimeout, |
|
242 TUint32 aVoiceCallEntryTxThreshold, |
|
243 TUint32 aVoiceNullTimeout, |
|
244 TUint32 aNoVoiceTimeout, |
|
245 TUint32 aKeepAliveTimeout, |
|
246 TUint32 aSpRcpiIndicationLevel, |
|
247 TUint32 aSpTimeToCountPrediction, |
|
248 TUint32 aSpMinIndicationInterval); |
|
249 |
|
250 virtual void OnWhaCommandResponse( |
|
251 WlanContextImpl& aCtxImpl, |
|
252 WHA::TCommandId aCommandId, |
|
253 WHA::TStatus aStatus, |
|
254 const WHA::UCommandResponseParams& aCommandResponseParams, |
|
255 TUint32 aAct ); |
|
256 |
|
257 /** |
|
258 * From MWlanUserEvent |
|
259 * Make system ready for unloading |
|
260 * |
|
261 * @since S60 3.1 |
|
262 */ |
|
263 virtual void FinitSystem( WlanContextImpl& aCtxImpl ); |
|
264 |
|
265 // Prohibit copy constructor. |
|
266 WlanDot11InitPhase1( const WlanDot11InitPhase1& ); |
|
267 // Prohibit assigment operator. |
|
268 WlanDot11InitPhase1& operator= ( const WlanDot11InitPhase1& ); |
|
269 |
|
270 private: // Data |
|
271 |
|
272 #ifndef NDEBUG |
|
273 /** max length of state name for tracing */ |
|
274 enum { KMaxStateStringLength = 50 }; |
|
275 /** max length of event name for tracing */ |
|
276 enum { KMaxEventStringLength = KMaxStateStringLength }; |
|
277 |
|
278 /** state names for tracing */ |
|
279 static const TUint8 iStateName[ESTATEMAX][KMaxStateStringLength]; |
|
280 /** event names for tracing */ |
|
281 static const TUint8 iEventName[EEVENTMAX][KMaxEventStringLength]; |
|
282 /** name of the state */ |
|
283 static const TInt8 iName[]; |
|
284 #endif |
|
285 |
|
286 /** current state */ |
|
287 TState iState; |
|
288 |
|
289 TUint32 iRTSThreshold; |
|
290 TUint32 iMaxTxMSDULifetime; |
|
291 |
|
292 TUint8* iPda; |
|
293 TUint32 iPdaLen; |
|
294 }; |
|
295 |
|
296 #endif // WLANDOT11INITPHASE1_H |