tomaspinho / rtl8821ce

Other
1.58k stars 412 forks source link

Not working for tp-link AC600 archer T2E #273

Closed Spybull closed 2 years ago

Spybull commented 2 years ago

This is wi-fi PCIex card ships only with windows drivers. Drivers from this repo doesn't work. OS: Fedora 35 Kernel: Linux fedora 5.17.11-200.fc35.x86_64

dkms status
rtl8821ce/v5.5.2_34066.20200325, 5.17.11-200.fc35.x86_64, x86_64: installed

What can I do with this card?

dubhater commented 2 years ago

The output of lspci -nn may be helpful.

hirenchhatbar commented 2 years ago

I'm using Manjaro Linux and the driver doesn't work for me as well, below is the output of above command:

❯ lspci -nn 00:00.0 Host bridge [0600]: Intel Corporation 10th Gen Core Processor Host Bridge/DRAM Registers [8086:9b63] (rev 03) 00:02.0 VGA compatible controller [0300]: Intel Corporation CometLake-S GT2 [UHD Graphics 630] [8086:9bc8] (rev 03) 00:14.0 USB controller [0c03]: Intel Corporation Tiger Lake-H USB 3.2 Gen 2x1 xHCI Host Controller [8086:43ed] (rev 11) 00:14.2 RAM memory [0500]: Intel Corporation Tiger Lake-H Shared SRAM [8086:43ef] (rev 11) 00:16.0 Communication controller [0780]: Intel Corporation Tiger Lake-H Management Engine Interface [8086:43e0] (rev 11) 00:17.0 SATA controller [0106]: Intel Corporation Device [8086:43d2] (rev 11) 00:1b.0 PCI bridge [0604]: Intel Corporation Device [8086:43c4] (rev 11) 00:1c.0 PCI bridge [0604]: Intel Corporation Tiger Lake-H PCI Express Root Port #5 [8086:43bc] (rev 11) 00:1c.5 PCI bridge [0604]: Intel Corporation Device [8086:43bd] (rev 11) 00:1d.0 PCI bridge [0604]: Intel Corporation Tiger Lake-H PCI Express Root Port #9 [8086:43b0] (rev 11) 00:1f.0 ISA bridge [0601]: Intel Corporation Device [8086:4387] (rev 11) 00:1f.3 Audio device [0403]: Intel Corporation Device [8086:f0c8] (rev 11) 00:1f.4 SMBus [0c05]: Intel Corporation Tiger Lake-H SMBus Controller [8086:43a3] (rev 11) 00:1f.5 Serial bus controller [0c80]: Intel Corporation Tiger Lake-H SPI Controller [8086:43a4] (rev 11) 02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 16) 03:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:b821] 04:00.0 Non-Volatile memory controller [0108]: Micron/Crucial Technology P2 NVMe PCIe SSD [c0a9:540a] (rev 01)

Some more information: https://deviwiki.com/wiki/TP-LINK_Archer_T2E

dubhater commented 2 years ago

This driver doesn't recognise the PCI ID 10ec:b821. Interesting. The Windows driver knows it, and it was added to the rtw88 driver too.

To test if this driver can handle your device:

sudo modprobe 8821ce
echo "10ec b821" | sudo tee /sys/module/8821ce/drivers/pci:rtl8821ce/new_id

If it works, you can make it more permanent. (The above won't survive a reboot.) Open the file os_dep/linux/pci_intf.c and find these lines:

        {PCI_DEVICE(PCI_VENDER_ID_REALTEK, 0xC821), .driver_data = RTL8821C},
        {PCI_DEVICE(PCI_VENDER_ID_REALTEK, 0xC82A), .driver_data = RTL8821C},
        {PCI_DEVICE(PCI_VENDER_ID_REALTEK, 0xC82B), .driver_data = RTL8821C},

And add one more:

        {PCI_DEVICE(PCI_VENDER_ID_REALTEK, 0xB821), .driver_data = RTL8821C}, // <<< this one
        {PCI_DEVICE(PCI_VENDER_ID_REALTEK, 0xC821), .driver_data = RTL8821C},
        {PCI_DEVICE(PCI_VENDER_ID_REALTEK, 0xC82A), .driver_data = RTL8821C},
        {PCI_DEVICE(PCI_VENDER_ID_REALTEK, 0xC82B), .driver_data = RTL8821C},

Then recompile, reinstall, reboot.

hirenchhatbar commented 2 years ago

@dubhater I tried, seems like not working:

sudo modprobe 8821ce

It didn't give any output, it just run.

echo "10ec b821" | sudo tee /sys/module/8821ce/drivers/pci:rtl8821ce/new_id

tee: '/sys/module/8821ce/drivers/pci:rtl8821ce/new_id': Invalid argument

So, it seems like echoing id with new_id file failed(?)

Output of few more commands if that helps you figuring this out:

❯ dkms status
rtl8821ce/1.0.5.r140.gbe733dc, 5.18.12-3-MANJARO, x86_64: installed
❯ uname -r
5.18.12-3-MANJARO
❯ inxi -Nn
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    driver: r8169
  IF: enp2s0 state: up speed: 1000 Mbps duplex: full mac: d8:5e:d3:59:40:a3
  Device-2: Realtek driver: N/A
  IF-ID-1: br-0f61be3a18f2 state: down mac: 02:42:ee:02:97:88
  IF-ID-2: br-52f7a1c3b4e3 state: down mac: 02:42:d8:de:bd:69
  IF-ID-3: br-8155acf25fd8 state: down mac: 02:42:48:92:99:80
  IF-ID-4: br-ad791761e5dd state: up speed: 10000 Mbps duplex: unknown
    mac: 02:42:8d:d5:05:f8
  IF-ID-5: docker0 state: down mac: 02:42:6f:28:59:72
  IF-ID-6: veth15f08d0 state: up speed: 10000 Mbps duplex: full
    mac: 32:46:54:70:8a:ce
  IF-ID-7: veth296939f state: up speed: 10000 Mbps duplex: full
    mac: 56:d8:16:d1:01:ea
  IF-ID-8: veth388c4ae state: up speed: 10000 Mbps duplex: full
    mac: 4e:d2:24:e5:7c:1d
  IF-ID-9: veth3f795c8 state: up speed: 10000 Mbps duplex: full
    mac: 4a:3a:3d:59:44:90
  IF-ID-10: veth53ba9fd state: up speed: 10000 Mbps duplex: full
    mac: ee:ac:7b:d1:5f:d2
  IF-ID-11: vetha28d392 state: up speed: 10000 Mbps duplex: full
    mac: 02:85:75:fd:7b:2a
  IF-ID-12: vethdc28a2a state: up speed: 10000 Mbps duplex: full
    mac: 46:4f:d4:55:0f:c8
❯ lspci -nnk
00:00.0 Host bridge [0600]: Intel Corporation 10th Gen Core Processor Host Bridge/DRAM Registers [8086:9b63] (rev 03)
    DeviceName: Onboard - Other
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:5000]
    Kernel driver in use: skl_uncore
