外部 Wi-Fi USB 适配器 TP-LINK 驱动程序安装失败

外部 Wi-Fi USB 适配器 TP-LINK 驱动程序安装失败

我刚买了 TP-LINK TL-WN823N (v2) 外部 wifi usb 适配器,它可以在 Windows 上运行。

我正在尝试弄清楚如何在我的 Ubuntu 上安装它。我去了http://www.tp-link.com/us/download/TL-WN823N.html#Driver并下载了 Linux 驱动程序。然后我尝试sudo make在驱动程序文件夹中运行,但失败了:

$>sudo make
"******************************************"
"NO SKRC,we will use default KSRC"
"******************************************"
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.13.0-32-generic/build M=/home/unicornslayer/Driver  modules
make[1]: Entering directory '/usr/src/linux-headers-4.13.0-32-generic'
e"******************************************"
"NO SKRC,we will use default KSRC"
"******************************************"
  CC [M]  /home/unicornslayer/Driver/core/rtw_cmd.o
In file included from /home/unicornslayer/Driver/include/drv_types.h:95:0,
                 from /home/unicornslayer/Driver/core/rtw_cmd.c:22:
/home/unicornslayer/Driver/include/hal_com.h:413:13: error: ‘file_path’ redeclared as different kind of symbol
 extern char file_path[PATH_LENGTH_MAX];
             ^
In file included from ./include/linux/seq_file.h:10:0,
                 from ./include/linux/pinctrl/consumer.h:17,
                 from ./include/linux/pinctrl/devinfo.h:21,
                 from ./include/linux/device.h:24,
                 from ./include/linux/dmaengine.h:20,
                 from ./include/linux/netdevice.h:38,
                 from /home/unicornslayer/Driver/include/osdep_service_linux.h:35,
                 from /home/unicornslayer/Driver/include/osdep_service.h:45,
                 from /home/unicornslayer/Driver/include/drv_types.h:32,
                 from /home/unicornslayer/Driver/core/rtw_cmd.c:22:
./include/linux/fs.h:2805:14: note: previous declaration of ‘file_path’ was here
 extern char *file_path(struct file *, char *, int);
              ^
In file included from /home/unicornslayer/Driver/include/drv_types.h:65:0,
                 from /home/unicornslayer/Driver/core/rtw_cmd.c:22:
/home/unicornslayer/Driver/core/rtw_cmd.c: In function ‘btinfo_evt_dump’:
/home/unicornslayer/Driver/include/rtw_debug.h:187:19: error: void value not ignored as it ought to be
  #define _seqdump seq_printf
                   ^
/home/unicornslayer/Driver/include/rtw_debug.h:242:7: note: in expansion of macro ‘_seqdump’
    if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/; \
       ^
/home/unicornslayer/Driver/core/rtw_cmd.c:3293:2: note: in expansion of macro ‘DBG_871X_SEL_NL’
  DBG_871X_SEL_NL(sel, "cid:0x%02x, len:%u\n", info->cid, info->len);
  ^
/home/unicornslayer/Driver/include/rtw_debug.h:187:19: error: void value not ignored as it ought to be
  #define _seqdump seq_printf
                   ^
/home/unicornslayer/Driver/include/rtw_debug.h:242:7: note: in expansion of macro ‘_seqdump’
    if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/; \
       ^
