lwfinger / rtl8188gu

This repo contains a Linux driver for the RTL8188GU
55 stars 19 forks source link

Does not work with Tenda W311MI #14

Open itsfuad opened 1 year ago

itsfuad commented 1 year ago

Tenda W311MI uses RTL8188GU but it do not work with any of linux destros.

lwfinger commented 1 year ago

Without the USB ID from lsusb, we will never be able to make it work.

itsfuad commented 1 year ago

Nice to see replies from you. So what to do after getting the USB ID?

lwfinger commented 1 year ago

Tell me what it is. That way I can tell if it your device is not in the code. What did you think I wanted?

itsfuad commented 1 year ago

Well, I got [0bda:b711] as the USB ID by running lsusb.

itsfuad commented 1 year ago

The thing is, It has monitor mode support. I can monitor from Windows. But I got 'monitor mode is not supported' message from ParrotOS. Is that driver issue or real hardware issue?

rebornplusplus commented 1 year ago

Hiya @lwfinger, I have the same issue with the device OP mentioned, Here's the lsusb output:

ID 0bda:b711 Realtek Semiconductor Corp. RTL8188GU 802.11n WLAN Adapter (After Modeswitch)

The driver from https://github.com/McMCCRU/rtl8188gu does seem to work with the device, but it has some known issues that are happening to me too.

Additionally, here's the output from uname -rm:

5.19.0-43-generic x86_64
lwfinger commented 1 year ago

In all my sources, that USB ID only shows as belonging to the RTL8710B, also know as RTL8188GU.

If that repo does not work, why not try my repo at https://github.com:lwfinger/rtl8188gu.git. That device is

Kernel 6.4 will drive this device using rtl8xxxu.

dubhater commented 1 year ago

Someone backported rtl8xxxu to kernel 6.0-6.3: https://github.com/a5a5aa555oo/rtl8xxxu Maybe it can support 5.19 too if you ask.

lwfinger commented 1 year ago

I just created a repository at https://github.com/lwfinger/rtl8xxxu.git that will build on kernels 5.15 through 6.4.

ohquait commented 1 year ago

I just created a repository at https://github.com/lwfinger/rtl8xxxu.git that will build on kernels 5.15 through 6.4.

That's works real nice on 5.15... and 6.3.5 and so you become a new bigger THANK YOU !

rebornplusplus commented 1 year ago

If that repo does not work, why not try my repo at https://github.com:lwfinger/rtl8188gu.git

Tried it first actually, didn't work for my device.

I just created a repository at https://github.com/lwfinger/rtl8xxxu.git that will build on kernels 5.15 through 6.4.

Is there support for 5.19 yet, @lwfinger? I ask because I just tried to compile it on my pc which has a 5.19.0-42-generic kernel. The compilation didn't work. I am attaching the error logs below if you want to take a look at it.

