2014-03-20 18:52:43

by Peter Wu

[permalink] [raw]
Subject: [PATCH 0/3] rtlwifi (and staging rtl8821ae) cleanups

Hi,

The first patch of these series was NAKed some weeks ago because it would
conflict with the new rtl8723be driver. Since those changes are in wireless-next
now, I have adjusted that patch to take care of rtl8723be.

The other two patches to the staging driver is similar to the rtlwifi changes.
I am not sure who to send these two patches to. Greg is the staging maintainer,
but John takes wireless patches, so I have included both of you.

All patches are compile-tested on top of v3.14-rc2-938-g67b3bd4.

I also found the following (unrelated to my patches) warning while compiling the
staging driver, perhaps it needs a closer look?

CC [M] drivers/net/wireless/rtlwifi/stats.o
CC [M] drivers/staging/rtl8821ae/rtl8821ae/hal_btc.o
drivers/staging/rtl8821ae/rtl8821ae/dm.c: In function ‘rtl8821ae_dm_clear_txpower_tracking_state’:
drivers/staging/rtl8821ae/rtl8821ae/dm.c:487:31: warning: iteration 2u invokes undefined behavior [-Waggressive-loop-optimizations]
rtldm->bb_swing_idx_ofdm[p] = rtldm->default_ofdm_index;
^
drivers/staging/rtl8821ae/rtl8821ae/dm.c:485:2: note: containing loop
for (p = RF90_PATH_A; p < MAX_RF_PATH; ++p) {
^
CC [M] drivers/staging/rtl8821ae/rtl8821ae/hal_bt_coexist.o

Thanks,
Peter

Peter Wu (3):
rtlwifi: remove unused allow_all_destaddr functions
staging/rtl8821ae: avoid accessing RCR directly
staging/rtl8821ae: remove unused allow_all_destaddr function

drivers/net/wireless/rtlwifi/rtl8188ee/hw.c | 20 --------------------
drivers/net/wireless/rtlwifi/rtl8188ee/hw.h | 2 --
drivers/net/wireless/rtlwifi/rtl8188ee/sw.c | 1 -
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 21 ---------------------
drivers/net/wireless/rtlwifi/rtl8192ce/hw.h | 2 --
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 1 -
drivers/net/wireless/rtlwifi/rtl8192se/hw.c | 20 --------------------
drivers/net/wireless/rtlwifi/rtl8192se/hw.h | 2 --
drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 1 -
drivers/net/wireless/rtlwifi/rtl8723ae/hw.c | 21 ---------------------
drivers/net/wireless/rtlwifi/rtl8723ae/hw.h | 2 --
drivers/net/wireless/rtlwifi/rtl8723ae/sw.c | 1 -
drivers/net/wireless/rtlwifi/rtl8723be/hw.c | 20 --------------------
drivers/net/wireless/rtlwifi/rtl8723be/hw.h | 2 --
drivers/net/wireless/rtlwifi/wifi.h | 2 --
drivers/staging/rtl8821ae/rtl8821ae/hw.c | 27 +++------------------------
drivers/staging/rtl8821ae/rtl8821ae/hw.h | 3 ---
drivers/staging/rtl8821ae/rtl8821ae/sw.c | 1 -
drivers/staging/rtl8821ae/wifi.h | 2 --
19 files changed, 3 insertions(+), 148 deletions(-)

--
1.9.1



2014-03-20 19:48:26

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH 0/3] rtlwifi (and staging rtl8821ae) cleanups

On 03/20/2014 01:52 PM, Peter Wu wrote:
> Hi,
>
> The first patch of these series was NAKed some weeks ago because it would
> conflict with the new rtl8723be driver. Since those changes are in wireless-next
> now, I have adjusted that patch to take care of rtl8723be.
>
> The other two patches to the staging driver is similar to the rtlwifi changes.
> I am not sure who to send these two patches to. Greg is the staging maintainer,
> but John takes wireless patches, so I have included both of you.
>
> All patches are compile-tested on top of v3.14-rc2-938-g67b3bd4.
>
> I also found the following (unrelated to my patches) warning while compiling the
> staging driver, perhaps it needs a closer look?

Peter,

