1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/ieee80211.h>
3 #include <linux/export.h>
4 #include <net/cfg80211.h>
10 int __cfg80211_stop_ap(struct cfg80211_registered_device
*rdev
,
11 struct net_device
*dev
, bool notify
)
13 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
16 ASSERT_WDEV_LOCK(wdev
);
18 if (!rdev
->ops
->stop_ap
)
21 if (dev
->ieee80211_ptr
->iftype
!= NL80211_IFTYPE_AP
&&
22 dev
->ieee80211_ptr
->iftype
!= NL80211_IFTYPE_P2P_GO
)
25 if (!wdev
->beacon_interval
)
28 err
= rdev_stop_ap(rdev
, dev
);
30 wdev
->beacon_interval
= 0;
31 memset(&wdev
->chandef
, 0, sizeof(wdev
->chandef
));
33 rdev_set_qos_map(rdev
, dev
, NULL
);
35 nl80211_send_ap_stopped(wdev
);
37 /* Should we apply the grace period during beaconing interface
40 cfg80211_sched_dfs_chan_update(rdev
);
46 int cfg80211_stop_ap(struct cfg80211_registered_device
*rdev
,
47 struct net_device
*dev
, bool notify
)
49 struct wireless_dev
*wdev
= dev
->ieee80211_ptr
;
53 err
= __cfg80211_stop_ap(rdev
, dev
, notify
);