|
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 Umac class. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 32 % |
|
20 */ |
|
21 |
|
22 #ifndef UMAC_H |
|
23 #define UMAC_H |
|
24 |
|
25 #include "umaceventdispatcherclient.h" |
|
26 #include "UmacProtocolStackSideUmac.h" |
|
27 #include "UmacProtocolStackSideUmacCb.h" |
|
28 #include "UmacManagementSideUmac.h" |
|
29 #include "UmacManagementSideUmacCb.h" |
|
30 #include "UmacTimerClient.h" |
|
31 #include "umacdfcclient.h" |
|
32 |
|
33 #ifndef RD_WLAN_DDK |
|
34 #include <wha.h> |
|
35 #else |
|
36 #include <wlanwha.h> |
|
37 #endif |
|
38 |
|
39 |
|
40 class WlanContextImpl; |
|
41 class WlanConnectContext; |
|
42 class WlanPrivacyModeFilters; |
|
43 |
|
44 class Umac : |
|
45 public MWlanProtocolStackSideUmac, |
|
46 public WlanProtocolStackSideUmacCb, |
|
47 public WlanManagementSideUmacCb, |
|
48 public MWlanManagementSideUmac, |
|
49 public MWlanTimerClient, |
|
50 public MWlanEventDispatcherClient, |
|
51 public MWlanDfcClient |
|
52 { |
|
53 |
|
54 public: |
|
55 |
|
56 /** |
|
57 * C++ default constructor. |
|
58 */ |
|
59 Umac(); |
|
60 |
|
61 virtual ~Umac(); |
|
62 |
|
63 virtual void OnTimeout( TWlanTimer aTimer ); |
|
64 |
|
65 virtual void OnDfc( TAny* aCtx ); |
|
66 |
|
67 void CompleteManagementCommand( |
|
68 TInt aReason, |
|
69 const TAny* aData = NULL, |
|
70 TUint32 aLengthInBytes = 0 ); |
|
71 |
|
72 /** |
|
73 * From MManagementSideUmac |
|
74 * OID request handler routine |
|
75 * @param aInputBuffer Pointer to the input buffer (set-operations) |
|
76 * @param aInputBufferSize Size of the buffer pointed to by aInputBuffer |
|
77 * @param aOutputBuffer Pointer to the output buffer (query-operations) |
|
78 * @param aOutputBufferSize Size of the buffer pointed to by aOutputBuffer |
|
79 * @return Status of the operation see #TStatus |
|
80 */ |
|
81 virtual void HandleOid( |
|
82 const TOIDHeader* aOid, |
|
83 TAny* aOutputBuffer, |
|
84 TUint aOutputBufferSize ); |
|
85 |
|
86 /** |
|
87 * From MManagementSideUmac |
|
88 */ |
|
89 virtual void AttachWsa( WHA::Wha* aWha ); |
|
90 virtual TBool Init(); |
|
91 virtual void BootUp( |
|
92 const TUint8* aPda, |
|
93 TUint32 aPdaLength, |
|
94 const TUint8* aFw, |
|
95 TUint32 aFwLength ); |
|
96 |
|
97 virtual void FinitSystem(); |
|
98 |
|
99 // From MWlanProtocolStackSideUmac |
|
100 |
|
101 virtual const TMacAddress& StationId() const; |
|
102 |
|
103 /** |
|
104 * Triggers the setting of the Tx offset on the protocol stack side for |
|
105 * every frame type which can be transmitted |
|
106 */ |
|
107 virtual void SetTxOffset(); |
|
108 |
|
109 /** |
|
110 * Transmit a protocol stack frame |
|
111 * |
|
112 * The frame to be sent needs to be in 802.3 format |
|
113 * @param aDataBuffer meta header of the frame to be transmitted |
|
114 * @param aMore ETrue if another frame is also ready to be transmitted |
|
115 * EFalse otherwise |
|
116 */ |
|
117 virtual void TxProtocolStackData( |
|
118 TDataBuffer& aDataBuffer, |
|
119 TBool aMore ); |
|
120 |
|
121 /** |
|
122 * Gets the WLAN vendor needs for extra space (bytes) in frame buffers |
|
123 * |
|
124 * @param aRxOffset How much extra space needs to be reserved |
|
125 * in the Rx buffer before every Rx frame that is received from the |
|
126 * WHA layer. |
|
127 * @param aTxHeaderSpace How much extra space needs to be reserved |
|
128 * in the Tx buffer before every Tx frame that is given to the |
|
129 * WHA layer. |
|
130 * @param aTxTrailerSpace How much extra space needs to be reserved |
|
131 * in the Tx buffer after every Tx frame that is given to the |
|
132 * WHA layer. |
|
133 */ |
|
134 virtual void GetFrameExtraSpaceForVendor( |
|
135 TUint8& aRxOffset, |
|
136 TUint8& aTxHeaderSpace, |
|
137 TUint8& aTxTrailerSpace ) const; |
|
138 |
|
139 /** |
|
140 * From MWlanProtocolStackSideUmac |
|
141 * Is protocol stack side transmission permitted |
|
142 * |
|
143 * @param aTxQueueState If the return value is ETrue, the state |
|
144 * (full / not full) of every WHA transmit queue. Otherwise, not |
|
145 * valid. |
|
146 * Note! A frame shall not be submitted to a full queue - even if |
|
147 * the return value would be ETrue |
|
148 * @return ETrue if Tx frame submission is permitted |
|
149 * EFalse if Tx frame submission is not permitted |
|
150 */ |
|
151 virtual TBool TxPermitted( TWhaTxQueueState& aTxQueueState ) const; |
|
152 |
|
153 /** |
|
154 * From MWlanProtocolStackSideUmac |
|
155 * Is user data Tx enabled |
|
156 * |
|
157 * @return ETrue if user data Tx is enabled |
|
158 * EFalse if user data Tx is not enabled |
|
159 */ |
|
160 virtual TBool UserDataTxEnabled() const; |
|
161 |
|
162 virtual void WriteMgmtFrame(TDataBuffer& aDataBuffer); |
|
163 |
|
164 private: |
|
165 |
|
166 /** |
|
167 * Connect OID request handler |
|
168 * @param aInputBuffer Pointer to the input buffer |
|
169 * @return ETrue if a state transition occurred |
|
170 * EFalse otherwise |
|
171 */ |
|
172 virtual TBool HandleConnect(const TAny *aInputBuffer); |
|
173 |
|
174 /** |
|
175 * Start IBSS OID request handler |
|
176 * @param aInputBuffer Pointer to the input buffer |
|
177 * @return ETrue if a state transition occurred |
|
178 * EFalse otherwise |
|
179 */ |
|
180 virtual TBool HandleStartIBSS(const TAny *aInputBuffer); |
|
181 |
|
182 /** |
|
183 * Disconnect OID request handler |
|
184 * @return ETrue if a state transition occurred |
|
185 * EFalse otherwise |
|
186 */ |
|
187 virtual TBool HandleDisconnect(); |
|
188 |
|
189 /** |
|
190 * Set power mode OID request handler |
|
191 * @param aInputBuffer Pointer to the input buffer |
|
192 * @return ETrue if a state transition occurred |
|
193 * EFalse otherwise |
|
194 */ |
|
195 virtual TBool HandleSetPowerMode(const TAny *aInputBuffer); |
|
196 |
|
197 /** |
|
198 * Set RCPI trigger level OID request handler |
|
199 * @param aInputBuffer Pointer to the input buffer |
|
200 * @return ETrue if a state transition occurred |
|
201 * EFalse otherwise |
|
202 */ |
|
203 virtual TBool HandleSetRcpiTriggerLevel(const TAny *aInputBuffer); |
|
204 |
|
205 /** |
|
206 * Set Tx power level OID request handler |
|
207 * @param aInputBuffer Pointer to the input buffer |
|
208 * @return ETrue if a state transition occurred |
|
209 * EFalse otherwise |
|
210 */ |
|
211 virtual TBool HandleSetTxPowerLevel(const TAny *aInputBuffer); |
|
212 |
|
213 /** |
|
214 * Configure OID request handler |
|
215 * @param aInputBuffer Pointer to the input buffer |
|
216 * @return ETrue if a state transition occurred |
|
217 * EFalse otherwise |
|
218 */ |
|
219 virtual TBool HandleConfigure(const TAny *aInputBuffer); |
|
220 |
|
221 /** |
|
222 * Scan OID request handler |
|
223 * @param aInputBuffer Pointer to the input buffer |
|
224 * @return ETrue if a state transition occurred |
|
225 * EFalse otherwise |
|
226 */ |
|
227 virtual TBool HandleScan(const TAny *aInputBuffer); |
|
228 |
|
229 /** |
|
230 * Stop scan OID request handler |
|
231 * |
|
232 * @since S60 3.2 |
|
233 * @return ETrue if a state transition occurred |
|
234 * EFalse otherwise |
|
235 */ |
|
236 TBool HandleStopScan(); |
|
237 |
|
238 /** |
|
239 * Get last RCPI OID request handler |
|
240 * @return ETrue if a state transition occurred |
|
241 * EFalse otherwise |
|
242 */ |
|
243 virtual TBool HandleGetLastRcpi(); |
|
244 |
|
245 /** |
|
246 * Disable user data OID request handler |
|
247 * @return ETrue if a state transition occurred |
|
248 * EFalse otherwise |
|
249 */ |
|
250 virtual TBool HandleDisableUserData(); |
|
251 |
|
252 /** |
|
253 * Enable user data OID request handler |
|
254 * @return ETrue if a state transition occurred |
|
255 * EFalse otherwise |
|
256 */ |
|
257 virtual TBool HandleEnableUserData(); |
|
258 |
|
259 /** |
|
260 * Add cipher key OID request handler |
|
261 * @return ETrue if a state transition occurred |
|
262 * EFalse otherwise |
|
263 */ |
|
264 virtual TBool HandleAddCipherKey(const TAny *aInputBuffer); |
|
265 |
|
266 /** |
|
267 * Add multicast address OID request handler |
|
268 * @return ETrue if a state transition occurred |
|
269 * EFalse otherwise |
|
270 */ |
|
271 virtual TBool HandleAddMulticastAddr(const TAny *aInputBuffer); |
|
272 |
|
273 /** |
|
274 * Remove multicast address OID request handler |
|
275 * @return ETrue if a state transition occurred |
|
276 * EFalse otherwise |
|
277 */ |
|
278 virtual TBool HandleRemoveMulticastAddr(const TAny *aInputBuffer); |
|
279 |
|
280 /** |
|
281 * BSS lost configure OID request handler |
|
282 * @return ETrue if a state transition occurred |
|
283 * EFalse otherwise |
|
284 */ |
|
285 virtual TBool HandleConfigureBssLost(const TAny *aInputBuffer); |
|
286 |
|
287 /** |
|
288 * Set Tx rate adaptation parameters OID request handler |
|
289 * @return ETrue if a state transition occurred |
|
290 * EFalse otherwise |
|
291 */ |
|
292 virtual TBool HandleSetTxRateAdaptParams(const TAny *aInputBuffer); |
|
293 |
|
294 /** |
|
295 * Configure Tx rate policies OID request handler |
|
296 * @return ETrue if a state transition occurred |
|
297 * EFalse otherwise |
|
298 */ |
|
299 virtual TBool HandleConfigureTxRatePolicies(const TAny *aInputBuffer); |
|
300 |
|
301 /** |
|
302 * Set power mode management parameters OID request handler |
|
303 * @return ETrue if a state transition occurred |
|
304 * EFalse otherwise |
|
305 */ |
|
306 virtual TBool HandleSetPowerModeMgmtParams(const TAny *aInputBuffer); |
|
307 |
|
308 /** |
|
309 * Configure PS Mode Traffic Override OID request handler |
|
310 * @return ETrue if a state transition occurred |
|
311 * EFalse otherwise |
|
312 */ |
|
313 virtual TBool HandleConfigurePwrModeMgmtTrafficOverride( |
|
314 const TAny *aInputBuffer ); |
|
315 |
|
316 /** |
|
317 * Get Frame Statistics OID request handler |
|
318 * @return ETrue if a state transition occurred |
|
319 * EFalse otherwise |
|
320 */ |
|
321 virtual TBool HandleGetFrameStatistics(); |
|
322 |
|
323 /** |
|
324 * Configure U-APSD OID request handler |
|
325 * @return ETrue if a state transition occurred |
|
326 * EFalse otherwise |
|
327 */ |
|
328 virtual TBool HandleConfigureUapsd( const TAny *aInputBuffer ); |
|
329 |
|
330 /** |
|
331 * Configure Tx Queue OID request handler |
|
332 * @return ETrue if a state transition occurred |
|
333 * EFalse otherwise |
|
334 */ |
|
335 virtual TBool HandleConfigureTxQueue( const TAny *aInputBuffer ); |
|
336 |
|
337 /** |
|
338 * Get MAC Address OID request handler |
|
339 * @return ETrue if a state transition occurred |
|
340 * EFalse otherwise |
|
341 */ |
|
342 virtual TBool HandleGetMacAddress(); |
|
343 |
|
344 /** |
|
345 * Configure ARP IP Address Filtering OID request handler |
|
346 * @return ETrue if a state transition occurred |
|
347 * EFalse otherwise |
|
348 */ |
|
349 virtual TBool HandleConfigureArpIpAddressFiltering( |
|
350 const TAny *aInputBuffer ); |
|
351 |
|
352 /** |
|
353 * Configure HT Block Ack OID request handler |
|
354 * @return ETrue if a state transition occurred |
|
355 * EFalse otherwise |
|
356 */ |
|
357 virtual TBool HandleConfigureHtBlockAck( const TAny *aInputBuffer ); |
|
358 |
|
359 /** |
|
360 * Configure Proprietary SNAP Header OID request handler |
|
361 * @return ETrue if a state transition occurred |
|
362 * EFalse otherwise |
|
363 */ |
|
364 virtual TBool HandleConfigureProprietarySnapHdr( |
|
365 const TAny *aInputBuffer ); |
|
366 |
|
367 /** |
|
368 * |
|
369 */ |
|
370 virtual TBool OnWhaCommandComplete( |
|
371 WHA::TCompleteCommandId aCompleteCommandId, |
|
372 WHA::TStatus aStatus, |
|
373 const WHA::UCommandCompletionParams& aCommandCompletionParams ); |
|
374 |
|
375 /** |
|
376 * |
|
377 */ |
|
378 virtual TBool OnInternalEvent( TInternalEvent aInternalEvent ); |
|
379 |
|
380 // Prohibit copy constructor |
|
381 Umac( const Umac& ); |
|
382 // Prohibit assigment operator |
|
383 Umac& operator= ( const Umac& ); |
|
384 |
|
385 private: // Data |
|
386 |
|
387 /** pointer to our implementation details (pimpl-idiom) */ |
|
388 WlanContextImpl* iPimpl; |
|
389 |
|
390 TBool iManagementRequestPending; |
|
391 WlanManagementSideUmacCb::SOidOutputData iOidOutputData; |
|
392 }; |
|
393 |
|
394 #endif // UMAC_H |
|
395 |