腾达USB无线网卡(U12)驱动安装笔记
作者:互联网
在京东上给家里的台式机(DELL OPTIPLEX 380)买了一个USB无线网卡(U12),腾达官方的驱动无法使用,因为其支持的Linux内核最大版本为4.4。本文介绍如何在Ubuntu16.04上安装这一网卡驱动。
00 - 系统信息
$ cat /etc/*release | grep VERSION= VERSION="16.04.6 LTS (Xenial Xerus)" $ uname -r 4.15.0-88-generic
01 - 尝试编译腾达官方的驱动
$ wget https://down.tenda.com.cn/uploadfile/U12/U12_linux_v5.1.5_19247_Driver.zip $ unzip U12_linux_v5.1.5_19247_Driver.zip $ cd U12_linux_v5.1.5_19247.20160830/driver $ tar zxf rtl8812AU_linux_v5.1.5_19247.20160830.tar.gz $ cd rtl8812AU_linux_v5.1.5_19247.20160830/ $ make make ARCH=i386 CROSS_COMPILE= -C /lib/modules/4.15.0-88-generic/build M=/tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830 modules make[1]: Entering directory '/usr/src/linux-headers-4.15.0-88-generic' CC [M] /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/core/rtw_cmd.o In file included from /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/include/osdep_service.h:41:0, from /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/include/drv_types.h:32, from /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/core/rtw_cmd.c:22: /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/include/osdep_service_linux.h: In function ‘_init_timer’: /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/include/osdep_service_linux.h:273:8: error: ‘_timer {aka struct timer_list}’ has no member named ‘data’ ptimer->data = (unsigned long)cntx; ^ /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/include/osdep_service_linux.h:274:2: error: implicit declaration of function ‘init_timer’ [-Werror=implicit-function-declaration] init_timer(ptimer); ^ In file included from /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/include/drv_types.h:32:0, from /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/core/rtw_cmd.c:22: /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/include/osdep_service.h: In function ‘thread_enter’: /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/include/osdep_service.h:345:2: error: implicit declaration of function ‘allow_signal’ [-Werror=implicit-function-declaration] allow_signal(SIGTERM); ^ /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/include/osdep_service.h: In function ‘flush_signals_thread’: /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/include/osdep_service.h:355:6: error: implicit declaration of function ‘signal_pending’ [-Werror=implicit-function-declaration] if (signal_pending(current)) ^ /tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/include/osdep_service.h:356:3: error: implicit declaration of function ‘flush_signals’ [-Werror=implicit-function-declaration] flush_signals(current); ^ cc1: some warnings being treated as errors scripts/Makefile.build:330: recipe for target '/tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/core/rtw_cmd.o' failed make[2]: *** [/tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830/core/rtw_cmd.o] Error 1 Makefile:1577: recipe for target '_module_/tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830' failed make[1]: *** [_module_/tmp/U12_linux_v5.1.5_19247.20160830/driver/rtl8812AU_linux_v5.1.5_19247.20160830] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-88-generic' Makefile:1838: recipe for target 'modules' failed make: *** [modules] Error 2
尝试修改了一些编译错误,但是又蹦出新的错误,果断放弃这一思路!
02 - 搜索现成的解决方案
找到了一个GitHub的repo, Realtek 802.11n WLAN Adapter Linux driver! 果然有人做了对应的修复,那就直接拿来用吧。
$ git clone https://github.com/gnab/rtl8812au.git $ cd rtl8812au/ $ make $ sudo make install $ # NOTE: rt8812au.ko is installed to /lib/modules/4.15.0-88-generic/kernel/drivers/net/wireless/8812au.ko $ sudo modprobe 8812au $ sudo lsmod | egrep 8812au 8812au 856064 0
连接wifi成功上网,网卡状态如下:
$ ethinfo enx502b73d14b1b ETH MAC STATE DEVICEID VENDORID MTU SPEED BDF DRIVER IPv4 enx502b73d14b1b 50:2b:73:d1:4b:1b up 1500 1-5:1.0 usb/drivers/rtl8812au 192.168.3.9/24
大功告成!Have fun:-)
标签:USB,rtl8812AU,linux,driver,网卡,v5.1,19247.20160830,U12 来源: https://www.cnblogs.com/idorax/p/12369624.html