OpenWrt Forum Archive

Topic: Adding support for RTL8812AE on x86 (64), Chaos Calmer RC2

The content of this topic has been archived on 10 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello guys:
I built an openwrt box, using an x86 64 bit processor, and I bought a rtl8812ae wireless card. However I noticed there is no driver for this chip in the x86 Chaos Calmer RC2.

I know there is a driver for this chip on the https://github.com/openwrt/bcm63xx-next … /rtl8821ae code repository, and for sure this chipset is supported on the vanilla x86 kernel.

Any help on how to create/add this package. I tried to follow this but I did not work well.
http://wiki.openwrt.org/doc/devel/packages

Thanks in advance.

Hi

a of commit 0c81733 the driver is already in vanilla kernel, around v3.17 I think.

You need only to modify the Makefile for building the kernel modules in openwrt

I am working to get this done, however I managed to create an empty package, and some how it seems that ALL the packages with source on SourceForge are failing (did SF change its url processing scheme???), I will post when I have more news or I am about to quit

News:
Managed to add driver via mac80211. yeah yeah smile cool

I still need to deploy my image and see if it really works.

Btw, how can I submit code and/or have a code review for this smile

Ran into this :'(

[  118.896233] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not read
[  119.053655] CPU: 0 PID: 2811 Comm: hostapd Not tainted 3.18.18 #4
[  119.053938] task: ffff8801198d4a40 ti: ffff8800d435c000 task.ti: ffff8800d435c000
[  119.054299] RIP: 0010:[<ffffffffa030c83c>]  [<ffffffffa030c83c>] rtl_get_tcb_desc+0x7c/0x630 [rtlwifi]
[  119.054767] RSP: 0018:ffff8800d435f788  EFLAGS: 00010086
[  119.055020] RAX: 0000000000000004 RBX: 0000000000000000 RCX: 0000000000000000
[  119.055329] RDX: ffff8800d61325f8 RSI: ffff8800d67ab028 RDI: ffff8800d6130d40
[  119.055639] RBP: ffff8800d6130d40 R08: 0000000000000000 R09: 0000000000000000
[  119.055948] R10: ffff8800d67ab030 R11: 0000000000000004 R12: ffff8800d67ab028
[  119.056257] R13: 0000000000000000 R14: ffff8800d41920e0 R15: 0000000000000080
[  119.056567] FS:  00007f12c7bad6a0(0000) GS:ffff88011ec00000(0000) knlGS:0000000000000000
[  119.056949] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  119.057215] CR2: 0000000000000006 CR3: 00000000d4300000 CR4: 00000000000407f0
[  119.057524] Stack:
[  119.057673]  0000000000000080 ffff8800d6132140 0000000000000c00 ffff8800d678d000
[  119.058202]  ffff8800d67ab000 0000000000000000 ffff8800d6132140 ffff8800d41920e0
[  119.058730]  ffff8800d6130d40 ffffffffa0348212 ffff8800d41920e0 ffff8800d65348c0
[  119.059258] Call Trace:
[  119.059429]  [<ffffffffa0348212>] ? rtl8821ae_tx_fill_desc+0xa2/0x930 [rtl8821ae]
[  119.059795]  [<ffffffffa032d1ba>] ? rtl_pci_reset_trx_ring+0x20ea/0x2500 [rtl_pci]
[  119.060162]  [<ffffffffa030ffbf>] ? rtl_cmd_send_packet+0xdbf/0x1920 [rtlwifi]
[  119.060524]  [<ffffffffa0297b01>] ? ieee80211_csa_finish+0x38f1/0x3f40 [mac80211]
[  119.060891]  [<ffffffffa024fa1f>] ? cfg80211_ch_switch_notify+0x243f/0x2520 [cfg80211]
[  119.061271]  [<ffffffff8137116d>] ? genl_family_rcv_msg+0x27d/0x2f0
[  119.061553]  [<ffffffff8137124d>] ? genl_rcv_msg+0x6d/0xa0
[  119.061811]  [<ffffffff813711e0>] ? genl_family_rcv_msg+0x2f0/0x2f0
[  119.062092]  [<ffffffff8137055d>] ? netlink_rcv_skb+0x3d/0x90
[  119.062357]  [<ffffffff81370edf>] ? genl_rcv+0x1f/0x30
[  119.062603]  [<ffffffff8136fe79>] ? netlink_unicast+0x109/0x1e0
[  119.062874]  [<ffffffff81370347>] ? netlink_sendmsg+0x357/0x3d0
[  119.063147]  [<ffffffff813320c3>] ? sock_sendmsg+0x63/0x80
[  119.063406]  [<ffffffff810e2fa4>] ? terminate_walk+0x14/0x40
[  119.063670]  [<ffffffff813f871f>] ? schedule_timeout+0x2f/0x190
[  119.063946]  [<ffffffff81333df2>] ? move_addr_to_kernel+0x22/0x40
[  119.064223]  [<ffffffff8133ff38>] ? verify_iovec+0x58/0xb0
[  119.064482]  [<ffffffff8133394f>] ? ___sys_sendmsg.part.34+0x21f/0x270
[  119.064773]  [<ffffffff811d1219>] ? rhashtable_insert+0x59/0xa0
[  119.065046]  [<ffffffff81066013>] ? __wake_up+0x43/0x70
[  119.065296]  [<ffffffff8136f7df>] ? netlink_bind+0x1df/0x220
[  119.065562]  [<ffffffff81334118>] ? SyS_bind+0x68/0xb0
[  119.065811]  [<ffffffff81334b11>] ? __sys_sendmsg+0x51/0x80
[  119.066074]  [<ffffffff813f9849>] ? system_call_fastpath+0x12/0x17
[  119.066352] Code: 9a a3 00 00 00 75 27 be cf 07 00 00 48 c7 c7 28 58 31 a0 e8 f7 17 d3 e0 c6 05 80 a3 00 00 01 eb 0d 66 0f 1f 44 00 00 0f b7 40 06 <88> 43 06 44 89 f8 83 e0 0c 66 83 f8 08 0f 85 19 05 00 00 41 80
[  119.069919] RIP  [<ffffffffa030c83c>] rtl_get_tcb_desc+0x7c/0x630 [rtlwifi]
[  119.070266]  RSP <ffff8800d435f788>
[  119.070460] CR2: 0000000000000006
[  119.070651] ---[ end trace 951d6ff7b966a04d ]---
[  179.029097] INFO: rcu_sched detected stalls on CPUs/tasks: { 3} (detected by 2, t=6002 jiffies, g=2092, c=2091, q=4590)
[  179.029874] Task dump for CPU 3:
[  179.030100] swapper/3       R  running task        0     0      1 0x00000008
[  179.030563]  ffff880119a85a00 ffffffff813f6396 0000000000010280 ffff88011a0fbfd8
[  179.031187]  0000000000010280 ffff88011a0aca40 0000000000000000 0000000000000000
[  179.031810]  ffff88011a2cd000 0000000000000000 0000000000000058 0000000000000010
[  179.032433] Call Trace:
[  179.032644]  [<ffffffff813f6396>] ? __schedule+0x4a6/0x620
[  179.032958]  [<ffffffff81322599>] ? cpuidle_enter_state+0x59/0xe0
[  179.033287]  [<ffffffff81322592>] ? cpuidle_enter_state+0x52/0xe0
[  179.033620]  [<ffffffff810669ed>] ? cpu_startup_entry+0x1cd/0x2b0

Box gets zombie after that

gilb_4 wrote:

Yes, I did appended the firmware. It seems the card works fine on client mode, but things go haywire with hostapd. It seems this is kinda common in RTL wifi cards tho ... (https://github.com/jekader/hostapd-rtl) (https://bugzilla.redhat.com/show_bug.cgi?id=797709)

[<ffffffffa0348212>] ? rtl8821ae_tx_fill_desc+0xa2/0x930 [rtl8821ae]

Looks like some NULL Pointer dereference here.
Is this only in AP mode ??

To my knowledge AP will work, but can't test this without ripping the card out of my testrouter

Yes, it is only on AP mode... it seems I need a patched version of hostapd... or patch the driver (that scares me...)

The discussion might have continued from here.