diff options
author | Alwin Beukers <alwin@broadcom.com> | 2011-11-10 14:30:28 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-11 14:28:41 -0500 |
commit | 02a588a2e3b9e0156f306a542bb6cd29ba42e1b9 (patch) | |
tree | 607f93b7792d19ec46b0f30ea36d45f4406fa9e1 /drivers | |
parent | ad3b8b39189689dbff84c8a8edf024511b087f87 (diff) |
brcm80211: smac: combine promiscuous mode functionality
Combined mac configuration for promiscious mode and monitor mode, and
removed unused monitor mode flag in pub structure.
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/main.c | 47 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/pub.h | 1 |
2 files changed, 17 insertions, 31 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c index 6a679c9848ab..36e3e0638300 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c | |||
@@ -3583,42 +3583,30 @@ static void brcms_c_bandinit_ordered(struct brcms_c_info *wlc, | |||
3583 | brcms_c_set_phy_chanspec(wlc, chanspec); | 3583 | brcms_c_set_phy_chanspec(wlc, chanspec); |
3584 | } | 3584 | } |
3585 | 3585 | ||
3586 | static void brcms_c_mac_bcn_promisc(struct brcms_c_info *wlc) | 3586 | /* |
3587 | { | 3587 | * Set or clear maccontrol bits MCTL_PROMISC, MCTL_BCNS_PROMISC and |
3588 | if (wlc->bcnmisc_monitor) | 3588 | * MCTL_KEEPCONTROL |
3589 | brcms_b_mctrl(wlc->hw, MCTL_BCNS_PROMISC, MCTL_BCNS_PROMISC); | 3589 | */ |
3590 | else | ||
3591 | brcms_b_mctrl(wlc->hw, MCTL_BCNS_PROMISC, 0); | ||
3592 | } | ||
3593 | |||
3594 | void brcms_c_mac_bcn_promisc_change(struct brcms_c_info *wlc, bool promisc) | ||
3595 | { | ||
3596 | wlc->bcnmisc_monitor = promisc; | ||
3597 | brcms_c_mac_bcn_promisc(wlc); | ||
3598 | } | ||
3599 | |||
3600 | /* set or clear maccontrol bits MCTL_PROMISC and MCTL_KEEPCONTROL */ | ||
3601 | static void brcms_c_mac_promisc(struct brcms_c_info *wlc) | 3590 | static void brcms_c_mac_promisc(struct brcms_c_info *wlc) |
3602 | { | 3591 | { |
3603 | u32 promisc_bits = 0; | 3592 | u32 promisc_bits = 0; |
3604 | 3593 | ||
3605 | /* | 3594 | if (wlc->bcnmisc_monitor) |
3606 | * promiscuous mode just sets MCTL_PROMISC | 3595 | promisc_bits |= MCTL_BCNS_PROMISC; |
3607 | * Note: APs get all BSS traffic without the need to set | ||
3608 | * the MCTL_PROMISC bit since all BSS data traffic is | ||
3609 | * directed at the AP | ||
3610 | */ | ||
3611 | if (wlc->pub->promisc) | ||
3612 | promisc_bits |= MCTL_PROMISC; | ||
3613 | 3596 | ||
3614 | /* monitor mode needs both MCTL_PROMISC and MCTL_KEEPCONTROL | ||
3615 | * Note: monitor mode also needs MCTL_BCNS_PROMISC, but that is | ||
3616 | * handled in brcms_c_mac_bcn_promisc() | ||
3617 | */ | ||
3618 | if (wlc->monitor) | 3597 | if (wlc->monitor) |
3619 | promisc_bits |= MCTL_PROMISC | MCTL_KEEPCONTROL; | 3598 | promisc_bits |= |
3599 | MCTL_PROMISC | MCTL_BCNS_PROMISC | MCTL_KEEPCONTROL; | ||
3620 | 3600 | ||
3621 | brcms_b_mctrl(wlc->hw, MCTL_PROMISC | MCTL_KEEPCONTROL, promisc_bits); | 3601 | brcms_b_mctrl(wlc->hw, |
3602 | MCTL_PROMISC | MCTL_BCNS_PROMISC | MCTL_KEEPCONTROL, | ||
3603 | promisc_bits); | ||
3604 | } | ||
3605 | |||
3606 | void brcms_c_mac_bcn_promisc_change(struct brcms_c_info *wlc, bool promisc) | ||
3607 | { | ||
3608 | wlc->bcnmisc_monitor = promisc; | ||
3609 | brcms_c_mac_promisc(wlc); | ||
3622 | } | 3610 | } |
3623 | 3611 | ||
3624 | /* | 3612 | /* |
@@ -3650,7 +3638,6 @@ static void brcms_c_ucode_mac_upd(struct brcms_c_info *wlc) | |||
3650 | } | 3638 | } |
3651 | 3639 | ||
3652 | /* update the various promisc bits */ | 3640 | /* update the various promisc bits */ |
3653 | brcms_c_mac_bcn_promisc(wlc); | ||
3654 | brcms_c_mac_promisc(wlc); | 3641 | brcms_c_mac_promisc(wlc); |
3655 | } | 3642 | } |
3656 | 3643 | ||
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pub.h b/drivers/net/wireless/brcm80211/brcmsmac/pub.h index 8f3da0e4af01..21ccf3a03987 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/pub.h +++ b/drivers/net/wireless/brcm80211/brcmsmac/pub.h | |||
@@ -381,7 +381,6 @@ struct brcms_pub { | |||
381 | uint _nbands; /* # bands supported */ | 381 | uint _nbands; /* # bands supported */ |
382 | uint now; /* # elapsed seconds */ | 382 | uint now; /* # elapsed seconds */ |
383 | 383 | ||
384 | bool promisc; /* promiscuous destination address */ | ||
385 | bool delayed_down; /* down delayed */ | 384 | bool delayed_down; /* down delayed */ |
386 | bool associated; /* true:part of [I]BSS, false: not */ | 385 | bool associated; /* true:part of [I]BSS, false: not */ |
387 | /* (union of stas_associated, aps_associated) */ | 386 | /* (union of stas_associated, aps_associated) */ |