Your Patch 1/3 applies cleanly and I think it is OK, but if you are going to do
cleanups on the wireless tree, you should be working from the latest version of
wireless-testing git repo. We are on 3.14-rc7 and there are several recent
commits that might have conflicted.

As for the changes to staging/rtl8821ae (No. 2 & 3), once Linus starts the merge
that will precede the release of 3.15-rc2, the entire code for rtl8821ae will be
replaced. A cleaned-up version was nearly ready for the regular wireless tree in
time to make 3.15, but it did not get enough testing. As a result, that driver
will be in testing for one more cycle. By 3.16, it should reside in the regular
tree and be out of staging.

Pushing patches that affect both the regular tree and staging is complicated and
should be avoided whenever possible.

Larry




2014-03-20 20:03:25

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 0/3] rtlwifi (and staging rtl8821ae) cleanups

On Thu, Mar 20, 2014 at 02:48:22PM -0500, Larry Finger wrote:
> On 03/20/2014 01:52 PM, Peter Wu wrote:
> >Hi,
> >
> >The first patch of these series was NAKed some weeks ago because it would
> >conflict with the new rtl8723be driver. Since those changes are in wireless-next
> >now, I have adjusted that patch to take care of rtl8723be.
> >
> >The other two patches to the staging driver is similar to the rtlwifi changes.
> >I am not sure who to send these two patches to. Greg is the staging maintainer,
> >but John takes wireless patches, so I have included both of you.
> >
> >All patches are compile-tested on top of v3.14-rc2-938-g67b3bd4.
> >
> >I also found the following (unrelated to my patches) warning while compiling the
> >staging driver, perhaps it needs a closer look?
>
> Peter,
>
> Your Patch 1/3 applies cleanly and I think it is OK, but if you are going to
> do cleanups on the wireless tree, you should be working from the latest
> version of wireless-testing git repo. We are on 3.14-rc7 and there are
> several recent commits that might have conflicted.
>
> As for the changes to staging/rtl8821ae (No. 2 & 3), once Linus starts the
> merge that will precede the release of 3.15-rc2, the entire code for
> rtl8821ae will be replaced. A cleaned-up version was nearly ready for the
> regular wireless tree in time to make 3.15, but it did not get enough
> testing. As a result, that driver will be in testing for one more cycle. By
> 3.16, it should reside in the regular tree and be out of staging.
>
> Pushing patches that affect both the regular tree and staging is complicated
> and should be avoided whenever possible.

Yes, for now, I'm going to ignore these patches (especially as my trees
are now closed for "cleanup" patches for 3.15-rc1, and wait for this all
to settle down before accepting anything else for this driver.

thanks,

greg k-h

2014-03-20 18:52:51

by Peter Wu

[permalink] [raw]
Subject: [PATCH 3/3] staging/rtl8821ae: remove unused allow_all_destaddr function

Similar to commit "rtlwifi: remove unused allow_all_destaddr functions",
this patch removes an unused function.

Unused as configure_filter takes care of setting/clearing RCR_AAP.

Signed-off-by: Peter Wu <[email protected]>
---
drivers/staging/rtl8821ae/rtl8821ae/hw.c | 22 ----------------------
drivers/staging/rtl8821ae/rtl8821ae/hw.h | 3 ---
drivers/staging/rtl8821ae/rtl8821ae/sw.c | 1 -
drivers/staging/rtl8821ae/wifi.h | 2 --
4 files changed, 28 deletions(-)

