diff options
author | Kyeyoon Park <kyeyoonp@qca.qualcomm.com> | 2013-12-17 02:04:43 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-12-19 10:30:58 -0500 |
commit | 32db6b54dfba38aa8fa4072b2a3fc6425139166a (patch) | |
tree | c77a6ad79daa65aa4ff186bdfc02e836be8e2254 /net/mac80211/cfg.c | |
parent | fa9ffc745610f31c6bc136d5a6a1782e00870e72 (diff) |
mac80211: Add support for QoS mapping
Implement set_qos_map() handler for mac80211 to enable QoS mapping
functionality.
Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index aab3c2f29de3..09d2e58a2ba7 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -3837,6 +3837,31 @@ static void ieee80211_set_wakeup(struct wiphy *wiphy, bool enabled) | |||
3837 | } | 3837 | } |
3838 | #endif | 3838 | #endif |
3839 | 3839 | ||
3840 | static int ieee80211_set_qos_map(struct wiphy *wiphy, | ||
3841 | struct net_device *dev, | ||
3842 | struct cfg80211_qos_map *qos_map) | ||
3843 | { | ||
3844 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
3845 | struct mac80211_qos_map *new_qos_map, *old_qos_map; | ||
3846 | |||
3847 | if (qos_map) { | ||
3848 | new_qos_map = kzalloc(sizeof(*new_qos_map), GFP_KERNEL); | ||
3849 | if (!new_qos_map) | ||
3850 | return -ENOMEM; | ||
3851 | memcpy(&new_qos_map->qos_map, qos_map, sizeof(*qos_map)); | ||
3852 | } else { | ||
3853 | /* A NULL qos_map was passed to disable QoS mapping */ | ||
3854 | new_qos_map = NULL; | ||
3855 | } | ||
3856 | |||
3857 | old_qos_map = rtnl_dereference(sdata->qos_map); | ||
3858 | rcu_assign_pointer(sdata->qos_map, new_qos_map); | ||
3859 | if (old_qos_map) | ||
3860 | kfree_rcu(old_qos_map, rcu_head); | ||
3861 | |||
3862 | return 0; | ||
3863 | } | ||
3864 | |||
3840 | struct cfg80211_ops mac80211_config_ops = { | 3865 | struct cfg80211_ops mac80211_config_ops = { |
3841 | .add_virtual_intf = ieee80211_add_iface, | 3866 | .add_virtual_intf = ieee80211_add_iface, |
3842 | .del_virtual_intf = ieee80211_del_iface, | 3867 | .del_virtual_intf = ieee80211_del_iface, |
@@ -3916,4 +3941,5 @@ struct cfg80211_ops mac80211_config_ops = { | |||
3916 | .get_channel = ieee80211_cfg_get_channel, | 3941 | .get_channel = ieee80211_cfg_get_channel, |
3917 | .start_radar_detection = ieee80211_start_radar_detection, | 3942 | .start_radar_detection = ieee80211_start_radar_detection, |
3918 | .channel_switch = ieee80211_channel_switch, | 3943 | .channel_switch = ieee80211_channel_switch, |
3944 | .set_qos_map = ieee80211_set_qos_map, | ||
3919 | }; | 3945 | }; |