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>
This commit is contained in:
Alwin Beukers 2011-11-10 20:30:28 +01:00 committed by John W. Linville
parent ad3b8b3918
commit 02a588a2e3
2 changed files with 17 additions and 31 deletions

View File

@ -3583,42 +3583,30 @@ static void brcms_c_bandinit_ordered(struct brcms_c_info *wlc,
brcms_c_set_phy_chanspec(wlc, chanspec); brcms_c_set_phy_chanspec(wlc, chanspec);
} }
static void brcms_c_mac_bcn_promisc(struct brcms_c_info *wlc) /*
* Set or clear maccontrol bits MCTL_PROMISC, MCTL_BCNS_PROMISC and
* MCTL_KEEPCONTROL
*/
static void brcms_c_mac_promisc(struct brcms_c_info *wlc)
{ {
u32 promisc_bits = 0;
if (wlc->bcnmisc_monitor) if (wlc->bcnmisc_monitor)
brcms_b_mctrl(wlc->hw, MCTL_BCNS_PROMISC, MCTL_BCNS_PROMISC); promisc_bits |= MCTL_BCNS_PROMISC;
else
brcms_b_mctrl(wlc->hw, MCTL_BCNS_PROMISC, 0); if (wlc->monitor)
promisc_bits |=
MCTL_PROMISC | MCTL_BCNS_PROMISC | MCTL_KEEPCONTROL;
brcms_b_mctrl(wlc->hw,
MCTL_PROMISC | MCTL_BCNS_PROMISC | MCTL_KEEPCONTROL,
promisc_bits);
} }
void brcms_c_mac_bcn_promisc_change(struct brcms_c_info *wlc, bool promisc) void brcms_c_mac_bcn_promisc_change(struct brcms_c_info *wlc, bool promisc)
{ {
wlc->bcnmisc_monitor = promisc; wlc->bcnmisc_monitor = promisc;
brcms_c_mac_bcn_promisc(wlc); brcms_c_mac_promisc(wlc);
}
/* set or clear maccontrol bits MCTL_PROMISC and MCTL_KEEPCONTROL */
static void brcms_c_mac_promisc(struct brcms_c_info *wlc)
{
u32 promisc_bits = 0;
/*
* promiscuous mode just sets MCTL_PROMISC
* Note: APs get all BSS traffic without the need to set
* the MCTL_PROMISC bit since all BSS data traffic is
* directed at the AP
*/
if (wlc->pub->promisc)
promisc_bits |= MCTL_PROMISC;
/* monitor mode needs both MCTL_PROMISC and MCTL_KEEPCONTROL
* Note: monitor mode also needs MCTL_BCNS_PROMISC, but that is
* handled in brcms_c_mac_bcn_promisc()
*/
if (wlc->monitor)
promisc_bits |= MCTL_PROMISC | MCTL_KEEPCONTROL;
brcms_b_mctrl(wlc->hw, MCTL_PROMISC | MCTL_KEEPCONTROL, promisc_bits);
} }
/* /*
@ -3650,7 +3638,6 @@ static void brcms_c_ucode_mac_upd(struct brcms_c_info *wlc)
} }
/* update the various promisc bits */ /* update the various promisc bits */
brcms_c_mac_bcn_promisc(wlc);
brcms_c_mac_promisc(wlc); brcms_c_mac_promisc(wlc);
} }

View File

@ -381,7 +381,6 @@ struct brcms_pub {
uint _nbands; /* # bands supported */ uint _nbands; /* # bands supported */
uint now; /* # elapsed seconds */ uint now; /* # elapsed seconds */
bool promisc; /* promiscuous destination address */
bool delayed_down; /* down delayed */ bool delayed_down; /* down delayed */
bool associated; /* true:part of [I]BSS, false: not */ bool associated; /* true:part of [I]BSS, false: not */
/* (union of stas_associated, aps_associated) */ /* (union of stas_associated, aps_associated) */