|
1 /* |
|
2 * Copyright (c) 2002-2007 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 WlanDot11InfrastructureModeInit class |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 22 % |
|
20 */ |
|
21 |
|
22 #ifndef WLANDOT11INFRASTRUCTUREMODEINIT_H |
|
23 #define WLANDOT11INFRASTRUCTUREMODEINIT_H |
|
24 |
|
25 #include "UmacDot11InfrastructureMode.h" |
|
26 |
|
27 /** |
|
28 * Initialization state for infrastructure mode |
|
29 * |
|
30 * @lib wlanumac.lib |
|
31 * @since S60 v3.1 |
|
32 */ |
|
33 class WlanDot11InfrastructureModeInit : public WlanDot11InfrastructureMode |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 /** |
|
39 * C++ default constructor. |
|
40 */ |
|
41 WlanDot11InfrastructureModeInit() : |
|
42 iFlags( 0 ), |
|
43 iState( EINIT ), |
|
44 iDtim( 0 ), |
|
45 iMibMemoryBuffer ( NULL ) {}; |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 virtual ~WlanDot11InfrastructureModeInit(); |
|
51 |
|
52 private: |
|
53 |
|
54 // events for the FSM |
|
55 enum TEvent |
|
56 { |
|
57 ESTATEENTRY, // state entry action to be executed |
|
58 // underlying sw layer tx delivery complete event |
|
59 ETXCOMPLETE, |
|
60 EBEACONPROCESSED, // beacon parsed for elements |
|
61 EUSERDATAENABLE, // protocol stack side datapath enabled |
|
62 EABORT, // abort fsm event |
|
63 EEVENTMAX // defined as an upper bound |
|
64 }; |
|
65 |
|
66 // states of the FSM |
|
67 enum TState |
|
68 { |
|
69 EINIT, // start state of the state machine |
|
70 EENABLEBEACONRX, // enable beacon reception |
|
71 ESETNULLDATAFRAMETEMPLATE, // set NULL data frame template |
|
72 ESETQOSNULLDATAFRAMETEMPLATE, // set QoS NULL data frame template |
|
73 ESETPSPOLLTEMPLATE, // set ps poll frame template |
|
74 EWAIT4BEACON, // wait 4 beacon state |
|
75 EDISABLEBEACONRX, // disable beacon reception |
|
76 ESETBSSPARAMS, // set BSS parameters |
|
77 ECONFBEACONFILTERIETABLE, // configure beacon filter IE table |
|
78 EWAIT4USERDATAENABLE, // wait 4 EUSERDATAENABLE event |
|
79 // junction state prior moving to dot11awakemode |
|
80 // or dot11enterdozemode dot11 state |
|
81 ECONTINUEDOT11TRAVERSE, |
|
82 ESTATEMAX // defined as an upper bound |
|
83 }; |
|
84 |
|
85 /** |
|
86 * ?member_description. |
|
87 * @since S60 3.1 |
|
88 * @param ?arg1 ?description |
|
89 * @return ?description |
|
90 */ |
|
91 void EnableBeaconRx( WlanContextImpl& aCtxImpl ); |
|
92 |
|
93 /** |
|
94 * ?member_description. |
|
95 * @since S60 3.1 |
|
96 * @param ?arg1 ?description |
|
97 * @return ?description |
|
98 */ |
|
99 void DisableBeaconRx( WlanContextImpl& aCtxImpl ); |
|
100 |
|
101 /** |
|
102 * ?member_description. |
|
103 * @since S60 3.1 |
|
104 * @param ?arg1 ?description |
|
105 * @return ?description |
|
106 */ |
|
107 void SetNullDataFrameTemplate( WlanContextImpl& aCtxImpl ); |
|
108 |
|
109 /** |
|
110 * ?member_description. |
|
111 * @since S60 3.1 |
|
112 * @param ?arg1 ?description |
|
113 * @return ?description |
|
114 */ |
|
115 void SetQosNullDataFrameTemplate( WlanContextImpl& aCtxImpl ); |
|
116 |
|
117 /** |
|
118 * ?member_description. |
|
119 * @since S60 3.1 |
|
120 * @param ?arg1 ?description |
|
121 * @return ?description |
|
122 */ |
|
123 void SetPsPollFrameTemplate( WlanContextImpl& aCtxImpl ); |
|
124 |
|
125 /** |
|
126 * ?member_description. |
|
127 * @since S60 3.1 |
|
128 * @param ?arg1 ?description |
|
129 * @return ?description |
|
130 */ |
|
131 void SetBssParams( WlanContextImpl& aCtxImpl ); |
|
132 |
|
133 /** |
|
134 * ?member_description. |
|
135 * @since S60 3.1 |
|
136 * @param ?arg1 ?description |
|
137 * @return ?description |
|
138 */ |
|
139 void ConfigureBeaconFilterIeTable( WlanContextImpl& aCtxImpl ); |
|
140 |
|
141 /** |
|
142 * ?member_description. |
|
143 * @since S60 3.1 |
|
144 * @param ?arg1 ?description |
|
145 * @return ?description |
|
146 */ |
|
147 inline void ChangeInternalState( |
|
148 WlanContextImpl& aCtxImpl, |
|
149 TState aNewState ); |
|
150 |
|
151 /** |
|
152 * ?member_description. |
|
153 * @since S60 3.1 |
|
154 * @param ?arg1 ?description |
|
155 * @return ?description |
|
156 */ |
|
157 void Fsm( |
|
158 WlanContextImpl& aCtxImpl, |
|
159 TEvent aEvent ); |
|
160 |
|
161 /** |
|
162 * ?member_description. |
|
163 * @since S60 3.1 |
|
164 * @param ?arg1 ?description |
|
165 * @return ?description |
|
166 */ |
|
167 void OnStateEntryEvent( WlanContextImpl& aCtxImpl ); |
|
168 |
|
169 /** |
|
170 * ?member_description. |
|
171 * @since S60 3.1 |
|
172 * @param ?arg1 ?description |
|
173 * @return ?description |
|
174 */ |
|
175 void OnTxCompleteEvent( WlanContextImpl& aCtxImpl ); |
|
176 |
|
177 /** |
|
178 * ?member_description. |
|
179 * @since S60 3.1 |
|
180 * @param ?arg1 ?description |
|
181 * @return ?description |
|
182 */ |
|
183 void OnBeaconProcessedEvent( WlanContextImpl& aCtxImpl ); |
|
184 |
|
185 /** |
|
186 * ?member_description. |
|
187 * @since S60 3.1 |
|
188 * @param ?arg1 ?description |
|
189 * @return ?description |
|
190 */ |
|
191 void OnUserDataEnableEvent( WlanContextImpl& aCtxImpl ); |
|
192 |
|
193 /** |
|
194 * |
|
195 * |
|
196 * @since S60 3.1 |
|
197 * @param ?arg1 ?description |
|
198 * @param ?arg2 ?description |
|
199 */ |
|
200 void OnAbortEvent( WlanContextImpl& aCtxImpl ); |
|
201 |
|
202 /** |
|
203 * ?member_description. |
|
204 * @since S60 3.1 |
|
205 * @param ?arg1 ?description |
|
206 * @return ?description |
|
207 */ |
|
208 void ContinueDot11StateTraversal( WlanContextImpl& aCtxImpl ); |
|
209 |
|
210 /** |
|
211 * |
|
212 * |
|
213 * @since S60 3.1 |
|
214 * @param ?arg1 ?description |
|
215 * @param ?arg2 ?description |
|
216 */ |
|
217 void CompleteConnectRequest( |
|
218 WlanContextImpl& aCtxImpl, |
|
219 TInt aCompletionCode ) const; |
|
220 |
|
221 /** |
|
222 * From |
|
223 * @since S60 3.1 |
|
224 * @param ?arg1 ?description |
|
225 */ |
|
226 #ifndef NDEBUG |
|
227 virtual const TInt8* GetStateName( TUint8& aLength ) const; |
|
228 #endif // !NDEBUG |
|
229 |
|
230 /** |
|
231 * From |
|
232 * @since S60 3.1 |
|
233 * @param aCtxImpl Global state machine context |
|
234 */ |
|
235 virtual void Entry( WlanContextImpl& aCtxImpl ); |
|
236 |
|
237 /** |
|
238 * From |
|
239 * @since S60 3.1 |
|
240 * @param aCtxImpl Global state machine context |
|
241 */ |
|
242 virtual void Exit( WlanContextImpl& aCtxImpl ); |
|
243 |
|
244 /** |
|
245 * From |
|
246 * @since S60 3.1 |
|
247 * @param aCtxImpl Global state machine context |
|
248 */ |
|
249 virtual TBool EnableUserData( WlanContextImpl& aCtxImpl ); |
|
250 |
|
251 /** |
|
252 * Scan all available networks. |
|
253 * This SW module decides is background scan or foreground scan used |
|
254 * @param aCtxImpl statemachine context |
|
255 * @param aMode passive or active scan see #TScanMode |
|
256 * @param aSSID Network that APs are scanned. Can be broadcast SSID. |
|
257 * @param aScanRate Rate that is used in active scanning |
|
258 * @param aMinChannelTime min. time to listen beacons/probe responses on |
|
259 * a channel |
|
260 * @param aMaxChannelTime max. time to listen beacons/probe responses on |
|
261 * a channel |
|
262 * @param aSplitScan if ETrue, use split scan |
|
263 * @return KErrNone = command completed successfully, |
|
264 * any other = failure |
|
265 */ |
|
266 virtual TBool RealScan( |
|
267 WlanContextImpl& aCtxImpl, |
|
268 TScanMode aMode, |
|
269 const TSSID& aSSID, |
|
270 TUint32 aScanRate, |
|
271 SChannels& aChannels, |
|
272 TUint32 aMinChannelTime, |
|
273 TUint32 aMaxChannelTime, |
|
274 TBool aSplitScan ); |
|
275 |
|
276 /** |
|
277 * Called upon receiving a beacon type frame |
|
278 * |
|
279 * @param aCtxImpl statemachine context |
|
280 * @param aRcpi RCPI of the frame |
|
281 * @param aBuffer pointer to the beginning of the Rx buffer allocated |
|
282 * for the frame |
|
283 */ |
|
284 virtual void OnBeaconFrameRx( |
|
285 WlanContextImpl& aCtxImpl, |
|
286 const TAny* aFrame, |
|
287 const TUint32 aLength, |
|
288 WHA::TRcpi aRcpi, |
|
289 TUint8* aBuffer ); |
|
290 |
|
291 // Prohibit copy constructor |
|
292 WlanDot11InfrastructureModeInit( |
|
293 const WlanDot11InfrastructureModeInit& ); |
|
294 // Prohibit assigment operator |
|
295 WlanDot11InfrastructureModeInit& operator= ( |
|
296 const WlanDot11InfrastructureModeInit& ); |
|
297 |
|
298 private: // Data |
|
299 |
|
300 /** event flags */ |
|
301 TUint32 iFlags; |
|
302 /** current state */ |
|
303 TState iState; |
|
304 /** DTIM */ |
|
305 TUint iDtim; |
|
306 |
|
307 // pointer to memory buffer used for mib writing |
|
308 TAny* iMibMemoryBuffer; |
|
309 |
|
310 #ifndef NDEBUG |
|
311 /** max length of state name for tracing */ |
|
312 enum { KMaxStateStringLength = 50 }; |
|
313 /** max length of event name for tracing */ |
|
314 enum { KMaxEventStringLength = KMaxStateStringLength }; |
|
315 |
|
316 /** state names for tracing */ |
|
317 static const TUint8 iStateName[ESTATEMAX][KMaxStateStringLength]; |
|
318 /** event names for tracing */ |
|
319 static const TUint8 iEventName[EEVENTMAX][KMaxEventStringLength]; |
|
320 /** name of the state */ |
|
321 static const TInt8 iName[]; |
|
322 #endif |
|
323 }; |
|
324 |
|
325 #endif // WLANDOT11INFRASTRUCTUREMODEINIT_H |
|
326 |