Ubuntu 16.04 笔记本E470 无法支持wifi 问题

笔记本装14.04 就不支持wifi 和audio  ,升级到16.04 audio 好了,但是wifi 还是不行,

网上看了很多文章 说要升级内核,所以升级了好几个内核(折腾了好几次 不是所有的内核都可以顺利升级) 最后 从4.4 升到了4.18

( 从这个网站上下载 deb http://kernel.ubuntu.com/~kernel-ppa/mainline/ 来升级内核 )

但是 网上下下来的源码编译出错了,https://github.com/douding002/rtl8821ce

/home/../rtl8821ce/rtl8821ce/include/osdep_service_linux.h:295:8: error: ‘_tim

然后才发现下文 找到了正确的驱动包 (之前 浪费了很多时间 想解决那个编译错误 )

https://blog.csdn.net/qq_33042187/article/details/80462412

https://github.com/endlessm/linux/tree/master/drivers/net/wireless/rtl8821ce 

还有 http://forum.ubuntu.org.cn/viewtopic.php?f=116&t=485936 这个论坛上下的才是我最后用的代码

直接改 export TopDIR ?= 为源码本地目录

make 

-------------------------------

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.18.0-041800-generic/build M=/home/xc/rtl8821ce  modules
make[1]: Entering directory '/usr/src/linux-headers-4.18.0-041800-generic'
Makefile:938: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"
  CC [M]  /home/xc/rtl8821ce/core/rtw_cmd.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_security.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_debug.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_io.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_ioctl_query.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_ioctl_set.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_ieee80211.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_mlme.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_mlme_ext.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_mi.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_wlan_util.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_vht.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_pwrctrl.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_rf.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_recv.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_sta_mgt.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_ap.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_xmit.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_p2p.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_tdls.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_br_ext.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_iol.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_sreset.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_btcoex_wifionly.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_btcoex.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_beamforming.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_odm.o
  CC [M]  /home/xc/rtl8821ce/core/efuse/rtw_efuse.o
  CC [M]  /home/xc/rtl8821ce/os_dep/osdep_service.o
  CC [M]  /home/xc/rtl8821ce/os_dep/linux/os_intfs.o
  CC [M]  /home/xc/rtl8821ce/os_dep/linux/pci_intf.o
  CC [M]  /home/xc/rtl8821ce/os_dep/linux/pci_ops_linux.o
  CC [M]  /home/xc/rtl8821ce/os_dep/linux/ioctl_linux.o
  CC [M]  /home/xc/rtl8821ce/os_dep/linux/xmit_linux.o
  CC [M]  /home/xc/rtl8821ce/os_dep/linux/mlme_linux.o
  CC [M]  /home/xc/rtl8821ce/os_dep/linux/recv_linux.o
  CC [M]  /home/xc/rtl8821ce/os_dep/linux/ioctl_cfg80211.o
  CC [M]  /home/xc/rtl8821ce/os_dep/linux/rtw_cfgvendor.o
  CC [M]  /home/xc/rtl8821ce/os_dep/linux/wifi_regd.o
  CC [M]  /home/xc/rtl8821ce/os_dep/linux/rtw_android.o
  CC [M]  /home/xc/rtl8821ce/os_dep/linux/rtw_proc.o
  CC [M]  /home/xc/rtl8821ce/os_dep/linux/ioctl_mp.o
  CC [M]  /home/xc/rtl8821ce/hal/hal_intf.o
  CC [M]  /home/xc/rtl8821ce/hal/hal_com.o
  CC [M]  /home/xc/rtl8821ce/hal/hal_com_phycfg.o
  CC [M]  /home/xc/rtl8821ce/hal/hal_phy.o
  CC [M]  /home/xc/rtl8821ce/hal/hal_dm.o
  CC [M]  /home/xc/rtl8821ce/hal/hal_btcoex_wifionly.o
  CC [M]  /home/xc/rtl8821ce/hal/hal_btcoex.o
  CC [M]  /home/xc/rtl8821ce/hal/hal_mp.o
  CC [M]  /home/xc/rtl8821ce/hal/hal_mcc.o
  CC [M]  /home/xc/rtl8821ce/hal/hal_hci/hal_pci.o
  CC [M]  /home/xc/rtl8821ce/hal/led/hal_pci_led.o
  CC [M]  /home/xc/rtl8821ce/hal/hal_halmac.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/rtl8821c_halinit.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/rtl8821c_mac.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/rtl8821c_cmd.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/rtl8821c_phy.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/rtl8821c_dm.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/rtl8821c_ops.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/hal8821c_fw.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/pci/rtl8821ce_halinit.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/pci/rtl8821ce_halmac.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/pci/rtl8821ce_io.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/pci/rtl8821ce_xmit.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/pci/rtl8821ce_recv.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/pci/rtl8821ce_led.o
  CC [M]  /home/xc/rtl8821ce/hal/rtl8821c/pci/rtl8821ce_ops.o
  CC [M]  /home/xc/rtl8821ce/hal/efuse/rtl8821c/HalEfuseMask8821C_PCIE.o
  CC [M]  /home/xc/rtl8821ce/hal/halmac/halmac_api.o
  CC [M]  /home/xc/rtl8821ce/hal/halmac/halmac_88xx/halmac_api_88xx.o
  CC [M]  /home/xc/rtl8821ce/hal/halmac/halmac_88xx/halmac_func_88xx.o
  CC [M]  /home/xc/rtl8821ce/hal/halmac/halmac_88xx/halmac_api_88xx_usb.o
  CC [M]  /home/xc/rtl8821ce/hal/halmac/halmac_88xx/halmac_api_88xx_sdio.o
  CC [M]  /home/xc/rtl8821ce/hal/halmac/halmac_88xx/halmac_api_88xx_pcie.o
  CC [M]  /home/xc/rtl8821ce/hal/halmac/halmac_88xx/halmac_8821c/halmac_8821c_pwr_seq.o
  CC [M]  /home/xc/rtl8821ce/hal/halmac/halmac_88xx/halmac_8821c/halmac_api_8821c.o
  CC [M]  /home/xc/rtl8821ce/hal/halmac/halmac_88xx/halmac_8821c/halmac_func_8821c.o
  CC [M]  /home/xc/rtl8821ce/hal/halmac/halmac_88xx/halmac_8821c/halmac_api_8821c_usb.o
  CC [M]  /home/xc/rtl8821ce/hal/halmac/halmac_88xx/halmac_8821c/halmac_api_8821c_sdio.o
  CC [M]  /home/xc/rtl8821ce/hal/halmac/halmac_88xx/halmac_8821c/halmac_api_8821c_pcie.o
  CC [M]  /home/xc/rtl8821ce/hal/halmac/halmac_88xx/halmac_8821c/halmac_8821c_phy.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_debug.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_antdiv.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_antdect.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_interface.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_hwconfig.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/halphyrf_ce.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_dig.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_pathdiv.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_rainfo.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_dynamicbbpowersaving.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_powertracking_ce.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_dynamictxpower.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_adaptivity.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_cfotracking.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_noisemonitor.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_acs.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_beamforming.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_dfs.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/txbf/halcomtxbf.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/txbf/haltxbfinterface.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/txbf/phydm_hal_txbf_api.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_adc_sampling.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_kfree.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_ccx.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/phydm_psd.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8723bwifionly.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8822bwifionly.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8821cwifionly.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8192e1ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8192e2ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8723b1ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8723b2ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8812a1ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8812a2ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8821a1ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8821a2ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8703b1ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8723d1ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8723d2ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8822b1ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8822b2ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8821c1ant.o
  CC [M]  /home/xc/rtl8821ce/hal/btc/halbtc8821c2ant.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/rtl8821c/halhwimg8821c_bb.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/rtl8821c/halhwimg8821c_mac.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/rtl8821c/halhwimg8821c_rf.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/rtl8821c/phydm_hal_api8821c.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/rtl8821c/phydm_regconfig8821c.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/rtl8821c/halphyrf_8821c.o
  CC [M]  /home/xc/rtl8821ce/hal/phydm/rtl8821c/phydm_iqk_8821c.o
  CC [M]  /home/xc/rtl8821ce/platform/platform_ops.o
  CC [M]  /home/xc/rtl8821ce/core/rtw_mp.o
  LD [M]  /home/xc/rtl8821ce/8821ce.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/xc/rtl8821ce/8821ce.mod.o
  LD [M]  /home/xc/rtl8821ce/8821ce.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.18.0-041800-generic'
----------------------------------------------------------------

sudo make install 

----------------------------------------------------------------

install -p -m 644 8821ce.ko  /lib/modules/4.18.0-041800-generic/kernel/drivers/net/wireless/
/sbin/depmod -a 4.18.0-041800-generic
-------------------------------------------------------------

sudo modprobe -a 8821ce

然后wifi就好了 神奇!(只是此驱动休眠下去 需要重新卸载 再加载模块 否则wifi 不能正常连接)

 

升级内核参考:

https://blog.csdn.net/CSDN_duomaomao/article/details/77668946

你可能感兴趣的:(ubuntu,environment,linux,driver)