McMCCRU / rtl8188gu

Driver for Linux RTL8188GU (RTL8710B) (VID:PID = 0x0BDA:0xB711)
317 stars 106 forks source link

Fails compilation with kernel 6.3.2 #61

Open aquilarubra opened 1 year ago

aquilarubra commented 1 year ago

I had to edit os_dep/linux/ioctl_cfg80211.c and change cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); to cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0);

as it required 1 more parameter now.

Also, my device did not work. It gives this: 0bda:1a2b Realtek Semiconductor Corp. RTL8188GU 802.11n WLAN Adapter (Driver CDROM Mode)

But when I do, eject cdrom, it gives this: 0bda:c832 Realtek Semiconductor Corp. 802.11ax WLAN Adapter

I don't know why it is recognized first as RTL8188GU, but it should be RTL8832CU. Maybe this driver could support RTL8832CU?

dubhater commented 1 year ago

No, this driver cannot support RTL8832CU. As far as I can tell, there is no published Linux driver for that chip yet. You should ask about it at linux-wireless@vger.kernel.org (plain text emails only, no need to subscribe). At least one Realtek employee will see your email.

X1nto commented 1 year ago

I had to edit os_dep/linux/ioctl_cfg80211.c and change cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); to cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0);

Just PR at this point

Luigi8D commented 1 year ago

On XeroLinux with kernel 6.3.2 I edited the line in os_dep/linux/ioctl_cfg80211.c as above and worked My chip is Realtek 8188GU. The model of WIFI Dongle is: Tenda W311MI

While on arcolinux with previous kernel the driver worked without editing the file

ddexter26 commented 5 months ago

I had to edit os_dep/linux/ioctl_cfg80211.c and change cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); to cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0);

as it required 1 more parameter now.

Also, my device did not work. It gives this: 0bda:1a2b Realtek Semiconductor Corp. RTL8188GU 802.11n WLAN Adapter (Driver CDROM Mode)

But when I do, eject cdrom, it gives this: 0bda:c832 Realtek Semiconductor Corp. 802.11ax WLAN Adapter

I don't know why it is recognized first as RTL8188GU, but it should be RTL8832CU. Maybe this driver could support RTL8832CU?

This totaly worked for me: https://forums.linuxmint.com/viewtopic.php?t=407894

Along with:

sudo usb_modeswitch -v 0bda -p 1a2b -K

Which I then had to add to the Rules so that it switches the mode on every reboot.

The Fix (Automated)

Step 1: Create a udev Rule

  1. Open a new udev rule file for editing:

    sudo nano /etc/udev/rules.d/40-usb_modeswitch.rules
  2. Add the following line to the file: This rule triggers usb_modeswitch whenever the specified USB device is connected.

    ACTION=="add", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="1a2b", RUN+="/usr/sbin/usb_modeswitch -v 0bda -p 1a2b -K"

    Replace 0bda with your device’s Vendor ID and 1a2b with the Product ID as necessary.

  3. Save and exit the editor: You can do this in nano by pressing Ctrl+O to save changes, then Ctrl+X to exit.

Step 2: Reload udev Rules

After saving the new rule, you need to reload the udev rules to apply the changes:

sudo udevadm control --reload-rules
sudo udevadm trigger

This was my experience, before the fix:

First Plug-in

Bus 001 Device 003: ID 0bda:1a2b Realtek Semiconductor Corp. RTL8188GU 802.11n WLAN Adapter (Driver CDROM Mode)

Second Plug-in

Bus 001 Device 006: ID 0bda:c820 Realtek Semiconductor Corp. 802.11ac NIC

Note: 0bda is the vendor ID and 1a2b is the product ID in CD-ROM mode, 0bda is the vendor ID and c820 is the product ID in WiFi Mode.