aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-10-13 06:06:23 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-13 15:45:22 -0400
commit271733cf844a2f5f186ef3b40c26d6397b71039a (patch)
tree6b674540afe189b48599ae423c2174ebd48a8ffe /net/wireless/mlme.c
parent7a8266524af7ec70d1b3d10f964ce911d922d466 (diff)
cfg80211: notify drivers about frame registrations
Drivers may need to adjust their filters according to frame registrations, so notify them about them. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/mlme.c')
-rw-r--r--net/wireless/mlme.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index caf11a427507..26838d903b9a 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -764,6 +764,8 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid,
764 u16 frame_type, const u8 *match_data, 764 u16 frame_type, const u8 *match_data,
765 int match_len) 765 int match_len)
766{ 766{
767 struct wiphy *wiphy = wdev->wiphy;
768 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
767 struct cfg80211_mgmt_registration *reg, *nreg; 769 struct cfg80211_mgmt_registration *reg, *nreg;
768 int err = 0; 770 int err = 0;
769 u16 mgmt_type; 771 u16 mgmt_type;
@@ -810,22 +812,37 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid,
810 nreg->frame_type = cpu_to_le16(frame_type); 812 nreg->frame_type = cpu_to_le16(frame_type);
811 list_add(&nreg->list, &wdev->mgmt_registrations); 813 list_add(&nreg->list, &wdev->mgmt_registrations);
812 814
815 if (rdev->ops->mgmt_frame_register)
816 rdev->ops->mgmt_frame_register(wiphy, wdev->netdev,
817 frame_type, true);
818
813 out: 819 out:
814 spin_unlock_bh(&wdev->mgmt_registrations_lock); 820 spin_unlock_bh(&wdev->mgmt_registrations_lock);
821
815 return err; 822 return err;
816} 823}
817 824
818void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid) 825void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid)
819{ 826{
827 struct wiphy *wiphy = wdev->wiphy;
828 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
820 struct cfg80211_mgmt_registration *reg, *tmp; 829 struct cfg80211_mgmt_registration *reg, *tmp;
821 830
822 spin_lock_bh(&wdev->mgmt_registrations_lock); 831 spin_lock_bh(&wdev->mgmt_registrations_lock);
823 832
824 list_for_each_entry_safe(reg, tmp, &wdev->mgmt_registrations, list) { 833 list_for_each_entry_safe(reg, tmp, &wdev->mgmt_registrations, list) {
825 if (reg->nlpid == nlpid) { 834 if (reg->nlpid != nlpid)
826 list_del(&reg->list); 835 continue;
827 kfree(reg); 836
837 if (rdev->ops->mgmt_frame_register) {
838 u16 frame_type = le16_to_cpu(reg->frame_type);
839
840 rdev->ops->mgmt_frame_register(wiphy, wdev->netdev,
841 frame_type, false);
828 } 842 }
843
844 list_del(&reg->list);
845 kfree(reg);
829 } 846 }
830 847
831 spin_unlock_bh(&wdev->mgmt_registrations_lock); 848 spin_unlock_bh(&wdev->mgmt_registrations_lock);