2 * cfg80211 MLME SAP interface
4 * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
7 #include <linux/kernel.h>
8 #include <linux/module.h>
9 #include <linux/netdevice.h>
10 #include <linux/nl80211.h>
11 #include <linux/wireless.h>
12 #include <net/cfg80211.h>
13 #include <net/iw_handler.h>
17 void cfg80211_send_rx_auth(struct net_device
*dev
, const u8
*buf
, size_t len
)
19 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
20 struct wiphy
*wiphy
= wdev
->wiphy
;
21 struct cfg80211_registered_device
*rdev
= wiphy_to_dev(wiphy
);
22 struct ieee80211_mgmt
*mgmt
= (struct ieee80211_mgmt
*)buf
;
23 u8
*bssid
= mgmt
->bssid
;
25 u16 status
= le16_to_cpu(mgmt
->u
.auth
.status_code
);
30 for (i
= 0; i
< MAX_AUTH_BSSES
; i
++) {
31 if (wdev
->authtry_bsses
[i
] &&
32 memcmp(wdev
->authtry_bsses
[i
]->pub
.bssid
, bssid
,
34 if (status
== WLAN_STATUS_SUCCESS
) {
35 wdev
->auth_bsses
[i
] = wdev
->authtry_bsses
[i
];
37 cfg80211_unhold_bss(wdev
->authtry_bsses
[i
]);
38 cfg80211_put_bss(&wdev
->authtry_bsses
[i
]->pub
);
40 wdev
->authtry_bsses
[i
] = NULL
;
48 nl80211_send_rx_auth(rdev
, dev
, buf
, len
, GFP_KERNEL
);
49 cfg80211_sme_rx_auth(dev
, buf
, len
);
53 EXPORT_SYMBOL(cfg80211_send_rx_auth
);
55 void cfg80211_send_rx_assoc(struct net_device
*dev
, const u8
*buf
, size_t len
)
58 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
59 struct wiphy
*wiphy
= wdev
->wiphy
;
60 struct cfg80211_registered_device
*rdev
= wiphy_to_dev(wiphy
);
61 struct ieee80211_mgmt
*mgmt
= (struct ieee80211_mgmt
*)buf
;
62 u8
*ie
= mgmt
->u
.assoc_resp
.variable
;
63 int i
, ieoffs
= offsetof(struct ieee80211_mgmt
, u
.assoc_resp
.variable
);
64 struct cfg80211_internal_bss
*bss
= NULL
;
68 status_code
= le16_to_cpu(mgmt
->u
.assoc_resp
.status_code
);
71 * This is a bit of a hack, we don't notify userspace of
72 * a (re-)association reply if we tried to send a reassoc
73 * and got a reject -- we only try again with an assoc
74 * frame instead of reassoc.
76 if (status_code
!= WLAN_STATUS_SUCCESS
&& wdev
->conn
&&
77 cfg80211_sme_failed_reassoc(wdev
))
80 nl80211_send_rx_assoc(rdev
, dev
, buf
, len
, GFP_KERNEL
);
82 if (status_code
== WLAN_STATUS_SUCCESS
) {
83 for (i
= 0; i
< MAX_AUTH_BSSES
; i
++) {
84 if (!wdev
->auth_bsses
[i
])
86 if (memcmp(wdev
->auth_bsses
[i
]->pub
.bssid
, mgmt
->bssid
,
88 bss
= wdev
->auth_bsses
[i
];
89 wdev
->auth_bsses
[i
] = NULL
;
90 /* additional reference to drop hold */
91 cfg80211_ref_bss(bss
);
97 } else if (wdev
->conn
) {
98 cfg80211_sme_failed_assoc(wdev
);
100 * do not call connect_result() now because the
101 * sme will schedule work that does it later.
106 if (!wdev
->conn
&& wdev
->sme_state
== CFG80211_SME_IDLE
) {
108 * This is for the userspace SME, the CONNECTING
109 * state will be changed to CONNECTED by
110 * __cfg80211_connect_result() below.
112 wdev
->sme_state
= CFG80211_SME_CONNECTING
;
115 /* this consumes one bss reference (unless bss is NULL) */
116 __cfg80211_connect_result(dev
, mgmt
->bssid
, NULL
, 0, ie
, len
- ieoffs
,
118 status_code
== WLAN_STATUS_SUCCESS
,
119 bss
? &bss
->pub
: NULL
);
120 /* drop hold now, and also reference acquired above */
122 cfg80211_unhold_bss(bss
);
123 cfg80211_put_bss(&bss
->pub
);
129 EXPORT_SYMBOL(cfg80211_send_rx_assoc
);
131 void __cfg80211_send_deauth(struct net_device
*dev
,
132 const u8
*buf
, size_t len
)
134 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
135 struct wiphy
*wiphy
= wdev
->wiphy
;
136 struct cfg80211_registered_device
*rdev
= wiphy_to_dev(wiphy
);
137 struct ieee80211_mgmt
*mgmt
= (struct ieee80211_mgmt
*)buf
;
138 const u8
*bssid
= mgmt
->bssid
;
141 ASSERT_WDEV_LOCK(wdev
);
143 nl80211_send_deauth(rdev
, dev
, buf
, len
, GFP_KERNEL
);
145 if (wdev
->current_bss
&&
146 memcmp(wdev
->current_bss
->pub
.bssid
, bssid
, ETH_ALEN
) == 0) {
147 cfg80211_unhold_bss(wdev
->current_bss
);
148 cfg80211_put_bss(&wdev
->current_bss
->pub
);
149 wdev
->current_bss
= NULL
;
150 } else for (i
= 0; i
< MAX_AUTH_BSSES
; i
++) {
151 if (wdev
->auth_bsses
[i
] &&
152 memcmp(wdev
->auth_bsses
[i
]->pub
.bssid
, bssid
, ETH_ALEN
) == 0) {
153 cfg80211_unhold_bss(wdev
->auth_bsses
[i
]);
154 cfg80211_put_bss(&wdev
->auth_bsses
[i
]->pub
);
155 wdev
->auth_bsses
[i
] = NULL
;
158 if (wdev
->authtry_bsses
[i
] &&
159 memcmp(wdev
->authtry_bsses
[i
]->pub
.bssid
, bssid
, ETH_ALEN
) == 0) {
160 cfg80211_unhold_bss(wdev
->authtry_bsses
[i
]);
161 cfg80211_put_bss(&wdev
->authtry_bsses
[i
]->pub
);
162 wdev
->authtry_bsses
[i
] = NULL
;
167 if (wdev
->sme_state
== CFG80211_SME_CONNECTED
) {
171 reason_code
= le16_to_cpu(mgmt
->u
.deauth
.reason_code
);
173 from_ap
= memcmp(mgmt
->sa
, dev
->dev_addr
, ETH_ALEN
) != 0;
174 __cfg80211_disconnected(dev
, NULL
, 0, reason_code
, from_ap
);
175 } else if (wdev
->sme_state
== CFG80211_SME_CONNECTING
) {
176 __cfg80211_connect_result(dev
, mgmt
->bssid
, NULL
, 0, NULL
, 0,
177 WLAN_STATUS_UNSPECIFIED_FAILURE
,
181 EXPORT_SYMBOL(__cfg80211_send_deauth
);
183 void cfg80211_send_deauth(struct net_device
*dev
, const u8
*buf
, size_t len
)
185 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
188 __cfg80211_send_deauth(dev
, buf
, len
);
191 EXPORT_SYMBOL(cfg80211_send_deauth
);
193 void __cfg80211_send_disassoc(struct net_device
*dev
,
194 const u8
*buf
, size_t len
)
196 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
197 struct wiphy
*wiphy
= wdev
->wiphy
;
198 struct cfg80211_registered_device
*rdev
= wiphy_to_dev(wiphy
);
199 struct ieee80211_mgmt
*mgmt
= (struct ieee80211_mgmt
*)buf
;
200 const u8
*bssid
= mgmt
->bssid
;
206 ASSERT_WDEV_LOCK(wdev
);
208 nl80211_send_disassoc(rdev
, dev
, buf
, len
, GFP_KERNEL
);
210 if (wdev
->sme_state
!= CFG80211_SME_CONNECTED
)
213 if (wdev
->current_bss
&&
214 memcmp(wdev
->current_bss
->pub
.bssid
, bssid
, ETH_ALEN
) == 0) {
215 for (i
= 0; i
< MAX_AUTH_BSSES
; i
++) {
216 if (wdev
->authtry_bsses
[i
] || wdev
->auth_bsses
[i
])
218 wdev
->auth_bsses
[i
] = wdev
->current_bss
;
219 wdev
->current_bss
= NULL
;
221 cfg80211_sme_disassoc(dev
, i
);
229 reason_code
= le16_to_cpu(mgmt
->u
.disassoc
.reason_code
);
231 from_ap
= memcmp(mgmt
->sa
, dev
->dev_addr
, ETH_ALEN
) != 0;
232 __cfg80211_disconnected(dev
, NULL
, 0, reason_code
, from_ap
);
234 EXPORT_SYMBOL(__cfg80211_send_disassoc
);
236 void cfg80211_send_disassoc(struct net_device
*dev
, const u8
*buf
, size_t len
)
238 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
241 __cfg80211_send_disassoc(dev
, buf
, len
);
244 EXPORT_SYMBOL(cfg80211_send_disassoc
);
246 static void __cfg80211_auth_remove(struct wireless_dev
*wdev
, const u8
*addr
)
251 ASSERT_WDEV_LOCK(wdev
);
253 for (i
= 0; addr
&& i
< MAX_AUTH_BSSES
; i
++) {
254 if (wdev
->authtry_bsses
[i
] &&
255 memcmp(wdev
->authtry_bsses
[i
]->pub
.bssid
,
256 addr
, ETH_ALEN
) == 0) {
257 cfg80211_unhold_bss(wdev
->authtry_bsses
[i
]);
258 cfg80211_put_bss(&wdev
->authtry_bsses
[i
]->pub
);
259 wdev
->authtry_bsses
[i
] = NULL
;
268 void __cfg80211_auth_canceled(struct net_device
*dev
, const u8
*addr
)
270 __cfg80211_auth_remove(dev
->ieee80211_ptr
, addr
);
272 EXPORT_SYMBOL(__cfg80211_auth_canceled
);
274 void cfg80211_send_auth_timeout(struct net_device
*dev
, const u8
*addr
)
276 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
277 struct wiphy
*wiphy
= wdev
->wiphy
;
278 struct cfg80211_registered_device
*rdev
= wiphy_to_dev(wiphy
);
282 nl80211_send_auth_timeout(rdev
, dev
, addr
, GFP_KERNEL
);
283 if (wdev
->sme_state
== CFG80211_SME_CONNECTING
)
284 __cfg80211_connect_result(dev
, addr
, NULL
, 0, NULL
, 0,
285 WLAN_STATUS_UNSPECIFIED_FAILURE
,
288 __cfg80211_auth_remove(wdev
, addr
);
292 EXPORT_SYMBOL(cfg80211_send_auth_timeout
);
294 void cfg80211_send_assoc_timeout(struct net_device
*dev
, const u8
*addr
)
296 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
297 struct wiphy
*wiphy
= wdev
->wiphy
;
298 struct cfg80211_registered_device
*rdev
= wiphy_to_dev(wiphy
);
304 nl80211_send_assoc_timeout(rdev
, dev
, addr
, GFP_KERNEL
);
305 if (wdev
->sme_state
== CFG80211_SME_CONNECTING
)
306 __cfg80211_connect_result(dev
, addr
, NULL
, 0, NULL
, 0,
307 WLAN_STATUS_UNSPECIFIED_FAILURE
,
310 for (i
= 0; addr
&& i
< MAX_AUTH_BSSES
; i
++) {
311 if (wdev
->auth_bsses
[i
] &&
312 memcmp(wdev
->auth_bsses
[i
]->pub
.bssid
,
313 addr
, ETH_ALEN
) == 0) {
314 cfg80211_unhold_bss(wdev
->auth_bsses
[i
]);
315 cfg80211_put_bss(&wdev
->auth_bsses
[i
]->pub
);
316 wdev
->auth_bsses
[i
] = NULL
;
326 EXPORT_SYMBOL(cfg80211_send_assoc_timeout
);
328 void cfg80211_michael_mic_failure(struct net_device
*dev
, const u8
*addr
,
329 enum nl80211_key_type key_type
, int key_id
,
330 const u8
*tsc
, gfp_t gfp
)
332 struct wiphy
*wiphy
= dev
->ieee80211_ptr
->wiphy
;
333 struct cfg80211_registered_device
*rdev
= wiphy_to_dev(wiphy
);
334 #ifdef CONFIG_CFG80211_WEXT
335 union iwreq_data wrqu
;
336 char *buf
= kmalloc(128, gfp
);
339 sprintf(buf
, "MLME-MICHAELMICFAILURE.indication("
340 "keyid=%d %scast addr=%pM)", key_id
,
341 key_type
== NL80211_KEYTYPE_GROUP
? "broad" : "uni",
343 memset(&wrqu
, 0, sizeof(wrqu
));
344 wrqu
.data
.length
= strlen(buf
);
345 wireless_send_event(dev
, IWEVCUSTOM
, &wrqu
, buf
);
350 nl80211_michael_mic_failure(rdev
, dev
, addr
, key_type
, key_id
, tsc
, gfp
);
352 EXPORT_SYMBOL(cfg80211_michael_mic_failure
);
354 /* some MLME handling for userspace SME */
355 int __cfg80211_mlme_auth(struct cfg80211_registered_device
*rdev
,
356 struct net_device
*dev
,
357 struct ieee80211_channel
*chan
,
358 enum nl80211_auth_type auth_type
,
360 const u8
*ssid
, int ssid_len
,
361 const u8
*ie
, int ie_len
,
362 const u8
*key
, int key_len
, int key_idx
)
364 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
365 struct cfg80211_auth_request req
;
366 struct cfg80211_internal_bss
*bss
;
367 int i
, err
, slot
= -1, nfree
= 0;
369 ASSERT_WDEV_LOCK(wdev
);
371 if (auth_type
== NL80211_AUTHTYPE_SHARED_KEY
)
372 if (!key
|| !key_len
|| key_idx
< 0 || key_idx
> 4)
375 if (wdev
->current_bss
&&
376 memcmp(bssid
, wdev
->current_bss
->pub
.bssid
, ETH_ALEN
) == 0)
379 for (i
= 0; i
< MAX_AUTH_BSSES
; i
++) {
380 if (wdev
->authtry_bsses
[i
] &&
381 memcmp(bssid
, wdev
->authtry_bsses
[i
]->pub
.bssid
,
384 if (wdev
->auth_bsses
[i
] &&
385 memcmp(bssid
, wdev
->auth_bsses
[i
]->pub
.bssid
,
390 memset(&req
, 0, sizeof(req
));
394 req
.auth_type
= auth_type
;
395 req
.bss
= cfg80211_get_bss(&rdev
->wiphy
, chan
, bssid
, ssid
, ssid_len
,
396 WLAN_CAPABILITY_ESS
, WLAN_CAPABILITY_ESS
);
398 req
.key_len
= key_len
;
399 req
.key_idx
= key_idx
;
403 bss
= bss_from_pub(req
.bss
);
405 for (i
= 0; i
< MAX_AUTH_BSSES
; i
++) {
406 if (!wdev
->auth_bsses
[i
] && !wdev
->authtry_bsses
[i
]) {
412 /* we need one free slot for disassoc and one for this auth */
418 wdev
->authtry_bsses
[slot
] = bss
;
419 cfg80211_hold_bss(bss
);
421 err
= rdev
->ops
->auth(&rdev
->wiphy
, dev
, &req
);
423 wdev
->authtry_bsses
[slot
] = NULL
;
424 cfg80211_unhold_bss(bss
);
429 cfg80211_put_bss(req
.bss
);
433 int cfg80211_mlme_auth(struct cfg80211_registered_device
*rdev
,
434 struct net_device
*dev
, struct ieee80211_channel
*chan
,
435 enum nl80211_auth_type auth_type
, const u8
*bssid
,
436 const u8
*ssid
, int ssid_len
,
437 const u8
*ie
, int ie_len
,
438 const u8
*key
, int key_len
, int key_idx
)
442 wdev_lock(dev
->ieee80211_ptr
);
443 err
= __cfg80211_mlme_auth(rdev
, dev
, chan
, auth_type
, bssid
,
444 ssid
, ssid_len
, ie
, ie_len
,
445 key
, key_len
, key_idx
);
446 wdev_unlock(dev
->ieee80211_ptr
);
451 int __cfg80211_mlme_assoc(struct cfg80211_registered_device
*rdev
,
452 struct net_device
*dev
,
453 struct ieee80211_channel
*chan
,
454 const u8
*bssid
, const u8
*prev_bssid
,
455 const u8
*ssid
, int ssid_len
,
456 const u8
*ie
, int ie_len
, bool use_mfp
,
457 struct cfg80211_crypto_settings
*crypt
)
459 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
460 struct cfg80211_assoc_request req
;
461 struct cfg80211_internal_bss
*bss
;
462 int i
, err
, slot
= -1;
463 bool was_connected
= false;
465 ASSERT_WDEV_LOCK(wdev
);
467 memset(&req
, 0, sizeof(req
));
469 if (wdev
->current_bss
&& prev_bssid
&&
470 memcmp(wdev
->current_bss
->pub
.bssid
, prev_bssid
, ETH_ALEN
) == 0) {
472 * Trying to reassociate: Allow this to proceed and let the old
473 * association to be dropped when the new one is completed.
475 if (wdev
->sme_state
== CFG80211_SME_CONNECTED
) {
476 was_connected
= true;
477 wdev
->sme_state
= CFG80211_SME_CONNECTING
;
479 } else if (wdev
->current_bss
)
484 memcpy(&req
.crypto
, crypt
, sizeof(req
.crypto
));
485 req
.use_mfp
= use_mfp
;
486 req
.prev_bssid
= prev_bssid
;
487 req
.bss
= cfg80211_get_bss(&rdev
->wiphy
, chan
, bssid
, ssid
, ssid_len
,
488 WLAN_CAPABILITY_ESS
, WLAN_CAPABILITY_ESS
);
491 wdev
->sme_state
= CFG80211_SME_CONNECTED
;
495 bss
= bss_from_pub(req
.bss
);
497 for (i
= 0; i
< MAX_AUTH_BSSES
; i
++) {
498 if (bss
== wdev
->auth_bsses
[i
]) {
509 err
= rdev
->ops
->assoc(&rdev
->wiphy
, dev
, &req
);
511 if (err
&& was_connected
)
512 wdev
->sme_state
= CFG80211_SME_CONNECTED
;
513 /* still a reference in wdev->auth_bsses[slot] */
514 cfg80211_put_bss(req
.bss
);
518 int cfg80211_mlme_assoc(struct cfg80211_registered_device
*rdev
,
519 struct net_device
*dev
,
520 struct ieee80211_channel
*chan
,
521 const u8
*bssid
, const u8
*prev_bssid
,
522 const u8
*ssid
, int ssid_len
,
523 const u8
*ie
, int ie_len
, bool use_mfp
,
524 struct cfg80211_crypto_settings
*crypt
)
526 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
530 err
= __cfg80211_mlme_assoc(rdev
, dev
, chan
, bssid
, prev_bssid
,
531 ssid
, ssid_len
, ie
, ie_len
, use_mfp
, crypt
);
537 int __cfg80211_mlme_deauth(struct cfg80211_registered_device
*rdev
,
538 struct net_device
*dev
, const u8
*bssid
,
539 const u8
*ie
, int ie_len
, u16 reason
)
541 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
542 struct cfg80211_deauth_request req
;
545 ASSERT_WDEV_LOCK(wdev
);
547 memset(&req
, 0, sizeof(req
));
548 req
.reason_code
= reason
;
551 if (wdev
->current_bss
&&
552 memcmp(wdev
->current_bss
->pub
.bssid
, bssid
, ETH_ALEN
) == 0) {
553 req
.bss
= &wdev
->current_bss
->pub
;
554 } else for (i
= 0; i
< MAX_AUTH_BSSES
; i
++) {
555 if (wdev
->auth_bsses
[i
] &&
556 memcmp(bssid
, wdev
->auth_bsses
[i
]->pub
.bssid
, ETH_ALEN
) == 0) {
557 req
.bss
= &wdev
->auth_bsses
[i
]->pub
;
560 if (wdev
->authtry_bsses
[i
] &&
561 memcmp(bssid
, wdev
->authtry_bsses
[i
]->pub
.bssid
, ETH_ALEN
) == 0) {
562 req
.bss
= &wdev
->authtry_bsses
[i
]->pub
;
570 return rdev
->ops
->deauth(&rdev
->wiphy
, dev
, &req
, wdev
);
573 int cfg80211_mlme_deauth(struct cfg80211_registered_device
*rdev
,
574 struct net_device
*dev
, const u8
*bssid
,
575 const u8
*ie
, int ie_len
, u16 reason
)
577 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
581 err
= __cfg80211_mlme_deauth(rdev
, dev
, bssid
, ie
, ie_len
, reason
);
587 static int __cfg80211_mlme_disassoc(struct cfg80211_registered_device
*rdev
,
588 struct net_device
*dev
, const u8
*bssid
,
589 const u8
*ie
, int ie_len
, u16 reason
)
591 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
592 struct cfg80211_disassoc_request req
;
594 ASSERT_WDEV_LOCK(wdev
);
596 if (wdev
->sme_state
!= CFG80211_SME_CONNECTED
)
599 if (WARN_ON(!wdev
->current_bss
))
602 memset(&req
, 0, sizeof(req
));
603 req
.reason_code
= reason
;
606 if (memcmp(wdev
->current_bss
->pub
.bssid
, bssid
, ETH_ALEN
) == 0)
607 req
.bss
= &wdev
->current_bss
->pub
;
611 return rdev
->ops
->disassoc(&rdev
->wiphy
, dev
, &req
, wdev
);
614 int cfg80211_mlme_disassoc(struct cfg80211_registered_device
*rdev
,
615 struct net_device
*dev
, const u8
*bssid
,
616 const u8
*ie
, int ie_len
, u16 reason
)
618 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
622 err
= __cfg80211_mlme_disassoc(rdev
, dev
, bssid
, ie
, ie_len
, reason
);
628 void cfg80211_mlme_down(struct cfg80211_registered_device
*rdev
,
629 struct net_device
*dev
)
631 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
632 struct cfg80211_deauth_request req
;
635 ASSERT_WDEV_LOCK(wdev
);
637 if (!rdev
->ops
->deauth
)
640 memset(&req
, 0, sizeof(req
));
641 req
.reason_code
= WLAN_REASON_DEAUTH_LEAVING
;
645 if (wdev
->current_bss
) {
646 req
.bss
= &wdev
->current_bss
->pub
;
647 rdev
->ops
->deauth(&rdev
->wiphy
, dev
, &req
, wdev
);
648 if (wdev
->current_bss
) {
649 cfg80211_unhold_bss(wdev
->current_bss
);
650 cfg80211_put_bss(&wdev
->current_bss
->pub
);
651 wdev
->current_bss
= NULL
;
655 for (i
= 0; i
< MAX_AUTH_BSSES
; i
++) {
656 if (wdev
->auth_bsses
[i
]) {
657 req
.bss
= &wdev
->auth_bsses
[i
]->pub
;
658 rdev
->ops
->deauth(&rdev
->wiphy
, dev
, &req
, wdev
);
659 if (wdev
->auth_bsses
[i
]) {
660 cfg80211_unhold_bss(wdev
->auth_bsses
[i
]);
661 cfg80211_put_bss(&wdev
->auth_bsses
[i
]->pub
);
662 wdev
->auth_bsses
[i
] = NULL
;
665 if (wdev
->authtry_bsses
[i
]) {
666 req
.bss
= &wdev
->authtry_bsses
[i
]->pub
;
667 rdev
->ops
->deauth(&rdev
->wiphy
, dev
, &req
, wdev
);
668 if (wdev
->authtry_bsses
[i
]) {
669 cfg80211_unhold_bss(wdev
->authtry_bsses
[i
]);
670 cfg80211_put_bss(&wdev
->authtry_bsses
[i
]->pub
);
671 wdev
->authtry_bsses
[i
] = NULL
;