【Linux驱动】ThinkPad笔记本wifi模块rtl8821ce在ubuntu16.04的驱动(默认没有)

0、wifi模块型号

在win10下设备管理器中查看,型号为:Realtek 8821CE Wireless LAN 802.11ac PCI-E NIC
在这里插入图片描述

1、问题描述

在ThinkPad上安装win10+ubuntu16.04双系统后,在win10下wifi可以正常使用,但是在ubuntu下没有wifi列表。

2、原因查找

2.1 查看wifi状态

使用rfkill查看wifi和蓝牙状态,发现只有蓝牙设备(Bluetooth)没有wifi(Wireless LAN)

$ rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
	Soft blocked: no
	Hard blocked: no
1: hci0: Bluetooth
	Soft blocked: yes
	Hard blocked: no

正常情况下应该有wifi

2: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no

2.2 查看驱动是否安装

使用lshw -C network查看驱动是否安装,输出信息如下,其中network UNCLAIMED表示没有安装驱动。

$ lshw -C network
WARNING: you should run this program as super-user.
  *-network               
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: enp3s0
       version: 10
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168g-3_0.0.1 04/23/13 ip=192.168.31.120 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
       resources: irq:16 ioport:c000(size=256) memory:f1304000-f1304fff memory:f1300000-f1303fff
  *-network UNCLAIMED
       description: Network controller
       product: RTL8821CE 802.11ac PCIe Wireless Network Adapter
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:05:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: cap_list
       configuration: latency=0
       resources: ioport:b000(size=256) memory:f1100000-f110ffff

3、安装驱动

3.1解压后修改Makefile

驱动源码下载:https://download.csdn.net/download/u010168781/33182699
解压后,进入源码目录,将Makefile中第152行中代表顶层目录打变量TopDIR,根据改成源码所在目录。

export TopDIR ?= $(srctree)/drivers/net/wireless/rtl8821ce

3.2编译、安装、加载驱动:

make
sudo make install
sudo modprobe -a 8821ce

加载后是否要重启?
本人的电脑没有重启,也没有重新启动网络管理(service network-manager restart);
根据自己的情况,如果不行,可以尝试重启网络;还不行就重启电脑。

4、验证

使用命令lshw -C network查看驱动是否安装成功,没有UNCLAIMED字样,说明安装成功

$ sudo lshw -C network
  *-network               
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: enp3s0
       version: 10
       serial: e8:6a:64:d7:1b:53
       size: 10Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168g-3_0.0.1 04/23/13 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:16 ioport:c000(size=256) memory:f1304000-f1304fff memory:f1300000-f1303fff
  *-network
       description: Wireless interface
       product: RTL8821CE 802.11ac PCIe Wireless Network Adapter
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:05:00.0
       logical name: wlp5s0
       version: 00
       serial: 3c:91:80:41:9e:4b
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=rtl8821ce ip=192.168.31.142 latency=0 multicast=yes wireless=IEEE 802.11bgn
       resources: irq:141 ioport:b000(size=256) memory:f1100000-f110ffff

再次使用== rfkill list==来查看wifi状况

$ rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
	Soft blocked: no
	Hard blocked: no
1: hci0: Bluetooth
	Soft blocked: yes
	Hard blocked: no
2: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no

5、尝试过的,无效打方法如下

sudo apt-get purge bcmwl-kernel-source(无法解决)

Guess you like

Origin blog.csdn.net/u010168781/article/details/120794596