Commit 00e96dec authored by Yoni Divinsky's avatar Yoni Divinsky Committed by Johannes Berg

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: default avatarYoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 50ae34a2
...@@ -680,6 +680,9 @@ struct ieee80211_sub_if_data { ...@@ -680,6 +680,9 @@ struct ieee80211_sub_if_data {
/* TID bitmap for NoAck policy */ /* TID bitmap for NoAck policy */
u16 noack_map; u16 noack_map;
/* bit field of ACM bits (BIT(802.1D tag)) */
u8 wmm_acm;
struct ieee80211_key __rcu *keys[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS]; struct ieee80211_key __rcu *keys[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS];
struct ieee80211_key __rcu *default_unicast_key; struct ieee80211_key __rcu *default_unicast_key;
struct ieee80211_key __rcu *default_multicast_key; struct ieee80211_key __rcu *default_multicast_key;
...@@ -1025,7 +1028,6 @@ struct ieee80211_local { ...@@ -1025,7 +1028,6 @@ struct ieee80211_local {
int total_ps_buffered; /* total number of all buffered unicast and int total_ps_buffered; /* total number of all buffered unicast and
* multicast packets for power saving stations * multicast packets for power saving stations
*/ */
unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */
bool pspolling; bool pspolling;
bool offchannel_ps_enabled; bool offchannel_ps_enabled;
......
...@@ -808,7 +808,7 @@ static u16 ieee80211_monitor_select_queue(struct net_device *dev, ...@@ -808,7 +808,7 @@ static u16 ieee80211_monitor_select_queue(struct net_device *dev,
hdr = (void *)((u8 *)skb->data + le16_to_cpu(rtap->it_len)); hdr = (void *)((u8 *)skb->data + le16_to_cpu(rtap->it_len));
return ieee80211_select_queue_80211(local, skb, hdr); return ieee80211_select_queue_80211(sdata, skb, hdr);
} }
static const struct net_device_ops ieee80211_monitorif_ops = { static const struct net_device_ops ieee80211_monitorif_ops = {
......
...@@ -1141,7 +1141,7 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local, ...@@ -1141,7 +1141,7 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
memset(&params, 0, sizeof(params)); memset(&params, 0, sizeof(params));
local->wmm_acm = 0; sdata->wmm_acm = 0;
for (; left >= 4; left -= 4, pos += 4) { for (; left >= 4; left -= 4, pos += 4) {
int aci = (pos[0] >> 5) & 0x03; int aci = (pos[0] >> 5) & 0x03;
int acm = (pos[0] >> 4) & 0x01; int acm = (pos[0] >> 4) & 0x01;
...@@ -1152,21 +1152,21 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local, ...@@ -1152,21 +1152,21 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
case 1: /* AC_BK */ case 1: /* AC_BK */
queue = 3; queue = 3;
if (acm) if (acm)
local->wmm_acm |= BIT(1) | BIT(2); /* BK/- */ sdata->wmm_acm |= BIT(1) | BIT(2); /* BK/- */
if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_BK) if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_BK)
uapsd = true; uapsd = true;
break; break;
case 2: /* AC_VI */ case 2: /* AC_VI */
queue = 1; queue = 1;
if (acm) if (acm)
local->wmm_acm |= BIT(4) | BIT(5); /* CL/VI */ sdata->wmm_acm |= BIT(4) | BIT(5); /* CL/VI */
if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VI) if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VI)
uapsd = true; uapsd = true;
break; break;
case 3: /* AC_VO */ case 3: /* AC_VO */
queue = 0; queue = 0;
if (acm) if (acm)
local->wmm_acm |= BIT(6) | BIT(7); /* VO/NC */ sdata->wmm_acm |= BIT(6) | BIT(7); /* VO/NC */
if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VO) if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VO)
uapsd = true; uapsd = true;
break; break;
...@@ -1174,7 +1174,7 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local, ...@@ -1174,7 +1174,7 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
default: default:
queue = 2; queue = 2;
if (acm) if (acm)
local->wmm_acm |= BIT(0) | BIT(3); /* BE/EE */ sdata->wmm_acm |= BIT(0) | BIT(3); /* BE/EE */
if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_BE) if (uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_BE)
uapsd = true; uapsd = true;
break; break;
......
...@@ -1935,7 +1935,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) ...@@ -1935,7 +1935,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
ether_addr_equal(sdata->vif.addr, hdr->addr3)) ether_addr_equal(sdata->vif.addr, hdr->addr3))
return RX_CONTINUE; return RX_CONTINUE;
q = ieee80211_select_queue_80211(local, skb, hdr); q = ieee80211_select_queue_80211(sdata, skb, hdr);
if (ieee80211_queue_stopped(&local->hw, q)) { if (ieee80211_queue_stopped(&local->hw, q)) {
IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_congestion); IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_congestion);
return RX_DROP_MONITOR; return RX_DROP_MONITOR;
......
...@@ -52,11 +52,11 @@ static int wme_downgrade_ac(struct sk_buff *skb) ...@@ -52,11 +52,11 @@ static int wme_downgrade_ac(struct sk_buff *skb)
} }
} }
static u16 ieee80211_downgrade_queue(struct ieee80211_local *local, static u16 ieee80211_downgrade_queue(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb) struct sk_buff *skb)
{ {
/* in case we are a client verify acm is not set for this ac */ /* in case we are a client verify acm is not set for this ac */
while (unlikely(local->wmm_acm & BIT(skb->priority))) { while (unlikely(sdata->wmm_acm & BIT(skb->priority))) {
if (wme_downgrade_ac(skb)) { if (wme_downgrade_ac(skb)) {
/* /*
* This should not really happen. The AP has marked all * This should not really happen. The AP has marked all
...@@ -73,10 +73,11 @@ static u16 ieee80211_downgrade_queue(struct ieee80211_local *local, ...@@ -73,10 +73,11 @@ static u16 ieee80211_downgrade_queue(struct ieee80211_local *local,
} }
/* Indicate which queue to use for this fully formed 802.11 frame */ /* Indicate which queue to use for this fully formed 802.11 frame */
u16 ieee80211_select_queue_80211(struct ieee80211_local *local, u16 ieee80211_select_queue_80211(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb, struct sk_buff *skb,
struct ieee80211_hdr *hdr) struct ieee80211_hdr *hdr)
{ {
struct ieee80211_local *local = sdata->local;
u8 *p; u8 *p;
if (local->hw.queues < IEEE80211_NUM_ACS) if (local->hw.queues < IEEE80211_NUM_ACS)
...@@ -94,7 +95,7 @@ u16 ieee80211_select_queue_80211(struct ieee80211_local *local, ...@@ -94,7 +95,7 @@ u16 ieee80211_select_queue_80211(struct ieee80211_local *local,
p = ieee80211_get_qos_ctl(hdr); p = ieee80211_get_qos_ctl(hdr);
skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK; skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK;
return ieee80211_downgrade_queue(local, skb); return ieee80211_downgrade_queue(sdata, skb);
} }
/* Indicate which queue to use. */ /* Indicate which queue to use. */
...@@ -156,7 +157,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, ...@@ -156,7 +157,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
* data frame has */ * data frame has */
skb->priority = cfg80211_classify8021d(skb); skb->priority = cfg80211_classify8021d(skb);
return ieee80211_downgrade_queue(local, skb); return ieee80211_downgrade_queue(sdata, skb);
} }
void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata, void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
extern const int ieee802_1d_to_ac[8]; extern const int ieee802_1d_to_ac[8];
u16 ieee80211_select_queue_80211(struct ieee80211_local *local, u16 ieee80211_select_queue_80211(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb, struct sk_buff *skb,
struct ieee80211_hdr *hdr); struct ieee80211_hdr *hdr);
u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment