1. 使用你的内核并编译rtl8822be

1. 使用你的内核并编译rtl8822be

两者都可以在 Windows 上运行,但不能在 Ubuntu 14.04 LTS 上运行

  • 内核 4.4.0-137-通用#163~ 14.04.1-Ubuntu SMP x86_64
  • GRUB 选项:ro quiet splash vt.handoff=7
  • 被认定为Realtek RTL8822BE 802.11ac PCIe 无线网络适配器

如果我进入设置,选择蓝牙并尝试启用它,但什么也不会发生。

$ lspci -knn | grep -i net -A3 
02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
    Subsystem: ASUSTeK Computer Inc. Device [1043:200f]
    Kernel driver in use: r8169
03:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:b822]
    Subsystem: AzureWave Device [1a3b:2950]

$lsmod | grep rtl
btrtl                  16384  1 btusb
bluetooth             540672  17 
btrtl,hci_uart,btintel,btqca,bnep,btbcm,rfcomm,btusb

$Error when turning laptop on Ubuntu
[    23.804997] tpm_crb MSFT0101:00: [Firmware Bug]: ACPI region does not cover t
sponse buffer. [mem 0xfed400000-0xfed4087f flags 0x201] vs fed 40080 f80
[    23.805039] tpm_crb MSFT0101:00: [Firmware Bug]: ACPI region does not cover t
sponse buffer. [mem 0xfed400000-0xfed4087f flags 0x201] vs fed 40080 f80
[    24.790248] r8822be: Selected firmware is not available

