aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJavier Cardona <javier@cozybit.com>2011-09-07 20:49:53 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-14 13:56:50 -0400
commit2154c81c32fa44364f83218a10d8dbec4e76d4f5 (patch)
treed51234e55d24c6ff5f4849d2757b57f1d6accaac /net/mac80211
parent4777be41638cfab56c78b2a764a5f83beb6cfdd2 (diff)
mac80211: Mesh data frames must have the QoS header
Per sec 7.1.3.5 of draft 12.0 of 802.11s, mesh frames indicate the presence of the mesh control header in their QoS header. Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/mesh.c3
-rw-r--r--net/mac80211/mesh_hwmp.c3
-rw-r--r--net/mac80211/mesh_pathtbl.c2
-rw-r--r--net/mac80211/rx.c6
-rw-r--r--net/mac80211/tx.c2
-rw-r--r--net/mac80211/wme.c10
-rw-r--r--net/mac80211/wme.h3
7 files changed, 15 insertions, 14 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 65acbf5eed2d..a4225ae69681 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -463,8 +463,7 @@ int ieee80211_fill_mesh_addresses(struct ieee80211_hdr *hdr, __le16 *fc,
463 memcpy(hdr->addr3, meshsa, ETH_ALEN); 463 memcpy(hdr->addr3, meshsa, ETH_ALEN);
464 return 24; 464 return 24;
465 } else { 465 } else {
466 *fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | 466 *fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS);
467 IEEE80211_FCTL_TODS);
468 /* RA TA DA SA */ 467 /* RA TA DA SA */
469 memset(hdr->addr1, 0, ETH_ALEN); /* RA is resolved later */ 468 memset(hdr->addr1, 0, ETH_ALEN); /* RA is resolved later */
470 memcpy(hdr->addr2, meshsa, ETH_ALEN); 469 memcpy(hdr->addr2, meshsa, ETH_ALEN);
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 63df0bc3dba4..6df7913d7ca4 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -209,7 +209,6 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
209static void prepare_frame_for_deferred_tx(struct ieee80211_sub_if_data *sdata, 209static void prepare_frame_for_deferred_tx(struct ieee80211_sub_if_data *sdata,
210 struct sk_buff *skb) 210 struct sk_buff *skb)
211{ 211{
212 struct ieee80211_local *local = sdata->local;
213 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 212 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
214 213
215 skb_set_mac_header(skb, 0); 214 skb_set_mac_header(skb, 0);
@@ -221,7 +220,7 @@ static void prepare_frame_for_deferred_tx(struct ieee80211_sub_if_data *sdata,
221 skb->priority = 7; 220 skb->priority = 7;
222 221
223 info->control.vif = &sdata->vif; 222 info->control.vif = &sdata->vif;
224 ieee80211_set_qos_hdr(local, skb); 223 ieee80211_set_qos_hdr(sdata, skb);
225} 224}
226 225
227/** 226/**
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 4fc8c7a5d4dd..332b5ff1e885 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -225,7 +225,7 @@ void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta)
225 hdr = (struct ieee80211_hdr *) skb->data; 225 hdr = (struct ieee80211_hdr *) skb->data;
226 memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN); 226 memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN);
227 skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, skb)); 227 skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, skb));
228 ieee80211_set_qos_hdr(sdata->local, skb); 228 ieee80211_set_qos_hdr(sdata, skb);
229 __skb_queue_tail(&tmpq, skb); 229 __skb_queue_tail(&tmpq, skb);
230 } 230 }
231 231
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index b1ea4444065e..db46601e50bf 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1910,7 +1910,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
1910 fwded_mcast); 1910 fwded_mcast);
1911 skb_set_queue_mapping(fwd_skb, 1911 skb_set_queue_mapping(fwd_skb,
1912 ieee80211_select_queue(sdata, fwd_skb)); 1912 ieee80211_select_queue(sdata, fwd_skb));
1913 ieee80211_set_qos_hdr(local, fwd_skb); 1913 ieee80211_set_qos_hdr(sdata, fwd_skb);
1914 } else { 1914 } else {
1915 int err; 1915 int err;
1916 /* 1916 /*
@@ -2572,12 +2572,12 @@ static void ieee80211_rx_handlers(struct ieee80211_rx_data *rx)
2572 CALL_RXH(ieee80211_rx_h_ps_poll) 2572 CALL_RXH(ieee80211_rx_h_ps_poll)
2573 CALL_RXH(ieee80211_rx_h_michael_mic_verify) 2573 CALL_RXH(ieee80211_rx_h_michael_mic_verify)
2574 /* must be after MMIC verify so header is counted in MPDU mic */ 2574 /* must be after MMIC verify so header is counted in MPDU mic */
2575 CALL_RXH(ieee80211_rx_h_remove_qos_control)
2576 CALL_RXH(ieee80211_rx_h_amsdu)
2577#ifdef CONFIG_MAC80211_MESH 2575#ifdef CONFIG_MAC80211_MESH
2578 if (ieee80211_vif_is_mesh(&rx->sdata->vif)) 2576 if (ieee80211_vif_is_mesh(&rx->sdata->vif))
2579 CALL_RXH(ieee80211_rx_h_mesh_fwding); 2577 CALL_RXH(ieee80211_rx_h_mesh_fwding);
2580#endif 2578#endif
2579 CALL_RXH(ieee80211_rx_h_remove_qos_control)
2580 CALL_RXH(ieee80211_rx_h_amsdu)
2581 CALL_RXH(ieee80211_rx_h_data) 2581 CALL_RXH(ieee80211_rx_h_data)
2582 CALL_RXH(ieee80211_rx_h_ctrl); 2582 CALL_RXH(ieee80211_rx_h_ctrl);
2583 CALL_RXH(ieee80211_rx_h_mgmt_check) 2583 CALL_RXH(ieee80211_rx_h_mgmt_check)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 2a8e437165fb..7cd6c28968b2 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1596,7 +1596,7 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata,
1596 return; 1596 return;
1597 } 1597 }
1598 1598
1599 ieee80211_set_qos_hdr(local, skb); 1599 ieee80211_set_qos_hdr(sdata, skb);
1600 ieee80211_tx(sdata, skb, false); 1600 ieee80211_tx(sdata, skb, false);
1601 rcu_read_unlock(); 1601 rcu_read_unlock();
1602} 1602}
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index a9fee2bc6300..971004c9b04f 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -135,7 +135,8 @@ u16 ieee80211_downgrade_queue(struct ieee80211_local *local,
135 return ieee802_1d_to_ac[skb->priority]; 135 return ieee802_1d_to_ac[skb->priority];
136} 136}
137 137
138void ieee80211_set_qos_hdr(struct ieee80211_local *local, struct sk_buff *skb) 138void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
139 struct sk_buff *skb)
139{ 140{
140 struct ieee80211_hdr *hdr = (void *)skb->data; 141 struct ieee80211_hdr *hdr = (void *)skb->data;
141 142
@@ -146,10 +147,11 @@ void ieee80211_set_qos_hdr(struct ieee80211_local *local, struct sk_buff *skb)
146 147
147 tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; 148 tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
148 149
149 if (unlikely(local->wifi_wme_noack_test)) 150 if (unlikely(sdata->local->wifi_wme_noack_test))
150 ack_policy |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK; 151 ack_policy |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK;
151 /* qos header is 2 bytes, second reserved */ 152 /* qos header is 2 bytes */
152 *p++ = ack_policy | tid; 153 *p++ = ack_policy | tid;
153 *p = 0; 154 *p = ieee80211_vif_is_mesh(&sdata->vif) ?
155 (IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT >> 8) : 0;
154 } 156 }
155} 157}
diff --git a/net/mac80211/wme.h b/net/mac80211/wme.h
index faead6d02026..34e166fbf4d4 100644
--- a/net/mac80211/wme.h
+++ b/net/mac80211/wme.h
@@ -17,7 +17,8 @@ extern const int ieee802_1d_to_ac[8];
17 17
18u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, 18u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
19 struct sk_buff *skb); 19 struct sk_buff *skb);
20void ieee80211_set_qos_hdr(struct ieee80211_local *local, struct sk_buff *skb); 20void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
21 struct sk_buff *skb);
21u16 ieee80211_downgrade_queue(struct ieee80211_local *local, 22u16 ieee80211_downgrade_queue(struct ieee80211_local *local,
22 struct sk_buff *skb); 23 struct sk_buff *skb);
23 24