error log ```shell $ make modules make -C /lib/modules/`uname -r`/build M=$PWD modules make[1]: Entering directory '/usr/src/linux-headers-5.19.0-42-generic' warning: the compiler differs from the one used to build the kernel The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0 You are using: gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0 CC [M] ~/rtl8xxxu/rtl8xxxu_core.o ~/rtl8xxxu/rtl8xxxu_core.c: In function ‘rtl8xxxu_wireless_mode’: ~/rtl8xxxu/rtl8xxxu_core.c:4862:24: error: ‘struct ieee80211_sta’ has no member named ‘vht_cap’ 4862 | if (sta->vht_cap.vht_supported) | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:4864:29: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 4864 | else if (sta->ht_cap.ht_supported) | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:4875:24: error: ‘struct ieee80211_sta’ has no member named ‘vht_cap’ 4875 | if (sta->vht_cap.vht_supported) | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:4877:29: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 4877 | else if (sta->ht_cap.ht_supported) | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:4886:24: error: ‘struct ieee80211_sta’ has no member named ‘supp_rates’ 4886 | if (sta->supp_rates[0] <= 0xf) | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:4888:29: error: ‘struct ieee80211_sta’ has no member named ‘supp_rates’ 4888 | else if (sta->supp_rates[0] & 0xf) | ^~ ~/rtl8xxxu/rtl8xxxu_core.c: In function ‘rtl8xxxu_bss_info_changed’: ~/rtl8xxxu/rtl8xxxu_core.c:5022:32: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 5022 | if (sta->ht_cap.ht_supported) | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:5024:32: error: ‘struct ieee80211_sta’ has no member named ‘vht_cap’ 5024 | if (sta->vht_cap.vht_supported) | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:5034:38: error: ‘struct ieee80211_sta’ has no member named ‘supp_rates’ 5034 | ramask = (sta->supp_rates[0] & 0xfff) | | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:5035:36: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 5035 | sta->ht_cap.mcs.rx_mask[0] << 12 | | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:5036:36: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 5036 | sta->ht_cap.mcs.rx_mask[1] << 20; | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:5037:32: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 5037 | if (sta->ht_cap.cap & | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:5047:33: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 5047 | (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)) | ^~ ~/rtl8xxxu/rtl8xxxu_core.c: In function ‘rtl8xxxu_tx’: ~/rtl8xxxu/rtl8xxxu_core.c:5642:24: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 5642 | if (sta->ht_cap.ht_supported) { | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:5651:41: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 5651 | ampdu = (u32)sta->ht_cap.ampdu_density; | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:5669:23: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 5669 | sta && sta->ht_cap.cap & | ^~ ~/rtl8xxxu/rtl8xxxu_core.c: In function ‘rtl8xxxu_ampdu_action’: ~/rtl8xxxu/rtl8xxxu_core.c:6971:35: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 6971 | ampdu_factor = sta->ht_cap.ampdu_factor; | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:6972:36: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 6972 | ampdu_density = sta->ht_cap.ampdu_density; | ^~ ~/rtl8xxxu/rtl8xxxu_core.c: In function ‘rtl8xxxu_refresh_rate_mask’: ~/rtl8xxxu/rtl8xxxu_core.c:7073:35: error: ‘struct ieee80211_sta’ has no member named ‘supp_rates’ 7073 | rate_bitmap = (sta->supp_rates[0] & 0xfff) | | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:7074:37: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 7074 | (sta->ht_cap.mcs.rx_mask[0] << 12) | | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:7075:37: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 7075 | (sta->ht_cap.mcs.rx_mask[1] << 20); | ^~ ~/rtl8xxxu/rtl8xxxu_core.c:7076:24: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’ 7076 | if (sta->ht_cap.cap & | ^~ make[2]: *** [scripts/Makefile.build:257: ~/rtl8xxxu/rtl8xxxu_core.o] Error 1 make[1]: *** [Makefile:1850: ~/rtl8xxxu] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-5.19.0-42-generic' make: *** [Makefile:22: modules] Error 2 ```
lwfinger commented 1 year ago

I pushed a fix. Do a 'git pull' and make it again.

rebornplusplus commented 1 year ago

It's working great now. Thanks a bunch @lwfinger.

I didn't need to do the modeswitch since mine was done already. The following worked like a charm:

make clean modules
sudo make install
sudo modprobe rtl8xxxu_git

For future notes though, since you are supporting 5.19.0 as well, you might want to take a look at dkms.conf in that repo. dkms install fails on my pc due to this:

BUILD_EXCLUSIVE_KERNEL="^6.*"
jatink2004 commented 7 months ago

I am getting this error. Can someone help me?🙏 image

lwfinger commented 7 months ago

As the message says, you need to install the correct headers. I do not use Kali, thus I cannot give you any tips.

jatink2004 commented 7 months ago

I am getting this error. Can someone help me?🙏 image

image It worked for a few times, but after that , it cannot find any targets.

dubhater commented 7 months ago

@jatink2004 Someone reported that problem with the RTL8188EU. Maybe the same fix can help you too:

diff --git a/rtl8xxxu_8710b.c b/rtl8xxxu_8710b.c
index 871b8cc..1778016 100644
--- a/rtl8xxxu_8710b.c
+++ b/rtl8xxxu_8710b.c
@@ -1757,7 +1757,7 @@ static void rtl8710b_disable_rf(struct rtl8xxxu_priv *priv)
    rtl8xxxu_write32(priv, REG_OFDM0_TRX_PATH_ENABLE, val32);

    /* Power down RF module */
-   rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_AC, 0);
+   // rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_AC, 0);
 }

 static void rtl8710b_usb_quirks(struct rtl8xxxu_priv *priv)