aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/mlme.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/mlme.c')
-rw-r--r--net/wireless/mlme.c55
1 files changed, 48 insertions, 7 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 2a74395e6ab3..46aeafce08d0 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -24,6 +24,7 @@ void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len)
24 struct wiphy *wiphy = wdev->wiphy; 24 struct wiphy *wiphy = wdev->wiphy;
25 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 25 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
26 26
27 trace_cfg80211_send_rx_auth(dev);
27 wdev_lock(wdev); 28 wdev_lock(wdev);
28 29
29 nl80211_send_rx_auth(rdev, dev, buf, len, GFP_KERNEL); 30 nl80211_send_rx_auth(rdev, dev, buf, len, GFP_KERNEL);
@@ -44,6 +45,7 @@ void cfg80211_send_rx_assoc(struct net_device *dev, struct cfg80211_bss *bss,
44 u8 *ie = mgmt->u.assoc_resp.variable; 45 u8 *ie = mgmt->u.assoc_resp.variable;
45 int ieoffs = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable); 46 int ieoffs = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable);
46 47
48 trace_cfg80211_send_rx_assoc(dev, bss);
47 wdev_lock(wdev); 49 wdev_lock(wdev);
48 50
49 status_code = le16_to_cpu(mgmt->u.assoc_resp.status_code); 51 status_code = le16_to_cpu(mgmt->u.assoc_resp.status_code);
@@ -100,6 +102,7 @@ void __cfg80211_send_deauth(struct net_device *dev,
100 const u8 *bssid = mgmt->bssid; 102 const u8 *bssid = mgmt->bssid;
101 bool was_current = false; 103 bool was_current = false;
102 104
105 trace___cfg80211_send_deauth(dev);
103 ASSERT_WDEV_LOCK(wdev); 106 ASSERT_WDEV_LOCK(wdev);
104 107
105 if (wdev->current_bss && 108 if (wdev->current_bss &&
@@ -149,6 +152,7 @@ void __cfg80211_send_disassoc(struct net_device *dev,
149 u16 reason_code; 152 u16 reason_code;
150 bool from_ap; 153 bool from_ap;
151 154
155 trace___cfg80211_send_disassoc(dev);
152 ASSERT_WDEV_LOCK(wdev); 156 ASSERT_WDEV_LOCK(wdev);
153 157
154 nl80211_send_disassoc(rdev, dev, buf, len, GFP_KERNEL); 158 nl80211_send_disassoc(rdev, dev, buf, len, GFP_KERNEL);
@@ -190,6 +194,7 @@ void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf,
190 struct wiphy *wiphy = wdev->wiphy; 194 struct wiphy *wiphy = wdev->wiphy;
191 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 195 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
192 196
197 trace_cfg80211_send_unprot_deauth(dev);
193 nl80211_send_unprot_deauth(rdev, dev, buf, len, GFP_ATOMIC); 198 nl80211_send_unprot_deauth(rdev, dev, buf, len, GFP_ATOMIC);
194} 199}
195EXPORT_SYMBOL(cfg80211_send_unprot_deauth); 200EXPORT_SYMBOL(cfg80211_send_unprot_deauth);
@@ -201,6 +206,7 @@ void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf,
201 struct wiphy *wiphy = wdev->wiphy; 206 struct wiphy *wiphy = wdev->wiphy;
202 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 207 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
203 208
209 trace_cfg80211_send_unprot_disassoc(dev);
204 nl80211_send_unprot_disassoc(rdev, dev, buf, len, GFP_ATOMIC); 210 nl80211_send_unprot_disassoc(rdev, dev, buf, len, GFP_ATOMIC);
205} 211}
206EXPORT_SYMBOL(cfg80211_send_unprot_disassoc); 212EXPORT_SYMBOL(cfg80211_send_unprot_disassoc);
@@ -211,6 +217,7 @@ void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr)
211 struct wiphy *wiphy = wdev->wiphy; 217 struct wiphy *wiphy = wdev->wiphy;
212 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 218 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
213 219
220 trace_cfg80211_send_auth_timeout(dev, addr);
214 wdev_lock(wdev); 221 wdev_lock(wdev);
215 222
216 nl80211_send_auth_timeout(rdev, dev, addr, GFP_KERNEL); 223 nl80211_send_auth_timeout(rdev, dev, addr, GFP_KERNEL);
@@ -229,6 +236,7 @@ void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr)
229 struct wiphy *wiphy = wdev->wiphy; 236 struct wiphy *wiphy = wdev->wiphy;
230 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 237 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
231 238
239 trace_cfg80211_send_assoc_timeout(dev, addr);
232 wdev_lock(wdev); 240 wdev_lock(wdev);
233 241
234 nl80211_send_assoc_timeout(rdev, dev, addr, GFP_KERNEL); 242 nl80211_send_assoc_timeout(rdev, dev, addr, GFP_KERNEL);
@@ -263,6 +271,7 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
263 } 271 }
264#endif 272#endif
265 273
274 trace_cfg80211_michael_mic_failure(dev, addr, key_type, key_id, tsc);
266 nl80211_michael_mic_failure(rdev, dev, addr, key_type, key_id, tsc, gfp); 275 nl80211_michael_mic_failure(rdev, dev, addr, key_type, key_id, tsc, gfp);
267} 276}
268EXPORT_SYMBOL(cfg80211_michael_mic_failure); 277EXPORT_SYMBOL(cfg80211_michael_mic_failure);
@@ -582,6 +591,8 @@ void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
582 struct wiphy *wiphy = wdev->wiphy; 591 struct wiphy *wiphy = wdev->wiphy;
583 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 592 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
584 593
594 trace_cfg80211_ready_on_channel(wdev, cookie, chan, channel_type,
595 duration);
585 nl80211_send_remain_on_channel(rdev, wdev, cookie, chan, channel_type, 596 nl80211_send_remain_on_channel(rdev, wdev, cookie, chan, channel_type,
586 duration, gfp); 597 duration, gfp);
587} 598}
@@ -595,6 +606,8 @@ void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
595 struct wiphy *wiphy = wdev->wiphy; 606 struct wiphy *wiphy = wdev->wiphy;
596 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 607 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
597 608
609 trace_cfg80211_ready_on_channel_expired(wdev, cookie, chan,
610 channel_type);
598 nl80211_send_remain_on_channel_cancel(rdev, wdev, cookie, chan, 611 nl80211_send_remain_on_channel_cancel(rdev, wdev, cookie, chan,
599 channel_type, gfp); 612 channel_type, gfp);
600} 613}
@@ -606,6 +619,7 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
606 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; 619 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
607 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 620 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
608 621
622 trace_cfg80211_new_sta(dev, mac_addr, sinfo);
609 nl80211_send_sta_event(rdev, dev, mac_addr, sinfo, gfp); 623 nl80211_send_sta_event(rdev, dev, mac_addr, sinfo, gfp);
610} 624}
611EXPORT_SYMBOL(cfg80211_new_sta); 625EXPORT_SYMBOL(cfg80211_new_sta);
@@ -615,6 +629,7 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp)
615 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; 629 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
616 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 630 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
617 631
632 trace_cfg80211_del_sta(dev, mac_addr);
618 nl80211_send_sta_del_event(rdev, dev, mac_addr, gfp); 633 nl80211_send_sta_del_event(rdev, dev, mac_addr, gfp);
619} 634}
620EXPORT_SYMBOL(cfg80211_del_sta); 635EXPORT_SYMBOL(cfg80211_del_sta);
@@ -867,10 +882,13 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm,
867 cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE); 882 cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE);
868 u16 stype; 883 u16 stype;
869 884
885 trace_cfg80211_rx_mgmt(wdev, freq, sig_mbm);
870 stype = (le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE) >> 4; 886 stype = (le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE) >> 4;
871 887
872 if (!(stypes->rx & BIT(stype))) 888 if (!(stypes->rx & BIT(stype))) {
889 trace_cfg80211_return_bool(false);
873 return false; 890 return false;
891 }
874 892
875 data = buf + ieee80211_hdrlen(mgmt->frame_control); 893 data = buf + ieee80211_hdrlen(mgmt->frame_control);
876 data_len = len - ieee80211_hdrlen(mgmt->frame_control); 894 data_len = len - ieee80211_hdrlen(mgmt->frame_control);
@@ -901,6 +919,7 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm,
901 919
902 spin_unlock_bh(&wdev->mgmt_registrations_lock); 920 spin_unlock_bh(&wdev->mgmt_registrations_lock);
903 921
922 trace_cfg80211_return_bool(result);
904 return result; 923 return result;
905} 924}
906EXPORT_SYMBOL(cfg80211_rx_mgmt); 925EXPORT_SYMBOL(cfg80211_rx_mgmt);
@@ -911,6 +930,8 @@ void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie,
911 struct wiphy *wiphy = wdev->wiphy; 930 struct wiphy *wiphy = wdev->wiphy;
912 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 931 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
913 932
933 trace_cfg80211_mgmt_tx_status(wdev, cookie, ack);
934
914 /* Indicate TX status of the Action frame to user space */ 935 /* Indicate TX status of the Action frame to user space */
915 nl80211_send_mgmt_tx_status(rdev, wdev, cookie, buf, len, ack, gfp); 936 nl80211_send_mgmt_tx_status(rdev, wdev, cookie, buf, len, ack, gfp);
916} 937}
@@ -924,6 +945,8 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,
924 struct wiphy *wiphy = wdev->wiphy; 945 struct wiphy *wiphy = wdev->wiphy;
925 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 946 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
926 947
948 trace_cfg80211_cqm_rssi_notify(dev, rssi_event);
949
927 /* Indicate roaming trigger event to user space */ 950 /* Indicate roaming trigger event to user space */
928 nl80211_send_cqm_rssi_notify(rdev, dev, rssi_event, gfp); 951 nl80211_send_cqm_rssi_notify(rdev, dev, rssi_event, gfp);
929} 952}
@@ -936,6 +959,8 @@ void cfg80211_cqm_pktloss_notify(struct net_device *dev,
936 struct wiphy *wiphy = wdev->wiphy; 959 struct wiphy *wiphy = wdev->wiphy;
937 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 960 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
938 961
962 trace_cfg80211_cqm_pktloss_notify(dev, peer, num_packets);
963
939 /* Indicate roaming trigger event to user space */ 964 /* Indicate roaming trigger event to user space */
940 nl80211_send_cqm_pktloss_notify(rdev, dev, peer, num_packets, gfp); 965 nl80211_send_cqm_pktloss_notify(rdev, dev, peer, num_packets, gfp);
941} 966}
@@ -961,6 +986,7 @@ void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid,
961 struct wiphy *wiphy = wdev->wiphy; 986 struct wiphy *wiphy = wdev->wiphy;
962 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 987 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
963 988
989 trace_cfg80211_gtk_rekey_notify(dev, bssid);
964 nl80211_gtk_rekey_notify(rdev, dev, bssid, replay_ctr, gfp); 990 nl80211_gtk_rekey_notify(rdev, dev, bssid, replay_ctr, gfp);
965} 991}
966EXPORT_SYMBOL(cfg80211_gtk_rekey_notify); 992EXPORT_SYMBOL(cfg80211_gtk_rekey_notify);
@@ -972,6 +998,7 @@ void cfg80211_pmksa_candidate_notify(struct net_device *dev, int index,
972 struct wiphy *wiphy = wdev->wiphy; 998 struct wiphy *wiphy = wdev->wiphy;
973 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 999 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
974 1000
1001 trace_cfg80211_pmksa_candidate_notify(dev, index, bssid, preauth);
975 nl80211_pmksa_candidate_notify(rdev, dev, index, bssid, preauth, gfp); 1002 nl80211_pmksa_candidate_notify(rdev, dev, index, bssid, preauth, gfp);
976} 1003}
977EXPORT_SYMBOL(cfg80211_pmksa_candidate_notify); 1004EXPORT_SYMBOL(cfg80211_pmksa_candidate_notify);
@@ -984,6 +1011,8 @@ void cfg80211_ch_switch_notify(struct net_device *dev, int freq,
984 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 1011 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
985 struct ieee80211_channel *chan; 1012 struct ieee80211_channel *chan;
986 1013
1014 trace_cfg80211_ch_switch_notify(dev, freq, type);
1015
987 wdev_lock(wdev); 1016 wdev_lock(wdev);
988 1017
989 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP && 1018 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP &&
@@ -1006,12 +1035,18 @@ bool cfg80211_rx_spurious_frame(struct net_device *dev,
1006 const u8 *addr, gfp_t gfp) 1035 const u8 *addr, gfp_t gfp)
1007{ 1036{
1008 struct wireless_dev *wdev = dev->ieee80211_ptr; 1037 struct wireless_dev *wdev = dev->ieee80211_ptr;
1038 bool ret;
1039
1040 trace_cfg80211_rx_spurious_frame(dev, addr);
1009 1041
1010 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP && 1042 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP &&
1011 wdev->iftype != NL80211_IFTYPE_P2P_GO)) 1043 wdev->iftype != NL80211_IFTYPE_P2P_GO)) {
1044 trace_cfg80211_return_bool(false);
1012 return false; 1045 return false;
1013 1046 }
1014 return nl80211_unexpected_frame(dev, addr, gfp); 1047 ret = nl80211_unexpected_frame(dev, addr, gfp);
1048 trace_cfg80211_return_bool(ret);
1049 return ret;
1015} 1050}
1016EXPORT_SYMBOL(cfg80211_rx_spurious_frame); 1051EXPORT_SYMBOL(cfg80211_rx_spurious_frame);
1017 1052
@@ -1019,12 +1054,18 @@ bool cfg80211_rx_unexpected_4addr_frame(struct net_device *dev,
1019 const u8 *addr, gfp_t gfp) 1054 const u8 *addr, gfp_t gfp)
1020{ 1055{
1021 struct wireless_dev *wdev = dev->ieee80211_ptr; 1056 struct wireless_dev *wdev = dev->ieee80211_ptr;
1057 bool ret;
1058
1059 trace_cfg80211_rx_unexpected_4addr_frame(dev, addr);
1022 1060
1023 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP && 1061 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP &&
1024 wdev->iftype != NL80211_IFTYPE_P2P_GO && 1062 wdev->iftype != NL80211_IFTYPE_P2P_GO &&
1025 wdev->iftype != NL80211_IFTYPE_AP_VLAN)) 1063 wdev->iftype != NL80211_IFTYPE_AP_VLAN)) {
1064 trace_cfg80211_return_bool(false);
1026 return false; 1065 return false;
1027 1066 }
1028 return nl80211_unexpected_4addr_frame(dev, addr, gfp); 1067 ret = nl80211_unexpected_4addr_frame(dev, addr, gfp);
1068 trace_cfg80211_return_bool(ret);
1069 return ret;
1029} 1070}
1030EXPORT_SYMBOL(cfg80211_rx_unexpected_4addr_frame); 1071EXPORT_SYMBOL(cfg80211_rx_unexpected_4addr_frame);