aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJavier Cardona <javier@cozybit.com>2011-11-04 00:11:13 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-11-09 16:05:48 -0500
commitd0ce1855eab098c6257f1321b02b70f916064aaa (patch)
tree342a84dc8e35b73f6dc1aad2d81e91b711ce1b24 /net/mac80211
parent660c6a449a714cf770641134124f2aae49ed8ab0 (diff)
mac80211: simplify mesh frame queue mapping and QoS
We only need to set the skb queue twice: 1. by the netdev, on local TX. 2. when forwarding a mesh frame. We only need to set the qos header twice: 1. by mac80211, on local TX. 2. when putting a frame on the mpath->frame_queue We also don't need the RA in order to set the proper queue mapping since all mesh STAs are QoS, indicate this and do it once when the frame is received. Also fixes an issue where the QoS header and queue mapping was not set for unicast forwarded frames. Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/mesh_hwmp.c1
-rw-r--r--net/mac80211/mesh_pathtbl.c3
-rw-r--r--net/mac80211/rx.c5
-rw-r--r--net/mac80211/wme.c2
4 files changed, 4 insertions, 7 deletions
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index b22b223ccde1..a7afb2d32def 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -1043,6 +1043,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb,
1043 skb_to_free = skb_dequeue(&mpath->frame_queue); 1043 skb_to_free = skb_dequeue(&mpath->frame_queue);
1044 1044
1045 info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; 1045 info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
1046 ieee80211_set_qos_hdr(sdata, skb);
1046 skb_queue_tail(&mpath->frame_queue, skb); 1047 skb_queue_tail(&mpath->frame_queue, skb);
1047 if (skb_to_free) 1048 if (skb_to_free)
1048 mesh_path_discard_frame(skb_to_free, sdata); 1049 mesh_path_discard_frame(skb_to_free, sdata);
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 7f54c5042235..4fc23d1b9c3a 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -213,7 +213,6 @@ void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta)
213 struct ieee80211_hdr *hdr; 213 struct ieee80211_hdr *hdr;
214 struct sk_buff_head tmpq; 214 struct sk_buff_head tmpq;
215 unsigned long flags; 215 unsigned long flags;
216 struct ieee80211_sub_if_data *sdata = mpath->sdata;
217 216
218 rcu_assign_pointer(mpath->next_hop, sta); 217 rcu_assign_pointer(mpath->next_hop, sta);
219 218
@@ -224,8 +223,6 @@ void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta)
224 while ((skb = __skb_dequeue(&mpath->frame_queue)) != NULL) { 223 while ((skb = __skb_dequeue(&mpath->frame_queue)) != NULL) {
225 hdr = (struct ieee80211_hdr *) skb->data; 224 hdr = (struct ieee80211_hdr *) skb->data;
226 memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN); 225 memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN);
227 skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, skb));
228 ieee80211_set_qos_hdr(sdata, skb);
229 __skb_queue_tail(&tmpq, skb); 226 __skb_queue_tail(&tmpq, skb);
230 } 227 }
231 228
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 04c1b05ba339..c8a7076f9bb8 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1941,6 +1941,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
1941 compare_ether_addr(sdata->vif.addr, hdr->addr3) == 0) 1941 compare_ether_addr(sdata->vif.addr, hdr->addr3) == 0)
1942 return RX_CONTINUE; 1942 return RX_CONTINUE;
1943 1943
1944 skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, skb));
1944 mesh_hdr->ttl--; 1945 mesh_hdr->ttl--;
1945 1946
1946 if (status->rx_flags & IEEE80211_RX_RA_MATCH) { 1947 if (status->rx_flags & IEEE80211_RX_RA_MATCH) {
@@ -1965,12 +1966,10 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
1965 memset(info, 0, sizeof(*info)); 1966 memset(info, 0, sizeof(*info));
1966 info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; 1967 info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
1967 info->control.vif = &rx->sdata->vif; 1968 info->control.vif = &rx->sdata->vif;
1969 info->control.jiffies = jiffies;
1968 if (is_multicast_ether_addr(fwd_hdr->addr1)) { 1970 if (is_multicast_ether_addr(fwd_hdr->addr1)) {
1969 IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, 1971 IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
1970 fwded_mcast); 1972 fwded_mcast);
1971 skb_set_queue_mapping(fwd_skb,
1972 ieee80211_select_queue(sdata, fwd_skb));
1973 ieee80211_set_qos_hdr(sdata, fwd_skb);
1974 } else { 1973 } else {
1975 int err; 1974 int err;
1976 /* 1975 /*
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index d4f789a4e4f1..43327115b490 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -83,7 +83,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
83 break; 83 break;
84#ifdef CONFIG_MAC80211_MESH 84#ifdef CONFIG_MAC80211_MESH
85 case NL80211_IFTYPE_MESH_POINT: 85 case NL80211_IFTYPE_MESH_POINT:
86 ra = skb->data; 86 qos = true;
87 break; 87 break;
88#endif 88#endif
89 case NL80211_IFTYPE_STATION: 89 case NL80211_IFTYPE_STATION: