diff options
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 266 |
1 files changed, 195 insertions, 71 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 3a45ea614cbb..0e5176784b42 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -9151,21 +9151,31 @@ void nl80211_send_disassoc(struct cfg80211_registered_device *rdev, | |||
9151 | NL80211_CMD_DISASSOCIATE, gfp); | 9151 | NL80211_CMD_DISASSOCIATE, gfp); |
9152 | } | 9152 | } |
9153 | 9153 | ||
9154 | void nl80211_send_unprot_deauth(struct cfg80211_registered_device *rdev, | 9154 | void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf, |
9155 | struct net_device *netdev, const u8 *buf, | 9155 | size_t len) |
9156 | size_t len, gfp_t gfp) | ||
9157 | { | 9156 | { |
9158 | nl80211_send_mlme_event(rdev, netdev, buf, len, | 9157 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
9159 | NL80211_CMD_UNPROT_DEAUTHENTICATE, gfp); | 9158 | struct wiphy *wiphy = wdev->wiphy; |
9159 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
9160 | |||
9161 | trace_cfg80211_send_unprot_deauth(dev); | ||
9162 | nl80211_send_mlme_event(rdev, dev, buf, len, | ||
9163 | NL80211_CMD_UNPROT_DEAUTHENTICATE, GFP_ATOMIC); | ||
9160 | } | 9164 | } |
9165 | EXPORT_SYMBOL(cfg80211_send_unprot_deauth); | ||
9161 | 9166 | ||
9162 | void nl80211_send_unprot_disassoc(struct cfg80211_registered_device *rdev, | 9167 | void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf, |
9163 | struct net_device *netdev, const u8 *buf, | 9168 | size_t len) |
9164 | size_t len, gfp_t gfp) | ||
9165 | { | 9169 | { |
9166 | nl80211_send_mlme_event(rdev, netdev, buf, len, | 9170 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
9167 | NL80211_CMD_UNPROT_DISASSOCIATE, gfp); | 9171 | struct wiphy *wiphy = wdev->wiphy; |
9172 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
9173 | |||
9174 | trace_cfg80211_send_unprot_disassoc(dev); | ||
9175 | nl80211_send_mlme_event(rdev, dev, buf, len, | ||
9176 | NL80211_CMD_UNPROT_DISASSOCIATE, GFP_ATOMIC); | ||
9168 | } | 9177 | } |
9178 | EXPORT_SYMBOL(cfg80211_send_unprot_disassoc); | ||
9169 | 9179 | ||
9170 | static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev, | 9180 | static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev, |
9171 | struct net_device *netdev, int cmd, | 9181 | struct net_device *netdev, int cmd, |
@@ -9368,14 +9378,19 @@ void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev, | |||
9368 | nlmsg_free(msg); | 9378 | nlmsg_free(msg); |
9369 | } | 9379 | } |
9370 | 9380 | ||
9371 | void nl80211_send_new_peer_candidate(struct cfg80211_registered_device *rdev, | 9381 | void cfg80211_notify_new_peer_candidate(struct net_device *dev, const u8 *addr, |
9372 | struct net_device *netdev, | 9382 | const u8* ie, u8 ie_len, gfp_t gfp) |
9373 | const u8 *macaddr, const u8* ie, u8 ie_len, | ||
9374 | gfp_t gfp) | ||
9375 | { | 9383 | { |
9384 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
9385 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | ||
9376 | struct sk_buff *msg; | 9386 | struct sk_buff *msg; |
9377 | void *hdr; | 9387 | void *hdr; |
9378 | 9388 | ||
9389 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_MESH_POINT)) | ||
9390 | return; | ||
9391 | |||
9392 | trace_cfg80211_notify_new_peer_candidate(dev, addr); | ||
9393 | |||
9379 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); | 9394 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
9380 | if (!msg) | 9395 | if (!msg) |
9381 | return; | 9396 | return; |
@@ -9387,8 +9402,8 @@ void nl80211_send_new_peer_candidate(struct cfg80211_registered_device *rdev, | |||
9387 | } | 9402 | } |
9388 | 9403 | ||
9389 | if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || | 9404 | if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || |
9390 | nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || | 9405 | nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || |
9391 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, macaddr) || | 9406 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) || |
9392 | (ie_len && ie && | 9407 | (ie_len && ie && |
9393 | nla_put(msg, NL80211_ATTR_IE, ie_len , ie))) | 9408 | nla_put(msg, NL80211_ATTR_IE, ie_len , ie))) |
9394 | goto nla_put_failure; | 9409 | goto nla_put_failure; |
@@ -9403,6 +9418,7 @@ void nl80211_send_new_peer_candidate(struct cfg80211_registered_device *rdev, | |||
9403 | genlmsg_cancel(msg, hdr); | 9418 | genlmsg_cancel(msg, hdr); |
9404 | nlmsg_free(msg); | 9419 | nlmsg_free(msg); |
9405 | } | 9420 | } |
9421 | EXPORT_SYMBOL(cfg80211_notify_new_peer_candidate); | ||
9406 | 9422 | ||
9407 | void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev, | 9423 | void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev, |
9408 | struct net_device *netdev, const u8 *addr, | 9424 | struct net_device *netdev, const u8 *addr, |
@@ -9541,31 +9557,42 @@ static void nl80211_send_remain_on_chan_event( | |||
9541 | nlmsg_free(msg); | 9557 | nlmsg_free(msg); |
9542 | } | 9558 | } |
9543 | 9559 | ||
9544 | void nl80211_send_remain_on_channel(struct cfg80211_registered_device *rdev, | 9560 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, |
9545 | struct wireless_dev *wdev, u64 cookie, | 9561 | struct ieee80211_channel *chan, |
9546 | struct ieee80211_channel *chan, | 9562 | unsigned int duration, gfp_t gfp) |
9547 | unsigned int duration, gfp_t gfp) | ||
9548 | { | 9563 | { |
9564 | struct wiphy *wiphy = wdev->wiphy; | ||
9565 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
9566 | |||
9567 | trace_cfg80211_ready_on_channel(wdev, cookie, chan, duration); | ||
9549 | nl80211_send_remain_on_chan_event(NL80211_CMD_REMAIN_ON_CHANNEL, | 9568 | nl80211_send_remain_on_chan_event(NL80211_CMD_REMAIN_ON_CHANNEL, |
9550 | rdev, wdev, cookie, chan, | 9569 | rdev, wdev, cookie, chan, |
9551 | duration, gfp); | 9570 | duration, gfp); |
9552 | } | 9571 | } |
9572 | EXPORT_SYMBOL(cfg80211_ready_on_channel); | ||
9553 | 9573 | ||
9554 | void nl80211_send_remain_on_channel_cancel( | 9574 | void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, |
9555 | struct cfg80211_registered_device *rdev, | 9575 | struct ieee80211_channel *chan, |
9556 | struct wireless_dev *wdev, | 9576 | gfp_t gfp) |
9557 | u64 cookie, struct ieee80211_channel *chan, gfp_t gfp) | ||
9558 | { | 9577 | { |
9578 | struct wiphy *wiphy = wdev->wiphy; | ||
9579 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
9580 | |||
9581 | trace_cfg80211_ready_on_channel_expired(wdev, cookie, chan); | ||
9559 | nl80211_send_remain_on_chan_event(NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL, | 9582 | nl80211_send_remain_on_chan_event(NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL, |
9560 | rdev, wdev, cookie, chan, 0, gfp); | 9583 | rdev, wdev, cookie, chan, 0, gfp); |
9561 | } | 9584 | } |
9585 | EXPORT_SYMBOL(cfg80211_remain_on_channel_expired); | ||
9562 | 9586 | ||
9563 | void nl80211_send_sta_event(struct cfg80211_registered_device *rdev, | 9587 | void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr, |
9564 | struct net_device *dev, const u8 *mac_addr, | 9588 | struct station_info *sinfo, gfp_t gfp) |
9565 | struct station_info *sinfo, gfp_t gfp) | ||
9566 | { | 9589 | { |
9590 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; | ||
9591 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
9567 | struct sk_buff *msg; | 9592 | struct sk_buff *msg; |
9568 | 9593 | ||
9594 | trace_cfg80211_new_sta(dev, mac_addr, sinfo); | ||
9595 | |||
9569 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); | 9596 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
9570 | if (!msg) | 9597 | if (!msg) |
9571 | return; | 9598 | return; |
@@ -9579,14 +9606,17 @@ void nl80211_send_sta_event(struct cfg80211_registered_device *rdev, | |||
9579 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, | 9606 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, |
9580 | nl80211_mlme_mcgrp.id, gfp); | 9607 | nl80211_mlme_mcgrp.id, gfp); |
9581 | } | 9608 | } |
9609 | EXPORT_SYMBOL(cfg80211_new_sta); | ||
9582 | 9610 | ||
9583 | void nl80211_send_sta_del_event(struct cfg80211_registered_device *rdev, | 9611 | void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp) |
9584 | struct net_device *dev, const u8 *mac_addr, | ||
9585 | gfp_t gfp) | ||
9586 | { | 9612 | { |
9613 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; | ||
9614 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
9587 | struct sk_buff *msg; | 9615 | struct sk_buff *msg; |
9588 | void *hdr; | 9616 | void *hdr; |
9589 | 9617 | ||
9618 | trace_cfg80211_del_sta(dev, mac_addr); | ||
9619 | |||
9590 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); | 9620 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
9591 | if (!msg) | 9621 | if (!msg) |
9592 | return; | 9622 | return; |
@@ -9611,12 +9641,14 @@ void nl80211_send_sta_del_event(struct cfg80211_registered_device *rdev, | |||
9611 | genlmsg_cancel(msg, hdr); | 9641 | genlmsg_cancel(msg, hdr); |
9612 | nlmsg_free(msg); | 9642 | nlmsg_free(msg); |
9613 | } | 9643 | } |
9644 | EXPORT_SYMBOL(cfg80211_del_sta); | ||
9614 | 9645 | ||
9615 | void nl80211_send_conn_failed_event(struct cfg80211_registered_device *rdev, | 9646 | void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr, |
9616 | struct net_device *dev, const u8 *mac_addr, | 9647 | enum nl80211_connect_failed_reason reason, |
9617 | enum nl80211_connect_failed_reason reason, | 9648 | gfp_t gfp) |
9618 | gfp_t gfp) | ||
9619 | { | 9649 | { |
9650 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; | ||
9651 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
9620 | struct sk_buff *msg; | 9652 | struct sk_buff *msg; |
9621 | void *hdr; | 9653 | void *hdr; |
9622 | 9654 | ||
@@ -9645,6 +9677,7 @@ void nl80211_send_conn_failed_event(struct cfg80211_registered_device *rdev, | |||
9645 | genlmsg_cancel(msg, hdr); | 9677 | genlmsg_cancel(msg, hdr); |
9646 | nlmsg_free(msg); | 9678 | nlmsg_free(msg); |
9647 | } | 9679 | } |
9680 | EXPORT_SYMBOL(cfg80211_conn_failed); | ||
9648 | 9681 | ||
9649 | static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd, | 9682 | static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd, |
9650 | const u8 *addr, gfp_t gfp) | 9683 | const u8 *addr, gfp_t gfp) |
@@ -9689,19 +9722,47 @@ static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd, | |||
9689 | return true; | 9722 | return true; |
9690 | } | 9723 | } |
9691 | 9724 | ||
9692 | bool nl80211_unexpected_frame(struct net_device *dev, const u8 *addr, gfp_t gfp) | 9725 | bool cfg80211_rx_spurious_frame(struct net_device *dev, |
9726 | const u8 *addr, gfp_t gfp) | ||
9693 | { | 9727 | { |
9694 | return __nl80211_unexpected_frame(dev, NL80211_CMD_UNEXPECTED_FRAME, | 9728 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
9695 | addr, gfp); | 9729 | bool ret; |
9730 | |||
9731 | trace_cfg80211_rx_spurious_frame(dev, addr); | ||
9732 | |||
9733 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP && | ||
9734 | wdev->iftype != NL80211_IFTYPE_P2P_GO)) { | ||
9735 | trace_cfg80211_return_bool(false); | ||
9736 | return false; | ||
9737 | } | ||
9738 | ret = __nl80211_unexpected_frame(dev, NL80211_CMD_UNEXPECTED_FRAME, | ||
9739 | addr, gfp); | ||
9740 | trace_cfg80211_return_bool(ret); | ||
9741 | return ret; | ||
9696 | } | 9742 | } |
9743 | EXPORT_SYMBOL(cfg80211_rx_spurious_frame); | ||
9697 | 9744 | ||
9698 | bool nl80211_unexpected_4addr_frame(struct net_device *dev, | 9745 | bool cfg80211_rx_unexpected_4addr_frame(struct net_device *dev, |
9699 | const u8 *addr, gfp_t gfp) | 9746 | const u8 *addr, gfp_t gfp) |
9700 | { | 9747 | { |
9701 | return __nl80211_unexpected_frame(dev, | 9748 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
9702 | NL80211_CMD_UNEXPECTED_4ADDR_FRAME, | 9749 | bool ret; |
9703 | addr, gfp); | 9750 | |
9751 | trace_cfg80211_rx_unexpected_4addr_frame(dev, addr); | ||
9752 | |||
9753 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP && | ||
9754 | wdev->iftype != NL80211_IFTYPE_P2P_GO && | ||
9755 | wdev->iftype != NL80211_IFTYPE_AP_VLAN)) { | ||
9756 | trace_cfg80211_return_bool(false); | ||
9757 | return false; | ||
9758 | } | ||
9759 | ret = __nl80211_unexpected_frame(dev, | ||
9760 | NL80211_CMD_UNEXPECTED_4ADDR_FRAME, | ||
9761 | addr, gfp); | ||
9762 | trace_cfg80211_return_bool(ret); | ||
9763 | return ret; | ||
9704 | } | 9764 | } |
9765 | EXPORT_SYMBOL(cfg80211_rx_unexpected_4addr_frame); | ||
9705 | 9766 | ||
9706 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, | 9767 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, |
9707 | struct wireless_dev *wdev, u32 nlportid, | 9768 | struct wireless_dev *wdev, u32 nlportid, |
@@ -9741,15 +9802,17 @@ int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, | |||
9741 | return -ENOBUFS; | 9802 | return -ENOBUFS; |
9742 | } | 9803 | } |
9743 | 9804 | ||
9744 | void nl80211_send_mgmt_tx_status(struct cfg80211_registered_device *rdev, | 9805 | void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie, |
9745 | struct wireless_dev *wdev, u64 cookie, | 9806 | const u8 *buf, size_t len, bool ack, gfp_t gfp) |
9746 | const u8 *buf, size_t len, bool ack, | ||
9747 | gfp_t gfp) | ||
9748 | { | 9807 | { |
9808 | struct wiphy *wiphy = wdev->wiphy; | ||
9809 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
9749 | struct net_device *netdev = wdev->netdev; | 9810 | struct net_device *netdev = wdev->netdev; |
9750 | struct sk_buff *msg; | 9811 | struct sk_buff *msg; |
9751 | void *hdr; | 9812 | void *hdr; |
9752 | 9813 | ||
9814 | trace_cfg80211_mgmt_tx_status(wdev, cookie, ack); | ||
9815 | |||
9753 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); | 9816 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
9754 | if (!msg) | 9817 | if (!msg) |
9755 | return; | 9818 | return; |
@@ -9777,17 +9840,21 @@ void nl80211_send_mgmt_tx_status(struct cfg80211_registered_device *rdev, | |||
9777 | genlmsg_cancel(msg, hdr); | 9840 | genlmsg_cancel(msg, hdr); |
9778 | nlmsg_free(msg); | 9841 | nlmsg_free(msg); |
9779 | } | 9842 | } |
9843 | EXPORT_SYMBOL(cfg80211_mgmt_tx_status); | ||
9780 | 9844 | ||
9781 | void | 9845 | void cfg80211_cqm_rssi_notify(struct net_device *dev, |
9782 | nl80211_send_cqm_rssi_notify(struct cfg80211_registered_device *rdev, | 9846 | enum nl80211_cqm_rssi_threshold_event rssi_event, |
9783 | struct net_device *netdev, | 9847 | gfp_t gfp) |
9784 | enum nl80211_cqm_rssi_threshold_event rssi_event, | ||
9785 | gfp_t gfp) | ||
9786 | { | 9848 | { |
9849 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
9850 | struct wiphy *wiphy = wdev->wiphy; | ||
9851 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
9787 | struct sk_buff *msg; | 9852 | struct sk_buff *msg; |
9788 | struct nlattr *pinfoattr; | 9853 | struct nlattr *pinfoattr; |
9789 | void *hdr; | 9854 | void *hdr; |
9790 | 9855 | ||
9856 | trace_cfg80211_cqm_rssi_notify(dev, rssi_event); | ||
9857 | |||
9791 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); | 9858 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
9792 | if (!msg) | 9859 | if (!msg) |
9793 | return; | 9860 | return; |
@@ -9799,7 +9866,7 @@ nl80211_send_cqm_rssi_notify(struct cfg80211_registered_device *rdev, | |||
9799 | } | 9866 | } |
9800 | 9867 | ||
9801 | if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || | 9868 | if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || |
9802 | nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex)) | 9869 | nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) |
9803 | goto nla_put_failure; | 9870 | goto nla_put_failure; |
9804 | 9871 | ||
9805 | pinfoattr = nla_nest_start(msg, NL80211_ATTR_CQM); | 9872 | pinfoattr = nla_nest_start(msg, NL80211_ATTR_CQM); |
@@ -9822,10 +9889,11 @@ nl80211_send_cqm_rssi_notify(struct cfg80211_registered_device *rdev, | |||
9822 | genlmsg_cancel(msg, hdr); | 9889 | genlmsg_cancel(msg, hdr); |
9823 | nlmsg_free(msg); | 9890 | nlmsg_free(msg); |
9824 | } | 9891 | } |
9892 | EXPORT_SYMBOL(cfg80211_cqm_rssi_notify); | ||
9825 | 9893 | ||
9826 | void nl80211_gtk_rekey_notify(struct cfg80211_registered_device *rdev, | 9894 | static void nl80211_gtk_rekey_notify(struct cfg80211_registered_device *rdev, |
9827 | struct net_device *netdev, const u8 *bssid, | 9895 | struct net_device *netdev, const u8 *bssid, |
9828 | const u8 *replay_ctr, gfp_t gfp) | 9896 | const u8 *replay_ctr, gfp_t gfp) |
9829 | { | 9897 | { |
9830 | struct sk_buff *msg; | 9898 | struct sk_buff *msg; |
9831 | struct nlattr *rekey_attr; | 9899 | struct nlattr *rekey_attr; |
@@ -9867,9 +9935,22 @@ void nl80211_gtk_rekey_notify(struct cfg80211_registered_device *rdev, | |||
9867 | nlmsg_free(msg); | 9935 | nlmsg_free(msg); |
9868 | } | 9936 | } |
9869 | 9937 | ||
9870 | void nl80211_pmksa_candidate_notify(struct cfg80211_registered_device *rdev, | 9938 | void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid, |
9871 | struct net_device *netdev, int index, | 9939 | const u8 *replay_ctr, gfp_t gfp) |
9872 | const u8 *bssid, bool preauth, gfp_t gfp) | 9940 | { |
9941 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
9942 | struct wiphy *wiphy = wdev->wiphy; | ||
9943 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
9944 | |||
9945 | trace_cfg80211_gtk_rekey_notify(dev, bssid); | ||
9946 | nl80211_gtk_rekey_notify(rdev, dev, bssid, replay_ctr, gfp); | ||
9947 | } | ||
9948 | EXPORT_SYMBOL(cfg80211_gtk_rekey_notify); | ||
9949 | |||
9950 | static void | ||
9951 | nl80211_pmksa_candidate_notify(struct cfg80211_registered_device *rdev, | ||
9952 | struct net_device *netdev, int index, | ||
9953 | const u8 *bssid, bool preauth, gfp_t gfp) | ||
9873 | { | 9954 | { |
9874 | struct sk_buff *msg; | 9955 | struct sk_buff *msg; |
9875 | struct nlattr *attr; | 9956 | struct nlattr *attr; |
@@ -9912,9 +9993,22 @@ void nl80211_pmksa_candidate_notify(struct cfg80211_registered_device *rdev, | |||
9912 | nlmsg_free(msg); | 9993 | nlmsg_free(msg); |
9913 | } | 9994 | } |
9914 | 9995 | ||
9915 | void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev, | 9996 | void cfg80211_pmksa_candidate_notify(struct net_device *dev, int index, |
9916 | struct net_device *netdev, | 9997 | const u8 *bssid, bool preauth, gfp_t gfp) |
9917 | struct cfg80211_chan_def *chandef, gfp_t gfp) | 9998 | { |
9999 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
10000 | struct wiphy *wiphy = wdev->wiphy; | ||
10001 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
10002 | |||
10003 | trace_cfg80211_pmksa_candidate_notify(dev, index, bssid, preauth); | ||
10004 | nl80211_pmksa_candidate_notify(rdev, dev, index, bssid, preauth, gfp); | ||
10005 | } | ||
10006 | EXPORT_SYMBOL(cfg80211_pmksa_candidate_notify); | ||
10007 | |||
10008 | static void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev, | ||
10009 | struct net_device *netdev, | ||
10010 | struct cfg80211_chan_def *chandef, | ||
10011 | gfp_t gfp) | ||
9918 | { | 10012 | { |
9919 | struct sk_buff *msg; | 10013 | struct sk_buff *msg; |
9920 | void *hdr; | 10014 | void *hdr; |
@@ -9946,11 +10040,36 @@ void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev, | |||
9946 | nlmsg_free(msg); | 10040 | nlmsg_free(msg); |
9947 | } | 10041 | } |
9948 | 10042 | ||
9949 | void | 10043 | void cfg80211_ch_switch_notify(struct net_device *dev, |
9950 | nl80211_send_cqm_txe_notify(struct cfg80211_registered_device *rdev, | 10044 | struct cfg80211_chan_def *chandef) |
9951 | struct net_device *netdev, const u8 *peer, | ||
9952 | u32 num_packets, u32 rate, u32 intvl, gfp_t gfp) | ||
9953 | { | 10045 | { |
10046 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
10047 | struct wiphy *wiphy = wdev->wiphy; | ||
10048 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
10049 | |||
10050 | trace_cfg80211_ch_switch_notify(dev, chandef); | ||
10051 | |||
10052 | wdev_lock(wdev); | ||
10053 | |||
10054 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP && | ||
10055 | wdev->iftype != NL80211_IFTYPE_P2P_GO)) | ||
10056 | goto out; | ||
10057 | |||
10058 | wdev->channel = chandef->chan; | ||
10059 | nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL); | ||
10060 | out: | ||
10061 | wdev_unlock(wdev); | ||
10062 | return; | ||
10063 | } | ||
10064 | EXPORT_SYMBOL(cfg80211_ch_switch_notify); | ||
10065 | |||
10066 | void cfg80211_cqm_txe_notify(struct net_device *dev, | ||
10067 | const u8 *peer, u32 num_packets, | ||
10068 | u32 rate, u32 intvl, gfp_t gfp) | ||
10069 | { | ||
10070 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
10071 | struct wiphy *wiphy = wdev->wiphy; | ||
10072 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
9954 | struct sk_buff *msg; | 10073 | struct sk_buff *msg; |
9955 | struct nlattr *pinfoattr; | 10074 | struct nlattr *pinfoattr; |
9956 | void *hdr; | 10075 | void *hdr; |
@@ -9966,7 +10085,7 @@ nl80211_send_cqm_txe_notify(struct cfg80211_registered_device *rdev, | |||
9966 | } | 10085 | } |
9967 | 10086 | ||
9968 | if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || | 10087 | if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || |
9969 | nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || | 10088 | nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || |
9970 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, peer)) | 10089 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, peer)) |
9971 | goto nla_put_failure; | 10090 | goto nla_put_failure; |
9972 | 10091 | ||
@@ -9995,6 +10114,7 @@ nl80211_send_cqm_txe_notify(struct cfg80211_registered_device *rdev, | |||
9995 | genlmsg_cancel(msg, hdr); | 10114 | genlmsg_cancel(msg, hdr); |
9996 | nlmsg_free(msg); | 10115 | nlmsg_free(msg); |
9997 | } | 10116 | } |
10117 | EXPORT_SYMBOL(cfg80211_cqm_txe_notify); | ||
9998 | 10118 | ||
9999 | void | 10119 | void |
10000 | nl80211_radar_notify(struct cfg80211_registered_device *rdev, | 10120 | nl80211_radar_notify(struct cfg80211_registered_device *rdev, |
@@ -10047,15 +10167,18 @@ nl80211_radar_notify(struct cfg80211_registered_device *rdev, | |||
10047 | nlmsg_free(msg); | 10167 | nlmsg_free(msg); |
10048 | } | 10168 | } |
10049 | 10169 | ||
10050 | void | 10170 | void cfg80211_cqm_pktloss_notify(struct net_device *dev, |
10051 | nl80211_send_cqm_pktloss_notify(struct cfg80211_registered_device *rdev, | 10171 | const u8 *peer, u32 num_packets, gfp_t gfp) |
10052 | struct net_device *netdev, const u8 *peer, | ||
10053 | u32 num_packets, gfp_t gfp) | ||
10054 | { | 10172 | { |
10173 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
10174 | struct wiphy *wiphy = wdev->wiphy; | ||
10175 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | ||
10055 | struct sk_buff *msg; | 10176 | struct sk_buff *msg; |
10056 | struct nlattr *pinfoattr; | 10177 | struct nlattr *pinfoattr; |
10057 | void *hdr; | 10178 | void *hdr; |
10058 | 10179 | ||
10180 | trace_cfg80211_cqm_pktloss_notify(dev, peer, num_packets); | ||
10181 | |||
10059 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); | 10182 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
10060 | if (!msg) | 10183 | if (!msg) |
10061 | return; | 10184 | return; |
@@ -10067,7 +10190,7 @@ nl80211_send_cqm_pktloss_notify(struct cfg80211_registered_device *rdev, | |||
10067 | } | 10190 | } |
10068 | 10191 | ||
10069 | if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || | 10192 | if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || |
10070 | nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || | 10193 | nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || |
10071 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, peer)) | 10194 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, peer)) |
10072 | goto nla_put_failure; | 10195 | goto nla_put_failure; |
10073 | 10196 | ||
@@ -10090,6 +10213,7 @@ nl80211_send_cqm_pktloss_notify(struct cfg80211_registered_device *rdev, | |||
10090 | genlmsg_cancel(msg, hdr); | 10213 | genlmsg_cancel(msg, hdr); |
10091 | nlmsg_free(msg); | 10214 | nlmsg_free(msg); |
10092 | } | 10215 | } |
10216 | EXPORT_SYMBOL(cfg80211_cqm_pktloss_notify); | ||
10093 | 10217 | ||
10094 | void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | 10218 | void cfg80211_probe_status(struct net_device *dev, const u8 *addr, |
10095 | u64 cookie, bool acked, gfp_t gfp) | 10219 | u64 cookie, bool acked, gfp_t gfp) |