Quoting Larry Finger <Larry.Finger@xxxxxxxxxxxx>:
On 03/11/2013 04:06 PM, Jussi Kivilinna wrote:
Scan appearently is not necessary, 'ifconfig wlan0 up & sleep 0.02; ifconfig
wlan0 down' is enough. Just doing 'ifconfig wlan0 up; ifconfig
wlan0 down' is
enough.
I also tested with monitor interface opened for tcpdump while doing
'ifconfig
up&down' on wlan0 and still triggered the issue. Then turning wlan0
up resulted
monitor interface only receiving probe requests from nearby devices.
I am in the middle of a long-term test of rtl8192ce, which keeps me
from running tests of rtl8192cu, but I noticed something strange.
Does the attached patch help? It is compile tested.
That patch alone did not help.. however replacing
_rtl92cu_set_check_bssid() with that new rtl92cu_set_check_bssid()
does fix the issue (patch attached).
But I think _rtl92cu_set_check_bssid() needs to be rechecked since it
has '(IS_NORMAL_CHIP(rtlhal->version))' conditional etc.
-Jussi
From: Jussi Kivilinna <jussi.kivilinna@xxxxxx>
---
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 31 +++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
index 3c6e18c..ee87201 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
@@ -1377,11 +1377,28 @@ void rtl92cu_card_disable(struct ieee80211_hw *hw)
void rtl92cu_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid)
{
- /* dummy routine needed for callback from rtl_op_configure_filter() */
+ struct rtl_priv *rtlpriv = rtl_priv(hw);
+ u32 reg_rcr = rtl_read_dword(rtlpriv, REG_RCR);
+
+ if (rtlpriv->psc.rfpwr_state != ERFON)
+ return;
+
+ if (check_bssid) {
+ reg_rcr |= (RCR_CBSSID_DATA | RCR_CBSSID_BCN);
+ rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR,
+ (u8 *) (®_rcr));
+ _rtl92cu_set_bcn_ctrl_reg(hw, 0, BIT(4));
+ } else if (!check_bssid) {
+ reg_rcr &= (~(RCR_CBSSID_DATA | RCR_CBSSID_BCN));
+ _rtl92cu_set_bcn_ctrl_reg(hw, BIT(4), 0);
+ rtlpriv->cfg->ops->set_hw_reg(hw,
+ HW_VAR_RCR, (u8 *) (®_rcr));
+ }
}
/*========================================================================== */
+#if 0
static void _rtl92cu_set_check_bssid(struct ieee80211_hw *hw,
enum nl80211_iftype type)
{
@@ -1439,12 +1456,22 @@ static void _rtl92cu_set_check_bssid(struct ieee80211_hw *hw,
}
}
}
+#endif
int rtl92cu_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type)
{
+ struct rtl_priv *rtlpriv = rtl_priv(hw);
+
if (_rtl92cu_set_media_status(hw, type))
return -EOPNOTSUPP;
- _rtl92cu_set_check_bssid(hw, type);
+
+ if (rtlpriv->mac80211.link_state == MAC80211_LINKED) {
+ if (type != NL80211_IFTYPE_AP)
+ rtl92cu_set_check_bssid(hw, true);
+ } else {
+ rtl92cu_set_check_bssid(hw, false);
+ }
+
return 0;
}