aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorYoni Divinsky <yoni.divinsky@ti.com>2012-06-20 08:39:13 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-20 11:35:22 -0400
commit00e96decfd0b927f975c98340a5982c5039eeaae (patch)
treeaec86580944dd4a5bc22238fe4a77bb3d8acc777 /net/mac80211
parent50ae34a254ca5192e46503884ed0edd60795fe87 (diff)
mac80211: save wmm_acm per sdata
Save and configure the wmm_acm per sdata, rather than per hardware. If wmm_acm is saved per hardware when running two interfaces simultaneously on the same hardware one interface's wmm policy will be affected by the other interface. Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ieee80211_i.h4
-rw-r--r--net/mac80211/iface.c2
-rw-r--r--net/mac80211/mlme.c10
-rw-r--r--net/mac80211/rx.c2
-rw-r--r--net/mac80211/wme.c11
-rw-r--r--net/mac80211/wme.h2
6 files changed, 17 insertions, 14 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 34af2e5263c2..0024c32d7bc4 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -680,6 +680,9 @@ struct ieee80211_sub_if_data {
680 /* TID bitmap for NoAck policy */ 680 /* TID bitmap for NoAck policy */
681 u16 noack_map; 681 u16 noack_map;
682 682
683 /* bit field of ACM bits (BIT(802.1D tag)) */
684 u8 wmm_acm;
685
683 struct ieee80211_key __rcu *keys[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS]; 686 struct ieee80211_key __rcu *keys[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS];
684 struct ieee80211_key __rcu *default_unicast_key; 687 struct ieee80211_key __rcu *default_unicast_key;
685 struct ieee80211_key __rcu *default_multicast_key; 688 struct ieee80211_key __rcu *default_multicast_key;
@@ -1025,7 +1028,6 @@ struct ieee80211_local {
1025 int total_ps_buffered; /* total number of all buffered unicast and 1028 int total_ps_buffered; /* total number of all buffered unicast and
1026 * multicast packets for power saving stations 1029 * multicast packets for power saving stations
1027 */ 1030 */
1028 unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */
1029 1031
1030 bool pspolling; 1032 bool pspolling;
1031 bool offchannel_ps_enabled; 1033 bool offchannel_ps_enabled;
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 87aeb4f21ffd..728d3eac1f59 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -808,7 +808,7 @@ static u16 ieee80211_monitor_select_queue(struct net_device *dev,
808 808
809 hdr = (void *)((u8 *)skb->data + le16_to_cpu(rtap->it_len)); 809 hdr = (void *)((u8 *)skb->data + le16_to_cpu(rtap->it_len));
810 810
811 return ieee80211_select_queue_80211(local, skb, hdr); 811 return ieee80211_select_queue_80211(sdata, skb, hdr);
812} 812}
813 813
814static const struct net_device_ops ieee80211_monitorif_ops = { 814static const struct net_device_ops ieee80211_monitorif_ops = {
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 94d0183ce224..2b450f541993 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1141,7 +1141,7 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
1141 1141
1142 memset(&params, 0, sizeof(params)); 1142 memset(&params, 0, sizeof(params));
1143 1143
1144 local->wmm_acm = 0; 1144 sdata->wmm_acm = 0;
1145 for (; left >= 4; left -= 4, pos += 4) { 1145 for (; left >= 4; left -= 4, pos += 4) {
1146 int aci = (pos[0] >> 5) & 0x03; 1146 int aci = (pos[0] >> 5) & 0x03;
1147 int acm = (pos[0] >> 4) & 0x01; 1147 int acm = (pos[0] >> 4) & 0x01;
@@ -1152,21 +1152,21 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
1152 case 1: /* AC_BK */ 1152 case 1: /* AC_BK */
1153 queue = 3; 1153 queue = 3;
1154 if (acm) 1154 if (acm)
1155 local->wmm_acm |= BIT(1) | BIT(2); /* BK/- */ 1155 sdata->wmm_acm |= BIT(1) | BIT(2); /* BK/- */
1156 if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_BK) 1156 if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_BK)
1157 uapsd = true; 1157 uapsd = true;
1158 break; 1158 break;
1159 case 2: /* AC_VI */ 1159 case 2: /* AC_VI */
1160 queue = 1; 1160 queue = 1;
1161 if (acm) 1161 if (acm)
1162 local->wmm_acm |= BIT(4) | BIT(5); /* CL/VI */ 1162 sdata->wmm_acm |= BIT(4) | BIT(5); /* CL/VI */
1163 if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VI) 1163 if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VI)
1164 uapsd = true; 1164 uapsd = true;
1165 break; 1165 break;
1166 case 3: /* AC_VO */ 1166 case 3: /* AC_VO */
1167 queue = 0; 1167 queue = 0;
1168 if (acm) 1168 if (acm)
1169 local->wmm_acm |= BIT(6) | BIT(7); /* VO/NC */ 1169 sdata->wmm_acm |= BIT(6) | BIT(7); /* VO/NC */
1170 if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VO) 1170 if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VO)
1171 uapsd = true; 1171 uapsd = true;
1172 break; 1172 break;
@@ -1174,7 +1174,7 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
1174 default: 1174 default:
1175 queue = 2; 1175 queue = 2;
1176 if (acm) 1176 if (acm)
1177 local->wmm_acm |= BIT(0) | BIT(3); /* BE/EE */ 1177 sdata->wmm_acm |= BIT(0) | BIT(3); /* BE/EE */
1178 if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_BE) 1178 if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_BE)
1179 uapsd = true; 1179 uapsd = true;
1180 break; 1180 break;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 072e8f3afa2b..446a327b3de0 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1935,7 +1935,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
1935 ether_addr_equal(sdata->vif.addr, hdr->addr3)) 1935 ether_addr_equal(sdata->vif.addr, hdr->addr3))
1936 return RX_CONTINUE; 1936 return RX_CONTINUE;
1937 1937
1938 q = ieee80211_select_queue_80211(local, skb, hdr); 1938 q = ieee80211_select_queue_80211(sdata, skb, hdr);
1939 if (ieee80211_queue_stopped(&local->hw, q)) { 1939 if (ieee80211_queue_stopped(&local->hw, q)) {
1940 IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_congestion); 1940 IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_congestion);
1941 return RX_DROP_MONITOR; 1941 return RX_DROP_MONITOR;
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index c3d643a6536c..cea06e9f26f4 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -52,11 +52,11 @@ static int wme_downgrade_ac(struct sk_buff *skb)
52 } 52 }
53} 53}
54 54
55static u16 ieee80211_downgrade_queue(struct ieee80211_local *local, 55static u16 ieee80211_downgrade_queue(struct ieee80211_sub_if_data *sdata,
56 struct sk_buff *skb) 56 struct sk_buff *skb)
57{ 57{
58 /* in case we are a client verify acm is not set for this ac */ 58 /* in case we are a client verify acm is not set for this ac */
59 while (unlikely(local->wmm_acm & BIT(skb->priority))) { 59 while (unlikely(sdata->wmm_acm & BIT(skb->priority))) {
60 if (wme_downgrade_ac(skb)) { 60 if (wme_downgrade_ac(skb)) {
61 /* 61 /*
62 * This should not really happen. The AP has marked all 62 * This should not really happen. The AP has marked all
@@ -73,10 +73,11 @@ static u16 ieee80211_downgrade_queue(struct ieee80211_local *local,
73} 73}
74 74
75/* Indicate which queue to use for this fully formed 802.11 frame */ 75/* Indicate which queue to use for this fully formed 802.11 frame */
76u16 ieee80211_select_queue_80211(struct ieee80211_local *local, 76u16 ieee80211_select_queue_80211(struct ieee80211_sub_if_data *sdata,
77 struct sk_buff *skb, 77 struct sk_buff *skb,
78 struct ieee80211_hdr *hdr) 78 struct ieee80211_hdr *hdr)
79{ 79{
80 struct ieee80211_local *local = sdata->local;
80 u8 *p; 81 u8 *p;
81 82
82 if (local->hw.queues < IEEE80211_NUM_ACS) 83 if (local->hw.queues < IEEE80211_NUM_ACS)
@@ -94,7 +95,7 @@ u16 ieee80211_select_queue_80211(struct ieee80211_local *local,
94 p = ieee80211_get_qos_ctl(hdr); 95 p = ieee80211_get_qos_ctl(hdr);
95 skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK; 96 skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK;
96 97
97 return ieee80211_downgrade_queue(local, skb); 98 return ieee80211_downgrade_queue(sdata, skb);
98} 99}
99 100
100/* Indicate which queue to use. */ 101/* Indicate which queue to use. */
@@ -156,7 +157,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
156 * data frame has */ 157 * data frame has */
157 skb->priority = cfg80211_classify8021d(skb); 158 skb->priority = cfg80211_classify8021d(skb);
158 159
159 return ieee80211_downgrade_queue(local, skb); 160 return ieee80211_downgrade_queue(sdata, skb);
160} 161}
161 162
162void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata, 163void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/wme.h b/net/mac80211/wme.h
index ca80818b7b66..7fea4bb8acbc 100644
--- a/net/mac80211/wme.h
+++ b/net/mac80211/wme.h
@@ -15,7 +15,7 @@
15 15
16extern const int ieee802_1d_to_ac[8]; 16extern const int ieee802_1d_to_ac[8];
17 17
18u16 ieee80211_select_queue_80211(struct ieee80211_local *local, 18u16 ieee80211_select_queue_80211(struct ieee80211_sub_if_data *sdata,
19 struct sk_buff *skb, 19 struct sk_buff *skb,
20 struct ieee80211_hdr *hdr); 20 struct ieee80211_hdr *hdr);
21u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, 21u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,