summaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-02-23 15:17:19 +0100
committerJohn W. Linville <linville@tuxdriver.com>2008-03-06 15:30:42 -0500
commit902acc7896d7649fb30e4b22bd4e643c7f34b02c (patch)
tree8d8f2838fead8417e16e801383ddb2691a89719f /net/mac80211/rx.c
parentf7a921443740d7dafc65b17aa32531730d358f50 (diff)
downloadop-kernel-dev-902acc7896d7649fb30e4b22bd4e643c7f34b02c.zip
op-kernel-dev-902acc7896d7649fb30e4b22bd4e643c7f34b02c.tar.gz
mac80211: clean up mesh code
Various cleanups, reducing the #ifdef mess and other things. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index cc4a896..d0018fc 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -20,9 +20,7 @@
#include "ieee80211_i.h"
#include "ieee80211_led.h"
-#ifdef CONFIG_MAC80211_MESH
#include "mesh.h"
-#endif
#include "wep.h"
#include "wpa.h"
#include "tkip.h"
@@ -439,6 +437,13 @@ ieee80211_rx_mesh_check(struct ieee80211_txrx_data *rx)
else
return RX_CONTINUE;
}
+#undef msh_h_get
+#else
+static inline ieee80211_rx_result
+ieee80211_rx_mesh_check(struct ieee80211_txrx_data *rx)
+{
+ return RX_CONTINUE;
+}
#endif
@@ -477,10 +482,8 @@ ieee80211_rx_h_check(struct ieee80211_txrx_data *rx)
* responsible for filtering on both auth and assoc states.
*/
-#ifdef CONFIG_MAC80211_MESH
- if (rx->sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT)
+ if (ieee80211_vif_is_mesh(&rx->sdata->vif))
return ieee80211_rx_mesh_check(rx);
-#endif
if (unlikely(((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA ||
((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL &&
@@ -1111,8 +1114,7 @@ ieee80211_data_to_8023(struct ieee80211_txrx_data *rx)
hdrlen = ieee80211_get_hdrlen(fc);
-#ifdef CONFIG_MAC80211_MESH
- if (sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) {
+ if (ieee80211_vif_is_mesh(&sdata->vif)) {
int meshhdrlen = ieee80211_get_mesh_hdrlen(
(struct ieee80211s_hdr *) (skb->data + hdrlen));
/* Copy on cb:
@@ -1126,7 +1128,6 @@ ieee80211_data_to_8023(struct ieee80211_txrx_data *rx)
memcpy(MESH_PREQ(skb), hdr->addr2, ETH_ALEN);
hdrlen += meshhdrlen;
}
-#endif
/* convert IEEE 802.11 header + possible LLC headers into Ethernet
* header
@@ -1306,9 +1307,8 @@ ieee80211_deliver_skb(struct ieee80211_txrx_data *rx)
}
}
-#ifdef CONFIG_MAC80211_MESH
/* Mesh forwarding */
- if (sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) {
+ if (ieee80211_vif_is_mesh(&sdata->vif)) {
u8 *mesh_ttl = &((struct ieee80211s_hdr *)skb->cb)->ttl;
(*mesh_ttl)--;
@@ -1321,12 +1321,13 @@ ieee80211_deliver_skb(struct ieee80211_txrx_data *rx)
else
xmit_skb->pkt_type = PACKET_OTHERHOST;
} else
- sdata->u.sta.mshstats.dropped_frames_ttl++;
-
+ IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.sta,
+ dropped_frames_ttl);
} else if (skb->pkt_type != PACKET_OTHERHOST &&
compare_ether_addr(dev->dev_addr, skb->data) != 0) {
if (*mesh_ttl == 0) {
- sdata->u.sta.mshstats.dropped_frames_ttl++;
+ IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.sta,
+ dropped_frames_ttl);
dev_kfree_skb(skb);
skb = NULL;
} else {
@@ -1337,7 +1338,6 @@ ieee80211_deliver_skb(struct ieee80211_txrx_data *rx)
}
}
}
-#endif
if (skb) {
/* deliver to local stack */
OpenPOWER on IntegriCloud