2 * ---------------------------------------------------------------------------
6 * This file contains the driver specific implementation of
8 * It is part of the porting exercise.
10 * Copyright (C) 2008-2009 by Cambridge Silicon Radio Ltd.
12 * Refer to LICENSE.txt included with this source code for details on
15 * ---------------------------------------------------------------------------
18 #include "csr_wifi_hip_unifiversion.h"
19 #include "unifi_priv.h"
20 #include "csr_wifi_hip_conversions.h"
22 * This file implements the SME MGT API. It contains the following functions:
23 * CsrWifiSmeWifiFlightmodeCfmSend()
24 * CsrWifiSmeWifiOnCfmSend()
25 * CsrWifiSmeWifiOffCfmSend()
26 * CsrWifiSmeWifiOffIndSend()
27 * CsrWifiSmeScanFullCfmSend()
28 * CsrWifiSmeScanResultsGetCfmSend()
29 * CsrWifiSmeScanResultIndSend()
30 * CsrWifiSmeScanResultsFlushCfmSend()
31 * CsrWifiSmeConnectCfmSend()
32 * CsrWifiSmeMediaStatusIndSend()
33 * CsrWifiSmeDisconnectCfmSend()
34 * CsrWifiSmeKeyCfmSend()
35 * CsrWifiSmeMulticastAddressCfmSend()
36 * CsrWifiSmeSetValueCfmSend()
37 * CsrWifiSmeGetValueCfmSend()
38 * CsrWifiSmeMicFailureIndSend()
39 * CsrWifiSmePmkidCfmSend()
40 * CsrWifiSmePmkidCandidateListIndSend()
41 * CsrWifiSmeMibSetCfmSend()
42 * CsrWifiSmeMibGetCfmSend()
43 * CsrWifiSmeMibGetNextCfmSend()
44 * CsrWifiSmeConnectionQualityIndSend()
45 * CsrWifiSmePacketFilterSetCfmSend()
46 * CsrWifiSmeTspecCfmSend()
47 * CsrWifiSmeTspecIndSend()
48 * CsrWifiSmeBlacklistCfmSend()
49 * CsrWifiSmeEventMaskSetCfmSend()
50 * CsrWifiSmeRoamStartIndSend()
51 * CsrWifiSmeRoamCompleteIndSend()
52 * CsrWifiSmeAssociationStartIndSend()
53 * CsrWifiSmeAssociationCompleteIndSend()
54 * CsrWifiSmeIbssStationIndSend()
58 void CsrWifiSmeMicFailureIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
60 #ifdef CSR_SUPPORT_WEXT
61 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
62 CsrWifiSmeMicFailureInd
* ind
= (CsrWifiSmeMicFailureInd
*)msg
;
65 unifi_error(NULL
, "CsrWifiSmeMicFailureIndSend: invalid priv\n");
69 unifi_trace(priv
, UDBG1
,
70 "CsrWifiSmeMicFailureIndSend: count=%d, KeyType=%d\n",
71 ind
->count
, ind
->keyType
);
73 wext_send_michaelmicfailure_event(priv
, ind
->count
, ind
->address
, ind
->keyType
, ind
->interfaceTag
);
78 void CsrWifiSmePmkidCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
80 #ifdef CSR_SUPPORT_WEXT
81 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
82 CsrWifiSmePmkidCfm
* cfm
= (CsrWifiSmePmkidCfm
*)msg
;
85 unifi_error(NULL
, "CsrWifiSmePmkidCfmSend: Invalid ospriv.\n");
90 * WEXT never does a GET operation the PMKIDs, so we don't need
91 * handle data returned in pmkids.
94 sme_complete_request(priv
, cfm
->status
);
99 void CsrWifiSmePmkidCandidateListIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
101 #ifdef CSR_SUPPORT_WEXT
102 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
103 CsrWifiSmePmkidCandidateListInd
* ind
= (CsrWifiSmePmkidCandidateListInd
*)msg
;
106 if (priv
->smepriv
== NULL
) {
107 unifi_error(priv
, "CsrWifiSmePmkidCandidateListIndSend: invalid smepriv\n");
111 for (i
= 0; i
< ind
->pmkidCandidatesCount
; i
++)
113 wext_send_pmkid_candidate_event(priv
, ind
->pmkidCandidates
[i
].bssid
, ind
->pmkidCandidates
[i
].preAuthAllowed
, ind
->interfaceTag
);
118 void CsrWifiSmeScanResultsFlushCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
122 void CsrWifiSmeScanResultsGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
124 #ifdef CSR_SUPPORT_WEXT
125 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
126 CsrWifiSmeScanResultsGetCfm
* cfm
= (CsrWifiSmeScanResultsGetCfm
*)msg
;
127 int bytesRequired
= cfm
->scanResultsCount
* sizeof(CsrWifiSmeScanResult
);
130 CsrWifiSmeScanResult
* scanCopy
;
133 unifi_error(NULL
, "CsrWifiSmeScanResultsGetCfmSend: Invalid ospriv.\n");
137 /* Calc the size of the buffer reuired */
138 for (i
= 0; i
< cfm
->scanResultsCount
; ++i
) {
139 const CsrWifiSmeScanResult
*scan_result
= &cfm
->scanResults
[i
];
140 bytesRequired
+= scan_result
->informationElementsLength
;
143 /* Take a Copy of the scan Results :-) */
144 scanCopy
= kmalloc(bytesRequired
, GFP_KERNEL
);
145 memcpy(scanCopy
, cfm
->scanResults
, sizeof(CsrWifiSmeScanResult
) * cfm
->scanResultsCount
);
147 /* Take a Copy of the Info Elements AND update the scan result pointers */
148 current_buff
= (u8
*)&scanCopy
[cfm
->scanResultsCount
];
149 for (i
= 0; i
< cfm
->scanResultsCount
; ++i
)
151 CsrWifiSmeScanResult
*scan_result
= &scanCopy
[i
];
152 memcpy(current_buff
, scan_result
->informationElements
, scan_result
->informationElementsLength
);
153 scan_result
->informationElements
= current_buff
;
154 current_buff
+= scan_result
->informationElementsLength
;
157 priv
->sme_reply
.reply_scan_results_count
= cfm
->scanResultsCount
;
158 priv
->sme_reply
.reply_scan_results
= scanCopy
;
160 sme_complete_request(priv
, cfm
->status
);
165 void CsrWifiSmeScanFullCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
167 #ifdef CSR_SUPPORT_WEXT
168 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
169 CsrWifiSmeScanFullCfm
* cfm
= (CsrWifiSmeScanFullCfm
*)msg
;
172 unifi_error(NULL
, "CsrWifiSmeScanFullCfmSend: Invalid ospriv.\n");
176 sme_complete_request(priv
, cfm
->status
);
181 void CsrWifiSmeScanResultIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
187 void CsrWifiSmeConnectCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
189 #ifdef CSR_SUPPORT_WEXT
190 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
191 CsrWifiSmeConnectCfm
* cfm
= (CsrWifiSmeConnectCfm
*)msg
;
194 unifi_error(NULL
, "CsrWifiSmeConnectCfmSend: Invalid ospriv.\n");
198 sme_complete_request(priv
, cfm
->status
);
203 void CsrWifiSmeDisconnectCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
205 #ifdef CSR_SUPPORT_WEXT
206 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
207 CsrWifiSmeDisconnectCfm
* cfm
= (CsrWifiSmeDisconnectCfm
*)msg
;
210 unifi_error(NULL
, "CsrWifiSmeDisconnectCfmSend: Invalid ospriv.\n");
214 sme_complete_request(priv
, cfm
->status
);
219 void CsrWifiSmeKeyCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
221 #ifdef CSR_SUPPORT_WEXT
222 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
223 CsrWifiSmeKeyCfm
* cfm
= (CsrWifiSmeKeyCfm
*)msg
;
226 unifi_error(NULL
, "CsrWifiSmeKeyCfmSend: Invalid ospriv.\n");
230 sme_complete_request(priv
, cfm
->status
);
235 void CsrWifiSmeMulticastAddressCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
237 #ifdef CSR_SUPPORT_WEXT
238 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
239 CsrWifiSmeMulticastAddressCfm
* cfm
= (CsrWifiSmeMulticastAddressCfm
*)msg
;
242 unifi_error(NULL
, "CsrWifiSmeMulticastAddressCfmSend: Invalid ospriv.\n");
246 sme_complete_request(priv
, cfm
->status
);
250 void CsrWifiSmeWifiFlightmodeCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
252 #ifdef CSR_SUPPORT_WEXT
253 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
254 CsrWifiSmeWifiFlightmodeCfm
* cfm
= (CsrWifiSmeWifiFlightmodeCfm
*)msg
;
257 unifi_error(NULL
, "CsrWifiSmeWifiFlightmodeCfmSend: Invalid ospriv.\n");
261 sme_complete_request(priv
, cfm
->status
);
265 void CsrWifiSmeWifiOnCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
267 #ifdef CSR_SUPPORT_WEXT
268 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
269 CsrWifiSmeWifiOnCfm
* cfm
= (CsrWifiSmeWifiOnCfm
*)msg
;
272 unifi_error(NULL
, "CsrWifiSmeWifiOnCfmSend: Invalid ospriv.\n");
276 unifi_trace(priv
, UDBG4
,
277 "CsrWifiSmeWifiOnCfmSend: wake up status %d\n", cfm
->status
);
278 #ifdef CSR_SUPPORT_WEXT_AP
279 sme_complete_request(priv
, cfm
->status
);
285 void CsrWifiSmeWifiOffCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
287 #ifdef CSR_SUPPORT_WEXT
288 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
289 CsrWifiSmeWifiOffCfm
* cfm
= (CsrWifiSmeWifiOffCfm
*)msg
;
292 unifi_error(NULL
, "CsrWifiSmeWifiOffCfmSend: Invalid ospriv.\n");
296 sme_complete_request(priv
, cfm
->status
);
301 void CsrWifiSmeWifiOffIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
303 #ifdef CSR_SUPPORT_WEXT
304 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
305 CsrWifiSmeWifiOffInd
* ind
= (CsrWifiSmeWifiOffInd
*)msg
;
308 unifi_error(NULL
, "CsrWifiRouterCtrlStoppedReqSend: Invalid ospriv.\n");
312 if (priv
->smepriv
== NULL
) {
313 unifi_error(priv
, "CsrWifiRouterCtrlStoppedReqSend: invalid smepriv\n");
318 * If the status indicates an error, the SME is in a stopped state.
319 * We need to start it again in order to reinitialise UniFi.
321 switch (ind
->reason
) {
322 case CSR_WIFI_SME_CONTROL_INDICATION_ERROR
:
323 unifi_trace(priv
, UDBG1
,
324 "CsrWifiRouterCtrlStoppedReqSend: Restarting SME (ind:%d)\n",
327 /* On error, restart the SME */
328 sme_mgt_wifi_on(priv
);
330 case CSR_WIFI_SME_CONTROL_INDICATION_EXIT
:
331 #ifdef CSR_SUPPORT_WEXT_AP
332 sme_complete_request(priv
, 0);
342 void CsrWifiSmeVersionsGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
344 #ifdef CSR_SUPPORT_WEXT
345 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
346 CsrWifiSmeVersionsGetCfm
* cfm
= (CsrWifiSmeVersionsGetCfm
*)msg
;
349 unifi_error(NULL
, "CsrWifiSmeVersionsGetCfmSend: Invalid ospriv.\n");
353 priv
->sme_reply
.versions
= cfm
->versions
;
354 sme_complete_request(priv
, cfm
->status
);
358 void CsrWifiSmePowerConfigGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
360 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
361 CsrWifiSmePowerConfigGetCfm
* cfm
= (CsrWifiSmePowerConfigGetCfm
*)msg
;
364 unifi_error(NULL
, "CsrWifiSmePowerConfigGetCfmSend: Invalid ospriv.\n");
368 priv
->sme_reply
.powerConfig
= cfm
->powerConfig
;
369 sme_complete_request(priv
, cfm
->status
);
372 void CsrWifiSmeHostConfigGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
374 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
375 CsrWifiSmeHostConfigGetCfm
* cfm
= (CsrWifiSmeHostConfigGetCfm
*)msg
;
378 unifi_error(NULL
, "CsrWifiSmeHostConfigGetCfmSend: Invalid ospriv.\n");
382 priv
->sme_reply
.hostConfig
= cfm
->hostConfig
;
383 sme_complete_request(priv
, cfm
->status
);
386 void CsrWifiSmeCoexInfoGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
388 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
389 CsrWifiSmeCoexInfoGetCfm
* cfm
= (CsrWifiSmeCoexInfoGetCfm
*)msg
;
392 unifi_error(NULL
, "CsrWifiSmeCoexInfoGetCfmSend: Invalid ospriv.\n");
396 priv
->sme_reply
.coexInfo
= cfm
->coexInfo
;
397 sme_complete_request(priv
, cfm
->status
);
400 void CsrWifiSmeCoexConfigGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
402 #ifdef CSR_SUPPORT_WEXT
403 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
404 CsrWifiSmeCoexConfigGetCfm
* cfm
= (CsrWifiSmeCoexConfigGetCfm
*)msg
;
407 unifi_error(NULL
, "CsrWifiSmeCoexConfigGetCfmSend: Invalid ospriv.\n");
411 priv
->sme_reply
.coexConfig
= cfm
->coexConfig
;
412 sme_complete_request(priv
, cfm
->status
);
416 void CsrWifiSmeMibConfigGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
418 #ifdef CSR_SUPPORT_WEXT
419 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
420 CsrWifiSmeMibConfigGetCfm
* cfm
= (CsrWifiSmeMibConfigGetCfm
*)msg
;
423 unifi_error(NULL
, "CsrWifiSmeMibConfigGetCfmSend: Invalid ospriv.\n");
427 priv
->sme_reply
.mibConfig
= cfm
->mibConfig
;
428 sme_complete_request(priv
, cfm
->status
);
432 void CsrWifiSmeConnectionInfoGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
434 #ifdef CSR_SUPPORT_WEXT
435 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
436 CsrWifiSmeConnectionInfoGetCfm
* cfm
= (CsrWifiSmeConnectionInfoGetCfm
*)msg
;
439 unifi_error(NULL
, "CsrWifiSmeConnectionInfoGetCfmSend: Invalid ospriv.\n");
443 priv
->sme_reply
.connectionInfo
= cfm
->connectionInfo
;
444 sme_complete_request(priv
, cfm
->status
);
448 void CsrWifiSmeConnectionConfigGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
450 #ifdef CSR_SUPPORT_WEXT
451 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
452 CsrWifiSmeConnectionConfigGetCfm
* cfm
= (CsrWifiSmeConnectionConfigGetCfm
*)msg
;
455 unifi_error(NULL
, "CsrWifiSmeConnectionConfigGetCfmSend: Invalid ospriv.\n");
459 priv
->sme_reply
.connectionConfig
= cfm
->connectionConfig
;
460 sme_complete_request(priv
, cfm
->status
);
464 void CsrWifiSmeConnectionStatsGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
466 #ifdef CSR_SUPPORT_WEXT
467 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
468 CsrWifiSmeConnectionStatsGetCfm
* cfm
= (CsrWifiSmeConnectionStatsGetCfm
*)msg
;
471 unifi_error(NULL
, "CsrWifiSmeConnectionStatsGetCfmSend: Invalid ospriv.\n");
475 priv
->sme_reply
.connectionStats
= cfm
->connectionStats
;
476 sme_complete_request(priv
, cfm
->status
);
480 void CsrWifiSmeMibSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
482 #ifdef CSR_SUPPORT_WEXT
483 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
484 CsrWifiSmeMibSetCfm
* cfm
= (CsrWifiSmeMibSetCfm
*)msg
;
487 unifi_error(NULL
, "CsrWifiSmeMibSetCfmSend: Invalid ospriv.\n");
491 sme_complete_request(priv
, cfm
->status
);
495 void CsrWifiSmeMibGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
497 #ifdef CSR_SUPPORT_WEXT
498 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
499 CsrWifiSmeMibGetCfm
* cfm
= (CsrWifiSmeMibGetCfm
*)msg
;
502 unifi_error(NULL
, "CsrWifiSmeMibGetCfmSend: Invalid ospriv.\n");
506 if (cfm
->mibAttribute
== NULL
) {
507 unifi_error(priv
, "CsrWifiSmeMibGetCfmSend: Empty reply.\n");
508 sme_complete_request(priv
, cfm
->status
);
512 if ((priv
->mib_cfm_buffer
!= NULL
) &&
513 (priv
->mib_cfm_buffer_length
>= cfm
->mibAttributeLength
)) {
514 memcpy(priv
->mib_cfm_buffer
, cfm
->mibAttribute
, cfm
->mibAttributeLength
);
515 priv
->mib_cfm_buffer_length
= cfm
->mibAttributeLength
;
518 "CsrWifiSmeMibGetCfmSend: No room to store MIB data (have=%d need=%d).\n",
519 priv
->mib_cfm_buffer_length
, cfm
->mibAttributeLength
);
522 sme_complete_request(priv
, cfm
->status
);
526 void CsrWifiSmeMibGetNextCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
528 #ifdef CSR_SUPPORT_WEXT
529 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
530 CsrWifiSmeMibGetNextCfm
* cfm
= (CsrWifiSmeMibGetNextCfm
*)msg
;
533 unifi_error(NULL
, "CsrWifiSmeMibGetNextCfmSend: Invalid ospriv.\n");
537 /* Need to copy MIB data */
538 sme_complete_request(priv
, cfm
->status
);
542 void CsrWifiSmeConnectionQualityIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
544 #ifdef CSR_SUPPORT_WEXT
545 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
546 CsrWifiSmeConnectionQualityInd
* ind
= (CsrWifiSmeConnectionQualityInd
*)msg
;
547 int signal
, noise
, snr
;
550 unifi_error(NULL
, "CsrWifiSmeConnectionQualityIndSend: Invalid ospriv.\n");
555 * level and noise below are mapped into an unsigned 8 bit number,
556 * ranging from [-192; 63]. The way this is achieved is simply to
557 * add 0x100 onto the number if it is negative,
558 * once clipped to the correct range.
560 signal
= ind
->linkQuality
.unifiRssi
;
561 /* Clip range of snr */
562 snr
= (ind
->linkQuality
.unifiSnr
> 0) ? ind
->linkQuality
.unifiSnr
: 0; /* In dB relative, from 0 - 255 */
563 snr
= (snr
< 255) ? snr
: 255;
564 noise
= signal
- snr
;
566 /* Clip range of signal */
567 signal
= (signal
< 63) ? signal
: 63;
568 signal
= (signal
> -192) ? signal
: -192;
570 /* Clip range of noise */
571 noise
= (noise
< 63) ? noise
: 63;
572 noise
= (noise
> -192) ? noise
: -192;
575 signal
= ( signal
< 0 ) ? signal
+ 0x100 : signal
;
576 noise
= ( noise
< 0 ) ? noise
+ 0x100 : noise
;
578 priv
->wext_wireless_stats
.qual
.level
= (u8
)signal
; /* -192 : 63 */
579 priv
->wext_wireless_stats
.qual
.noise
= (u8
)noise
; /* -192 : 63 */
580 priv
->wext_wireless_stats
.qual
.qual
= snr
; /* 0 : 255 */
581 priv
->wext_wireless_stats
.qual
.updated
= 0;
583 #if WIRELESS_EXT > 16
584 priv
->wext_wireless_stats
.qual
.updated
|= IW_QUAL_LEVEL_UPDATED
|
585 IW_QUAL_NOISE_UPDATED
|
586 IW_QUAL_QUAL_UPDATED
;
587 #if WIRELESS_EXT > 18
588 priv
->wext_wireless_stats
.qual
.updated
|= IW_QUAL_DBM
;
594 void CsrWifiSmePacketFilterSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
596 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
599 unifi_error(NULL
, "CsrWifiSmePacketFilterSetCfmSend: Invalid ospriv.\n");
603 /* The packet filter set request does not block for a reply */
606 void CsrWifiSmeTspecCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
608 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
609 CsrWifiSmeTspecCfm
* cfm
= (CsrWifiSmeTspecCfm
*)msg
;
612 unifi_error(NULL
, "CsrWifiSmeTspecCfmSend: Invalid ospriv.\n");
616 sme_complete_request(priv
, cfm
->status
);
619 void CsrWifiSmeTspecIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
623 void CsrWifiSmeBlacklistCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
627 void CsrWifiSmeEventMaskSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
632 void CsrWifiSmeRoamStartIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
636 void CsrWifiSmeRoamCompleteIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
638 /* This is called when the association completes, before any 802.1x authentication */
641 void CsrWifiSmeAssociationStartIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
645 void CsrWifiSmeAssociationCompleteIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
649 void CsrWifiSmeIbssStationIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
653 void CsrWifiSmeWifiOnIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
657 void CsrWifiSmeRestrictedAccessEnableCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
661 void CsrWifiSmeRestrictedAccessDisableCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
666 void CsrWifiSmeAdhocConfigGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
670 void CsrWifiSmeAdhocConfigSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
672 #ifdef CSR_SUPPORT_WEXT
673 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
674 CsrWifiSmeAdhocConfigSetCfm
* cfm
= (CsrWifiSmeAdhocConfigSetCfm
*)msg
;
677 unifi_error(NULL
, "CsrWifiSmeSmeConfigSetCfmSend: Invalid ospriv.\n");
681 sme_complete_request(priv
, cfm
->status
);
685 void CsrWifiSmeCalibrationDataGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
689 void CsrWifiSmeCalibrationDataSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
691 #ifdef CSR_SUPPORT_WEXT
692 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
693 CsrWifiSmeCalibrationDataSetCfm
* cfm
= (CsrWifiSmeCalibrationDataSetCfm
*)msg
;
696 unifi_error(NULL
, "CsrWifiSmeSmeConfigSetCfmSend: Invalid ospriv.\n");
700 sme_complete_request(priv
, cfm
->status
);
704 void CsrWifiSmeCcxConfigGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
708 void CsrWifiSmeCcxConfigSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
710 #ifdef CSR_SUPPORT_WEXT
711 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
712 CsrWifiSmeCcxConfigSetCfm
* cfm
= (CsrWifiSmeCcxConfigSetCfm
*)msg
;
715 unifi_error(NULL
, "CsrWifiSmeSmeConfigSetCfmSend: Invalid ospriv.\n");
719 sme_complete_request(priv
, cfm
->status
);
723 void CsrWifiSmeCloakedSsidsGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
727 void CsrWifiSmeCloakedSsidsSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
729 #ifdef CSR_SUPPORT_WEXT
730 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
731 CsrWifiSmeCloakedSsidsSetCfm
* cfm
= (CsrWifiSmeCloakedSsidsSetCfm
*)msg
;
734 unifi_error(NULL
, "CsrWifiSmeSmeConfigSetCfmSend: Invalid ospriv.\n");
738 sme_complete_request(priv
, cfm
->status
);
743 void CsrWifiSmeCoexConfigSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
745 #ifdef CSR_SUPPORT_WEXT
746 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
747 CsrWifiSmeCoexConfigSetCfm
* cfm
= (CsrWifiSmeCoexConfigSetCfm
*)msg
;
750 unifi_error(NULL
, "CsrWifiSmeSmeConfigSetCfmSend: Invalid ospriv.\n");
754 sme_complete_request(priv
, cfm
->status
);
758 void CsrWifiSmeHostConfigSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
760 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
761 CsrWifiSmeHostConfigSetCfm
* cfm
= (CsrWifiSmeHostConfigSetCfm
*)msg
;
764 unifi_error(NULL
, "CsrWifiSmeSmeConfigSetCfmSend: Invalid ospriv.\n");
768 sme_complete_request(priv
, cfm
->status
);
771 void CsrWifiSmeLinkQualityGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
776 void CsrWifiSmeMibConfigSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
778 #ifdef CSR_SUPPORT_WEXT
779 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
780 CsrWifiSmeMibConfigSetCfm
* cfm
= (CsrWifiSmeMibConfigSetCfm
*)msg
;
783 unifi_error(NULL
, "CsrWifiSmeSmeConfigSetCfmSend: Invalid ospriv.\n");
787 sme_complete_request(priv
, cfm
->status
);
791 void CsrWifiSmePermanentMacAddressGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
795 void CsrWifiSmePowerConfigSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
797 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
798 CsrWifiSmePowerConfigSetCfm
* cfm
= (CsrWifiSmePowerConfigSetCfm
*)msg
;
801 unifi_error(NULL
, "CsrWifiSmeSmeConfigSetCfmSend: Invalid ospriv.\n");
805 sme_complete_request(priv
, cfm
->status
);
808 void CsrWifiSmeRegulatoryDomainInfoGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
812 void CsrWifiSmeRoamingConfigGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
816 void CsrWifiSmeMediaStatusIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
818 #ifdef CSR_SUPPORT_WEXT
819 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
820 CsrWifiSmeMediaStatusInd
* ind
= (CsrWifiSmeMediaStatusInd
*)msg
;
822 if (priv
->smepriv
== NULL
) {
823 unifi_error(priv
, "CsrWifiSmeMediaStatusIndSend: invalid smepriv\n");
827 if (ind
->mediaStatus
== CSR_WIFI_SME_MEDIA_STATUS_CONNECTED
) {
829 * Send wireless-extension event up to userland to announce
832 wext_send_assoc_event(priv
,
833 (unsigned char *)ind
->connectionInfo
.bssid
.a
,
834 (unsigned char *)ind
->connectionInfo
.assocReqInfoElements
,
835 ind
->connectionInfo
.assocReqInfoElementsLength
,
836 (unsigned char *)ind
->connectionInfo
.assocRspInfoElements
,
837 ind
->connectionInfo
.assocRspInfoElementsLength
,
838 (unsigned char *)ind
->connectionInfo
.assocScanInfoElements
,
839 ind
->connectionInfo
.assocScanInfoElementsLength
);
841 unifi_trace(priv
, UDBG2
, "CsrWifiSmeMediaStatusIndSend: IBSS=%pM\n",
842 ind
->connectionInfo
.bssid
.a
);
844 sme_mgt_packet_filter_set(priv
);
848 * Send wireless-extension event up to userland to announce
849 * connection lost to a BSS.
851 wext_send_disassoc_event(priv
);
856 void CsrWifiSmeRoamingConfigSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
858 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
859 CsrWifiSmeRoamingConfigSetCfm
* cfm
= (CsrWifiSmeRoamingConfigSetCfm
*)msg
;
862 unifi_error(NULL
, "CsrWifiSmeRoamingConfigSetCfmSend: Invalid ospriv.\n");
866 sme_complete_request(priv
, cfm
->status
);
869 void CsrWifiSmeScanConfigGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
873 void CsrWifiSmeScanConfigSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
875 #ifdef CSR_SUPPORT_WEXT
876 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
877 CsrWifiSmeScanConfigSetCfm
* cfm
= (CsrWifiSmeScanConfigSetCfm
*)msg
;
880 unifi_error(NULL
, "CsrWifiSmeSmeConfigSetCfmSend: Invalid ospriv.\n");
884 sme_complete_request(priv
, cfm
->status
);
888 void CsrWifiSmeStationMacAddressGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
892 void CsrWifiSmeSmeCommonConfigGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
894 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
895 CsrWifiSmeSmeCommonConfigGetCfm
* cfm
= (CsrWifiSmeSmeCommonConfigGetCfm
*)msg
;
898 unifi_error(NULL
, "CsrWifiSmeSmeCommonConfigGetCfmSend: Invalid ospriv.\n");
902 priv
->sme_reply
.deviceConfig
= cfm
->deviceConfig
;
903 sme_complete_request(priv
, cfm
->status
);
906 void CsrWifiSmeSmeStaConfigGetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
908 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
909 CsrWifiSmeSmeStaConfigGetCfm
* cfm
= (CsrWifiSmeSmeStaConfigGetCfm
*)msg
;
912 unifi_error(NULL
, "CsrWifiSmeSmeStaConfigGetCfmSend: Invalid ospriv.\n");
916 priv
->sme_reply
.staConfig
= cfm
->smeConfig
;
917 sme_complete_request(priv
, cfm
->status
);
920 void CsrWifiSmeSmeCommonConfigSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
922 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
923 CsrWifiSmeSmeCommonConfigSetCfm
* cfm
= (CsrWifiSmeSmeCommonConfigSetCfm
*)msg
;
926 unifi_error(NULL
, "CsrWifiSmeSmeCommonConfigGetCfmSend: Invalid ospriv.\n");
930 sme_complete_request(priv
, cfm
->status
);
933 void CsrWifiSmeSmeStaConfigSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
935 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
936 CsrWifiSmeSmeStaConfigSetCfm
* cfm
= (CsrWifiSmeSmeStaConfigSetCfm
*)msg
;
939 unifi_error(NULL
, "CsrWifiSmeSmeStaConfigGetCfmSend: Invalid ospriv.\n");
943 sme_complete_request(priv
, cfm
->status
);
946 void CsrWifiSmeGetInterfaceCapabilityCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
950 void CsrWifiSmeErrorIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
954 void CsrWifiSmeInfoIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
958 void CsrWifiSmeCoreDumpIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
961 void CsrWifiSmeAmpStatusChangeIndHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
965 void CsrWifiSmeActivateCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
968 void CsrWifiSmeDeactivateCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
972 #ifdef CSR_SUPPORT_WEXT
973 #ifdef CSR_SUPPORT_WEXT_AP
974 void CsrWifiNmeApStartCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
976 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
977 CsrWifiNmeApStartCfm
* cfm
= (CsrWifiNmeApStartCfm
*)msg
;
980 unifi_error(NULL
, "CsrWifiNmeApStartCfmSend: Invalid ospriv.\n");
984 sme_complete_request(priv
, cfm
->status
);
987 void CsrWifiNmeApStopCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
989 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
990 CsrWifiNmeApStopCfm
* cfm
= (CsrWifiNmeApStopCfm
*)msg
;
993 unifi_error(NULL
, "CsrWifiNmeApStopCfmSend: Invalid ospriv.\n");
997 sme_complete_request(priv
, cfm
->status
);
1000 void CsrWifiNmeApConfigSetCfmHandler(void* drvpriv
, CsrWifiFsmEvent
* msg
)
1002 unifi_priv_t
*priv
= (unifi_priv_t
*)drvpriv
;
1003 CsrWifiNmeApConfigSetCfm
* cfm
= (CsrWifiNmeApConfigSetCfm
*)msg
;
1006 unifi_error(NULL
, "CsrWifiNmeApConfigSetCfmSend: Invalid ospriv.\n");
1009 sme_complete_request(priv
, cfm
->status
);