$dmesg --level=err,warn
[    0.044039] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
[    0.044040] ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)
[    0.625867] (NULL device *): hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    0.640341] i8042: PNP: PS/2 appears to have AUX port disabled, if 
this is incorrect please boot with i8042.nopnp
[    0.725243] r8169 0000:02:00.0: can't disable ASPM; OS doesn't have ASPM control
[   17.963317] (NULL device *): hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[   18.048745] tpm_crb MSFT0101:00: [Firmware Bug]: ACPI region does not cover the entire command/response buffer. [mem 0xfed40000-0xfed4087f flags 0x201] vs fed40080 f80
[   18.048816] tpm_crb MSFT0101:00: [Firmware Bug]: ACPI region does not cover the entire command/response buffer. [mem 0xfed40000-0xfed4087f flags 0x201] vs fed40080 f80
[   18.628287] i2c_hid i2c-ELAN1200:00: i2c-ELAN1200:00 supply vdd not found, using dummy regulator
[   18.718771] i915 0000:00:02.0: Direct firmware load for i915/kbl_dmc_ver1_01.bin failed with error -2
[   19.295390] r8822be: module is from the staging directory, the quality is unknown, you have been warned.
[   19.755793] uvcvideo 1-6:1.0: Entity type for entity Extension 4 was not initialized!
[   19.755795] uvcvideo 1-6:1.0: Entity type for entity Processing 2 was not initialized!
[   19.755795] uvcvideo 1-6:1.0: Entity type for entity Camera 1 was not initialized!
[   23.734167] init: failsafe main process (713) killed by TERM signal
[   24.975378] init: cups main process (834) killed by HUP signal
[   24.975386] init: cups main process ended, respawning
[   25.655309] init: samba-ad-dc main process (888) terminated with status 1
[   27.876713] init: mongodb main process (995) terminated with status 100
[   29.044999] init: plymouth-upstart-bridge main process ended, respawning
[   29.048690] init: plymouth-upstart-bridge main process (1176) terminated with status 1
[   29.048698] init: plymouth-upstart-bridge main process ended, respawning
[   34.387832] r8822be: [ERR]Pwr cmd polling timeout!!
[   34.387835] r8822be: [ERR]Pwr cmd offset : 5!!
[   34.387836] r8822be: [ERR]Pwr cmd value : 0!!
[   34.387837] r8822be: [ERR]Pwr cmd msk : 2!!
[   34.387837] r8822be: [ERR]Read offset = 5 value = 2!!
[   34.387838] r8822be: [Err]pwr sub seq parser fail, status = 0x28!
[   34.387839] r8822be: Handle power off cmd error
[   50.999015] r8822be: halmac_init_hal failed
[   50.999137] r8822be: halmac_init_hal failed
[   50.999254] r8822be: halmac_init_hal failed
[   50.999371] r8822be: halmac_init_hal failed
[   50.999488] r8822be: halmac_init_hal failed
[   50.999604] r8822be: halmac_init_hal failed
[   50.999720] r8822be: halmac_init_hal failed
[   50.999854] r8822be: halmac_init_hal failed
[   50.999969] r8822be: halmac_init_hal failed
[   51.000084] r8822be: halmac_init_hal failed
[   51.000116] return H2C cmd because of Fw download fail!!!
[   51.000131] ------------[ cut here ]------------
[   51.000141] WARNING: CPU: 3 PID: 1103 at /home/kernel/COD/linux/drivers/staging/rtlwifi/rtl8822be/fw.c:239 rtl8822be_fill_h2c_cmd+0x1ac/0x610 [r8822be]
[   51.000142] Modules linked in: bnep rfcomm binfmt_misc nls_iso8859_1 intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel snd_hda_codec_hdmi snd_soc_skl snd_soc_skl_ipc snd_soc_sst_ipc snd_soc_sst_dsp snd_hda_ext_core kvm snd_soc_sst_match snd_soc_core irqbypass snd_compress ac97_bus snd_pcm_dmaengine crct10dif_pclmul crc32_pclmul asus_nb_wmi ghash_clmulni_intel joydev snd_hda_codec_generic pcbc snd_hda_intel asus_wmi hid_multitouch spi_pxa2xx_platform wmi_bmof snd_hda_codec aesni_intel sparse_keymap 8250_dw aes_x86_64 crypto_simd xpad ff_memless snd_hda_core glue_helper uvcvideo snd_hwdep snd_pcm cryptd videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core videodev media snd_seq_midi snd_seq_midi_event arc4 snd_rawmidi intel_cstate snd_seq snd_seq_device intel_rapl_perf
[   51.000161]  snd_timer hci_uart btusb r8822be(C) serdev btrtl btbcm btqca btintel bluetooth mac80211 snd cfg80211 ecdh_generic input_leds soundcore i915 serio_raw i2c_hid wmi drm_kms_helper mac_hid drm int3403_thermal i2c_algo_bit fb_sys_fops syscopyarea sysfillrect sysimgblt video idma64 virt_dma processor_thermal_device int340x_thermal_zone pinctrl_sunrisepoint acpi_pad pinctrl_intel parport_pc asus_wireless shpchp intel_lpss_pci intel_lpss_acpi acpi_als kfifo_buf industrialio intel_soc_dts_iosf ppdev tpm_crb lp int3400_thermal parport intel_pch_thermal acpi_thermal_rel mei_me intel_lpss mei hid_generic usbhid hid r8169 ahci mii libahci
[   51.000183] CPU: 3 PID: 1103 Comm: wpa_supplicant Tainted: G         C      4.14.0-041400-generic #201711122031
[   51.000184] Hardware name: ASUSTeK COMPUTER INC. X405UA/X405UA, BIOS X405UA.203 05/05/2017
[   51.000184] task: ffff8e07c0561780 task.stack: ffffb45241248000
[   51.000190] RIP: 0010:rtl8822be_fill_h2c_cmd+0x1ac/0x610 [r8822be]
[   51.000191] RSP: 0018:ffffb4524124b800 EFLAGS: 00010286
[   51.000192] RAX: 000000000000002d RBX: ffff8e07d2281560 RCX: 0000000000000006
[   51.000192] RDX: 0000000000000000 RSI: 0000000000000086 RDI: ffff8e07ded8dc90
[   51.000193] RBP: ffffb4524124b878 R08: 0000000000000001 R09: 0000000000000386
[   51.000193] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8e07d1450600
[   51.000194] R13: ffff8e07d2280780 R14: ffff8e07d22815c8 R15: ffff8e07d22810e8
[   51.000195] FS:  00007f3273897740(0000) GS:ffff8e07ded80000(0000) knlGS:0000000000000000
[   51.000195] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   51.000196] CR2: 0000555a6c2e3198 CR3: 00000001c45e9003 CR4: 00000000003606e0
[   51.000196] Call Trace:
[   51.000205]  halbtc_fill_h2c_cmd+0x29/0x30 [r8822be]
[   51.000212]  halbtc8822b1ant_query_bt_info+0x46/0xa0 [r8822be]
[   51.000218]  ex_btc8822b1ant_ips_notify+0xa4/0x150 [r8822be]
[   51.000224]  exhalbtc_ips_notify+0x5a/0x60 [r8822be]
[   51.000231]  rtl_btc_ips_notify+0x26/0x50 [r8822be]
[   51.000236]  rtl_ips_nic_on+0xac/0xc0 [r8822be]
[   51.000240]  rtl_op_config+0x23a/0x470 [r8822be]
[   51.000250]  ieee80211_hw_config+0x1c0/0x350 [mac80211]
[   51.000258]  ieee80211_recalc_idle+0x22/0x30 [mac80211]
[   51.000265]  __ieee80211_start_scan+0x1b6/0x6d0 [mac80211]
[   51.000272]  ieee80211_request_scan+0x30/0x50 [mac80211]
[   51.000280]  ieee80211_scan+0x69/0x90 [mac80211]
[   51.000290]  nl80211_trigger_scan+0x67d/0x7e0 [cfg80211]
[   51.000292]  genl_family_rcv_msg+0x1f5/0x3e0
[   51.000294]  genl_rcv_msg+0x4c/0x90
[   51.000295]  ? genl_family_rcv_msg+0x3e0/0x3e0
[   51.000296]  netlink_rcv_skb+0x91/0x130
[   51.000297]  genl_rcv+0x28/0x40
[   51.000298]  netlink_unicast+0x18e/0x220
[   51.000299]  netlink_sendmsg+0x2c5/0x3c0
[   51.000301]  sock_sendmsg+0x38/0x50
[   51.000302]  ___sys_sendmsg+0x29a/0x2f0
[   51.000305]  ? __fpu__restore_sig+0x96/0x470
[   51.000306]  __sys_sendmsg+0x54/0x90
[   51.000308]  ? __sys_sendmsg+0x54/0x90
[   51.000309]  SyS_sendmsg+0x12/0x20
[   51.000311]  entry_SYSCALL_64_fastpath+0x1e/0xa9
[   51.000312] RIP: 0033:0x7f3272127160
[   51.000312] RSP: 002b:00007fff09bb3dc8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
[   51.000313] RAX: ffffffffffffffda RBX: 000000000253c120 RCX: 00007f3272127160
[   51.000314] RDX: 0000000000000000 RSI: 00007fff09bb3df0 RDI: 0000000000000007
[   51.000314] RBP: 000000000253ee00 R08: 0000000000000001 R09: 000000000000000f
[   51.000315] R10: 00007f32723e8fe0 R11: 0000000000000246 R12: 00007fff09bb3e40
[   51.000315] R13: 0000000002541b50 R14: 00000000000000d7 R15: 000000000253c610
[   51.000316] Code: 00 00 00 48 89 c6 75 b1 48 89 c6 4c 89 e7 e8 ec db 68 e6 e9 5b ff ff ff 48 c7 c7 70 5d 91 c0 c6 05 65 df 09 00 01 e8 25 b2 e3 e5 <0f> ff e9 92 fe ff ff c6 83 14 09 00 00 01 48 89 c6 4c 89 e7 e8 
[   51.000334] ---[ end trace 1353df30adbe2664 ]---
[   56.701963] r8822be: [ERR]Pwr cmd polling timeout!!
[   56.701966] r8822be: [ERR]Pwr cmd offset : 5!!
[   56.701967] r8822be: [ERR]Pwr cmd value : 0!!
[   56.701968] r8822be: [ERR]Pwr cmd msk : 2!!
[   56.701968] r8822be: [ERR]Read offset = 5 value = 2!!
[   56.701969] r8822be: [Err]pwr sub seq parser fail, status = 0x28!
[   56.701970] r8822be: Handle power off cmd error
[   83.982092] r8822be: halmac_init_hal failed
[   83.982213] r8822be: halmac_init_hal failed
[   83.982332] r8822be: halmac_init_hal failed
[   83.982449] r8822be: halmac_init_hal failed
[   83.982567] r8822be: halmac_init_hal failed
[   83.982683] r8822be: halmac_init_hal failed
[   83.982799] r8822be: halmac_init_hal failed
[   83.982916] r8822be: halmac_init_hal failed
[   83.983032] r8822be: halmac_init_hal failed
[   83.983149] r8822be: halmac_init_hal failed
[   89.860907] r8822be: [ERR]Pwr cmd polling timeout!!
[   89.860919] r8822be: [ERR]Pwr cmd offset : 5!!
[   89.860924] r8822be: [ERR]Pwr cmd value : 0!!
[   89.860927] r8822be: [ERR]Pwr cmd msk : 2!!
[   89.860930] r8822be: [ERR]Read offset = 5 value = 2!!
[   89.860933] r8822be: [Err]pwr sub seq parser fail, status = 0x28!
[   89.860937] r8822be: Handle power off cmd error
[  126.960076] r8822be: halmac_init_hal failed
[  126.960212] r8822be: halmac_init_hal failed
[  126.960343] r8822be: halmac_init_hal failed
[  126.960474] r8822be: halmac_init_hal failed
[  126.960604] r8822be: halmac_init_hal failed
[  126.960735] r8822be: halmac_init_hal failed
[  126.960866] r8822be: halmac_init_hal failed
[  126.960996] r8822be: halmac_init_hal failed
[  126.961153] r8822be: halmac_init_hal failed
[  126.961290] r8822be: halmac_init_hal failed
[  132.887637] r8822be: [ERR]Pwr cmd polling timeout!!
[  132.887640] r8822be: [ERR]Pwr cmd offset : 5!!
[  132.887641] r8822be: [ERR]Pwr cmd value : 0!!
[  132.887642] r8822be: [ERR]Pwr cmd msk : 2!!
[  132.887643] r8822be: [ERR]Read offset = 5 value = 2!!
[  132.887643] r8822be: [Err]pwr sub seq parser fail, status = 0x28!
[  132.887644] r8822be: Handle power off cmd error
[  179.934289] r8822be: halmac_init_hal failed
[  179.934452] r8822be: halmac_init_hal failed
[  179.934604] r8822be: halmac_init_hal failed
[  179.934760] r8822be: halmac_init_hal failed
[  179.934911] r8822be: halmac_init_hal failed
[  179.935063] r8822be: halmac_init_hal failed
[  179.935213] r8822be: halmac_init_hal failed
[  179.935364] r8822be: halmac_init_hal failed
[  179.935515] r8822be: halmac_init_hal failed
[  179.935664] r8822be: halmac_init_hal failed
[  186.002951] r8822be: [ERR]Pwr cmd polling timeout!!
[  186.002958] r8822be: [ERR]Pwr cmd offset : 5!!
[  186.002960] r8822be: [ERR]Pwr cmd value : 0!!
[  186.002962] r8822be: [ERR]Pwr cmd msk : 2!!
[  186.002963] r8822be: [ERR]Read offset = 5 value = 2!!
[  186.002965] r8822be: [Err]pwr sub seq parser fail, status = 0x28!
[  186.002967] r8822be: Handle power off cmd error
[  242.905678] r8822be: halmac_init_hal failed
[  242.905827] r8822be: halmac_init_hal failed
[  242.905970] r8822be: halmac_init_hal failed
[  242.906110] r8822be: halmac_init_hal failed
[  242.906250] r8822be: halmac_init_hal failed
[  242.906389] r8822be: halmac_init_hal failed
[  242.906528] r8822be: halmac_init_hal failed
[  242.906670] r8822be: halmac_init_hal failed
[  242.906809] r8822be: halmac_init_hal failed
[  242.906949] r8822be: halmac_init_hal failed
[  248.988222] r8822be: [ERR]Pwr cmd polling timeout!!
[  248.988234] r8822be: [ERR]Pwr cmd offset : 5!!
[  248.988238] r8822be: [ERR]Pwr cmd value : 0!!
[  248.988241] r8822be: [ERR]Pwr cmd msk : 2!!
[  248.988245] r8822be: [ERR]Read offset = 5 value = 2!!
[  248.988248] r8822be: [Err]pwr sub seq parser fail, status = 0x28!
[  248.988252] r8822be: Handle power off cmd error

