diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/wireless/Makefile | 2 | ||||
-rw-r--r-- | net/wireless/ap.c | 44 | ||||
-rw-r--r-- | net/wireless/core.h | 4 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 17 |
4 files changed, 50 insertions, 17 deletions
diff --git a/net/wireless/Makefile b/net/wireless/Makefile index 55a28ab21db9..0f7e0d621ab0 100644 --- a/net/wireless/Makefile +++ b/net/wireless/Makefile | |||
@@ -10,7 +10,7 @@ obj-$(CONFIG_WEXT_SPY) += wext-spy.o | |||
10 | obj-$(CONFIG_WEXT_PRIV) += wext-priv.o | 10 | obj-$(CONFIG_WEXT_PRIV) += wext-priv.o |
11 | 11 | ||
12 | cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o | 12 | cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o |
13 | cfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o | 13 | cfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o ap.o |
14 | cfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o | 14 | cfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o |
15 | cfg80211-$(CONFIG_CFG80211_WEXT) += wext-compat.o wext-sme.o | 15 | cfg80211-$(CONFIG_CFG80211_WEXT) += wext-compat.o wext-sme.o |
16 | cfg80211-$(CONFIG_CFG80211_INTERNAL_REGDB) += regdb.o | 16 | cfg80211-$(CONFIG_CFG80211_INTERNAL_REGDB) += regdb.o |
diff --git a/net/wireless/ap.c b/net/wireless/ap.c new file mode 100644 index 000000000000..45199cca63d5 --- /dev/null +++ b/net/wireless/ap.c | |||
@@ -0,0 +1,44 @@ | |||
1 | #include <linux/ieee80211.h> | ||
2 | #include <linux/export.h> | ||
3 | #include <net/cfg80211.h> | ||
4 | #include "nl80211.h" | ||
5 | #include "core.h" | ||
6 | |||
7 | |||
8 | static int __cfg80211_stop_ap(struct cfg80211_registered_device *rdev, | ||
9 | struct net_device *dev) | ||
10 | { | ||
11 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
12 | int err; | ||
13 | |||
14 | ASSERT_WDEV_LOCK(wdev); | ||
15 | |||
16 | if (!rdev->ops->stop_ap) | ||
17 | return -EOPNOTSUPP; | ||
18 | |||
19 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && | ||
20 | dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) | ||
21 | return -EOPNOTSUPP; | ||
22 | |||
23 | if (!wdev->beacon_interval) | ||
24 | return -ENOENT; | ||
25 | |||
26 | err = rdev->ops->stop_ap(&rdev->wiphy, dev); | ||
27 | if (!err) | ||
28 | wdev->beacon_interval = 0; | ||
29 | |||
30 | return err; | ||
31 | } | ||
32 | |||
33 | int cfg80211_stop_ap(struct cfg80211_registered_device *rdev, | ||
34 | struct net_device *dev) | ||
35 | { | ||
36 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
37 | int err; | ||
38 | |||
39 | wdev_lock(wdev); | ||
40 | err = __cfg80211_stop_ap(rdev, dev); | ||
41 | wdev_unlock(wdev); | ||
42 | |||
43 | return err; | ||
44 | } | ||
diff --git a/net/wireless/core.h b/net/wireless/core.h index 609a579255ac..fef476d2117e 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h | |||
@@ -289,6 +289,10 @@ int cfg80211_set_mesh_freq(struct cfg80211_registered_device *rdev, | |||
289 | struct wireless_dev *wdev, int freq, | 289 | struct wireless_dev *wdev, int freq, |
290 | enum nl80211_channel_type channel_type); | 290 | enum nl80211_channel_type channel_type); |
291 | 291 | ||
292 | /* AP */ | ||
293 | int cfg80211_stop_ap(struct cfg80211_registered_device *rdev, | ||
294 | struct net_device *dev); | ||
295 | |||
292 | /* MLME */ | 296 | /* MLME */ |
293 | int __cfg80211_mlme_auth(struct cfg80211_registered_device *rdev, | 297 | int __cfg80211_mlme_auth(struct cfg80211_registered_device *rdev, |
294 | struct net_device *dev, | 298 | struct net_device *dev, |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 5c4a720f0442..20d0fd6d1286 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -2521,23 +2521,8 @@ static int nl80211_stop_ap(struct sk_buff *skb, struct genl_info *info) | |||
2521 | { | 2521 | { |
2522 | struct cfg80211_registered_device *rdev = info->user_ptr[0]; | 2522 | struct cfg80211_registered_device *rdev = info->user_ptr[0]; |
2523 | struct net_device *dev = info->user_ptr[1]; | 2523 | struct net_device *dev = info->user_ptr[1]; |
2524 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
2525 | int err; | ||
2526 | |||
2527 | if (!rdev->ops->stop_ap) | ||
2528 | return -EOPNOTSUPP; | ||
2529 | 2524 | ||
2530 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && | 2525 | return cfg80211_stop_ap(rdev, dev); |
2531 | dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) | ||
2532 | return -EOPNOTSUPP; | ||
2533 | |||
2534 | if (!wdev->beacon_interval) | ||
2535 | return -ENOENT; | ||
2536 | |||
2537 | err = rdev->ops->stop_ap(&rdev->wiphy, dev); | ||
2538 | if (!err) | ||
2539 | wdev->beacon_interval = 0; | ||
2540 | return err; | ||
2541 | } | 2526 | } |
2542 | 2527 | ||
2543 | static const struct nla_policy sta_flags_policy[NL80211_STA_FLAG_MAX + 1] = { | 2528 | static const struct nla_policy sta_flags_policy[NL80211_STA_FLAG_MAX + 1] = { |