diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-02-25 10:24:38 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-06 15:30:46 -0500 |
commit | d6d1a5a7096172a1592115331a420630adf47f8c (patch) | |
tree | 4c5ead46ee39eb3693bd313243222692b5f9fc66 /net/mac80211/rx.c | |
parent | c1edd987a4ae08908d8ec08c550240ea065e0649 (diff) |
mac80211: clean up mesh RX path a bit more
Moves another ifdef into the sta_info header file in favour of
compiling more code even w/o CONFIG_MAC80211_MESH.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Luis Carlos Cobo <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index d0018fc40b09..1ff1301ca3df 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -391,13 +391,14 @@ ieee80211_rx_h_passive_scan(struct ieee80211_txrx_data *rx) | |||
391 | return RX_CONTINUE; | 391 | return RX_CONTINUE; |
392 | } | 392 | } |
393 | 393 | ||
394 | #ifdef CONFIG_MAC80211_MESH | ||
395 | #define msh_h_get(h, l) ((struct ieee80211s_hdr *) ((u8 *)h + l)) | ||
396 | static ieee80211_rx_result | 394 | static ieee80211_rx_result |
397 | ieee80211_rx_mesh_check(struct ieee80211_txrx_data *rx) | 395 | ieee80211_rx_mesh_check(struct ieee80211_txrx_data *rx) |
398 | { | 396 | { |
399 | int hdrlen = ieee80211_get_hdrlen(rx->fc); | 397 | int hdrlen = ieee80211_get_hdrlen(rx->fc); |
400 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data; | 398 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data; |
399 | |||
400 | #define msh_h_get(h, l) ((struct ieee80211s_hdr *) ((u8 *)h + l)) | ||
401 | |||
401 | if ((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) { | 402 | if ((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) { |
402 | if (!((rx->fc & IEEE80211_FCTL_FROMDS) && | 403 | if (!((rx->fc & IEEE80211_FCTL_FROMDS) && |
403 | (rx->fc & IEEE80211_FCTL_TODS))) | 404 | (rx->fc & IEEE80211_FCTL_TODS))) |
@@ -410,8 +411,9 @@ ieee80211_rx_mesh_check(struct ieee80211_txrx_data *rx) | |||
410 | * establisment frame, beacon or probe, drop the frame. | 411 | * establisment frame, beacon or probe, drop the frame. |
411 | */ | 412 | */ |
412 | 413 | ||
413 | if (!rx->sta || rx->sta->plink_state != ESTAB) { | 414 | if (!rx->sta || sta_plink_state(rx->sta) != ESTAB) { |
414 | struct ieee80211_mgmt *mgmt; | 415 | struct ieee80211_mgmt *mgmt; |
416 | |||
415 | if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT) | 417 | if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT) |
416 | return RX_DROP_MONITOR; | 418 | return RX_DROP_MONITOR; |
417 | 419 | ||
@@ -434,17 +436,10 @@ ieee80211_rx_mesh_check(struct ieee80211_txrx_data *rx) | |||
434 | is_broadcast_ether_addr(hdr->addr1) && | 436 | is_broadcast_ether_addr(hdr->addr1) && |
435 | mesh_rmc_check(hdr->addr4, msh_h_get(hdr, hdrlen), rx->dev)) | 437 | mesh_rmc_check(hdr->addr4, msh_h_get(hdr, hdrlen), rx->dev)) |
436 | return RX_DROP_MONITOR; | 438 | return RX_DROP_MONITOR; |
437 | else | ||
438 | return RX_CONTINUE; | ||
439 | } | ||
440 | #undef msh_h_get | 439 | #undef msh_h_get |
441 | #else | 440 | |
442 | static inline ieee80211_rx_result | ||
443 | ieee80211_rx_mesh_check(struct ieee80211_txrx_data *rx) | ||
444 | { | ||
445 | return RX_CONTINUE; | 441 | return RX_CONTINUE; |
446 | } | 442 | } |
447 | #endif | ||
448 | 443 | ||
449 | 444 | ||
450 | static ieee80211_rx_result | 445 | static ieee80211_rx_result |