|
1 /* |
|
2 * Copyright (c) 2002-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 WlanDot11InfrastructureMode class |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 34 % |
|
20 */ |
|
21 |
|
22 #ifndef WLANDOT11INFRASTRUCTUREMODE_H |
|
23 #define WLANDOT11INFRASTRUCTUREMODE_H |
|
24 |
|
25 #include "UmacDot11Associated.h" |
|
26 |
|
27 class WlanElementLocator; |
|
28 |
|
29 /** |
|
30 * This is a state where STA has succesfully |
|
31 * authenticated and associated to a infrastructuremode network |
|
32 */ |
|
33 class WlanDot11InfrastructureMode : public WlanDot11Associated |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Connect (authenticate and associate) to a BSS. |
|
39 * As we are already connected, this means actually roaming. |
|
40 * |
|
41 * @since S60 3.1 |
|
42 * @param aCtxImpl statemachine context |
|
43 * @param aSSID Name of the network |
|
44 * @param aBSSID BSSID of the access point |
|
45 * @param aAuthAlgorithmNbr Authentication algorithm number to be used |
|
46 * @param aEncryptionStatus Used encryption level |
|
47 * @param aIsInfra ETrue when connecting to infrastructure network |
|
48 * @param aScanResponseFrameBodyLength length of the scan response frame body |
|
49 * @param aScanResponseFrameBody scan response frame body |
|
50 * @param aIeData The IE(s) to be included into the (re-)association request. |
|
51 * NULL, if none to be included |
|
52 * @param aIeDataLength Length of the IE(s) to be included into the |
|
53 * (re-)association request |
|
54 * @return ETrue if a state transition occurred |
|
55 * EFalse otherwise |
|
56 */ |
|
57 virtual TBool Connect( |
|
58 WlanContextImpl& aCtxImpl, |
|
59 const TSSID& aSSID, |
|
60 const TMacAddress& aBSSID, |
|
61 TUint16 aAuthAlgorithmNbr, |
|
62 TEncryptionStatus aEncryptionStatus, |
|
63 TBool aIsInfra, |
|
64 TUint16 aScanResponseFrameBodyLength, |
|
65 const TUint8* aScanResponseFrameBody, |
|
66 const TUint8* aIeData, |
|
67 TUint16 aIeDataLength ); |
|
68 |
|
69 /** |
|
70 * Connect (authenticate and associate) to a BSS. |
|
71 * As we are already connected, this means actually roaming. |
|
72 * |
|
73 * @since S60 3.1 |
|
74 * @param aCtxImpl statemachine context |
|
75 * @param aSSID Name of the network. |
|
76 * @param aBSSID BSSID of the access point. |
|
77 * @param aAuthAlgorithmNbr Authentication algorithm number to be used |
|
78 * @param aEncryptionStatus Used encryption level. |
|
79 * @return KErrNone = command completed successfully, |
|
80 * any other = failure |
|
81 */ |
|
82 TBool Connect( |
|
83 WlanContextImpl& aCtxImpl, |
|
84 const TSSID& aSSID, |
|
85 const TMacAddress& aBSSID, |
|
86 TUint16 aAuthAlgorithmNbr, |
|
87 TEncryptionStatus aEncryptionStatus ); |
|
88 |
|
89 protected: |
|
90 |
|
91 /** |
|
92 * C++ default constructor. |
|
93 */ |
|
94 WlanDot11InfrastructureMode() {}; |
|
95 |
|
96 /** |
|
97 * Destructor. |
|
98 */ |
|
99 virtual ~WlanDot11InfrastructureMode() {}; |
|
100 |
|
101 virtual void DoSetTxMpduDaAddress( |
|
102 SDataFrameHeader& aDataFrameHeader, |
|
103 const TMacAddress& aMac ) const; |
|
104 |
|
105 virtual TBool DoIsRxFrameSAourAddress( |
|
106 WlanContextImpl& aCtxImpl, |
|
107 const SDataFrameHeader& aFrameHeader, |
|
108 const SAmsduSubframeHeader* aSubFrameHeader ) const; |
|
109 |
|
110 virtual TBool DoIsValidAddressBitCombination( |
|
111 const SDataFrameHeader& aFrameHeader ) const; |
|
112 |
|
113 virtual void DoBuildEthernetFrame( |
|
114 TDataBuffer& aBuffer, |
|
115 const SDataMpduHeader& aDot11DataMpdu, |
|
116 const TUint8* aStartOfEtherPayload, |
|
117 TUint aEtherPayloadLength, |
|
118 TBool aAmsdu, |
|
119 TUint8* aCopyBuffer ); |
|
120 |
|
121 /** |
|
122 * Indicates Consecutive 802.11 Power Management Mode Set Failures |
|
123 * to WLAN Mgmt Client; if necessary |
|
124 * |
|
125 * @since S60 5.0 |
|
126 * @param aCtxImpl global statemachine context |
|
127 */ |
|
128 virtual void DoConsecutivePwrModeSetFailuresIndication( |
|
129 WlanContextImpl& aCtxImpl ); |
|
130 |
|
131 private: |
|
132 |
|
133 /** |
|
134 * Set trigger level for RCPI trigger. |
|
135 * @param aCtxImpl statemachine context |
|
136 * @param aRcpiTrigger RCPI trigger level |
|
137 * @return ETrue if a state change occurred in the state machine |
|
138 * EFalse otherwise |
|
139 */ |
|
140 virtual TBool SetRcpiTriggerLevel( |
|
141 WlanContextImpl& aCtxImpl, |
|
142 TUint32 aRcpiTrigger); |
|
143 |
|
144 /** |
|
145 * Updates the RCPI Trigger Level MIB |
|
146 * |
|
147 * @since Series 60 3.1 |
|
148 * @param aCtxImpl Global statemachine context |
|
149 * @param aRcpiTrigger the value to assign to the MIB |
|
150 * @param aCompleteManagementRequest ETrue if this request came from the |
|
151 * WLAN Mgmt client and that request |
|
152 * needs to be completed. |
|
153 * EFalse otherwise. |
|
154 * @return ETrue if state transition occurred, EFalse otherwise |
|
155 */ |
|
156 virtual TBool SetRcpiTriggerLevelMib( |
|
157 WlanContextImpl& aCtxImpl, |
|
158 TUint32 aRcpiTrigger, |
|
159 TBool aCompleteManagementRequest ); |
|
160 |
|
161 /** |
|
162 * Validates our current ERP parameters |
|
163 * |
|
164 * @param aCtxImpl statemachine context |
|
165 * @param aElementLocator |
|
166 */ |
|
167 void ValidateErpParams( |
|
168 WlanContextImpl& aCtxImpl, |
|
169 WlanElementLocator& aElementLocator ); |
|
170 |
|
171 /** |
|
172 * Validates our current QoS AC parameters |
|
173 * |
|
174 * @param aCtxImpl statemachine context |
|
175 * @param aElementLocator |
|
176 */ |
|
177 void ValidateAcParams( |
|
178 WlanContextImpl& aCtxImpl, |
|
179 WlanElementLocator& aElementLocator ); |
|
180 |
|
181 /** |
|
182 * Validates our current HT operation parameters |
|
183 * |
|
184 * @param aCtxImpl statemachine context |
|
185 * @param aElementLocator |
|
186 */ |
|
187 void ValidateHtBssOperationParams( |
|
188 WlanContextImpl& aCtxImpl, |
|
189 WlanElementLocator& aElementLocator ); |
|
190 |
|
191 /** |
|
192 * Called upon receiving a deauthentication frame |
|
193 * @param aCtxImpl statemachine context |
|
194 * @param aBuffer pointer to the beginning of the Rx buffer allocated |
|
195 * for the frame |
|
196 */ |
|
197 virtual void OnDeauthenticateFrameRx( |
|
198 WlanContextImpl& aCtxImpl, |
|
199 TUint8* aBuffer ); |
|
200 |
|
201 /** |
|
202 * Called upon receiving a disassociation frame |
|
203 * @param aCtxImpl statemachine context |
|
204 * @param aBuffer pointer to the beginning of the Rx buffer allocated |
|
205 * for the frame |
|
206 */ |
|
207 virtual void OnDisassociateFrameRx( |
|
208 WlanContextImpl& aCtxImpl, |
|
209 TUint8* aBuffer ); |
|
210 |
|
211 /** |
|
212 * Called upon receiving a beacon type frame |
|
213 * |
|
214 * @param aCtxImpl statemachine context |
|
215 * @param aRcpi RCPI of the frame |
|
216 * @param aBuffer pointer to the beginning of the Rx buffer allocated |
|
217 * for the frame |
|
218 */ |
|
219 virtual void OnBeaconFrameRx( |
|
220 WlanContextImpl& aCtxImpl, |
|
221 const TAny* aFrame, |
|
222 const TUint32 aLength, |
|
223 WHA::TRcpi aRcpi, |
|
224 TUint8* aBuffer ); |
|
225 |
|
226 /** |
|
227 * Disconnect STA from current network. |
|
228 * @param aCtxImpl statemachine context |
|
229 * @return KErrNone = command completed successfully, |
|
230 * any other = failure |
|
231 */ |
|
232 virtual TBool Disconnect( WlanContextImpl& aCtxImpl ); |
|
233 |
|
234 /** |
|
235 * Write for management data |
|
236 * The frame to be sent needs to be in 802.3 format |
|
237 * Data is copied to NIC's Tx queue. That normally succeeds, but in |
|
238 * the event the Tx queue is full copying is deferred to a |
|
239 * more appropriate time -> TxCompleted function |
|
240 * @param aCtxImpl statemachine context |
|
241 * @param aDataBuffer meta header of the frame to be transmitted |
|
242 */ |
|
243 virtual void TxMgmtData( |
|
244 WlanContextImpl& aCtxImpl, |
|
245 TDataBuffer& aDataBuffer ); |
|
246 |
|
247 /** |
|
248 * Scan all available networks. |
|
249 * This SW module decides is background scan or foreground scan used |
|
250 * @param aCtxImpl statemachine context |
|
251 * @param aMode passive or active scan see #TScanMode |
|
252 * @param aSSID Network that APs are scanned. Can be broadcast SSID. |
|
253 * @param aScanRate Rate that is used in active scanning |
|
254 * @param aMinChannelTime min. time to listen beacons/probe responses on |
|
255 * a channel |
|
256 * @param aMaxChannelTime max. time to listen beacons/probe responses on |
|
257 * a channel |
|
258 * @param aSplitScan if ETrue, use split scan |
|
259 * @return KErrNone = command completed successfully, |
|
260 * any other = failure |
|
261 */ |
|
262 virtual TBool RealScan( |
|
263 WlanContextImpl& aCtxImpl, |
|
264 TScanMode aMode, |
|
265 const TSSID& aSSID, |
|
266 TUint32 aScanRate, |
|
267 SChannels& aChannels, |
|
268 TUint32 aMinChannelTime, |
|
269 TUint32 aMaxChannelTime, |
|
270 TBool aSplitScan ); |
|
271 |
|
272 virtual void DoRcpiIndication( |
|
273 WlanContextImpl& aCtxImpl, |
|
274 WHA::TRcpi aRcpi ); |
|
275 |
|
276 /** |
|
277 * Indicates that the WLAN device has detected problems in the power |
|
278 * save mode operation of the AP |
|
279 * |
|
280 * @param aCtxImpl global statemachine context |
|
281 */ |
|
282 virtual void DoPsModeErrorIndication( WlanContextImpl& aCtxImpl ); |
|
283 |
|
284 /** |
|
285 * Voice Call Entry timer timeout function |
|
286 * |
|
287 * @since S60 v3.2 |
|
288 * @param aCtxImpl statemachine context |
|
289 * @return ETrue if a state change occurred in the state machine |
|
290 * EFalse otherwise |
|
291 */ |
|
292 virtual TBool OnVoiceCallEntryTimerTimeout( WlanContextImpl& aCtxImpl ); |
|
293 |
|
294 /** |
|
295 * Null timer timeout function |
|
296 * |
|
297 * @since S60 v3.2 |
|
298 * @param aCtxImpl statemachine context |
|
299 * @return ETrue if a state change occurred in the state machine |
|
300 * EFalse otherwise |
|
301 */ |
|
302 virtual TBool OnNullTimerTimeout( WlanContextImpl& aCtxImpl ); |
|
303 |
|
304 /** |
|
305 * No Voice timer timeout function |
|
306 * |
|
307 * @since S60 v3.2 |
|
308 * @param aCtxImpl statemachine context |
|
309 * @return ETrue if a state change occurred in the state machine |
|
310 * EFalse otherwise |
|
311 */ |
|
312 virtual TBool OnNoVoiceTimerTimeout( WlanContextImpl& aCtxImpl ); |
|
313 |
|
314 /** |
|
315 * To be called upon Keep Alive Timer timeout |
|
316 * |
|
317 * @since S60 3.2 |
|
318 * @param aCtxImpl statemachine context |
|
319 * @return ETrue if a state change occurred in the state machine |
|
320 * EFalse otherwise |
|
321 */ |
|
322 virtual TBool OnKeepAliveTimerTimeout( WlanContextImpl& aCtxImpl ); |
|
323 |
|
324 virtual TBool OnWlanWakeUpIntervalChange( WlanContextImpl& aCtxImpl ); |
|
325 |
|
326 /** |
|
327 * Request to send a Null Data Frame |
|
328 * |
|
329 * @since S60 v3.2 |
|
330 * @param aCtxImpl statemachine context |
|
331 * @param aQosNull ETrue if a QoS Null Data frame should be transmitted |
|
332 * EFalse if a regular Null Data frame should be transmitted |
|
333 * @return ETrue if the send request was successfully submitted |
|
334 * EFalse otherwise |
|
335 */ |
|
336 virtual TBool TxNullDataFrame( |
|
337 WlanContextImpl& aCtxImpl, |
|
338 TBool aQosNull ); |
|
339 |
|
340 |
|
341 // Prohibit copy constructor. |
|
342 WlanDot11InfrastructureMode( |
|
343 const WlanDot11InfrastructureMode& ); |
|
344 // Prohibit assigment operator. |
|
345 WlanDot11InfrastructureMode& operator= ( |
|
346 const WlanDot11InfrastructureMode& ); |
|
347 }; |
|
348 |
|
349 #endif // WLANDOT11INFRASTRUCTUREMODE_H |