8 #include <linux/if_arp.h>
9 #include <linux/slab.h>
10 #include <linux/export.h>
20 #ifdef CONFIG_CFG80211_WEXT
42 cfg80211_hold_bss(bss_from_pub(bss));
50 #ifdef CONFIG_CFG80211_WEXT
51 memset(&wrqu, 0,
sizeof(wrqu));
66 ev = kzalloc(
sizeof(*ev), gfp);
75 spin_unlock_irqrestore(&wdev->
event_lock, flags);
100 rdev->wiphy.bands[params->
channel->band];
107 if (sband->
bitrates[j].flags & flag)
117 #ifdef CONFIG_CFG80211_WEXT
120 wdev->
sme_state = CFG80211_SME_CONNECTING;
122 err = cfg80211_can_use_chan(rdev, wdev, params->
channel,
131 err = rdev->
ops->join_ibss(&rdev->wiphy, dev, params);
161 static void __cfg80211_clear_ibss(
struct net_device *
dev,
bool nowext)
176 if (rdev->
ops->del_key)
177 for (i = 0; i < 6; i++)
188 #ifdef CONFIG_CFG80211_WEXT
199 __cfg80211_clear_ibss(dev, nowext);
214 err = rdev->
ops->leave_ibss(&rdev->wiphy, dev);
219 __cfg80211_clear_ibss(dev, nowext);
237 #ifdef CONFIG_CFG80211_WEXT
251 if (!wdev->wext.ibss.
channel) {
256 sband = rdev->wiphy.bands[
band];
266 wdev->wext.ibss.
channel = chan;
282 if (!netif_running(wdev->
netdev))
285 if (wdev->wext.keys) {
286 wdev->wext.keys->def = wdev->wext.default_key;
287 wdev->wext.keys->defmgmt = wdev->wext.default_mgmt_key;
290 wdev->wext.ibss.privacy = wdev->wext.default_key != -1;
292 if (wdev->wext.keys) {
296 for (i = 0; i < 6; i++)
300 &wdev->wext.ibss, ck);
320 if (!rdev->
ops->join_ibss)
328 chan = ieee80211_get_channel(wdev->
wiphy, freq);
336 if (wdev->wext.ibss.
channel == chan)
349 wdev->wext.ibss.
channel = chan;
350 wdev->wext.ibss.channel_fixed =
true;
353 wdev->wext.ibss.channel_fixed =
false;
367 struct iw_freq *freq,
char *extra)
379 else if (wdev->wext.ibss.
channel)
380 chan = wdev->wext.ibss.
channel;
406 if (!rdev->
ops->join_ibss)
419 if (len > 0 && ssid[len - 1] ==
'\0')
452 }
else if (wdev->wext.ibss.
ssid && wdev->wext.ibss.
ssid_len) {
464 struct sockaddr *ap_addr,
char *extra)
475 if (!rdev->
ops->join_ibss)
482 if (is_zero_ether_addr(bssid) || is_broadcast_ether_addr(bssid))
486 if (!bssid && !wdev->wext.ibss.bssid)
490 if (wdev->wext.ibss.bssid && bssid &&
491 ether_addr_equal(bssid, wdev->wext.ibss.bssid))
505 wdev->wext.ibss.bssid = wdev->wext.bssid;
507 wdev->wext.ibss.bssid =
NULL;
520 struct sockaddr *ap_addr,
char *extra)
533 else if (wdev->wext.ibss.bssid)