$ lsmod | grep 8822
r8822be               839680  0 
mac80211              778240  1 r8822be
cfg80211              614400  2 mac80211,r8822be

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

$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 88:d7:f6:da:78:e2 brd ff:ff:ff:ff:ff:ff
3: wlan1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
link/ether 40:9f:38:28:41:a9 brd ff:ff:ff:ff:ff:ff

$lspci -knn | grep -i net -A3

02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
Subsystem: ASUSTeK Computer Inc. Device [1043:200f]
Kernel driver in use: r8169
03:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:b822] (rev ff)
Kernel driver in use: r8822be

$make
make -C /lib/modules/4.14.0-041400-generic/build 
M=/home/julio/rtlwifi-next modules
make[1]: Entering directory `/usr/src/linux-headers-4.14.0-041400-generic'
CC [M]  /home/julio/rtlwifi-next/rtl8188ee/trx.o
/home/julio/rtlwifi-next/rtl8188ee/trx.c: In function ‘rtl88ee_rx_query_desc’:
/home/julio/rtlwifi-next/rtl8188ee/trx.c:447:22: error: ‘RX_FLAG_40MHZ’ undeclared (first use in this function)
 rx_status->flag |= RX_FLAG_40MHZ;
                  ^
/home/julio/rtlwifi-next/rtl8188ee/trx.c:447:22: note: each undeclared identifier is reported only once for each function it appears in
/home/julio/rtlwifi-next/rtl8188ee/trx.c:450:22: error: ‘RX_FLAG_HT’ undeclared (first use in this function)
 rx_status->flag |= RX_FLAG_HT;
                  ^
make[3]: *** [/home/julio/rtlwifi-next/rtl8188ee/trx.o] Error 1
make[2]: *** [/home/julio/rtlwifi-next/rtl8188ee] Error 2
make[1]: *** [_module_/home/julio/rtlwifi-next] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-4.14.0-041400-generic'
make: *** [all] Error 2

答案1

1. 使用你的内核并编译rtl8822be

sudo apt install build-essential git
git clone https://github.com/rtlwifi-linux/rtlwifi-next
cd rtlwifi-next
make
sudo make install
sudo modprobe rtl8822be

来自的一些提示Ubuntu 论坛

第二个如果不对源代码做一点改动就无法编译。改动如下:添加行

#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS

在两个文件中:

  • wifi.h

    #ifndef __RTL_WIFI_H__
    #define __RTL_WIFI_H__
    
  • base.c

    #include lines
    

2.安装内核4.14和rtl8822固件

或者使用这个解决方案 其中包括内核更新!

主线内核不包含任何 Ubuntu 提供的驱动程序或补丁。它们不受支持且不适合用于生产。

请参阅此链接支持的内核,对于 Ubuntu 14.04.5 来说,最新也是最后一个内核是 4.4。

  1. 安装最新的 4.14 内核和驱动程序代码(来自说明这里

    wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14/linux-headers-4.14.0-041400_4.14.0-041400.201711122031_all.deb
    wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14/linux-headers-4.14.0-041400-generic_4.14.0-041400.201711122031_amd64.deb
    wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14/linux-image-4.14.0-041400-generic_4.14.0-041400.201711122031_amd64.deb
    
    sudo dpkg -i linux*.deb
    
  2. rtl8822befw.bin从以下位置下载固件文件这里

    wget https://github.com/wkennington/linux-firmware/raw/master/rtlwifi/rtl8822befw.bin
    

    矛盾的是,bin 与 realteak 驱动程序页面不同,并且似乎不起作用:

    # wget  https://github.com/rtlwifi-linux/rtlwifi-next/tree/master/firmware/rtlwifi/rtl8822befw.bin # non-working - use the one above
    
  3. 将其移入/lib/firmware/rtlwifi。请注意,较新的发行版可能已在此处包含此文件。

    sudo cp rtl8822befw.bin /lib/firmware/rtlwifi/
    
  4. 重启。


rtl8822be自内核 > 起受支持4.9-rc1 (看kconfig-v4.16)否则你必须手动编译它。

RTL8822BE是一款新的 Realtek wifi 和 BT 设备。特此添加对 BT 部分的支持。

由于此设备与大多数其他 Realtek BT 设备相似,因此变化很小。主要区别在于 8822BE 需要一个配置文件来启用和禁用功能。因此添加了代码来选择和加载此配置文件。虽然目前不需要,但为可能需要此类配置文件的其他设备添加了挂钩。

另一个变化是测试固件中包含的项目 ID 是否与硬件匹配的例程。由于项目 ID 不是连续的,继续使用数组中的位置作为 ID 的预期值将需要在表中添加额外的未使用条目,并且数组的任何后续重新排列都会破坏代码。为了解决这些问题,数组元素现在包含硬件 ID 和项目 ID 的预期值。

相关内容