morrownr / 88x2bu

Linux Driver for USB WiFi Adapters that are based on the RTL8812BU and RTL8822BU Chipsets
435 stars 74 forks source link

Cudy AC1300, Station can't see AP with the same dongle, in Scan results #93

Closed dmitttri closed 2 years ago

dmitttri commented 2 years ago

Hi Nick, first of all thanks a lot for your hard work and amazing support you provide with issues other people report. Such effort deserves only respect!

I have stumpled upon a strange issue using this driver. My setup consists of two EC-R3328PC boards (Rockchip ARM64 with custom buildroot linux and 4.4.213 kernel) , both of them with the same Cudy AC1300 usb dongle. One device was set up to operate as 5G band AP, the other is as STATION which should connect to the AP.

What happens is that STATION device can't see my AP (created by the first device) in scan results. It can see all other AP's in my neighbourhood (both 2.4 Gand 5G), the only missing AP is the one running on the same Cudy dongle.

It's important to note that AP which runs with Cudy is visible for my phone and other devices, which normally can connect to it. Only the STATION device with same dongle is not able to detect it. Also, same STATION can connect to any other 5G Access Point than mine.

Have you ever seen such behavior with this driver, or any other 80211ac chipsets?

Thanks in advance! Dmitri

dmitttri commented 2 years ago

What I was suspecting from the beginning, is that this may be chipset issue or limitation, rather than driver, kernel 80211 stack or hostapd/wpa_supplicant config issue.

I will provide more details about what I had to do, to check what's going on. Looking at the driver code in more details, I wanted to understand the way scan operates, and where I can check scan results at the lowest level possible, to see if my AP appears but gets filtered out somehow.

What I've seen is that driver pass scan request to the chipset with cfg80211_rtw_scan call, and wait until scan results are ready. The lowest level I could catch scan results was in the rtw_add_network function in the core/rtw_mlme_ext.c file.

The I have added printk for all detected SSID's, to see what chipset passes to the driver, before any other filtering and parsing takes place. I can confirm my AP is not present in these results, which makes me thing that Realtek has something wired implemented in their chipset firmware, which filters out AP with same chipsets. Although it's totally crazy thing to do, seems it's the case here.

Please correct me if I got scan procedure in a wrong was, and if I am missing something obvious in the driver structure.

dmitttri commented 2 years ago

Since thsi driver has CONFIG_WIFI_MONITOR = y, I have tried airodump analysis to check if I can see Beacon frames form my AP, but they are missing in the oputput. Simply there are no frames wtih my AP mac address.

dmitttri commented 2 years ago

On my AP side driver is loaded without parameters, and this is my hostapd conf file:

interface=wlan0
driver=nl80211
ssid=MyTest5G

macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=mytest2021
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

hw_mode=a
channel=44
wmm_enabled=1

country_code=RS

require_ht=1
ieee80211ac=1
require_vht=1

#This below is supposed to get us 867Mbps and works on rtl8814au doesn't work on this driver yet
#vht_oper_chwidth=1
#vht_oper_centr_freq_seg0_idx=157

ieee80211n=1
ieee80211ac=1
dmitttri commented 2 years ago

I will try to investigate more, as this may be Realtek specific issue, unless I am missing something obvious. In any case, if I come up with any results, I'll make sure to let you know