|
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: Handles sending management commands to drivers. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 30 % |
|
20 */ |
|
21 |
|
22 #ifndef WLANMGMTCOMMANDHANDLER_H |
|
23 #define WLANMGMTCOMMANDHANDLER_H |
|
24 |
|
25 #include "RWlanLogicalChannel.h" |
|
26 #include "umacoidmsg.h" |
|
27 #include "core_types.h" |
|
28 |
|
29 const SChannels KWlanChannels802p11bgAll = { |
|
30 0x01, |
|
31 { 0xFF, 0x1F }, |
|
32 { 0, 0, 0 }, |
|
33 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
34 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
35 0, 0, 0, 0, 0, 0 |
|
36 } }; |
|
37 |
|
38 /** |
|
39 * Callback interface |
|
40 */ |
|
41 class MWlanMgmtCommandCallback |
|
42 { |
|
43 public: |
|
44 |
|
45 virtual void OnRequestComplete( TInt status ) = 0; |
|
46 }; |
|
47 |
|
48 /** |
|
49 * CWlanMgmtCommandHandler transfers commands from WlanEngine to |
|
50 * LDD (Logical Device Driver). |
|
51 * CWlanMgmtCommandHandler implements FW (Firmware) dependent functions. |
|
52 * @since S60 v.3.0 |
|
53 * @lib wlmserversrv.lib |
|
54 */ |
|
55 NONSHARABLE_CLASS( CWlanMgmtCommandHandler ) : |
|
56 public CActive |
|
57 { |
|
58 public: // Constructors and destructor |
|
59 |
|
60 /** |
|
61 * Static constructor. |
|
62 * @param aIndPtr Interface to send indications. |
|
63 * @return Pointer to created object. |
|
64 */ |
|
65 static CWlanMgmtCommandHandler* NewL( |
|
66 RWlanLogicalChannel& aChannel, |
|
67 MWlanMgmtCommandCallback& aClient ); |
|
68 |
|
69 /** |
|
70 * Destructor. |
|
71 */ |
|
72 virtual ~CWlanMgmtCommandHandler(); |
|
73 |
|
74 /** |
|
75 * Start an own IBSS network if there doesn't already exist |
|
76 * a network that has the same name. |
|
77 * @param aSSID Name of the network. |
|
78 * @param aBeaconInterval Beacon period in TUs (kusec). |
|
79 * @param aChannel Used channel (1-11). |
|
80 * Has to be leagal at the current region. |
|
81 * @param aEncryptionStatus Used encryption level. |
|
82 */ |
|
83 void StartIBSS( |
|
84 const TSSID& aSSID, |
|
85 TUint32 aBeaconInterval, |
|
86 TUint32 aChannel, |
|
87 TEncryptionStatus aEncryptionStatus ); |
|
88 |
|
89 /** |
|
90 * Scan all available networks. WLAN driver decides is |
|
91 * background scan or foreground scan used. |
|
92 * @param aMode Passive or active. |
|
93 * @param aSSID Network that APs are scanned. Can be broadcast |
|
94 * SSID. |
|
95 * @param aScanRate Rate that is used in active scanning. |
|
96 * @param aStatus (IN/OUT)Request status. Based on active object |
|
97 * framework. |
|
98 * @param aChannels Defines the channels to scan. |
|
99 * @param aMinChannelTime Minimum time to listen for beacons/probe responses on a channel. |
|
100 * @param aMaxChannelTime Maximum time to listen for beacons/probe responses on a channel. |
|
101 * @param aIsSplitScan Whether the scan should be performed as a split-scan. |
|
102 */ |
|
103 void Scan( |
|
104 TScanMode aMode, |
|
105 const TSSID& aSSID, |
|
106 TRate aScanRate, |
|
107 const SChannels& aChannels, |
|
108 TUint32 aMinChannelTime, |
|
109 TUint32 aMaxChannelTime, |
|
110 TBool aIsSplitScan ); |
|
111 |
|
112 /** |
|
113 * Request an ongoing scan to be stopped. |
|
114 */ |
|
115 void StopScan(); |
|
116 |
|
117 /** |
|
118 * Disconnect STA from current network. |
|
119 */ |
|
120 void Disconnect(); |
|
121 |
|
122 /** |
|
123 * Set WLAN power saving mode in infrastructure networks. |
|
124 * @param aMode The power save mode to be used. |
|
125 * @param aDisableDynamicPs Disable dynamic power save management. |
|
126 * @param aWakeUpModeLight Wake-up mode in Light PS mode. |
|
127 * @param aListenIntervalLight Wake-up interval in Light PS mode. |
|
128 * @param aWakeUpModeDeep Wake-up mode in Deep PS mode. |
|
129 * @param aListenIntervalDeep Wake-up interval in Deep PS mode. |
|
130 */ |
|
131 void SetPowerMode( |
|
132 TPowerMode aMode, |
|
133 TBool aDisableDynamicPs, |
|
134 TWlanWakeUpInterval aWakeUpModeLight, |
|
135 TUint8 aListenIntervalLight, |
|
136 TWlanWakeUpInterval aWakeUpModeDeep, |
|
137 TUint8 aListenIntervalDeep ); |
|
138 |
|
139 /** |
|
140 * Set level for RCPI trigger. |
|
141 * @param aRCPITrigger RCPI level. |
|
142 */ |
|
143 void SetRCPITriggerLevel( TUint32 aRCPITrigger ); |
|
144 |
|
145 /** |
|
146 * Set transmission power level. This has to be |
|
147 * leagal at the current region. |
|
148 * @param aLevel Transmission power level in dBm. |
|
149 */ |
|
150 void SetTxPowerLevel( TUint32 aLevel ); |
|
151 |
|
152 /** |
|
153 * Initialise WLAN. |
|
154 * @param aRTSThreshold Limit for packet size when to use RTS/CTS |
|
155 * protocol. |
|
156 * @param aMaxTxMSDULifetime Max. time to (re-)send whole MSDU packet. |
|
157 * (In TUs.) |
|
158 * @param aQoSNullFrameEntryTimeout Defines the time period in microseconds which is used |
|
159 * to evaluate whether QoS NULL data frame sending should be started. |
|
160 * @param aQosNullFrameEntryTxCount Defines how many Voice AC packets must be sent during the time |
|
161 * period defined in aQoSNullFrameEntryTimeout before QoS NULL |
|
162 * data frame sending is started. |
|
163 * @param aQoSNullFrameInterval Defines how often a QoS NULL data frame is sent. |
|
164 * @param aQoSNullFrameExitTimeout Defines how soon after the last Voice AC packet |
|
165 * QoS NULL data frame sending is stopped. |
|
166 * @param aKeepAliveInterval Defines how often NULL data frames are sent |
|
167 * if there are no other frames to send. |
|
168 * @param aSpRcpiTarget Defines the signal predictor algorithm "target" RCPI value for roam indication. |
|
169 * @param aSpTimeTarget Defines the signal predictor algorithm "target" time for roam indication |
|
170 * (in microseconds). |
|
171 * @param aSpMinIndicationInterval Defines the minimum time interval for consecutive roam |
|
172 * indications from the signal predictor algorithm (in microseconds). |
|
173 */ |
|
174 void Configure( |
|
175 TUint16 aRTSThreshold, |
|
176 TUint32 aMaxTxMSDULifetime, |
|
177 TUint32 aQoSNullFrameEntryTimeout, |
|
178 TUint32 aQosNullFrameEntryTxCount, |
|
179 TUint32 aQoSNullFrameInterval, |
|
180 TUint32 aQoSNullFrameExitTimeout, |
|
181 TUint32 aKeepAliveInterval, |
|
182 TUint32 aSpRcpiTarget, |
|
183 TUint32 aSpTimeTarget, |
|
184 TUint32 aSpMinIndicationInterval ); |
|
185 |
|
186 /** |
|
187 * GetLastRCPI |
|
188 * @param aRCPI (OUT) Current RCPI. |
|
189 */ |
|
190 void GetLastRCPI( TUint32& aRCPI ); |
|
191 |
|
192 /** |
|
193 * ConfigureMulticastGroup |
|
194 * @param aJoinGroup is set true_t if adding a multicast address |
|
195 * otherwise the address will be removed. |
|
196 * @param aMulticastAddr contains the MAC address to add/remove |
|
197 */ |
|
198 void ConfigureMulticastGroup( |
|
199 TBool aJoinGroup, |
|
200 const TMacAddress& aMulticastAddr ); |
|
201 |
|
202 /** |
|
203 * Set the parameters related to BSS lost indication. |
|
204 * @param aBssLostCount The number of consecutive beacons that can be lost |
|
205 * before BSS lost is indicated. |
|
206 * @param aFailedTxCount The number of consecutive transmissions that can fail |
|
207 * before BSS lost is indicated. |
|
208 */ |
|
209 void SetBssLostParameters( |
|
210 TUint32 aBssLostCount, |
|
211 TUint8 aFailedTxCount ); |
|
212 |
|
213 /** |
|
214 * Set the parameters related to tx rate adaptation algorithm. |
|
215 * @param aMinStepUpCheckpoint Minimum and initial rate increase checkpoint in units of frames. |
|
216 * @param aMaxStepUpCheckpoint Maximum rate increase checkpoint in units of frames. |
|
217 * @param aStepUpCheckpointFactor Rate increase checkpoint is multiplied with this |
|
218 * value if sending of a probe frame fails. |
|
219 * @param aStepDownCheckpoint After this many frames the need to decrease the rate is checked. |
|
220 * @param aMinStepUpThreshold Minimum and initial rate increase threshold percentage. |
|
221 * @param aMaxStepUpThreshold Maximum rate increase threshold percentage value. |
|
222 * @param aStepUpThresholdIncrement Rate increase threshold is incremented by this |
|
223 * value if sending of a probe frame fails. |
|
224 * @param aStepDownThreshold Rate decrease threshold percentage. |
|
225 * @param aDisableProbeHandling If EFalse, the rate adaptation algorithm handles the first frame |
|
226 * transmitted after a rate increase in a special way. |
|
227 */ |
|
228 void SetTxRateAdaptationParameters( |
|
229 TUint8 aMinStepUpCheckpoint, |
|
230 TUint8 aMaxStepUpCheckpoint, |
|
231 TUint8 aStepUpCheckpointFactor, |
|
232 TUint8 aStepDownCheckpoint, |
|
233 TUint8 aMinStepUpThreshold, |
|
234 TUint8 aMaxStepUpThreshold, |
|
235 TUint8 aStepUpThresholdIncrement, |
|
236 TUint8 aStepDownThreshold, |
|
237 TBool aDisableProbeHandling ); |
|
238 |
|
239 /** |
|
240 * Set the parameters related to power mode management. |
|
241 * @param aActiveToLightTimeout Timeout for Active->Light transition. |
|
242 * @param aActiveToLightThreshold Frame count threshold for Active->Light transition. |
|
243 * @param aLightToActiveTimeout Timeout for Light->Active transition. |
|
244 * @param aLightToActiveThreshold Frame count threshold for Light->Active transition. |
|
245 * @param aLightToDeepTimeout Timeout for Light->Deep transition. |
|
246 * @param aLightToDeepThreshold Frame count threshold for Light->Deep transition. |
|
247 * @param aUapsdRxFrameLengthThreshold Rx frame lenght threshold in U-APSD for Best Effort. |
|
248 */ |
|
249 void SetPowerModeMgmtParameters( |
|
250 TUint32 aActiveToLightTimeout, |
|
251 TUint16 aActiveToLightThreshold, |
|
252 TUint32 aLightToActiveTimeout, |
|
253 TUint16 aLightToActiveThreshold, |
|
254 TUint32 aLightToDeepTimeout, |
|
255 TUint16 aLightToDeepThreshold, |
|
256 TUint16 aUapsdRxFrameLengthThreshold ); |
|
257 |
|
258 /** |
|
259 * Set the parameters related to power mode management. |
|
260 * @param aRatePolicies TX rate policies to set. |
|
261 * @param aMcsPolicies MCS policies to set. |
|
262 * @param aMappings Mappings between Access Classes and TX rate policies. |
|
263 * @param aInitialRates Initial rates for the policies. |
|
264 * @param aAutoRatePolicies TX auto rate policies to set. |
|
265 */ |
|
266 void SetTxRatePolicies( |
|
267 const TTxRatePolicy& aRatePolicies, |
|
268 const THtMcsPolicy& aMcsPolicies, |
|
269 const TQueue2RateClass& aMappings, |
|
270 const TInitialMaxTxRate4RateClass& aInitialRates, |
|
271 const TTxAutoRatePolicy& aAutoRatePolicies ); |
|
272 |
|
273 /** |
|
274 * Get packet statistics for the current connection. |
|
275 * @param aStatistics Packet statistics for the current connection. |
|
276 */ |
|
277 void GetPacketStatistics( |
|
278 TStatisticsResponse& aStatistics ); |
|
279 |
|
280 /** |
|
281 * Set the U-APSD settings. |
|
282 * @param aMaxServicePeriodLength The maximum number of frames to send during a service period. |
|
283 * @param aUapsdEnabledForVoice Whether U-APSD is trigger and delivery-enabled for Voice. |
|
284 * @param aUapsdEnabledForVideo Whether U-APSD is trigger and delivery-enabled for Video. |
|
285 * @param aUapsdEnabledForBestEffort Whether U-APSD is trigger and delivery-enabled for BestEffort. |
|
286 * @param aUapsdEnabledForBackground Whether U-APSD is trigger and delivery-enabled for Background. |
|
287 */ |
|
288 void SetUapsdSettings( |
|
289 TMaxServicePeriodLength aMaxServicePeriodLength, |
|
290 TBool aUapsdEnabledForVoice, |
|
291 TBool aUapsdEnabledForVideo, |
|
292 TBool aUapsdEnabledForBestEffort, |
|
293 TBool aUapsdEnabledForBackground ); |
|
294 |
|
295 /** |
|
296 * Set the RCPI trigger level. |
|
297 * @param aTriggerLevel The RCPI trigger level. |
|
298 */ |
|
299 void SetRcpiTriggerLevel( |
|
300 TUint8 aTriggerLevel ); |
|
301 |
|
302 /** |
|
303 * Set the power save settings. |
|
304 * @param aStayInUapsdPsModeForVoice Whether the terminal stays in U-APSD power save when using Voice. |
|
305 * @param aStayInUapsdPsModeForVideo Whether the terminal stays in U-APSD power save when using Video. |
|
306 * @param aStayInUapsdPsModeForBestEffort Whether the terminal stays in U-APSD power save when using BestEffort. |
|
307 * @param aStayInUapsdPsModeForBackground Whether the terminal stays in U-APSD power save when using Background. |
|
308 * @param aStayInLegacyPsModeForVoice Whether the terminal stays in legacy power save when using Voice. |
|
309 * @param aStayInLegacyPsModeForVideo Whether the terminal stays in legacy power save when using Video. |
|
310 * @param aStayInLegacyPsModeForBestEffort Whether the terminal stays in legacy power save when using BestEffort. |
|
311 * @param aStayInLegacyPsModeForBackground Whether the terminal stays in legacy power save when using Background. |
|
312 */ |
|
313 void SetPowerSaveSettings( |
|
314 TBool aStayInUapsdPsModeForVoice, |
|
315 TBool aStayInUapsdPsModeForVideo, |
|
316 TBool aStayInUapsdPsModeForBestEffort, |
|
317 TBool aStayInUapsdPsModeForBackground, |
|
318 TBool aStayInLegacyPsModeForVoice, |
|
319 TBool aStayInLegacyPsModeForVideo, |
|
320 TBool aStayInLegacyPsModeForBestEffort, |
|
321 TBool aStayInLegacyPsModeForBackground ); |
|
322 |
|
323 /** |
|
324 * Set parameters of a Tx queue. |
|
325 * @param aQueueId Queue to be configured. |
|
326 * @param aMediumTime Medium time to be used. |
|
327 * @param aMaxTxMSDULifetime Maximum Transmit MSDU Lifetime to be used. |
|
328 */ |
|
329 void SetTxQueueParameters( |
|
330 TQueueId aQueueId, |
|
331 TUint16 aMediumTime, |
|
332 TUint32 aMaxTxMSDULifetime ); |
|
333 |
|
334 /** |
|
335 * Set block ACK usage per traffic stream. |
|
336 * @param aTxUsage Bitmap of TIDs where TX block ACK is allowed. |
|
337 * @param aRxUsage Bitmap of TIDs where RX block ACK is allowed. |
|
338 */ |
|
339 void SetBlockAckUsage( |
|
340 TUint8 aTxUsage, |
|
341 TUint8 aRxUsage ); |
|
342 |
|
343 /** |
|
344 * Set the SNAP header of frames to receive. |
|
345 * @param aHeader SNAP header of frames to receive.. |
|
346 */ |
|
347 void SetSnapHeaderFilter( |
|
348 TSnapHeader aHeader ); |
|
349 |
|
350 /** |
|
351 * Disable user data (802.1x: block data during |
|
352 * authentication). |
|
353 */ |
|
354 void DisableUserData(); |
|
355 |
|
356 /** |
|
357 * Enable user data (802.1x: pass data through after |
|
358 * succesfull authentication). Default value is to |
|
359 * enable user data. |
|
360 */ |
|
361 void EnableUserData(); |
|
362 |
|
363 /** |
|
364 * Add a cipher key. |
|
365 * @param aCipherSuite The cipher suite of the key. |
|
366 * @param aKeyIndex Index of the key. |
|
367 * @param aLength Length of the cipher key. |
|
368 * @param aData Cipher key. |
|
369 * @param aMacAddr Defines the MAC address the key is used for. |
|
370 * @param aUseAsDefault in case of wep, whether the key is used as default cipher key |
|
371 */ |
|
372 void AddCipherKey( |
|
373 TWlanCipherSuite aCipherSuite, |
|
374 TUint8 aKeyIndex, |
|
375 TUint32 aLength, |
|
376 const TUint8* aData, |
|
377 const TMacAddress& aMacAddr, |
|
378 TBool aUseAsDefault ); |
|
379 |
|
380 /** |
|
381 * Connect (authenticate and associate) to a BSS. |
|
382 * @param aSSID Name of the network. |
|
383 * @param aBSSID BSSID of the access point. |
|
384 * @param aAuthAlgorithm Authentication algorithm number. |
|
385 * @param aEncryptionStatus Used encryption level. |
|
386 * @param aPairwiseKeyType Pairwise cipher key type to be used. |
|
387 * @param aIsInfra The BSS type. |
|
388 * @param aIeDataLength The IE data lenght. |
|
389 * @param aIeData The IE data. |
|
390 * @param aScanFrameLength Length of beacon/probe response frame. |
|
391 * @param aScanFrame Pointer to beacon/probe response frame. |
|
392 * @param aIsPairwiseKeyInvalidated Whether the pairwise key should be invalidated. |
|
393 * @param aIsGroupKeyInvalidated Whether the group key should be invalidated |
|
394 * @param aIsRadioMeasurementSupported Whether the radio measurement is supported |
|
395 */ |
|
396 void Connect( |
|
397 const TSSID& aSSID, |
|
398 const TMacAddress& aBSSID, |
|
399 TUint16 aAuthAlgorithm, |
|
400 TEncryptionStatus aEncryptionStatus, |
|
401 TWlanCipherSuite aPairwiseKeyType, |
|
402 TBool aIsInfra, |
|
403 TUint32 aIeDataLength, |
|
404 const TUint8* aIeData, |
|
405 TUint32 aScanFrameLength, |
|
406 const TUint8* aScanFrame, |
|
407 TBool aIsPairwiseKeyInvalidated, |
|
408 TBool aIsGroupKeyInvalidated, |
|
409 TBool aIsRadioMeasurementSupported ); |
|
410 |
|
411 protected: // From CActive |
|
412 |
|
413 /** |
|
414 * DoCancel |
|
415 */ |
|
416 void DoCancel(); |
|
417 |
|
418 /** |
|
419 * RunL |
|
420 */ |
|
421 void RunL(); |
|
422 |
|
423 private: // Construction methods |
|
424 |
|
425 /** |
|
426 * C++ default constructor. |
|
427 * @param aIndPtr Interface to send indications. |
|
428 */ |
|
429 CWlanMgmtCommandHandler( |
|
430 RWlanLogicalChannel& aChannel, |
|
431 MWlanMgmtCommandCallback& aClient ); |
|
432 |
|
433 /** |
|
434 * By default Symbian 2nd phase constructor is private. |
|
435 */ |
|
436 void ConstructL(); |
|
437 |
|
438 private: // Members |
|
439 |
|
440 /** |
|
441 * Callback interface to complete the requested commands |
|
442 */ |
|
443 MWlanMgmtCommandCallback& iClient; |
|
444 |
|
445 /** |
|
446 * Interface to access LDD |
|
447 */ |
|
448 RWlanLogicalChannel& iChannel; |
|
449 |
|
450 /** |
|
451 * Package buffer for output parameter(s). |
|
452 */ |
|
453 TPtr8 iBuffer; |
|
454 |
|
455 }; |
|
456 |
|
457 #endif // WLANMGMTCOMMANDHANDLER_H |