00:02.0 VGA compatible controller [0300]: Intel Corporation CometLake-S GT2 [UHD Graphics 630] [8086:9bc8] (rev 03)
    DeviceName: Onboard - Video
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:d000]
    Kernel driver in use: i915
    Kernel modules: i915
00:14.0 USB controller [0c03]: Intel Corporation Tiger Lake-H USB 3.2 Gen 2x1 xHCI Host Controller [8086:43ed] (rev 11)
    DeviceName: Onboard - Other
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:5007]
    Kernel driver in use: xhci_hcd
    Kernel modules: xhci_pci
00:14.2 RAM memory [0500]: Intel Corporation Tiger Lake-H Shared SRAM [8086:43ef] (rev 11)
    DeviceName: Onboard - Other
00:16.0 Communication controller [0780]: Intel Corporation Tiger Lake-H Management Engine Interface [8086:43e0] (rev 11)
    DeviceName: Onboard - Other
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:1c3a]
    Kernel driver in use: mei_me
    Kernel modules: mei_me
00:17.0 SATA controller [0106]: Intel Corporation Device [8086:43d2] (rev 11)
    DeviceName: Onboard - SATA
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:b005]
    Kernel driver in use: ahci
00:1b.0 PCI bridge [0604]: Intel Corporation Device [8086:43c4] (rev 11)
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:5001]
    Kernel driver in use: pcieport
00:1c.0 PCI bridge [0604]: Intel Corporation Tiger Lake-H PCI Express Root Port #5 [8086:43bc] (rev 11)
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:5001]
    Kernel driver in use: pcieport
00:1c.5 PCI bridge [0604]: Intel Corporation Device [8086:43bd] (rev 11)
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:5001]
    Kernel driver in use: pcieport
00:1d.0 PCI bridge [0604]: Intel Corporation Tiger Lake-H PCI Express Root Port #9 [8086:43b0] (rev 11)
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:5001]
    Kernel driver in use: pcieport
00:1f.0 ISA bridge [0601]: Intel Corporation Device [8086:4387] (rev 11)
    DeviceName: Onboard - Other
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:5001]
00:1f.3 Audio device [0403]: Intel Corporation Device [8086:f0c8] (rev 11)
    DeviceName: Onboard - Sound
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:a194]
    Kernel driver in use: snd_hda_intel
    Kernel modules: snd_hda_intel
00:1f.4 SMBus [0c05]: Intel Corporation Tiger Lake-H SMBus Controller [8086:43a3] (rev 11)
    DeviceName: Onboard - Other
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:5001]
    Kernel driver in use: i801_smbus
    Kernel modules: i2c_i801
00:1f.5 Serial bus controller [0c80]: Intel Corporation Tiger Lake-H SPI Controller [8086:43a4] (rev 11)
    DeviceName: Onboard - Other
    Kernel driver in use: intel-spi
    Kernel modules: spi_intel_pci
02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 16)
    Subsystem: Gigabyte Technology Co., Ltd Onboard Ethernet [1458:e000]
    Kernel driver in use: r8169
    Kernel modules: r8169
03:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:b821]
    Subsystem: Realtek Semiconductor Co., Ltd. Device [10ec:b821]
04:00.0 Non-Volatile memory controller [0108]: Micron/Crucial Technology P2 NVMe PCIe SSD [c0a9:540a] (rev 01)
    Subsystem: Micron/Crucial Technology P2 NVMe PCIe SSD [c0a9:540a]
    Kernel driver in use: nvme
    Kernel modules: nvme

If you need anything more my side, please let me know.

Thank you for taking time.

hirenchhatbar commented 2 years ago

@dubhater JFYI, /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor resume=UUID=7542b867-0dc4-482d-86d9-9023e1397a07 udev.log_priority=3"
dubhater commented 2 years ago

Yeah, I got the same error now that I tried it. I don't know what's up with that. The instruction comes from the kernel documentation: https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-pci

Just edit os_dep/linux/pci_intf.c and recompile the driver. It will probably work.

hirenchhatbar commented 2 years ago

@dubhater It worked flawlessly, thank you very much.

That one line change in os_dep/linux/pci_intf.c, remove driver, recompile, install and reboot did the job for me and really made my day - I can forget RJ45 :smile:.

Quite grateful for your prompt response and giving this a effort and time.

Feel free to close this for good.

Thank you again.