mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
This commit is contained in:
parent
7a8266524a
commit
271733cf84
2 changed files with 27 additions and 3 deletions
|
|
@ -764,6 +764,8 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid,
|
|||
u16 frame_type, const u8 *match_data,
|
||||
int match_len)
|
||||
{
|
||||
struct wiphy *wiphy = wdev->wiphy;
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
|
||||
struct cfg80211_mgmt_registration *reg, *nreg;
|
||||
int err = 0;
|
||||
u16 mgmt_type;
|
||||
|
|
@ -810,22 +812,37 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid,
|
|||
nreg->frame_type = cpu_to_le16(frame_type);
|
||||
list_add(&nreg->list, &wdev->mgmt_registrations);
|
||||
|
||||
if (rdev->ops->mgmt_frame_register)
|
||||
rdev->ops->mgmt_frame_register(wiphy, wdev->netdev,
|
||||
frame_type, true);
|
||||
|
||||
out:
|
||||
spin_unlock_bh(&wdev->mgmt_registrations_lock);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid)
|
||||
{
|
||||
struct wiphy *wiphy = wdev->wiphy;
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
|
||||
struct cfg80211_mgmt_registration *reg, *tmp;
|
||||
|
||||
spin_lock_bh(&wdev->mgmt_registrations_lock);
|
||||
|
||||
list_for_each_entry_safe(reg, tmp, &wdev->mgmt_registrations, list) {
|
||||
if (reg->nlpid == nlpid) {
|
||||
list_del(®->list);
|
||||
kfree(reg);
|
||||
if (reg->nlpid != nlpid)
|
||||
continue;
|
||||
|
||||
if (rdev->ops->mgmt_frame_register) {
|
||||
u16 frame_type = le16_to_cpu(reg->frame_type);
|
||||
|
||||
rdev->ops->mgmt_frame_register(wiphy, wdev->netdev,
|
||||
frame_type, false);
|
||||
}
|
||||
|
||||
list_del(®->list);
|
||||
kfree(reg);
|
||||
}
|
||||
|
||||
spin_unlock_bh(&wdev->mgmt_registrations_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue