OpenWrt Forum Archive

Topic: compiling kernel module ax88179_178a for usb-ethernet-adapter failed

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

Hi guys,

after one week of daily frustation I hope you could help me out. :-/
Actually I just want to get the ASIX driver ax88179_178a compiled for my raspberry pi b+ based on the brcm2708 environment. After I recognized that just the general asix.ko kernel module is able to compile in the trunk I downloaded the ax88179_178a source from the offical website (http://www.asix.com.tw/download.php?sub … ItemID=131).
However I didn't get it done by cross compiling with the openwrt toolchain from the trunk. ... By the way, the ax88179_178a.ko is officially supportet in the kernel since 3.9. Is there any reason that this kernel module is not selectable in the "make menueconfig" environment of openwrt from the trunk (using the kernel version 3.14.30 right now)?

Since I am not really a expert in compiling and programming at all, can anybody help me and would do the cross compiling of the called kernal module or make the ax88179_178a selectable in the menueconfig? :-)

Thanks for your support!
cheers

the asix driver is supported in upstream kernel - at least according to the official git

so it should be as simple as adding

define KernelPackage/usb-net-asix-ax88179
  TITLE:=Kernel module for USB-to-Gigabit-Ethernet Asix convertors
  DEPENDS:=+kmod-libphy
  KCONFIG:=CONFIG_USB_NET_AX88179_178A
  FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/ax88179_178a.ko
  AUTOLOAD:=$(call AutoProbe,ax88179_178a)
  $(call AddDepends/usb-net)
endef

define KernelPackage/usb-net-asix-ax88179/description
 Kernel module for USB-to-Ethernet ASIX AX88179 based USB 3.0/2.0
 to Gigabit Ethernet adapters.
endef

$(eval $(call KernelPackage,usb-net-asix-ax88179))

to package/kernel/linux/modules/usb.mk

This compiles successfully on trunk with ar71xx.
I cannot test if this is working, because I dont have the Hardware.
Report if it is working for you and this might be integrated officially into trunk.

Thanks zloop, it compiles also successful for my brmc2708 environment and I just copied the kernel module ax88179_178a.ko to an existing build of the trunk, I'd downloaded a couple of days before. 

However,  I have got a kernel panic after I pluged in the lan cable. Earnestly, I am not familiar with kernel stuff that I hope somebody of you could give me a hint what's going wrong with that kernel module implementation.

p.s. Just for your information, my usb-net-adapter works pretty good on the Debian Whezzy based RASBIAN with the ax88179_178a kernel module.

dmesg:
...
[    3.022195] usb 1-1.3: new high-speed USB device number 4 using dwc_otg
[    3.148205] usb 1-1.3: New USB device found, idVendor=0b95, idProduct=1790
[    3.156603] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.165345] usb 1-1.3: Product: AX88179
[    3.170556] usb 1-1.3: Manufacturer: ASIX Elec. Corp.
[    3.176970] usb 1-1.3: SerialNumber: 00503F56009EAC
[    3.410290] random: mktemp urandom read with 45 bits of entropy available
[    3.515648] ax88179_178a 1-1.3:1.0 eth1: register 'ax88179_178a' at usb-bcm2708_usb-1.3, ASIX AX88179 USB 3.0 Gigabit Ethernet, 50:3f:56:00:9e:ac
[    6.589487] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    9.051892] NET: Registered protocol family 10
[    9.089200] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    9.109441] hidraw: raw HID events driver (C) Jiri Kosina
[    9.148489] ip_tables: (C) 2000-2006 Netfilter Core Team
[    9.164806] nf_conntrack version 0.5.0 (7034 buckets, 28136 max)
[    9.190705] usbcore: registered new interface driver usbhid
[    9.197785] usbhid: USB HID core driver
[    9.221245] xt_time: kernel timezone is -0000
[    9.236593] PPP generic driver version 2.4.2
[    9.244253] NET: Registered protocol family 24
[   11.150334] random: nonblocking pool is initialized
[   12.874902] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   12.884411] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   12.900837] device eth0 entered promiscuous mode
[   12.923123] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   13.315622] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   16.388266] ax88179_178a 1-1.3:1.0 eth1: ax88179 - Link status is: 1
[   16.398485] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   16.422324] Unable to handle kernel NULL pointer dereference at virtual address 00000014
[   16.433316] pgd = da8d8000
[   16.437413] [00000014] *pgd=1a88c831, *pte=00000000, *ppte=00000000
[   16.445223] Internal error: Oops: 17 [#1] ARM
[   16.450939] Modules linked in: pppoe ppp_async iptable_nat pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_MASQUERADE xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_id xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_CT usbhid slhc nf_nat_irc nf_nat_ftp nf_nat nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack_irc nf_conntrack_ftp nf_conntrack iptable_raw iptable_mangle iptable_filter ipt_REJECT ip_tables hid_generic crc_ccitt snd_bcm2835 hid evdev ip6t_REJECT ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables snd_compress snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_rawmidi snd_seq_device snd_hwdep snd soundcore ipv6 ax88179_178a asix xhci_hcd ehci_platform ehci_hcd libphy
[   16.534112] CPU: 0 PID: 534 Comm: dhcp.sh Not tainted 3.14.30 #1
[   16.541734] task: dba12400 ti: da86a000 task.ti: da86a000
[   16.548813] PC is at ax88179_tx_fixup+0x28/0xf0 [ax88179_178a]
[   16.556323] LR is at ax88179_tx_fixup+0x20/0xf0 [ax88179_178a]
[   16.563747] pc : [<bf03b140>]    lr : [<bf03b138>]    psr: 80000113
[   16.563747] sp : da86bc98  ip : db805740  fp : 00000001
[   16.578322] r10: 00004012  r9 : db8822a0  r8 : bf03d284
[   16.585048] r7 : db9d0c00  r6 : db9d0800  r5 : db8822a0  r4 : db8822a0
[   16.593095] r3 : 00000012  r2 : 00000200  r1 : 00000008  r0 : 00000007
[   16.601151] Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   16.609826] Control: 00c5387d  Table: 1a8d8008  DAC: 00000015
[   16.617106] Process dhcp.sh (pid: 534, stack limit = 0xda86a1b0)
[   16.624614] Stack: (0xda86bc98 to 0xda86c000)
[   16.630461] bc80:                                                       00000000 dba03f60
[   16.641474] bca0: db8822a0 c01d3e40 c01d3dec 00000000 db8822a0 db8b7700 db9d0800 bf03cf0c
[   16.652450] bcc0: db8822a0 00004012 00000001 c02499d4 c0405b58 bf1d836c 00000000 00003a3c
[   16.663421] bce0: da86bd3c 00000000 00000000 dbbea000 db8b7700 db9d0800 db8822a0 00000000
[   16.674440] bd00: 00000000 c025fcb4 00000000 00000000 db8822a0 db9d0800 db8b7700 dbbea000
[   16.685549] bd20: 00000000 c0249e00 dbbea060 c0252328 00000000 da84b4c0 db8822a0 da86a018
[   16.696830] bd40: da871a00 16000000 00000000 41fa3b6f db805050 bf042bd8 00000001 db805020
[   16.708264] bd60: db805050 bf046374 db9d0800 c04124b8 00000060 db8822a0 da86a010 dba7fc00
[   16.719821] bd80: 00000001 db805020 db805050 bf061b08 db9d0800 bf0600ec 80000000 db8822a0
[   16.731424] bda0: bf06256c 00000003 00000000 00000000 003a0000 00000000 000002ff 00000000
[   16.743122] bdc0: 00000000 16000000 00000000 00000000 00000000 00000000 00000000 0000008f
[   16.754978] bde0: 00989680 00000000 00000000 db8822a0 bf06256c dba7fc00 da86a000 00000001
[   16.766879] be00: c044d4d0 bf0625a0 00000001 00000000 00000002 da86a000 00000100 da86a038
[   16.778756] be20: bf062368 c0407360 c044d0d0 c044d2d0 c044d4d0 c002af7c caf5ac80 00000003
[   16.790669] be40: c044c8c0 da86be60 00000000 00200200 c0407360 c002b13c ca5d3928 c044d6d0
[   16.802585] be60: da86be60 da86be60 00000003 00000000 c0477ac8 c0477ac4 40000001 da86a000
[   16.814474] be80: 00000001 00000100 c0477ac4 c0025e40 000001ff 000001ff 0000000a ffff912d
[   16.826383] bea0: da86a010 00400000 da86bf1c da86a010 00000003 00000000 da86bf1c c0008aa8
[   16.838295] bec0: 00000000 00000000 01fb8008 c00261c8 c0408204 c00161a4 c008eeac a0000013
[   16.850212] bee0: f200b200 c0009834 db800760 00000001 00000006 00000000 dba0c000 40000013
[   16.862100] bf00: db800760 000000d0 c0008aa8 00000000 00000000 01fb8008 00000002 da86bf30
[   16.874013] bf20: c009ebb8 c008eeac a0000013 ffffffff c0404e90 00020000 00000000 01fb82f4
[   16.885934] bf40: 00000005 c009ebb8 00020000 00000000 ffffff9c 00000005 c0008aa8 da86a000
[   16.897830] bf60: 00000000 c0091d20 00000000 00000000 be852480 00020000 00000000 00000024
[   16.909741] bf80: 00000100 00000001 00200200 00000000 00000000 01fb82f4 00000005 c0008aa8
[   16.921659] bfa0: da86a000 c0008900 00000000 00000000 01fb82f4 00020000 00000000 00000000
[   16.933576] bfc0: 00000000 00000000 01fb82f4 00000005 00000002 01fb8324 00000002 01fb8008
[   16.945463] bfe0: 0007c474 be8522c0 0002d760 b6f2d20c 60000010 01fb82f4 00000000 00000000
[   16.957454] [<bf03b140>] (ax88179_tx_fixup [ax88179_178a]) from [<c01d3e40>] (usbnet_start_xmit+0x54/0x4f0)
[   16.970999] [<c01d3e40>] (usbnet_start_xmit) from [<c02499d4>] (dev_hard_start_xmit+0x2b0/0x488)
[   16.983544] [<c02499d4>] (dev_hard_start_xmit) from [<c025fcb4>] (sch_direct_xmit+0x50/0x190)
[   16.995786] [<c025fcb4>] (sch_direct_xmit) from [<c0249e00>] (__dev_queue_xmit+0x254/0x478)
[   17.007933] [<c0249e00>] (__dev_queue_xmit) from [<bf042bd8>] (ip6_finish_output2+0x464/0x7d0 [ipv6])
[   17.021005] [<bf042bd8>] (ip6_finish_output2 [ipv6]) from [<bf061b08>] (igmp6_mcf_seq_show+0x580/0xcdc [ipv6])
[   17.034845] [<bf061b08>] (igmp6_mcf_seq_show [ipv6]) from [<bf0625a0>] (mld_ifc_timer_expire+0x238/0x9e4 [ipv6])
[   17.048797] [<bf0625a0>] (mld_ifc_timer_expire [ipv6]) from [<c002af7c>] (call_timer_fn.isra.41+0x24/0x88)
[   17.062140] [<c002af7c>] (call_timer_fn.isra.41) from [<c002b13c>] (run_timer_softirq+0x15c/0x1a0)
[   17.074779] [<c002b13c>] (run_timer_softirq) from [<c0025e40>] (__do_softirq+0xa4/0x1f8)
[   17.086507] [<c0025e40>] (__do_softirq) from [<c00261c8>] (irq_exit+0x80/0xe0)
[   17.095596] [<c00261c8>] (irq_exit) from [<c00161a4>] (handle_IRQ+0x64/0x80)
[   17.104509] [<c00161a4>] (handle_IRQ) from [<c0009834>] (__irq_svc+0x34/0xa8)
[   17.113487] [<c0009834>] (__irq_svc) from [<c008eeac>] (kmem_cache_alloc+0x80/0xe8)
[   17.124686] [<c008eeac>] (kmem_cache_alloc) from [<c009ebb8>] (getname_flags+0x20/0x108)
[   17.136329] [<c009ebb8>] (getname_flags) from [<c0091d20>] (do_sys_open+0xf4/0x1c0)
[   17.147498] [<c0091d20>] (do_sys_open) from [<c0008900>] (ret_fast_syscall+0x0/0x30)
[   17.158764] Code: e58d3000 eb3f439f e594309c e5d40060 (e1d320b2)
[   17.166755] ---[ end trace eedeb40adcdf6105 ]---
[   17.173258] Kernel panic - not syncing: Fatal exception in interrupt
[   17.181402] Rebooting in 3 seconds..


Thanks all for your hints! :-)

- Compile an image in a single run
There might be dependency issues (libphy / PHYLIB)

- Check the Kernel config difference between OpenWrt and Raspbian
Debian has some patches to have the module run with older wheezy kernels.
OpenWrt might do things differently - maybe its some usb (I see you use dwc_otg - so usb 2.0)
Maybe use the Debian Kernel config in OpenWrt ?

- Try to replicate on x86/x86_64 OpenWrt

- I dont understand kernel dump/stacktrace.
usbnet_start_xmit / ax88179_tx_fixup somewhere has a NULL dereference ?
Is it IPv6 related ? Try some IPv6 stuff in Debian ?

- If no one answers in the forum you can try to ask on the mailing list of openwrt or the mailing list of the subsystem (probably netdev)

Thanks zloop, on first examination the kernel module ax88179_178a seems to work after I compiled the image in a single run and without any usb 2.0 stuff. :-)

[   16.648087] ax88179_178a 1-1.5:1.0 eth1: ax88179 - Link status is: 1
[   16.657946] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready

without any kernel panic!

Till now I just did it with a minimal set of parameters in the menuconfig. However tonight I am going to compile it with a full set of parameters, I've taken over from the config file in the brcm2708 folder of the trunk.

Anyway, I would be glad if somebody could bring your extensions to the usb.mk at the trunk. Finally I would test the new pre-compiled image for brcm2708 environments and give you feedback.

Thanks for response!
Cheers

Hi zloop,

I need guidance from you,  to build the ar5523 kernel module for ar71xx platform
I can see the source here:
trunk/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/linux-3.10.44/drivers/net/wireless/ath/ar5523/

I dont know how to add it to package/kernel/linux/modules/wireless.mk correctly
been trying many times yesterday but it wont build, the option is shown in menuconfig but it wont build

Regards
Ari

The discussion might have continued from here.