aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-02-25 10:24:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-03-06 15:30:46 -0500
commitd6d1a5a7096172a1592115331a420630adf47f8c (patch)
tree4c5ead46ee39eb3693bd313243222692b5f9fc66 /net
parentc1edd987a4ae08908d8ec08c550240ea065e0649 (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')
-rw-r--r--net/mac80211/rx.c17
-rw-r--r--net/mac80211/sta_info.h8
2 files changed, 14 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))
396static ieee80211_rx_result 394static ieee80211_rx_result
397ieee80211_rx_mesh_check(struct ieee80211_txrx_data *rx) 395ieee80211_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
442static inline ieee80211_rx_result
443ieee80211_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
450static ieee80211_rx_result 445static ieee80211_rx_result
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 4ad500373d5a..4d0840b8c58e 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -235,6 +235,14 @@ struct sta_info {
235#endif 235#endif
236}; 236};
237 237
238static inline enum plink_state sta_plink_state(struct sta_info *sta)
239{
240#ifdef CONFIG_MAC80211_MESH
241 return sta->plink_state;
242#endif
243 return LISTEN;
244}
245
238 246
239/* Maximum number of concurrently registered stations */ 247/* Maximum number of concurrently registered stations */
240#define MAX_STA_COUNT 2007 248#define MAX_STA_COUNT 2007