Some AP code ended up in mlme.c as ap.c didn't exist when it was written, move it now.
Unified · Split
| @@ -46,3 +46,65 @@ int cfg80211_stop_ap(struct cfg80211_registered_device *rdev, · 45 unmodified lines | |||
| 46 | 46 | ||
| 47 | return err; | 47 | return err; |
| 48 | } | 48 | } |
| 49 | |||
| 50 | void cfg80211_ch_switch_notify(struct net_device *dev, | ||
| 51 | struct cfg80211_chan_def *chandef) | ||
| 52 | { | ||
| 53 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
| 54 | struct wiphy *wiphy = wdev->wiphy; | ||
| 55 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
| 56 | |||
| 57 | trace_cfg80211_ch_switch_notify(dev, chandef); | ||
| 58 | |||
| 59 | wdev_lock(wdev); | ||
| 60 | |||
| 61 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP && | ||
| 62 | wdev->iftype != NL80211_IFTYPE_P2P_GO)) | ||
| 63 | goto out; | ||
| 64 | |||
| 65 | wdev->channel = chandef->chan; | ||
| 66 | nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL); | ||
| 67 | out: | ||
| 68 | wdev_unlock(wdev); | ||
| 69 | return; | ||
| 70 | } | ||
| 71 | EXPORT_SYMBOL(cfg80211_ch_switch_notify); | ||
| 72 | |||
| 73 | bool cfg80211_rx_spurious_frame(struct net_device *dev, | ||
| 74 | const u8 *addr, gfp_t gfp) | ||
| 75 | { | ||
| 76 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
| 77 | bool ret; | ||
| 78 | |||
| 79 | trace_cfg80211_rx_spurious_frame(dev, addr); | ||
| 80 | |||
| 81 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP && | ||
| 82 | wdev->iftype != NL80211_IFTYPE_P2P_GO)) { | ||
| 83 | trace_cfg80211_return_bool(false); | ||
| 84 | return false; | ||
| 85 | } | ||
| 86 | ret = nl80211_unexpected_frame(dev, addr, gfp); | ||
| 87 | trace_cfg80211_return_bool(ret); | ||
| 88 | return ret; | ||
| 89 | } | ||
| 90 | EXPORT_SYMBOL(cfg80211_rx_spurious_frame); | ||
| 91 | |||
| 92 | bool cfg80211_rx_unexpected_4addr_frame(struct net_device *dev, | ||
| 93 | const u8 *addr, gfp_t gfp) | ||
| 94 | { | ||
| 95 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
| 96 | bool ret; | ||
| 97 | |||
| 98 | trace_cfg80211_rx_unexpected_4addr_frame(dev, addr); | ||
| 99 | |||
| 100 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP && | ||
| 101 | wdev->iftype != NL80211_IFTYPE_P2P_GO && | ||
| 102 | wdev->iftype != NL80211_IFTYPE_AP_VLAN)) { | ||
| 103 | trace_cfg80211_return_bool(false); | ||
| 104 | return false; | ||
| 105 | } | ||
| 106 | ret = nl80211_unexpected_4addr_frame(dev, addr, gfp); | ||
| 107 | trace_cfg80211_return_bool(ret); | ||
| 108 | return ret; | ||
| 109 | } | ||
| 110 | EXPORT_SYMBOL(cfg80211_rx_unexpected_4addr_frame); | ||
| @@ -987,65 +987,3 @@ void cfg80211_pmksa_candidate_notify(struct net_device *dev, int index, · 986 unmodified lines | |||
| 987 | nl80211_pmksa_candidate_notify(rdev, dev, index, bssid, preauth, gfp); | 987 | nl80211_pmksa_candidate_notify(rdev, dev, index, bssid, preauth, gfp); |
| 988 | } | 988 | } |
| 989 | EXPORT_SYMBOL(cfg80211_pmksa_candidate_notify); | 989 | EXPORT_SYMBOL(cfg80211_pmksa_candidate_notify); |
| 990 | |||
| 991 | void cfg80211_ch_switch_notify(struct net_device *dev, | ||
| 992 | struct cfg80211_chan_def *chandef) | ||
| 993 | { | ||
| 994 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
| 995 | struct wiphy *wiphy = wdev->wiphy; | ||
| 996 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
| 997 | |||
| 998 | trace_cfg80211_ch_switch_notify(dev, chandef); | ||
| 999 | |||
| 1000 | wdev_lock(wdev); | ||
| 1001 | |||
| 1002 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP && | ||
| 1003 | wdev->iftype != NL80211_IFTYPE_P2P_GO)) | ||
| 1004 | goto out; | ||
| 1005 | |||
| 1006 | wdev->channel = chandef->chan; | ||
| 1007 | nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL); | ||
| 1008 | out: | ||
| 1009 | wdev_unlock(wdev); | ||
| 1010 | return; | ||
| 1011 | } | ||
| 1012 | EXPORT_SYMBOL(cfg80211_ch_switch_notify); | ||
| 1013 | |||
| 1014 | bool cfg80211_rx_spurious_frame(struct net_device *dev, | ||
| 1015 | const u8 *addr, gfp_t gfp) | ||
| 1016 | { | ||
| 1017 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
| 1018 | bool ret; | ||
| 1019 | |||
| 1020 | trace_cfg80211_rx_spurious_frame(dev, addr); | ||
| 1021 | |||
| 1022 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP && | ||
| 1023 | wdev->iftype != NL80211_IFTYPE_P2P_GO)) { | ||
| 1024 | trace_cfg80211_return_bool(false); | ||
| 1025 | return false; | ||
| 1026 | } | ||
| 1027 | ret = nl80211_unexpected_frame(dev, addr, gfp); | ||
| 1028 | trace_cfg80211_return_bool(ret); | ||
| 1029 | return ret; | ||
| 1030 | } | ||
| 1031 | EXPORT_SYMBOL(cfg80211_rx_spurious_frame); | ||
| 1032 | |||
| 1033 | bool cfg80211_rx_unexpected_4addr_frame(struct net_device *dev, | ||
| 1034 | const u8 *addr, gfp_t gfp) | ||
| 1035 | { | ||
| 1036 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
| 1037 | bool ret; | ||
| 1038 | |||
| 1039 | trace_cfg80211_rx_unexpected_4addr_frame(dev, addr); | ||
| 1040 | |||
| 1041 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP && | ||
| 1042 | wdev->iftype != NL80211_IFTYPE_P2P_GO && | ||
| 1043 | wdev->iftype != NL80211_IFTYPE_AP_VLAN)) { | ||
| 1044 | trace_cfg80211_return_bool(false); | ||
| 1045 | return false; | ||
| 1046 | } | ||
| 1047 | ret = nl80211_unexpected_4addr_frame(dev, addr, gfp); | ||
| 1048 | trace_cfg80211_return_bool(ret); | ||
| 1049 | return ret; | ||
| 1050 | } | ||
| 1051 | EXPORT_SYMBOL(cfg80211_rx_unexpected_4addr_frame); | ||