mwl8k: enforce FIF_BCN_PRBRESP_PROMISC when no STA interfaces are active

When FIF_BCN_PRBRESP_PROMISC is not set, we enable the hardware's BSS
filter so that we'll only see packets destined for our BSS.  But if no
STA interfaces have been configured, we would end up passing the BSSID
00:00:00:00:00:00 into the POST_SCAN command, which actually disables
the hardware's BSS filter, as it's not a valid BSSID.

Fix this by passing in 01:00:00:00:00:00 instead (the criterion is
that the OUI part of the BSSID must be nonzero), and add comments to
explain what PRE_SCAN and POST_SCAN do.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Lennert Buytenhek 2009-10-22 20:19:53 +02:00 committed by John W. Linville
parent 447ced07d0
commit 77165d8809
1 changed files with 14 additions and 3 deletions

View File

@ -2705,12 +2705,23 @@ static void mwl8k_configure_filter(struct ieee80211_hw *hw,
return;
if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
if (*total_flags & FIF_BCN_PRBRESP_PROMISC) {
/*
* Disable the BSS filter.
*/
mwl8k_cmd_set_pre_scan(hw);
else {
} else {
u8 *bssid;
bssid = "\x00\x00\x00\x00\x00\x00";
/*
* Enable the BSS filter.
*
* If there is an active STA interface, use that
* interface's BSSID, otherwise use a dummy one
* (where the OUI part needs to be nonzero for
* the BSSID to be accepted by POST_SCAN).
*/
bssid = "\x01\x00\x00\x00\x00\x00";
if (priv->vif != NULL)
bssid = MWL8K_VIF(priv->vif)->bssid;