8 #include <linux/export.h>
10 #include <linux/if_arp.h>
11 #include <linux/slab.h>
21 const u8 *prev_bssid =
NULL;
27 if (!netif_running(wdev->
netdev))
30 wdev->wext.connect.ie = wdev->wext.ie;
31 wdev->wext.connect.ie_len = wdev->wext.ie_len;
34 wdev->wext.connect.bg_scan_period = -1;
36 if (wdev->wext.keys) {
37 wdev->wext.keys->def = wdev->wext.default_key;
38 wdev->wext.keys->defmgmt = wdev->wext.default_mgmt_key;
39 if (wdev->wext.default_key != -1)
40 wdev->wext.connect.privacy =
true;
46 if (wdev->wext.keys) {
50 for (i = 0; i < 6; i++)
54 if (wdev->wext.prev_bssid_valid)
55 prev_bssid = wdev->wext.prev_bssid;
58 &wdev->wext.connect, ck, prev_bssid);
83 chan = ieee80211_get_channel(wdev->
wiphy, freq);
90 cfg80211_lock_rdev(rdev);
94 if (wdev->
sme_state != CFG80211_SME_IDLE) {
97 if (wdev->wext.connect.
channel == chan) {
112 wdev->wext.connect.
channel = chan;
121 if (chan && !wdev->wext.connect.
ssid_len) {
130 cfg80211_unlock_rdev(rdev);
148 else if (wdev->wext.connect.
channel)
149 chan = wdev->wext.connect.
channel;
179 if (len > 0 && ssid[len - 1] ==
'\0')
182 cfg80211_lock_rdev(rdev);
188 if (wdev->
sme_state != CFG80211_SME_IDLE) {
191 if (wdev->wext.connect.
ssid && len &&
192 len == wdev->wext.connect.
ssid_len &&
193 memcmp(wdev->wext.connect.
ssid, ssid, len) == 0)
205 wdev->wext.prev_bssid_valid =
false;
206 wdev->wext.connect.
ssid = wdev->wext.
ssid;
210 wdev->wext.connect.crypto.control_port =
false;
211 wdev->wext.connect.crypto.control_port_ethertype =
218 cfg80211_unlock_rdev(rdev);
243 }
else if (wdev->wext.connect.
ssid && wdev->wext.connect.
ssid_len) {
270 if (is_zero_ether_addr(bssid) || is_broadcast_ether_addr(bssid))
273 cfg80211_lock_rdev(rdev);
277 if (wdev->
sme_state != CFG80211_SME_IDLE) {
280 if (!bssid && !wdev->wext.connect.bssid)
284 if (wdev->wext.connect.bssid && bssid &&
285 ether_addr_equal(bssid, wdev->wext.connect.bssid))
296 wdev->wext.connect.bssid = wdev->wext.bssid;
298 wdev->wext.connect.bssid =
NULL;
304 cfg80211_unlock_rdev(rdev);
349 if (wdev->wext.ie_len == ie_len &&
350 memcmp(wdev->wext.ie, ie, ie_len) == 0)
362 kfree(wdev->wext.ie);
364 wdev->wext.ie_len = ie_len;
366 if (wdev->
sme_state != CFG80211_SME_IDLE) {
392 rdev = wiphy_to_dev(wdev->
wiphy);