diff options
author | Alwin Beukers <alwin@broadcom.com> | 2011-11-22 20:21:43 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-28 14:43:32 -0500 |
commit | be667669ec01d514b3820f8c74d9336115be6aa7 (patch) | |
tree | 91489b29c7164e8b655be7bf5bb3f421c453b0d7 /drivers/net/wireless/brcm80211 | |
parent | 8906c43cb160abc89c3d7e0721cacb8bc54be927 (diff) |
brcm80211: smac: added support for mac80211 filter flags
Added support for handling FIF_PROMISC_IN_BSS, FIF_FCSFAIL,
FIF_CONTROL, FIF_OTHER_BSS and FIF_PSPOLL.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | 38 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/main.c | 45 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/main.h | 6 |
3 files changed, 38 insertions, 51 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c index ba3e4b5cba71..76376eb112fe 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | |||
@@ -40,10 +40,10 @@ | |||
40 | #define MAC_FILTERS (FIF_PROMISC_IN_BSS | \ | 40 | #define MAC_FILTERS (FIF_PROMISC_IN_BSS | \ |
41 | FIF_ALLMULTI | \ | 41 | FIF_ALLMULTI | \ |
42 | FIF_FCSFAIL | \ | 42 | FIF_FCSFAIL | \ |
43 | FIF_PLCPFAIL | \ | ||
44 | FIF_CONTROL | \ | 43 | FIF_CONTROL | \ |
45 | FIF_OTHER_BSS | \ | 44 | FIF_OTHER_BSS | \ |
46 | FIF_BCN_PRBRESP_PROMISC) | 45 | FIF_BCN_PRBRESP_PROMISC | \ |
46 | FIF_PSPOLL) | ||
47 | 47 | ||
48 | #define CHAN2GHZ(channel, freqency, chflags) { \ | 48 | #define CHAN2GHZ(channel, freqency, chflags) { \ |
49 | .band = IEEE80211_BAND_2GHZ, \ | 49 | .band = IEEE80211_BAND_2GHZ, \ |
@@ -373,7 +373,7 @@ static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed) | |||
373 | conf->listen_interval); | 373 | conf->listen_interval); |
374 | } | 374 | } |
375 | if (changed & IEEE80211_CONF_CHANGE_MONITOR) | 375 | if (changed & IEEE80211_CONF_CHANGE_MONITOR) |
376 | wiphy_err(wiphy, "%s: change monitor mode: %s (implement)\n", | 376 | wiphy_dbg(wiphy, "%s: change monitor mode: %s\n", |
377 | __func__, conf->flags & IEEE80211_CONF_MONITOR ? | 377 | __func__, conf->flags & IEEE80211_CONF_MONITOR ? |
378 | "true" : "false"); | 378 | "true" : "false"); |
379 | if (changed & IEEE80211_CONF_CHANGE_PS) | 379 | if (changed & IEEE80211_CONF_CHANGE_PS) |
@@ -550,29 +550,25 @@ brcms_ops_configure_filter(struct ieee80211_hw *hw, | |||
550 | 550 | ||
551 | changed_flags &= MAC_FILTERS; | 551 | changed_flags &= MAC_FILTERS; |
552 | *total_flags &= MAC_FILTERS; | 552 | *total_flags &= MAC_FILTERS; |
553 | |||
553 | if (changed_flags & FIF_PROMISC_IN_BSS) | 554 | if (changed_flags & FIF_PROMISC_IN_BSS) |
554 | wiphy_err(wiphy, "FIF_PROMISC_IN_BSS\n"); | 555 | wiphy_dbg(wiphy, "FIF_PROMISC_IN_BSS\n"); |
555 | if (changed_flags & FIF_ALLMULTI) | 556 | if (changed_flags & FIF_ALLMULTI) |
556 | wiphy_err(wiphy, "FIF_ALLMULTI\n"); | 557 | wiphy_dbg(wiphy, "FIF_ALLMULTI\n"); |
557 | if (changed_flags & FIF_FCSFAIL) | 558 | if (changed_flags & FIF_FCSFAIL) |
558 | wiphy_err(wiphy, "FIF_FCSFAIL\n"); | 559 | wiphy_dbg(wiphy, "FIF_FCSFAIL\n"); |
559 | if (changed_flags & FIF_PLCPFAIL) | ||
560 | wiphy_err(wiphy, "FIF_PLCPFAIL\n"); | ||
561 | if (changed_flags & FIF_CONTROL) | 560 | if (changed_flags & FIF_CONTROL) |
562 | wiphy_err(wiphy, "FIF_CONTROL\n"); | 561 | wiphy_dbg(wiphy, "FIF_CONTROL\n"); |
563 | if (changed_flags & FIF_OTHER_BSS) | 562 | if (changed_flags & FIF_OTHER_BSS) |
564 | wiphy_err(wiphy, "FIF_OTHER_BSS\n"); | 563 | wiphy_dbg(wiphy, "FIF_OTHER_BSS\n"); |
565 | if (changed_flags & FIF_BCN_PRBRESP_PROMISC) { | 564 | if (changed_flags & FIF_PSPOLL) |
566 | spin_lock_bh(&wl->lock); | 565 | wiphy_dbg(wiphy, "FIF_PSPOLL\n"); |
567 | if (*total_flags & FIF_BCN_PRBRESP_PROMISC) { | 566 | if (changed_flags & FIF_BCN_PRBRESP_PROMISC) |
568 | wl->pub->mac80211_state |= MAC80211_PROMISC_BCNS; | 567 | wiphy_dbg(wiphy, "FIF_BCN_PRBRESP_PROMISC\n"); |
569 | brcms_c_mac_bcn_promisc_change(wl->wlc, 1); | 568 | |
570 | } else { | 569 | spin_lock_bh(&wl->lock); |
571 | brcms_c_mac_bcn_promisc_change(wl->wlc, 0); | 570 | brcms_c_mac_promisc(wl->wlc, *total_flags); |
572 | wl->pub->mac80211_state &= ~MAC80211_PROMISC_BCNS; | 571 | spin_unlock_bh(&wl->lock); |
573 | } | ||
574 | spin_unlock_bh(&wl->lock); | ||
575 | } | ||
576 | return; | 572 | return; |
577 | } | 573 | } |
578 | 574 | ||
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c index 897e252bdb57..87f8f5d3d91f 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c | |||
@@ -3062,7 +3062,7 @@ static bool brcms_c_ps_allowed(struct brcms_c_info *wlc) | |||
3062 | return false; | 3062 | return false; |
3063 | 3063 | ||
3064 | /* disallow PS when one of these meets when not scanning */ | 3064 | /* disallow PS when one of these meets when not scanning */ |
3065 | if (wlc->monitor) | 3065 | if (wlc->filter_flags & FIF_PROMISC_IN_BSS) |
3066 | return false; | 3066 | return false; |
3067 | 3067 | ||
3068 | if (cfg->associated) { | 3068 | if (cfg->associated) { |
@@ -3582,29 +3582,31 @@ static void brcms_c_bandinit_ordered(struct brcms_c_info *wlc, | |||
3582 | } | 3582 | } |
3583 | 3583 | ||
3584 | /* | 3584 | /* |
3585 | * Set or clear maccontrol bits MCTL_PROMISC, MCTL_BCNS_PROMISC and | 3585 | * Set or clear filtering related maccontrol bits based on |
3586 | * MCTL_KEEPCONTROL | 3586 | * specified filter flags |
3587 | */ | 3587 | */ |
3588 | static void brcms_c_mac_promisc(struct brcms_c_info *wlc) | 3588 | void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags) |
3589 | { | 3589 | { |
3590 | u32 promisc_bits = 0; | 3590 | u32 promisc_bits = 0; |
3591 | 3591 | ||
3592 | if (wlc->bcnmisc_monitor) | 3592 | wlc->filter_flags = filter_flags; |
3593 | |||
3594 | if (filter_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) | ||
3595 | promisc_bits |= MCTL_PROMISC; | ||
3596 | |||
3597 | if (filter_flags & FIF_BCN_PRBRESP_PROMISC) | ||
3593 | promisc_bits |= MCTL_BCNS_PROMISC; | 3598 | promisc_bits |= MCTL_BCNS_PROMISC; |
3594 | 3599 | ||
3595 | if (wlc->monitor) | 3600 | if (filter_flags & FIF_FCSFAIL) |
3596 | promisc_bits |= | 3601 | promisc_bits |= MCTL_KEEPBADFCS; |
3597 | MCTL_PROMISC | MCTL_BCNS_PROMISC | MCTL_KEEPCONTROL; | ||
3598 | 3602 | ||
3599 | brcms_b_mctrl(wlc->hw, | 3603 | if (filter_flags & (FIF_CONTROL | FIF_PSPOLL)) |
3600 | MCTL_PROMISC | MCTL_BCNS_PROMISC | MCTL_KEEPCONTROL, | 3604 | promisc_bits |= MCTL_KEEPCONTROL; |
3601 | promisc_bits); | ||
3602 | } | ||
3603 | 3605 | ||
3604 | void brcms_c_mac_bcn_promisc_change(struct brcms_c_info *wlc, bool promisc) | 3606 | brcms_b_mctrl(wlc->hw, |
3605 | { | 3607 | MCTL_PROMISC | MCTL_BCNS_PROMISC | |
3606 | wlc->bcnmisc_monitor = promisc; | 3608 | MCTL_KEEPCONTROL | MCTL_KEEPBADFCS, |
3607 | brcms_c_mac_promisc(wlc); | 3609 | promisc_bits); |
3608 | } | 3610 | } |
3609 | 3611 | ||
3610 | /* | 3612 | /* |
@@ -3634,9 +3636,6 @@ static void brcms_c_ucode_mac_upd(struct brcms_c_info *wlc) | |||
3634 | } else { | 3636 | } else { |
3635 | /* disable an active IBSS if we are not on the home channel */ | 3637 | /* disable an active IBSS if we are not on the home channel */ |
3636 | } | 3638 | } |
3637 | |||
3638 | /* update the various promisc bits */ | ||
3639 | brcms_c_mac_promisc(wlc); | ||
3640 | } | 3639 | } |
3641 | 3640 | ||
3642 | static void brcms_c_write_rate_shm(struct brcms_c_info *wlc, u8 rate, | 3641 | static void brcms_c_write_rate_shm(struct brcms_c_info *wlc, u8 rate, |
@@ -8072,14 +8071,8 @@ static void brcms_c_recv(struct brcms_c_info *wlc, struct sk_buff *p) | |||
8072 | len = p->len; | 8071 | len = p->len; |
8073 | 8072 | ||
8074 | if (rxh->RxStatus1 & RXS_FCSERR) { | 8073 | if (rxh->RxStatus1 & RXS_FCSERR) { |
8075 | if (wlc->pub->mac80211_state & MAC80211_PROMISC_BCNS) { | 8074 | if (!(wlc->filter_flags & FIF_FCSFAIL)) |
8076 | wiphy_err(wlc->wiphy, "FCSERR while scanning******* -" | ||
8077 | " tossing\n"); | ||
8078 | goto toss; | 8075 | goto toss; |
8079 | } else { | ||
8080 | wiphy_err(wlc->wiphy, "RCSERR!!!\n"); | ||
8081 | goto toss; | ||
8082 | } | ||
8083 | } | 8076 | } |
8084 | 8077 | ||
8085 | /* check received pkt has at least frame control field */ | 8078 | /* check received pkt has at least frame control field */ |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.h b/drivers/net/wireless/brcm80211/brcmsmac/main.h index 251c350b3164..e2de97d93635 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.h +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.h | |||
@@ -519,8 +519,7 @@ struct brcms_c_info { | |||
519 | struct brcms_timer *radio_timer; | 519 | struct brcms_timer *radio_timer; |
520 | 520 | ||
521 | /* promiscuous */ | 521 | /* promiscuous */ |
522 | bool monitor; | 522 | uint filter_flags; |
523 | bool bcnmisc_monitor; | ||
524 | 523 | ||
525 | /* driver feature */ | 524 | /* driver feature */ |
526 | bool _rifs; | 525 | bool _rifs; |
@@ -658,8 +657,7 @@ extern void brcms_c_print_txdesc(struct d11txh *txh); | |||
658 | #endif | 657 | #endif |
659 | 658 | ||
660 | extern int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config); | 659 | extern int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config); |
661 | extern void brcms_c_mac_bcn_promisc_change(struct brcms_c_info *wlc, | 660 | extern void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags); |
662 | bool promisc); | ||
663 | extern void brcms_c_send_q(struct brcms_c_info *wlc); | 661 | extern void brcms_c_send_q(struct brcms_c_info *wlc); |
664 | extern int brcms_c_prep_pdu(struct brcms_c_info *wlc, struct sk_buff *pdu, | 662 | extern int brcms_c_prep_pdu(struct brcms_c_info *wlc, struct sk_buff *pdu, |
665 | uint *fifo); | 663 | uint *fifo); |