Ubuntu 20.04.3 LTS can't compile driver for "tp-link AC1300" USB WiFi dongle using an answered previous question

Previous similar question here: Ubuntu not picking up Wifi Adapter

Answered with Terminal instructions to compile driver.

I follow those instructions [pasted at the bottom of this question] and things seem fine until I do the "make" instruction and then I get the following output from terminal.


   
 make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.11.0-27-generic/build M=/home/arch/Downloads/linux-wifi-88x2bu-driver  modules
make[1]: Entering directory '/usr/src/linux-headers-5.11.0-27-generic'
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_cmd.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_security.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_debug.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_io.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_ioctl_query.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_ioctl_set.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_ieee80211.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_mlme.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_mlme_ext.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_mi.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_wlan_util.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_vht.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_pwrctrl.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_rf.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_recv.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_sta_mgt.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_ap.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/mesh/rtw_mesh.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/mesh/rtw_mesh_pathtbl.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/mesh/rtw_mesh_hwmp.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_xmit.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_p2p.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_rson.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_tdls.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_br_ext.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_iol.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_sreset.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_btcoex_wifionly.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_btcoex.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_beamforming.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_odm.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_rm.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/rtw_rm_fsm.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/core/efuse/rtw_efuse.o
  CC [M]  /home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.o
/home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.c: In function ‘isFileReadable’:
/home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.c:2189:11: error: implicit declaration of function ‘get_fs’; did you mean ‘get_sa’? [-Werror=implicit-function-declaration]
 2189 |   oldfs = get_fs();
      |           ^~~~~~
      |           get_sa
/home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.c:2189:11: error: incompatible types when assigning to type ‘mm_segment_t’ {aka ‘struct <anonymous>’} from type ‘int’
/home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.c:2190:3: error: implicit declaration of function ‘set_fs’; did you mean ‘sget_fc’? [-Werror=implicit-function-declaration]
 2190 |   set_fs(KERNEL_DS);
      |   ^~~~~~
      |   sget_fc
/home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.c:2190:10: error: ‘KERNEL_DS’ undeclared (first use in this function); did you mean ‘KERNFS_NS’?
 2190 |   set_fs(KERNEL_DS);
      |          ^~~~~~~~~
      |          KERNFS_NS
/home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.c:2190:10: note: each undeclared identifier is reported only once for each function it appears in
/home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.c: In function ‘retriveFromFile’:
/home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.c:2227:12: error: incompatible types when assigning to type ‘mm_segment_t’ {aka ‘struct <anonymous>’} from type ‘int’
 2227 |    oldfs = get_fs();
      |            ^~~~~~
/home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.c:2228:11: error: ‘KERNEL_DS’ undeclared (first use in this function); did you mean ‘KERNFS_NS’?
 2228 |    set_fs(KERNEL_DS);
      |           ^~~~~~~~~
      |           KERNFS_NS
/home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.c: In function ‘storeToFile’:
/home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.c:2262:12: error: incompatible types when assigning to type ‘mm_segment_t’ {aka ‘struct <anonymous>’} from type ‘int’
 2262 |    oldfs = get_fs();
      |            ^~~~~~
/home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.c:2263:11: error: ‘KERNEL_DS’ undeclared (first use in this function); did you mean ‘KERNFS_NS’?
 2263 |    set_fs(KERNEL_DS);
      |           ^~~~~~~~~
      |           KERNFS_NS
cc1: all warnings being treated as errors
make[2]: *** [scripts/Makefile.build:287: /home/arch/Downloads/linux-wifi-88x2bu-driver/os_dep/osdep_service.o] Error 1
make[1]: *** [Makefile:1848: /home/arch/Downloads/linux-wifi-88x2bu-driver] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-27-generic'
make: *** [Makefile:1999: modules] Error 2
arch@bird:~/Downloads/linux-wifi-88x2bu-driver$ 

More info... My computer is "ASUS TUF Gaming A15 TUF506QE-MS74 15.6" Laptop Computer Platinum Collection"

Ubuntu 20.04.3 LTS hasn't recognized Bluetooth or WiFi. (Installed about 2 weeks ago)

Bluetooth now works using an old USB Dongle I had around.

Install of Ubuntu was difficult. I accepted to disappearance of Bluetooth and WiFi as something that could be fixed in some future update. Whaduiknow?

Using an alternative driver for Nvidea drivers which were freezing my computer. This is being used: "Using X.org X server - Nouveau display driver from Xserver-xorg-video-nouveau (open source)"

The answer I worked from was:

This particular WiFi device uses an Archer T4U chipset, which needs a special driver to operate. This needs to be compiled from source on your machine. Fortunately, it's not too difficult. Here's how:

  1. Open Terminal (If it's not already open)

  2. Install some prerequisites:

    $ sudo apt install git linux-headers-generic build-essential
    
  3. Clone the Git repository to your Downloads directory (or any other, but Downloads is fine for this case):

    $ cd ~/Downloads
    $ git clone https://github.com/nyetwurk/linux-wifi-88x2bu-driver
    
  4. Compile and install the driver:

    $ cd linux-wifi-88x2bu-driver
    $ make
    $ sudo make install
    $ sudo modprobe 88x2bu
    

At this point Ubuntu should pick up the WiFi device and let you connect to the network. If it does not, a reboot may be in order.

Hope this helps.


It seems that repository is somewhat older. I was able to reproduce the issue you had with compiling it and I looked into patching/updating it to work, but instead I just found a newer repository that appears to be maintained:

git clone 'https://github.com/morrownr/88x2bu'
cd 88x2bu
make -j $(nproc)

The -j $(nproc) part simply speeds up the compilation by using multiple processes. If it gives you any trouble (such as nproc not existing somehow) simply compile with make and it will work.

You can also refer to the directions present on that GitHub page: https://github.com/morrownr/88x2bu

You probably want to just run their install-driver.sh script as root.