7 #include <linux/kernel.h>
8 #include <linux/module.h>
10 #include <linux/netdevice.h>
12 #include <linux/slab.h>
13 #include <linux/wireless.h>
35 const u8 *
buf,
size_t len)
42 u8 *ie = mgmt->
u.assoc_resp.variable;
47 status_code =
le16_to_cpu(mgmt->
u.assoc_resp.status_code);
79 wdev->
sme_state = CFG80211_SME_CONNECTING;
92 const u8 *
buf,
size_t len)
99 bool was_current =
false;
104 ether_addr_equal(wdev->
current_bss->pub.bssid, bssid)) {
113 if (wdev->
sme_state == CFG80211_SME_CONNECTED && was_current) {
119 from_ap = !ether_addr_equal(mgmt->
sa, dev->
dev_addr);
121 }
else if (wdev->
sme_state == CFG80211_SME_CONNECTING) {
140 const u8 *
buf,
size_t len)
154 if (wdev->
sme_state != CFG80211_SME_CONNECTED)
158 ether_addr_equal(wdev->
current_bss->pub.bssid, bssid)) {
167 reason_code =
le16_to_cpu(mgmt->
u.disassoc.reason_code);
169 from_ap = !ether_addr_equal(mgmt->
sa, dev->
dev_addr);
215 if (wdev->
sme_state == CFG80211_SME_CONNECTING)
233 if (wdev->
sme_state == CFG80211_SME_CONNECTING)
248 #ifdef CONFIG_CFG80211_WEXT
253 sprintf(buf,
"MLME-MICHAELMICFAILURE.indication("
254 "keyid=%d %scast addr=%pM)", key_id,
257 memset(&wrqu, 0,
sizeof(wrqu));
274 const u8 *
ssid,
int ssid_len,
285 if (!key || !key_len || key_idx < 0 || key_idx > 4)
289 ether_addr_equal(bssid, wdev->
current_bss->pub.bssid))
292 memset(&req, 0,
sizeof(req));
305 err = cfg80211_can_use_chan(rdev, wdev, req.
bss->channel,
310 err = rdev->
ops->auth(&rdev->wiphy, dev, &req);
320 const u8 *
ssid,
int ssid_len,
329 ssid, ssid_len, ie, ie_len,
330 key, key_len, key_idx);
344 memset(ht_capa, 0,
sizeof(*ht_capa));
349 p2 = (
u8*)(ht_capa_mask);
350 for (i = 0; i<
sizeof(*ht_capa); i++)
358 const u8 *
ssid,
int ssid_len,
367 bool was_connected =
false;
371 memset(&req, 0,
sizeof(req));
374 ether_addr_equal(wdev->
current_bss->pub.bssid, prev_bssid)) {
379 if (wdev->
sme_state == CFG80211_SME_CONNECTED) {
380 was_connected =
true;
381 wdev->
sme_state = CFG80211_SME_CONNECTING;
391 req.
flags = assoc_flags;
398 rdev->wiphy.ht_capa_mod_mask);
404 wdev->
sme_state = CFG80211_SME_CONNECTED;
408 err = cfg80211_can_use_chan(rdev, wdev, req.
bss->channel,
413 err = rdev->
ops->assoc(&rdev->wiphy, dev, &req);
418 wdev->
sme_state = CFG80211_SME_CONNECTED;
429 const u8 *
ssid,
int ssid_len,
441 ssid, ssid_len, ie, ie_len, use_mfp, crypt,
442 assoc_flags, ht_capa, ht_capa_mask);
452 bool local_state_change)
466 !ether_addr_equal(wdev->
current_bss->pub.bssid, bssid)))
469 return rdev->
ops->deauth(&rdev->wiphy, dev, &req);
491 bool local_state_change)
498 if (wdev->
sme_state != CFG80211_SME_CONNECTED)
509 if (ether_addr_equal(wdev->
current_bss->pub.bssid, bssid))
514 return rdev->
ops->disassoc(&rdev->wiphy, dev, &
req);
519 const u8 *ie,
int ie_len,
u16 reason,
520 bool local_state_change)
526 err = __cfg80211_mlme_disassoc(rdev, dev, bssid, ie, ie_len, reason,
542 if (!rdev->
ops->deauth)
545 memset(&req, 0,
sizeof(req));
555 rdev->
ops->deauth(&rdev->wiphy, dev, &req);
642 if (!wdev->
wiphy->mgmt_stypes)
652 if (!(wdev->
wiphy->mgmt_stypes[wdev->
iftype].rx &
BIT(mgmt_type)))
655 nreg = kzalloc(
sizeof(*reg) + match_len,
GFP_KERNEL);
684 if (rdev->
ops->mgmt_frame_register)
685 rdev->
ops->mgmt_frame_register(wiphy, wdev, frame_type,
true);
705 if (rdev->
ops->mgmt_frame_register) {
708 rdev->
ops->mgmt_frame_register(wiphy, wdev,
740 bool channel_type_valid,
unsigned int wait,
741 const u8 *
buf,
size_t len,
bool no_cck,
747 if (!wdev->
wiphy->mgmt_stypes)
750 if (!rdev->
ops->mgmt_tx)
762 if (!(wdev->
wiphy->mgmt_stypes[wdev->
iftype].tx &
BIT(stype >> 4)))
780 if (!ether_addr_equal(wdev->
current_bss->pub.bssid,
794 if (!ether_addr_equal(wdev->
current_bss->pub.bssid,
803 if (!ether_addr_equal(mgmt->
bssid, wdev_address(wdev)))
807 if (!ether_addr_equal(mgmt->
sa, mgmt->
bssid)) {
831 if (!ether_addr_equal(mgmt->
sa, wdev_address(wdev)))
835 return rdev->
ops->mgmt_tx(&rdev->wiphy, wdev, chan, offchan,
836 channel_type, channel_type_valid,
837 wait, buf, len, no_cck, dont_wait_for_ack,
859 if (!(stypes->
rx &
BIT(stype)))
932 const u8 *peer,
u32 num_packets,
945 const u8 *replay_ctr,
gfp_t gfp)
956 const u8 *bssid,
bool preauth,
gfp_t gfp)