/home/unicornslayer/Driver/core/rtw_cmd.c:3296:3: note: in expansion of macro ‘DBG_871X_SEL_NL’
   DBG_871X_SEL_NL(sel, "byte2:%s%s%s%s%s%s%s%s\n"
   ^
/home/unicornslayer/Driver/include/rtw_debug.h:187:19: error: void value not ignored as it ought to be
  #define _seqdump seq_printf
                   ^
/home/unicornslayer/Driver/include/rtw_debug.h:242:7: note: in expansion of macro ‘_seqdump’
    if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/; \
       ^
/home/unicornslayer/Driver/core/rtw_cmd.c:3308:3: note: in expansion of macro ‘DBG_871X_SEL_NL’
   DBG_871X_SEL_NL(sel, "retry_cnt:%u\n", info->retry_cnt);
   ^
/home/unicornslayer/Driver/include/rtw_debug.h:187:19: error: void value not ignored as it ought to be
  #define _seqdump seq_printf
                   ^
/home/unicornslayer/Driver/include/rtw_debug.h:242:7: note: in expansion of macro ‘_seqdump’
    if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/; \
       ^
/home/unicornslayer/Driver/core/rtw_cmd.c:3311:3: note: in expansion of macro ‘DBG_871X_SEL_NL’
   DBG_871X_SEL_NL(sel, "rssi:%u\n", info->rssi);
   ^
/home/unicornslayer/Driver/include/rtw_debug.h:187:19: error: void value not ignored as it ought to be
  #define _seqdump seq_printf
                   ^
/home/unicornslayer/Driver/include/rtw_debug.h:242:7: note: in expansion of macro ‘_seqdump’
    if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/; \
       ^
/home/unicornslayer/Driver/core/rtw_cmd.c:3314:3: note: in expansion of macro ‘DBG_871X_SEL_NL’
   DBG_871X_SEL_NL(sel, "byte5:%s%s\n"
   ^
scripts/Makefile.build:308: recipe for target '/home/unicornslayer/Driver/core/rtw_cmd.o' failed
make[2]: *** [/home/unicornslayer/Driver/core/rtw_cmd.o] Error 1
Makefile:1550: recipe for target '_module_/home/unicornslayer/Driver' failed
make[1]: *** [_module_/home/unicornslayer/Driver] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.13.0-32-generic'
Makefile:1696: recipe for target 'modules' failed
make: *** [modules] Error 2

我尝试通过 Windows 无线驱动程序应用程序安装该驱动程序,但似乎dmesg不起作用:

[  522.042037] usb 2-1.1: new high-speed USB device number 6 using ehci-pci
[  522.167320] usb 2-1.1: New USB device found, idVendor=2357, idProduct=0109
[  522.167326] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  522.167329] usb 2-1.1: Product: 802.11n NIC 
[  522.167332] usb 2-1.1: Manufacturer: Realtek 
[  522.167335] usb 2-1.1: SerialNumber: 00e04c000001
[  522.254021] usb 2-1.1: reset high-speed USB device number 6 using ehci-pci
[  522.372986] ndiswrapper (import:232): unknown symbol: ntoskrnl.exe:'IoCsqInsertIrp'
[  522.373004] ndiswrapper (import:232): unknown symbol: ntoskrnl.exe:'IoCsqRemoveNextIrp'
[  522.373014] ndiswrapper (import:232): unknown symbol: ntoskrnl.exe:'IoCsqInitialize'
[  522.373225] ndiswrapper (load_sys_files:200): couldn't prepare driver 'netrtwlanu_xp_coinst'
[  522.375002] ndiswrapper (load_wrap_driver:103): couldn't load driver netrtwlanu_xp_coinst; check system log for messages from 'loadndisdriver'

以下是我运行过的一些命令:

$>rfkill list all
0: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no
1: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
2: brcmwl-0: Wireless LAN
    Soft blocked: no
    Hard blocked: yes

$>sudo lshw -C network
  *-network               
       description: Ethernet interface
       product: NetLink BCM57785 Gigabit Ethernet PCIe
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: enp2s0f0
       version: 10
       serial: b8:70:f4:ae:a6:b6
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi msix pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.137 firmware=sb latency=0 link=no multicast=yes port=twisted pair
       resources: irq:16 memory:d1830000-d183ffff memory:d1840000-d184ffff memory:9fb00000-9fb007ff
  *-generic
       description: Wireless interface
       product: Illegal Vendor ID
       vendor: Illegal Vendor ID
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: wlp3s0
       version: ff
       serial: e8:39:df:f6:ba:f0
       width: 32 bits
       clock: 66MHz
       capabilities: bus_master vga_palette cap_list ethernet physical wireless
       configuration: broadcast=yes driver=wl0 driverversion=6.30.223.271 (r587334) latency=255 maxlatency=255 mingnt=255 multicast=yes wireless=IEEE 802.11
       resources: irq:17 memory:d1900000-d1903fff
  *-network
       description: Ethernet interface
       physical id: 3
       logical name: enp0s29u1u2
       serial: ee:e9:39:65:01:dd
       capabilities: ethernet physical
       configuration: broadcast=yes driver=rndis_host driverversion=22-Aug-2005 firmware=RNDIS device ip=192.168.42.187 link=yes multicast=yes

$>lspci | grep -i net
02:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57785 Gigabit Ethernet PCIe (rev 10)
03:00.0 Network controller: Broadcom Corporation BCM43225 802.11b/g/n (rev ff)

$>lsusb
Bus 002 Device 005: ID 0458:6001 KYE Systems Corp. (Mouse Systems) GF3000F Ethernet Adapter
Bus 002 Device 004: ID 17ef:7436 Lenovo 
Bus 002 Device 006: ID 2357:0109  
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 04fc:2800 Sunplus Technology Co., Ltd 
Bus 001 Device 003: ID 0a5c:219a Broadcom Corp. 
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

如果我拔掉外​​部适配器,该2357:0109字段就会消失。

$>ifconfig
enp0s29u1u2 Link encap:Ethernet  HWaddr ee:e9:39:65:01:dd  
          inet addr:192.168.42.187  Bcast:192.168.42.255  Mask:255.255.255.0
          inet6 addr: fe80::c40d:26ec:37db:94d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6841 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6755 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4928868 (4.9 MB)  TX bytes:1922765 (1.9 MB)

enp2s0f0  Link encap:Ethernet  HWaddr b8:70:f4:ae:a6:b6  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:16 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:685 errors:0 dropped:0 overruns:0 frame:0
          TX packets:685 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:61365 (61.3 KB)  TX bytes:61365 (61.3 KB)

wlp3s0    Link encap:Ethernet  HWaddr e8:39:df:f6:ba:f0  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:17 

$>iwconfig
wlp3s0    IEEE 802.11  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

enp0s29u1u2  no wireless extensions.

lo        no wireless extensions.

enp2s0f0  no wireless extensions.

$>iwlist scan
wlp3s0    No scan results

enp0s29u1u2  Interface doesn't support scanning.

lo        Interface doesn't support scanning.

enp2s0f0  Interface doesn't support scanning.

$>lsb_release -d
Description:    Ubuntu 16.04.3 LTS
$>uname -mr
4.13.0-32-generic x86_64

以太网工作正常。

答案1

首先,您链接的驱动程序文件具体内容如下:Linux(内核2.6.18~3.10.10)。您正在运行较新的 4.13.0-xx。您下载的文件永远无法编译。

接下来,我们看到您安装了 ndiswrapper 来尝试使设备运行。请将其删除。

sudo apt purge ndiswrapper*

您可以使用以下方式安装设备的驱动程序:

sudo apt-get update
sudo apt-get install git
git clone https://github.com/Mange/rtl8192eu-linux-driver.git
cd rtl8192eu-linux-driver
sudo dkms add .
sudo dkms install rtl8192eu/1.0
sudo modprobe 8192eu

最后,我们发现您的内部 Broadcom 设备由于硬件阻塞而无法工作;也就是说,开关或组合键设置为禁用无线。USB 也有可能被阻塞,在这种情况下,您需要找到并切换无线开关,如果您想使用 USB,请将内部无线驱动程序列入黑名单。

编辑:为了防止与内部设备可能出现的冲突,我建议我们将驱动程序列入黑名单:

sudo -i
echo "blacklist wl"  >>  /etc/modprobe.d/blacklist.conf
echo "blacklist rtl8xxxu"  >>  /etc/modprobe.d/blacklist.conf
exit

有什么改进吗?如果您需要粘贴 dmesg,我建议:http://paste.ubuntu.com并提供链接给我们。

答案2

我刚刚从制造商页面下载了最新的驱动程序https://www.tp-link.com/us/support/download/tl-wn823n/#Driver

我使用终端中的以下命令安装了驱动程序:

cd [unzip-directory]  
sudo make clean  
sudo make  
sudo make install  

重启后,适配器工作正常。

马丁

相关内容