diff --git a/drivers/staging/rtl8821ae/rtl8821ae/hw.c b/drivers/staging/rtl8821ae/rtl8821ae/hw.c
index e4dbf05..8ae4fae 100644
--- a/drivers/staging/rtl8821ae/rtl8821ae/hw.c
+++ b/drivers/staging/rtl8821ae/rtl8821ae/hw.c
@@ -3323,25 +3323,3 @@ void rtl8821ae_suspend(struct ieee80211_hw *hw)
void rtl8821ae_resume(struct ieee80211_hw *hw)
{
}
-
-/* Turn on AAP (RCR:bit 0) for promicuous mode. */
-void rtl8821ae_allow_all_destaddr(struct ieee80211_hw *hw,
- bool allow_all_da, bool write_into_reg)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
-
- if (allow_all_da) /* Set BIT0 */
- rtlpci->receive_config |= RCR_AAP;
- else /* Clear BIT0 */
- rtlpci->receive_config &= ~RCR_AAP;
-
- if(write_into_reg)
- rtl_write_dword(rtlpriv, REG_RCR, rtlpci->receive_config);
-
-
- RT_TRACE(COMP_TURBO | COMP_INIT, DBG_LOUD,
- ("receive_config=0x%08X, write_into_reg=%d\n",
- rtlpci->receive_config, write_into_reg ));
-}
-
diff --git a/drivers/staging/rtl8821ae/rtl8821ae/hw.h b/drivers/staging/rtl8821ae/rtl8821ae/hw.h
index 4fb6bf0..f1d2949 100644
--- a/drivers/staging/rtl8821ae/rtl8821ae/hw.h
+++ b/drivers/staging/rtl8821ae/rtl8821ae/hw.h
@@ -67,9 +67,6 @@ void rtl8821ae_bt_reg_init(struct ieee80211_hw* hw);
void rtl8821ae_bt_hw_init(struct ieee80211_hw* hw);
void rtl8821ae_suspend(struct ieee80211_hw *hw);
void rtl8821ae_resume(struct ieee80211_hw *hw);
-void rtl8821ae_allow_all_destaddr(struct ieee80211_hw *hw,
- bool allow_all_da,
- bool write_into_reg);
void _rtl8821ae_stop_tx_beacon(struct ieee80211_hw *hw);
void _rtl8821ae_resume_tx_beacon(struct ieee80211_hw *hw);
#endif
diff --git a/drivers/staging/rtl8821ae/rtl8821ae/sw.c b/drivers/staging/rtl8821ae/rtl8821ae/sw.c
index 85a3474..25a8114 100644
--- a/drivers/staging/rtl8821ae/rtl8821ae/sw.c
+++ b/drivers/staging/rtl8821ae/rtl8821ae/sw.c
@@ -298,7 +298,6 @@ struct rtl_hal_ops rtl8821ae_hal_ops = {
.enable_hw_sec = rtl8821ae_enable_hw_security_config,
.set_key = rtl8821ae_set_key,
.init_sw_leds = rtl8821ae_init_sw_leds,
- .allow_all_destaddr = rtl8821ae_allow_all_destaddr,
.get_bbreg = rtl8821ae_phy_query_bb_reg,
.set_bbreg = rtl8821ae_phy_set_bb_reg,
.get_rfreg = rtl8821ae_phy_query_rf_reg,
diff --git a/drivers/staging/rtl8821ae/wifi.h b/drivers/staging/rtl8821ae/wifi.h
index cfe88a1..871ff51 100644
--- a/drivers/staging/rtl8821ae/wifi.h
+++ b/drivers/staging/rtl8821ae/wifi.h
@@ -1840,8 +1840,6 @@ struct rtl_hal_ops {
u32 regaddr, u32 bitmask);
void (*set_rfreg) (struct ieee80211_hw * hw, enum radio_path rfpath,
u32 regaddr, u32 bitmask, u32 data);
- void (*allow_all_destaddr)(struct ieee80211_hw *hw,
- bool allow_all_da, bool write_into_reg);
void (*linked_set_reg) (struct ieee80211_hw * hw);
void (*check_switch_to_dmdp) (struct ieee80211_hw * hw);
void (*dualmac_easy_concurrent) (struct ieee80211_hw *hw);
--
1.9.1


2014-03-20 21:02:06

by Peter Wu

[permalink] [raw]
Subject: Re: [PATCH 0/3] rtlwifi (and staging rtl8821ae) cleanups

On Thursday 20 March 2014 14:48:22 Larry Finger wrote:
> On 03/20/2014 01:52 PM, Peter Wu wrote:
> > Hi,
> >
> > The first patch of these series was NAKed some weeks ago because it would
> > conflict with the new rtl8723be driver. Since those changes are in
> > wireless-next now, I have adjusted that patch to take care of rtl8723be.
> >
> > The other two patches to the staging driver is similar to the rtlwifi
> > changes. I am not sure who to send these two patches to. Greg is the
> > staging maintainer, but John takes wireless patches, so I have included
> > both of you.
> >
> > All patches are compile-tested on top of v3.14-rc2-938-g67b3bd4.
> >
> > I also found the following (unrelated to my patches) warning while
> > compiling the staging driver, perhaps it needs a closer look?
>
> Peter,
>
> Your Patch 1/3 applies cleanly and I think it is OK, but if you are going to
> do cleanups on the wireless tree, you should be working from the latest
> version of wireless-testing git repo. We are on 3.14-rc7 and there are
> several recent commits that might have conflicted.

The changes are not new, just updated for the latest wireless-next. I did test
it on wireless-next, apparently it has not synced with Linus' tree yet:

$ git describe wireless-next/master
v3.14-rc2-938-g67b3bd4
$ git log --oneline -n4 rtlwifi-wireless-next
cb39071 staging/rtl8821ae: remove unused allow_all_destaddr function
607693e staging/rtl8821ae: avoid accessing RCR directly
7db8deb rtlwifi: remove unused allow_all_destaddr functions
67b3bd4 brcmfmac: fallback to mimo_bw_cap for older firmwares

> As for the changes to staging/rtl8821ae (No. 2 & 3), once Linus starts the
> merge that will precede the release of 3.15-rc2, the entire code for
> rtl8821ae will be replaced. A cleaned-up version was nearly ready for the
> regular wireless tree in time to make 3.15, but it did not get enough
> testing. As a result, that driver will be in testing for one more cycle. By
> 3.16, it should reside in the regular tree and be out of staging.

I must be missing something, since I subscribed to linux-wireless this month,
I have not seen discussions about a replacement for rtl8821ae. Is this driver
not published yet?

> Pushing patches that affect both the regular tree and staging is complicated
> and should be avoided whenever possible.

Ok, I kept those in separate patches, but will send different series next time
if it is preferred.

Thanks,
Peter


2014-03-20 18:52:48

by Peter Wu

[permalink] [raw]
Subject: [PATCH v2 1/3] rtlwifi: remove unused allow_all_destaddr functions

Unused as configure_filter takes care of setting/clearing RCR_AAP.

In commit "rtlwifi: rtl8723be: rtl8723com: Remove unused
allow_all_destaddr functions", Larry Finger removed allow_all_destaddr
from the struct. This commit removes the related function too.

Signed-off-by: Peter Wu <[email protected]>
---
- v2: removed functions for rtl8723be too, fix merge conflict due to
a rename in the context of rtl8723ae.
---
drivers/net/wireless/rtlwifi/rtl8188ee/hw.c | 20 --------------------
drivers/net/wireless/rtlwifi/rtl8188ee/hw.h | 2 --
drivers/net/wireless/rtlwifi/rtl8188ee/sw.c | 1 -
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 21 ---------------------
drivers/net/wireless/rtlwifi/rtl8192ce/hw.h | 2 --
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 1 -
drivers/net/wireless/rtlwifi/rtl8192se/hw.c | 20 --------------------
drivers/net/wireless/rtlwifi/rtl8192se/hw.h | 2 --
drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 1 -
drivers/net/wireless/rtlwifi/rtl8723ae/hw.c | 21 ---------------------
drivers/net/wireless/rtlwifi/rtl8723ae/hw.h | 2 --
drivers/net/wireless/rtlwifi/rtl8723ae/sw.c | 1 -
drivers/net/wireless/rtlwifi/rtl8723be/hw.c | 20 --------------------
drivers/net/wireless/rtlwifi/rtl8723be/hw.h | 2 --
drivers/net/wireless/rtlwifi/wifi.h | 2 --
15 files changed, 118 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
index bd2a26b..e655c65 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
@@ -2521,23 +2521,3 @@ void rtl88ee_suspend(struct ieee80211_hw *hw)
void rtl88ee_resume(struct ieee80211_hw *hw)
{
}
-
-/* Turn on AAP (RCR:bit 0) for promicuous mode. */
-void rtl88ee_allow_all_destaddr(struct ieee80211_hw *hw,
- bool allow_all_da, bool write_into_reg)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
-
- if (allow_all_da) /* Set BIT0 */
- rtlpci->receive_config |= RCR_AAP;
- else /* Clear BIT0 */
- rtlpci->receive_config &= ~RCR_AAP;
-
- if (write_into_reg)
- rtl_write_dword(rtlpriv, REG_RCR, rtlpci->receive_config);
-
- RT_TRACE(rtlpriv, COMP_TURBO | COMP_INIT, DBG_LOUD,
- "receive_config = 0x%08X, write_into_reg =%d\n",
- rtlpci->receive_config, write_into_reg);
-}
diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/hw.h b/drivers/net/wireless/rtlwifi/rtl8188ee/hw.h
index b4460a4..1850fde 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/hw.h
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/hw.h
@@ -61,8 +61,6 @@ void rtl8188ee_bt_reg_init(struct ieee80211_hw *hw);
void rtl8188ee_bt_hw_init(struct ieee80211_hw *hw);
void rtl88ee_suspend(struct ieee80211_hw *hw);
void rtl88ee_resume(struct ieee80211_hw *hw);
-void rtl88ee_allow_all_destaddr(struct ieee80211_hw *hw,
- bool allow_all_da, bool write_into_reg);
void rtl88ee_fw_clk_off_timer_callback(unsigned long data);

