cilynx / rtl88x2bu

rtl88x2bu driver updated for current kernels.
http://www.wolfteck.com/2018/02/22/wsky_1200mbps_wireless_usb_wifi_adapter/
GNU General Public License v2.0
1.61k stars 316 forks source link

Fix compilation for CentOS 9 Stream #220

Closed dhuertas closed 1 year ago

dhuertas commented 1 year ago

Fix dkms compilation for CentOS 9 Stream.

Additional details:

dhuertas@localhost rtl88x2bu]$ cat /etc/centos-release 
CentOS Stream release 9
[dhuertas@localhost rtl88x2bu]$ uname -a
Linux localhost.localdomain 5.14.0-160.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 25 23:06:03 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[dhuertas@localhost rtl88x2bu]$ lsusb -s 3:2
Bus 003 Device 002: ID 2357:0138 TP-Link 802.11ac NIC
[dhuertas@localhost rtl88x2bu]$ lsmod | grep 88x2bu
88x2bu               2813952  0
cfg80211             1052672  1 88x2bu
[dhuertas@localhost rtl88x2bu]$ nmcli
wlp6s0u1: connected to XXXXXXXXXXXXXXXXXX
        "TP-Link Wi-Fi"
        wifi (rtl88x2bu), XX:XX:XX:XX:XX:XX, hw, mtu 1500
        ip4 default
        inet4 192.168.1.45/24
        route4 192.168.1.0/24 metric 600
        route4 default via 192.168.1.1 metric 600
        inet6 fe80::6700:52fb:bbc5:49f1/64
        route6 fe80::/64 metric 1024
CGarces commented 1 year ago

Bon dia Daniel.

The change fix the compilation for CentOS and similar but broke the compilations on distributions that use mainline kernels like Ubuntu/Debian based. You must define an additional variable for CentOS distributions

    #ifndef RHEL_RELEASE_CODE
        #define RHEL_RELEASE_VERSION(a,b) (((a) << 8) + (b))
        #define RHEL_RELEASE_CODE 0
    #endif

Use this patch as reference. https://github.com/Mange/rtl8192eu-linux-driver/pull/232

Note. I'm against this modifications, keep compatibility with distribution backports is a pain. Please read the discussion at https://github.com/aircrack-ng/rtl8812au/issues/542 and consider using a different kernel as suggested at https://github.com/aircrack-ng/rtl8812au/issues/542#issuecomment-587775745

dhuertas commented 1 year ago

Hola Carlos.

Thanks for your feedback, I've added the variable now (silly me).

I understand your point. In a different situation I would def consider updating to a newer kernel, but I'm interested in testing a few things with the default one. Having the wifi dongle running was sort of a (rather short) side quest.

I'm closing the PR and will keep the changes in my fork.

Cheers!