|
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: Implementation of the WlanWsaConfigure class |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 23 % |
|
20 */ |
|
21 |
|
22 #include "config.h" |
|
23 #include "UmacWsaConfigure.h" |
|
24 #include "UmacContextImpl.h" |
|
25 |
|
26 #ifndef RD_WLAN_DDK |
|
27 #include <wha_types.h> |
|
28 #else |
|
29 #include <wlanwha_types.h> |
|
30 #endif // RD_WLAN_DDK |
|
31 |
|
32 #ifndef NDEBUG |
|
33 const TInt8 WlanWsaConfigure::iName[] = "wsa-configure"; |
|
34 #endif // !NDEBUG |
|
35 |
|
36 // ======== MEMBER FUNCTIONS ======== |
|
37 |
|
38 // ----------------------------------------------------------------------------- |
|
39 // |
|
40 // ----------------------------------------------------------------------------- |
|
41 // |
|
42 void WlanWsaConfigure::Entry( WlanContextImpl& aCtxImpl ) |
|
43 { |
|
44 // mark WSA cmd active |
|
45 aCtxImpl.ActivateWsaCmd(); |
|
46 |
|
47 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
48 ("UMAC: WlanWsaConfigure::Entry: pda size: %d"), iLength); |
|
49 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
50 ("UMAC: WlanWsaConfigure::Entry: pda start address: 0x%08x"), |
|
51 reinterpret_cast<TUint32>(iData)); |
|
52 |
|
53 OsTracePrint( KWsaCmdState, (TUint8*) |
|
54 ("UMAC: WHA-CMD-Configure") ); |
|
55 |
|
56 // execute the command |
|
57 aCtxImpl.Wha().Configure( |
|
58 *(static_cast<const WHA::SConfigureData*>(iData)), |
|
59 aCtxImpl.WHASettings() ); |
|
60 |
|
61 #ifndef NDEBUG |
|
62 // WHA settings object should be set |
|
63 // trace it |
|
64 |
|
65 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
66 ("UMAC: WlanWsaConfigure::Entry: WSASettings object:") ); |
|
67 |
|
68 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
69 ("UMAC: WlanWsaConfigure::Entry: iNumOfSSIDs: %d"), |
|
70 aCtxImpl.WHASettings().iNumOfSSIDs ); |
|
71 |
|
72 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
73 ("UMAC: WlanWsaConfigure::Entry: iRxBufAlignment (DEPRECATED): %d"), |
|
74 aCtxImpl.WHASettings().iRxBufAlignment ); |
|
75 |
|
76 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
77 ("UMAC: WlanWsaConfigure::Entry: iNumOfBytesForSsid: %d"), |
|
78 aCtxImpl.WHASettings().iNumOfBytesForSsid ); |
|
79 |
|
80 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
81 ("UMAC: WlanWsaConfigure::Entry: iRates: 0x%08x"), |
|
82 aCtxImpl.WHASettings().iRates ); |
|
83 |
|
84 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
85 ("UMAC: WlanWsaConfigure::Entry: iBand: %d"), |
|
86 aCtxImpl.WHASettings().iBand ); |
|
87 |
|
88 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
89 ("UMAC: WlanWsaConfigure::Entry: iRxoffset: %d"), |
|
90 aCtxImpl.WHASettings().iRxoffset ); |
|
91 |
|
92 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
93 ("UMAC: WlanWsaConfigure::Entry: iNumOfGroupTableEntrys: %d"), |
|
94 aCtxImpl.WHASettings().iNumOfGroupTableEntrys ); |
|
95 |
|
96 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
97 ("UMAC: WlanWsaConfigure::Entry: iNumOfTxRateClasses: %d"), |
|
98 aCtxImpl.WHASettings().iNumOfTxRateClasses ); |
|
99 |
|
100 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
101 ("UMAC: WlanWsaConfigure::Entry: iTxFrameTrailerSpace: %d"), |
|
102 aCtxImpl.WHASettings().iTxFrameTrailerSpace ); |
|
103 |
|
104 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
105 ("UMAC: WlanWsaConfigure::Entry: iTxFrameHeaderSpace: %d"), |
|
106 aCtxImpl.WHASettings().iTxFrameHeaderSpace ); |
|
107 |
|
108 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
109 ("UMAC: WlanWsaConfigure::Entry: iFlagsMask: 0x%04x"), |
|
110 aCtxImpl.WHASettings().iFlagsMask ); |
|
111 |
|
112 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
113 ("UMAC: WlanWsaConfigure::Entry: power levels per band (from lowest to highest):") ); |
|
114 |
|
115 for ( TUint i = 0; i < WHA::SSettings::KNumOfBandsSupported; ++i ) |
|
116 { |
|
117 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
118 ("UMAC: WlanWsaConfigure::Entry: iMinPowerLevel: %d"), |
|
119 aCtxImpl.WHASettings().iTxPowerRange[i].iMinPowerLevel ); |
|
120 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
121 ("UMAC: WlanWsaConfigure::Entry: iMaxPowerLevel: %d"), |
|
122 aCtxImpl.WHASettings().iTxPowerRange[i].iMaxPowerLevel ); |
|
123 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
124 ("UMAC: WlanWsaConfigure::Entry: iStepping: %d"), |
|
125 aCtxImpl.WHASettings().iTxPowerRange[i].iStepping ); |
|
126 } |
|
127 |
|
128 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
129 ("UMAC: WlanWsaConfigure::Entry: iCapability: 0x%08x"), |
|
130 aCtxImpl.WHASettings().iCapability ); |
|
131 |
|
132 if ( aCtxImpl.WHASettings().iCapability & WHA::SSettings::KHtOperation ) |
|
133 { |
|
134 // trace HT related information |
|
135 |
|
136 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
137 ("UMAC: WlanWsaConfigure::Entry: iHTCapabilitiesBitMask: 0x%08x"), |
|
138 aCtxImpl.WHASettings().iHtCapabilities.iHTCapabilitiesBitMask ); |
|
139 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
140 ("UMAC: WlanWsaConfigure::Entry: iRxMaxDataRate: %d"), |
|
141 aCtxImpl.WHASettings().iHtCapabilities.iRxMaxDataRate ); |
|
142 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
143 ("UMAC: WlanWsaConfigure::Entry: iChannelWidth: %d"), |
|
144 aCtxImpl.WHASettings().iHtCapabilities.iChannelWidth ); |
|
145 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
146 ("UMAC: WlanWsaConfigure::Entry: iRxStbc: %d"), |
|
147 aCtxImpl.WHASettings().iHtCapabilities.iRxStbc ); |
|
148 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
149 ("UMAC: WlanWsaConfigure::Entry: iMaxAmsdu: %d"), |
|
150 aCtxImpl.WHASettings().iHtCapabilities.iMaxAmsdu ); |
|
151 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
152 ("UMAC: WlanWsaConfigure::Entry: iMaxAmpdu: %d"), |
|
153 aCtxImpl.WHASettings().iHtCapabilities.iMaxAmpdu ); |
|
154 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
155 ("UMAC: WlanWsaConfigure::Entry: iAmpduSpacing: %d"), |
|
156 aCtxImpl.WHASettings().iHtCapabilities.iAmpduSpacing ); |
|
157 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
158 ("UMAC: WlanWsaConfigure::Entry: iRxMcs:"), |
|
159 aCtxImpl.WHASettings().iHtCapabilities.iRxMcs, |
|
160 aCtxImpl.WHASettings().iHtCapabilities.iRxMcs + |
|
161 WHA::KHtMcsSetLength ); |
|
162 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
163 ("UMAC: WlanWsaConfigure::Entry: iTxMcs:"), |
|
164 aCtxImpl.WHASettings().iHtCapabilities.iTxMcs, |
|
165 aCtxImpl.WHASettings().iHtCapabilities.iTxMcs + |
|
166 WHA::KHtMcsSetLength ); |
|
167 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
168 ("UMAC: WlanWsaConfigure::Entry: iPcoTransTime: %d"), |
|
169 aCtxImpl.WHASettings().iHtCapabilities.iPcoTransTime ); |
|
170 OsTracePrint( KWsaCmdStateDetails, (TUint8*) |
|
171 ("UMAC: WlanWsaConfigure::Entry: iMcsFeedback: %d"), |
|
172 aCtxImpl.WHASettings().iHtCapabilities.iMcsFeedback ); |
|
173 } |
|
174 #endif |
|
175 |
|
176 if ( aCtxImpl.WHASettings().iCapability & WHA::SSettings::KHtOperation ) |
|
177 { |
|
178 // wlanpdd indicates HT support. Record that in our BSS Membership |
|
179 // features |
|
180 aCtxImpl.AddBssMembershipFeature( E802Dot11HtPhy ); |
|
181 } |
|
182 } |
|
183 |
|
184 // ----------------------------------------------------------------------------- |
|
185 // |
|
186 // ----------------------------------------------------------------------------- |
|
187 // |
|
188 void WlanWsaConfigure::CommandResponse( |
|
189 WlanContextImpl& aCtxImpl, |
|
190 WHA::TCommandId aCommandId, |
|
191 WHA::TStatus aStatus, |
|
192 const WHA::UCommandResponseParams& aCommandResponseParams ) |
|
193 { |
|
194 if ( aCommandId == WHA::EConfigureResponse ) |
|
195 { |
|
196 TraverseToHistoryState( aCtxImpl, |
|
197 aCommandId, |
|
198 aStatus, |
|
199 aCommandResponseParams ); |
|
200 } |
|
201 else |
|
202 { |
|
203 OsTracePrint( KErrorLevel, |
|
204 (TUint8*)("UMAC: aCommandId: %d"), aCommandId ); |
|
205 OsAssert( (TUint8*)("UMAC: panic"), (TUint8*)(WLAN_FILE), __LINE__ ); |
|
206 } |
|
207 } |
|
208 |
|
209 // ----------------------------------------------------------------------------- |
|
210 // |
|
211 // ----------------------------------------------------------------------------- |
|
212 // |
|
213 void WlanWsaConfigure::Set( |
|
214 WlanContextImpl& /*aCtxImpl*/, |
|
215 const TAny* aData, |
|
216 TUint32 aLength ) |
|
217 { |
|
218 OsTracePrint( KWsaCmdState, (TUint8*) |
|
219 ("UMAC: WlanWsaConfigure::Set: user space PDA address: 0x%08x"), |
|
220 reinterpret_cast<TUint32>(aData) ); |
|
221 OsTracePrint( KWsaCmdState, (TUint8*) |
|
222 ("UMAC: WlanWsaConfigure::Set: length of PDA: %d"), aLength ); |
|
223 |
|
224 iData = aData; |
|
225 iLength = aLength; |
|
226 } |
|
227 |
|
228 // ----------------------------------------------------------------------------- |
|
229 // |
|
230 // ----------------------------------------------------------------------------- |
|
231 // |
|
232 #ifndef NDEBUG |
|
233 const TInt8* WlanWsaConfigure::GetStateName( TUint8& aLength ) const |
|
234 { |
|
235 aLength = sizeof( iName ); |
|
236 return iName; |
|
237 } |
|
238 #endif |