diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-02-23 09:17:19 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-06 15:30:42 -0500 |
commit | 902acc7896d7649fb30e4b22bd4e643c7f34b02c (patch) | |
tree | 8d8f2838fead8417e16e801383ddb2691a89719f /net/mac80211/rx.c | |
parent | f7a921443740d7dafc65b17aa32531730d358f50 (diff) |
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.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index cc4a896c617f..d0018fc40b09 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -20,9 +20,7 @@ | |||
20 | 20 | ||
21 | #include "ieee80211_i.h" | 21 | #include "ieee80211_i.h" |
22 | #include "ieee80211_led.h" | 22 | #include "ieee80211_led.h" |
23 | #ifdef CONFIG_MAC80211_MESH | ||
24 | #include "mesh.h" | 23 | #include "mesh.h" |
25 | #endif | ||
26 | #include "wep.h" | 24 | #include "wep.h" |
27 | #include "wpa.h" | 25 | #include "wpa.h" |
28 | #include "tkip.h" | 26 | #include "tkip.h" |
@@ -439,6 +437,13 @@ ieee80211_rx_mesh_check(struct ieee80211_txrx_data *rx) | |||
439 | else | 437 | else |
440 | return RX_CONTINUE; | 438 | return RX_CONTINUE; |
441 | } | 439 | } |
440 | #undef msh_h_get | ||
441 | #else | ||
442 | static inline ieee80211_rx_result | ||
443 | ieee80211_rx_mesh_check(struct ieee80211_txrx_data *rx) | ||
444 | { | ||
445 | return RX_CONTINUE; | ||
446 | } | ||
442 | #endif | 447 | #endif |
443 | 448 | ||
444 | 449 | ||
@@ -477,10 +482,8 @@ ieee80211_rx_h_check(struct ieee80211_txrx_data *rx) | |||
477 | * responsible for filtering on both auth and assoc states. | 482 | * responsible for filtering on both auth and assoc states. |
478 | */ | 483 | */ |
479 | 484 | ||
480 | #ifdef CONFIG_MAC80211_MESH | 485 | if (ieee80211_vif_is_mesh(&rx->sdata->vif)) |
481 | if (rx->sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) | ||
482 | return ieee80211_rx_mesh_check(rx); | 486 | return ieee80211_rx_mesh_check(rx); |
483 | #endif | ||
484 | 487 | ||
485 | if (unlikely(((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA || | 488 | if (unlikely(((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA || |
486 | ((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL && | 489 | ((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL && |
@@ -1111,8 +1114,7 @@ ieee80211_data_to_8023(struct ieee80211_txrx_data *rx) | |||
1111 | 1114 | ||
1112 | hdrlen = ieee80211_get_hdrlen(fc); | 1115 | hdrlen = ieee80211_get_hdrlen(fc); |
1113 | 1116 | ||
1114 | #ifdef CONFIG_MAC80211_MESH | 1117 | if (ieee80211_vif_is_mesh(&sdata->vif)) { |
1115 | if (sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) { | ||
1116 | int meshhdrlen = ieee80211_get_mesh_hdrlen( | 1118 | int meshhdrlen = ieee80211_get_mesh_hdrlen( |
1117 | (struct ieee80211s_hdr *) (skb->data + hdrlen)); | 1119 | (struct ieee80211s_hdr *) (skb->data + hdrlen)); |
1118 | /* Copy on cb: | 1120 | /* Copy on cb: |
@@ -1126,7 +1128,6 @@ ieee80211_data_to_8023(struct ieee80211_txrx_data *rx) | |||
1126 | memcpy(MESH_PREQ(skb), hdr->addr2, ETH_ALEN); | 1128 | memcpy(MESH_PREQ(skb), hdr->addr2, ETH_ALEN); |
1127 | hdrlen += meshhdrlen; | 1129 | hdrlen += meshhdrlen; |
1128 | } | 1130 | } |
1129 | #endif | ||
1130 | 1131 | ||
1131 | /* convert IEEE 802.11 header + possible LLC headers into Ethernet | 1132 | /* convert IEEE 802.11 header + possible LLC headers into Ethernet |
1132 | * header | 1133 | * header |
@@ -1306,9 +1307,8 @@ ieee80211_deliver_skb(struct ieee80211_txrx_data *rx) | |||
1306 | } | 1307 | } |
1307 | } | 1308 | } |
1308 | 1309 | ||
1309 | #ifdef CONFIG_MAC80211_MESH | ||
1310 | /* Mesh forwarding */ | 1310 | /* Mesh forwarding */ |
1311 | if (sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) { | 1311 | if (ieee80211_vif_is_mesh(&sdata->vif)) { |
1312 | u8 *mesh_ttl = &((struct ieee80211s_hdr *)skb->cb)->ttl; | 1312 | u8 *mesh_ttl = &((struct ieee80211s_hdr *)skb->cb)->ttl; |
1313 | (*mesh_ttl)--; | 1313 | (*mesh_ttl)--; |
1314 | 1314 | ||
@@ -1321,12 +1321,13 @@ ieee80211_deliver_skb(struct ieee80211_txrx_data *rx) | |||
1321 | else | 1321 | else |
1322 | xmit_skb->pkt_type = PACKET_OTHERHOST; | 1322 | xmit_skb->pkt_type = PACKET_OTHERHOST; |
1323 | } else | 1323 | } else |
1324 | sdata->u.sta.mshstats.dropped_frames_ttl++; | 1324 | IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.sta, |
1325 | 1325 | dropped_frames_ttl); | |
1326 | } else if (skb->pkt_type != PACKET_OTHERHOST && | 1326 | } else if (skb->pkt_type != PACKET_OTHERHOST && |
1327 | compare_ether_addr(dev->dev_addr, skb->data) != 0) { | 1327 | compare_ether_addr(dev->dev_addr, skb->data) != 0) { |
1328 | if (*mesh_ttl == 0) { | 1328 | if (*mesh_ttl == 0) { |
1329 | sdata->u.sta.mshstats.dropped_frames_ttl++; | 1329 | IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.sta, |
1330 | dropped_frames_ttl); | ||
1330 | dev_kfree_skb(skb); | 1331 | dev_kfree_skb(skb); |
1331 | skb = NULL; | 1332 | skb = NULL; |
1332 | } else { | 1333 | } else { |
@@ -1337,7 +1338,6 @@ ieee80211_deliver_skb(struct ieee80211_txrx_data *rx) | |||
1337 | } | 1338 | } |
1338 | } | 1339 | } |
1339 | } | 1340 | } |
1340 | #endif | ||
1341 | 1341 | ||
1342 | if (skb) { | 1342 | if (skb) { |
1343 | /* deliver to local stack */ | 1343 | /* deliver to local stack */ |