Skip to content

rtlwifi promiscious mode fix and cleanup

Peter Wu linux-wireless lkml 1 version NAK

Status from this message: NACK - at least for now. This patch has merge conflicts for the set of patches that add the rtl8723be driver, and would cause build errors if the merge were fixed. I will hang on to it and apply it la…

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesNAK

Patches in v1

#Subject and filesSizeRepliesApplied
1/3rtlwifi: avoid accessing RCR directlydrivers/net/wireless/rtlwifi/rtl8188ee/hw.c drivers/net/wireless/rtlwifi/rtl8192ce/hw.c drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +3 more+19 -102 replies
2/3rtlwifi: properly apply filter flagsdrivers/net/wireless/rtlwifi/core.c+30 -221 reply
3/3rtlwifi: remove unused allow_all_destaddr functionsdrivers/net/wireless/rtlwifi/rtl8188ee/hw.c drivers/net/wireless/rtlwifi/rtl8188ee/hw.h drivers/net/wireless/rtlwifi/rtl8188ee/sw.c +10 more+0 -963 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchPeter WuLarry Finger
1/3A-b
2/3T-b A-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] rtlwifi promiscious mode fix and cleanup

Hi,

While investigating bug 60713[1] which is about the inability to connect with RTL8192CE hardware, I noticed that the monitor mode only shows broadcast and multicast frames. The cause is described next.

rtlpci->receive_config seems to contain the current value of REG_RCR. It gets initialized in rtl*_init_sw_vars. It is returned by rtl*_get_hw_reg and set by rtl*_set_hw_reg (after writing to REG_RCR).

mac->rx_conf is initialized in rtl_init_rx_config. For PCIe drivers, it gets inited from receive_config via get_hw_reg (one of the functions from the previous section).

When monitor mode is enabled with otherbss set, rtl_op_configure_filter is called. This has a problem:

(1) The rtl_op_configure_filter function only sets mac->rx_conf.
(2) rx_conf is only written to register REG_RCR by rtl8192cu and besides that driver, it is only read by rtl_init_rx_config in base.c.

Patch 2/3 fixes the above issue. 1/2 makes accessing RCR more consistent and 3/3 removes unused functions (yay, less code!). Similar modifications (3 and probably 1) need to be done for staging.

I have tested these patches on top of v3.14-rc2-267-g9398a10, but it unfortunately does not improve the connectivity problem. It got even stranger, when I run iw wlan0 set monitor fcsfail, I do not see a "Enable receive FCS error frame" message with debug=5. Instead I see "Enable receive control frame". More testing will be done later this day. For example, only the first and second EAPOL frame of a second test device got captured, others got lost somehow. Hopefully it is not a memory corruption issue somewhere.

Related question for a Realtek engineer (or someone with access to the specs): the rx_ctrl_filter and rx_data_filter fields are only *read* in the rtl8192cu driver. Besides that they are unused. Can this be removed? Otherwise, what about moving them to rtl_init_rx_config() and updating the *_get_hw_reg() functions to ignore/process the vars? After doing so, _update_mac_setting can be removed from rtl8192cu/hw.c.

Regards,
Peter

[1]: https://bugzilla.kernel.org/show_bug.cgi?id=60713
---

Peter Wu (3):
rtlwifi: avoid accessing RCR directly
rtlwifi: properly apply filter flags
rtlwifi: remove unused allow_all_destaddr functions

 drivers/net/wireless/rtlwifi/core.c         | 52 +++++++++++++++++------------
 drivers/net/wireless/rtlwifi/rtl8188ee/hw.c | 25 ++------------
 drivers/net/wireless/rtlwifi/rtl8188ee/hw.h |  2 --
 drivers/net/wireless/rtlwifi/rtl8188ee/sw.c |  1 -
 drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 25 ++------------
 drivers/net/wireless/rtlwifi/rtl8192ce/hw.h |  2 --
 drivers/net/wireless/rtlwifi/rtl8192ce/sw.c |  1 -
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c |  4 ++-
 drivers/net/wireless/rtlwifi/rtl8192de/hw.c |  6 ++--
 drivers/net/wireless/rtlwifi/rtl8192se/hw.c | 25 ++------------
 drivers/net/wireless/rtlwifi/rtl8192se/hw.h |  2 --
 drivers/net/wireless/rtlwifi/rtl8192se/sw.c |  1 -
 drivers/net/wireless/rtlwifi/rtl8723ae/hw.c | 26 ++-------------
 drivers/net/wireless/rtlwifi/rtl8723ae/hw.h |  2 --
 drivers/net/wireless/rtlwifi/rtl8723ae/sw.c |  1 -
 drivers/net/wireless/rtlwifi/wifi.h         |  2 --
 16 files changed, 49 insertions(+), 128 deletions(-)
Signature · 1 line
1.8.5.4