#endif
diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/sw.c b/drivers/net/wireless/rtlwifi/rtl8188ee/sw.c
index 347af1e..41de6f3 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/sw.c
@@ -254,7 +254,6 @@ static struct rtl_hal_ops rtl8188ee_hal_ops = {
.enable_hw_sec = rtl88ee_enable_hw_security_config,
.set_key = rtl88ee_set_key,
.init_sw_leds = rtl88ee_init_sw_leds,
- .allow_all_destaddr = rtl88ee_allow_all_destaddr,
.get_bbreg = rtl88e_phy_query_bb_reg,
.set_bbreg = rtl88e_phy_set_bb_reg,
.get_rfreg = rtl88e_phy_query_rf_reg,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
index 4ae51d5..e2ba368 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
@@ -2423,24 +2423,3 @@ void rtl92ce_suspend(struct ieee80211_hw *hw)
void rtl92ce_resume(struct ieee80211_hw *hw)
{
}
-
-/* Turn on AAP (RCR:bit 0) for promicuous mode. */
-void rtl92ce_allow_all_destaddr(struct ieee80211_hw *hw,
- bool allow_all_da, bool write_into_reg)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
-
- if (allow_all_da) {/* Set BIT0 */
- rtlpci->receive_config |= RCR_AAP;
- } else {/* Clear BIT0 */
- rtlpci->receive_config &= ~RCR_AAP;
- }
-
- if (write_into_reg)
- rtl_write_dword(rtlpriv, REG_RCR, rtlpci->receive_config);
-
- RT_TRACE(rtlpriv, COMP_TURBO | COMP_INIT, DBG_LOUD,
- "receive_config=0x%08X, write_into_reg=%d\n",
- rtlpci->receive_config, write_into_reg);
-}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.h b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.h
index 2d063b0..5533070 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.h
@@ -76,7 +76,5 @@ void rtl8192ce_bt_reg_init(struct ieee80211_hw *hw);
void rtl8192ce_bt_hw_init(struct ieee80211_hw *hw);
void rtl92ce_suspend(struct ieee80211_hw *hw);
void rtl92ce_resume(struct ieee80211_hw *hw);
-void rtl92ce_allow_all_destaddr(struct ieee80211_hw *hw,
- bool allow_all_da, bool write_into_reg);

#endif
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
index b790320..12f21f4 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -229,7 +229,6 @@ static struct rtl_hal_ops rtl8192ce_hal_ops = {
.enable_hw_sec = rtl92ce_enable_hw_security_config,
.set_key = rtl92ce_set_key,
.init_sw_leds = rtl92ce_init_sw_leds,
- .allow_all_destaddr = rtl92ce_allow_all_destaddr,
.get_bbreg = rtl92c_phy_query_bb_reg,
.set_bbreg = rtl92c_phy_set_bb_reg,
.set_rfreg = rtl92ce_phy_set_rf_reg,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
index 3015af1..52a9230 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
@@ -2546,23 +2546,3 @@ void rtl92se_resume(struct ieee80211_hw *hw)
pci_write_config_dword(rtlpci->pdev, 0x40,
val & 0xffff00ff);
}
-
-/* Turn on AAP (RCR:bit 0) for promicuous mode. */
-void rtl92se_allow_all_destaddr(struct ieee80211_hw *hw,
- bool allow_all_da, bool write_into_reg)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
-
- if (allow_all_da) /* Set BIT0 */
- rtlpci->receive_config |= RCR_AAP;
- else /* Clear BIT0 */
- rtlpci->receive_config &= ~RCR_AAP;
-
- if (write_into_reg)
- rtl_write_dword(rtlpriv, RCR, rtlpci->receive_config);
-
- RT_TRACE(rtlpriv, COMP_TURBO | COMP_INIT, DBG_LOUD,
- "receive_config=0x%08X, write_into_reg=%d\n",
- rtlpci->receive_config, write_into_reg);
-}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/hw.h b/drivers/net/wireless/rtlwifi/rtl8192se/hw.h
index da48aa8..4cacee1 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/hw.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/hw.h
@@ -74,7 +74,5 @@ void rtl92se_set_key(struct ieee80211_hw *hw,
u8 enc_algo, bool is_wepkey, bool clear_all);
void rtl92se_suspend(struct ieee80211_hw *hw);
void rtl92se_resume(struct ieee80211_hw *hw);
-void rtl92se_allow_all_destaddr(struct ieee80211_hw *hw,
- bool allow_all_da, bool write_into_reg);

#endif
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
index 2e8e6f8..1bff2a0 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -290,7 +290,6 @@ static struct rtl_hal_ops rtl8192se_hal_ops = {
.enable_hw_sec = rtl92se_enable_hw_security_config,
.set_key = rtl92se_set_key,
.init_sw_leds = rtl92se_init_sw_leds,
- .allow_all_destaddr = rtl92se_allow_all_destaddr,
.get_bbreg = rtl92s_phy_query_bb_reg,
.set_bbreg = rtl92s_phy_set_bb_reg,
.get_rfreg = rtl92s_phy_query_rf_reg,
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c b/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c
index f4c9852..2e27ae3 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c
@@ -2390,24 +2390,3 @@ void rtl8723ae_suspend(struct ieee80211_hw *hw)
void rtl8723ae_resume(struct ieee80211_hw *hw)
{
}
-
-/* Turn on AAP (RCR:bit 0) for promicuous mode. */
-void rtl8723ae_allow_all_destaddr(struct ieee80211_hw *hw,
- bool allow_all_da, bool write_into_reg)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
-
- if (allow_all_da) /* Set BIT0 */
- rtlpci->receive_config |= RCR_AAP;
- else /* Clear BIT0 */
- rtlpci->receive_config &= ~RCR_AAP;
-
- if (write_into_reg)
- rtl_write_dword(rtlpriv, REG_RCR, rtlpci->receive_config);
-
-
- RT_TRACE(rtlpriv, COMP_TURBO | COMP_INIT, DBG_LOUD,
- "receive_config=0x%08X, write_into_reg=%d\n",
- rtlpci->receive_config, write_into_reg);
-}
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/hw.h b/drivers/net/wireless/rtlwifi/rtl8723ae/hw.h
index 6fa24f7..d3bc39f 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/hw.h
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/hw.h
@@ -67,7 +67,5 @@ void rtl8723ae_bt_reg_init(struct ieee80211_hw *hw);
void rtl8723ae_bt_hw_init(struct ieee80211_hw *hw);
void rtl8723ae_suspend(struct ieee80211_hw *hw);
void rtl8723ae_resume(struct ieee80211_hw *hw);
-void rtl8723ae_allow_all_destaddr(struct ieee80211_hw *hw,
- bool allow_all_da, bool write_into_reg);

#endif
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c b/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c
index 1087a3b..73cba1e 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c
@@ -238,7 +238,6 @@ static struct rtl_hal_ops rtl8723ae_hal_ops = {
.enable_hw_sec = rtl8723ae_enable_hw_security_config,
.set_key = rtl8723ae_set_key,
.init_sw_leds = rtl8723ae_init_sw_leds,
- .allow_all_destaddr = rtl8723ae_allow_all_destaddr,
.get_bbreg = rtl8723_phy_query_bb_reg,
.set_bbreg = rtl8723_phy_set_bb_reg,
.get_rfreg = rtl8723ae_phy_query_rf_reg,
diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/rtlwifi/rtl8723be/hw.c
index 7e70c71..6d8fe50 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723be/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723be/hw.c
@@ -2505,23 +2505,3 @@ void rtl8723be_suspend(struct ieee80211_hw *hw)
void rtl8723be_resume(struct ieee80211_hw *hw)
{
}
-
-/* Turn on AAP (RCR:bit 0) for promicuous mode. */
-void rtl8723be_allow_all_destaddr(struct ieee80211_hw *hw, bool allow_all_da,
- bool write_into_reg)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
-
- if (allow_all_da) /* Set BIT0 */
- rtlpci->receive_config |= RCR_AAP;
- else /* Clear BIT0 */
- rtlpci->receive_config &= ~RCR_AAP;
-
- if (write_into_reg)
- rtl_write_dword(rtlpriv, REG_RCR, rtlpci->receive_config);
-
- RT_TRACE(rtlpriv, COMP_TURBO | COMP_INIT, DBG_LOUD,
- "receive_config = 0x%08X, write_into_reg =%d\n",
- rtlpci->receive_config, write_into_reg);
-}
diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/hw.h b/drivers/net/wireless/rtlwifi/rtl8723be/hw.h
index b7449a9..64c7551 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723be/hw.h
+++ b/drivers/net/wireless/rtlwifi/rtl8723be/hw.h
@@ -59,6 +59,4 @@ void rtl8723be_bt_reg_init(struct ieee80211_hw *hw);
void rtl8723be_bt_hw_init(struct ieee80211_hw *hw);
void rtl8723be_suspend(struct ieee80211_hw *hw);
void rtl8723be_resume(struct ieee80211_hw *hw);
-void rtl8723be_allow_all_destaddr(struct ieee80211_hw *hw, bool allow_all_da,
- bool write_into_reg);
#endif
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index 6965afd..903874c 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -1960,8 +1960,6 @@ struct rtl_hal_ops {
u32 regaddr, u32 bitmask);
void (*set_rfreg) (struct ieee80211_hw *hw, enum radio_path rfpath,
u32 regaddr, u32 bitmask, u32 data);
- void (*allow_all_destaddr)(struct ieee80211_hw *hw,
- bool allow_all_da, bool write_into_reg);
void (*linked_set_reg) (struct ieee80211_hw *hw);
void (*chk_switch_dmdp) (struct ieee80211_hw *hw);
void (*dualmac_easy_concurrent) (struct ieee80211_hw *hw);
--
1.9.1


2014-03-20 18:52:44

by Peter Wu

[permalink] [raw]
Subject: [PATCH 2/3] staging/rtl8821ae: avoid accessing RCR directly

Similar to "rtlwifi: avoid accessing RCR directly", this patch avoids
accessing receive_config directly and uses get_hw_reg. There is no
functional change.

Signed-off-by: Peter Wu <[email protected]>
---
drivers/staging/rtl8821ae/rtl8821ae/hw.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8821ae/rtl8821ae/hw.c b/drivers/staging/rtl8821ae/rtl8821ae/hw.c
index 5ed7a11..e4dbf05 100644
--- a/drivers/staging/rtl8821ae/rtl8821ae/hw.c
+++ b/drivers/staging/rtl8821ae/rtl8821ae/hw.c
@@ -1633,12 +1633,13 @@ static int _rtl8821ae_set_media_status(struct ieee80211_hw *hw,
void rtl8821ae_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
- u32 reg_rcr = rtlpci->receive_config;
+ u32 reg_rcr;

if (rtlpriv->psc.rfpwr_state != ERFON)
return;

+ rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_RCR, (u8 *)(&reg_rcr));
+
if (check_bssid == true) {
reg_rcr |= (RCR_CBSSID_DATA | RCR_CBSSID_BCN);
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR,
--
1.9.1