Search Linux Wireless

[PATCH 2/2] mac80211: Add support for QoS mapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Kyeyoon Park <kyeyoonp@xxxxxxxxxxxxxxxx>

Implement set_qos_map() handler for mac80211 to enable QoS mapping
functionality.

Signed-off-by: Kyeyoon Park <kyeyoonp@xxxxxxxxxxxxxxxx>
Signed-off-by: Jouni Malinen <jouni@xxxxxxxxxxxxxxxx>
---
 net/mac80211/cfg.c         |   12 ++++++++++++
 net/mac80211/ieee80211_i.h |    1 +
 net/mac80211/iface.c       |    2 ++
 net/mac80211/wme.c         |    3 ++-
 4 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 95667b0..37fc6ff 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3785,6 +3785,17 @@ static void ieee80211_set_wakeup(struct wiphy *wiphy, bool enabled)
 }
 #endif
 
+static int ieee80211_set_qos_map(struct wiphy *wiphy,
+				 struct net_device *dev,
+				 struct cfg80211_qos_map *qos_map)
+{
+	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+
+	memcpy(&sdata->qos_map, qos_map, sizeof(struct cfg80211_qos_map));
+
+	return 0;
+}
+
 struct cfg80211_ops mac80211_config_ops = {
 	.add_virtual_intf = ieee80211_add_iface,
 	.del_virtual_intf = ieee80211_del_iface,
@@ -3864,4 +3875,5 @@ struct cfg80211_ops mac80211_config_ops = {
 	.get_channel = ieee80211_cfg_get_channel,
 	.start_radar_detection = ieee80211_start_radar_detection,
 	.channel_switch = ieee80211_channel_switch,
+	.set_qos_map = ieee80211_set_qos_map,
 };
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 29dc505..7bb5914 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -730,6 +730,7 @@ struct ieee80211_sub_if_data {
 	bool control_port_no_encrypt;
 
 	struct ieee80211_tx_queue_params tx_conf[IEEE80211_NUM_ACS];
+	struct cfg80211_qos_map qos_map;
 
 	struct work_struct csa_finalize_work;
 	int csa_counter_offset_beacon;
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index ff101ea..bd43217 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -636,6 +636,8 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
 		ieee80211_set_wmm_default(sdata, true);
 	}
 
+	sdata->qos_map.valid = false;
+
 	set_bit(SDATA_STATE_RUNNING, &sdata->state);
 
 	if (sdata->vif.type == NL80211_IFTYPE_WDS) {
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index faa9d8e..eb87ec5 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -103,6 +103,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
 			   struct sk_buff *skb)
 {
 	struct ieee80211_local *local = sdata->local;
+	struct cfg80211_qos_map *qos_map = &sdata->qos_map;
 	struct sta_info *sta = NULL;
 	const u8 *ra = NULL;
 	bool qos = false;
@@ -155,7 +156,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
 
 	/* use the data classifier to determine what 802.1d tag the
 	 * data frame has */
-	skb->priority = cfg80211_classify8021d(skb, NULL);
+	skb->priority = cfg80211_classify8021d(skb, qos_map);
 
 	return ieee80211_downgrade_queue(sdata, skb);
 }
-- 
1.7.9.5


-- 
Jouni Malinen                                            PGP id EFC895FA
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux