Iphone tethering - ipheth kernel driver fails

Hi,
finally got iphone tethering to start working, but also it fails quite fast :frowning:

To summarize how I got it working:

  • downloaded OpenWrt 18.06.0-rc1 Imagebuilder
  • build custom image for Jalapeno dev board using this command:
    • make image PROFILE=8dev_jalapeno PACKAGES="kmod-usb-net kmod-usb-net-rndis kmod-usb-net-cdc-ether kmod-usb-net-ipheth luci libimobiledevice-utils usbmuxd libusbmuxd-utils"
  • paired iphone to openwrt using idevicepair command: "idevicepair pair"
  • after that you need to add new interface and add it to wan zone...

I'll write up a detailed blog post and wiki page regarding how to setup everything step-by-step, but only if tethering starts working without issue.

Currently ipheth kernel driver crashes and only thing that helps is to unload it and reload it again.

On Fedora linux tethering with same driver works without issues, so I'm not sure what is the reason why it crashes on OpenWrt.

Here is the console output when ipheth kernel driver crashes:

root@Crisis_Innovation_Lab:/# 
[ 1340.520876] ------------[ cut here ]------------
[ 1340.521527] WARNING: CPU: 0 PID: 7 at net/core/dev.c:4125 0xc0627f34
[ 1340.524789] Modules linked in: ipheth pppoe ppp_async ath10k_pci ath10k_core ath rndis_host pppox ppp_generic nf_conntrack_ipv6 mac80211 iptable_nat ipt_REJECT ipt_MASQUERADE cfg80211 cdc_ether xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_FLOWOFFLOAD xt_CT usbnet slhc nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack iptable_mangle iptable_filter ip_tables crc_ccitt compat ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_of_simple gpio_button_hotplug mii [last unloaded: ipheth]
[ 1340.580546] CPU: 0 PID: 7 Comm: ksoftirqd/0 Not tainted 4.14.50 #0
[ 1340.602648] Hardware name: Generic DT based system
[ 1340.608647] Function entered at [<c030e9f0>] from [<c030af24>]
[ 1340.613415] Function entered at [<c030af24>] from [<c0728648>]
[ 1340.619230] Function entered at [<c0728648>] from [<c0317314>]
[ 1340.625047] Function entered at [<c0317314>] from [<c03173e0>]
[ 1340.630861] Function entered at [<c03173e0>] from [<c0627f34>]
[ 1340.636679] Function entered at [<c0627f34>] from [<c0301520>]
[ 1340.642495] Function entered at [<c0301520>] from [<c031afac>]
[ 1340.648310] Function entered at [<c031afac>] from [<c0334c60>]
[ 1340.654127] Function entered at [<c0334c60>] from [<c0331740>]
[ 1340.659943] Function entered at [<c0331740>] from [<c0307848>]
[ 1340.665875] ---[ end trace 91f02d943833fda4 ]---
[ 1346.014034] ------------[ cut here ]------------
[ 1346.014367] WARNING: CPU: 2 PID: 0 at net/sched/sch_generic.c:320 0xc0650564
[ 1346.017975] NETDEV WATCHDOG: eth2 (ipheth): transmit queue 0 timed out
[ 1346.025145] Modules linked in: ipheth pppoe ppp_async ath10k_pci ath10k_core ath rndis_host pppox ppp_generic nf_conntrack_ipv6 mac80211 iptable_nat ipt_REJECT ipt_MASQUERADE cfg80211 cdc_ether xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_FLOWOFFLOAD xt_CT usbnet slhc nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack iptable_mangle iptable_filter ip_tables crc_ccitt compat ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_of_simple gpio_button_hotplug mii [last unloaded: ipheth]
[ 1346.080883] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G        W       4.14.50 #0
[ 1346.103029] Hardware name: Generic DT based system
[ 1346.110053] Function entered at [<c030e9f0>] from [<c030af24>]
[ 1346.114821] Function entered at [<c030af24>] from [<c0728648>]
[ 1346.120634] Function entered at [<c0728648>] from [<c0317314>]
[ 1346.126563] Function entered at [<c0317314>] from [<c0317368>]
[ 1346.132384] Function entered at [<c0317368>] from [<c0650564>]
[ 1346.138192] Function entered at [<c0650564>] from [<c03633b4>]
[ 1346.144011] Function entered at [<c03633b4>] from [<c03634b4>]
[ 1346.149818] Function entered at [<c03634b4>] from [<c0363540>]
[ 1346.155638] Function entered at [<c0363540>] from [<c0301520>]
[ 1346.161457] Function entered at [<c0301520>] from [<c031b24c>]
[ 1346.167270] Function entered at [<c031b24c>] from [<c03526c0>]
[ 1346.173088] Function entered at [<c03526c0>] from [<c030140c>]
[ 1346.178901] Function entered at [<c030140c>] from [<c030ba8c>]
[ 1346.184711] Exception stack(0xcf85bf80 to 0xcf85bfc8)
[ 1346.190624] bf80: 00000001 00000000 00000000 c0313e40 ffffe000 c0a03c70 c0a03c24 00000000
[ 1346.195762] bfa0: 00000000 410fc075 00000000 00000000 cf85bfc8 cf85bfd0 c0308100 c0308104
[ 1346.203853] bfc0: 60000013 ffffffff
[ 1346.211968] Function entered at [<c030ba8c>] from [<c0308104>]
[ 1346.215279] Function entered at [<c0308104>] from [<c0349618>]
[ 1346.221182] Function entered at [<c0349618>] from [<c0349938>]
[ 1346.226992] Function entered at [<c0349938>] from [<8030170c>]
[ 1346.233766] ---[ end trace 91f02d943833fda5 ]---
[ 1346.238681] ipheth 3-1:4.2: ipheth_tx_timeout: TX timeout
[ 1352.174016] ipheth 3-1:4.2: ipheth_tx_timeout: TX timeout
[ 1356.973863] ipheth 3-1:4.2: ipheth_tx_timeout: TX timeout
[ 1362.014136] ipheth 3-1:4.2: ipheth_tx_timeout: TX timeout
[ 1366.974184] ipheth 3-1:4.2: ipheth_tx_timeout: TX timeout
[ 1372.013842] ipheth 3-1:4.2: ipheth_tx_timeout: TX timeout
[ 1376.973854] ipheth 3-1:4.2: ipheth_tx_timeout: TX timeout

It looks like it was fixed with this commit
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/drivers/net/usb/ipheth.c?h=v4.17.4&id=bb1b40c7cb863f0800a6410c7dcb86cf3f28d3b1

Its part of kernel 4.15 and later

1 Like

Hi,
I'm trying the same without success a long time.
Today I am trying it again from scratch.

I am using an DIR-505 with Openwrt 18.06.1 and an iPhone 6S plus with IOS 12.

On OpenWRT I installed kmod-usb-net kmod-usb-net-rndis kmod-usb-net-cdc-ether usbutils udev kmod-usb-net-ipheth.

With dmesg the only references seen are:

[ 1287.289095] usbcore: registered new interface driver rndis_host
[ 1420.547248] usb 1-1: new high-speed USB device number 3 using ehci-platform

rndis-host do not apear.

Then I used
cat /sys/kernel/debug/usb/devices
This shows that the iPhone is connected but no driver is loaded:

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  4
P:  Vendor=05ac ProdID=12a8 Rev= 8.02
S:  Manufacturer=Apple Inc.
S:  Product=iPhone
S:  SerialNumber=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=06(still) Sub=01 Prot=01 Driver=(none)
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=64ms
C:  #Ifs= 3 Cfg#= 2 Atr=c0 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=
I:  If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=
I:  If#= 1 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=00 Driver=
E:  Ad=81(I) Atr=01(Isoc) MxPS= 192 Ivl=1ms
I:  If#= 2 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=
E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=125us
C:  #Ifs= 2 Cfg#= 3 Atr=c0 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=06(still) Sub=01 Prot=01 Driver=
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=64ms
I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=fe Prot=02 Driver=
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
C:  #Ifs= 3 Cfg#= 4 Atr=c0 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=06(still) Sub=01 Prot=01 Driver=
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=64ms
I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=fe Prot=02 Driver=
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:  If#= 2 Alt= 0 #EPs= 0 Cls=ff(vend.) Sub=fd Prot=01 Driver=
I:  If#= 2 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=fd Prot=01 Driver=
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:  If#= 2 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=fd Prot=01 Driver=
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

I can see on LeDE Overview that kernel version is 4.9.120.

In no moment I see any message on iPhone to allow access to DIR-505.

Any news to this problem?

Thanks in advance.

Best
carliedu

Had a friend with a problem that ipheth did not work.
Turns out that the issue was fixed in 4.15

Thanks.
I'm not familiar with patches. I will wait until OpenWRT kernel is newer or equal 4.15

Should be soon depending on a platform since 4.19 kernel is being prepared

I also want this.

Any updates on this? I seem to be having the same problem (no driver)

1 Like

You are gonna have to wait for a new kernel

1 Like

Thanks for the tip. I've tested the patch and it does solve the problem of ipheth crashes, so now iPhone USB tethering doesn't die every time you try to load more than a few bytes. However it looks like patch doesn't solve all queuing problems. When I do Speedtest on iPhone directly I get about 20mbit download. When I do it from router it starts at 10, instantly drops to 0-2, and then slowly recovers to 5-10. Another issue is each time I reconnect the iPhone I have to restart usbmuxd to get connection working

Which router are you using?
If there is 4.19 support for it I would suggest you trying it out since 4.15+ kernels have a lot of ipheth fixes

I'm using xiaomi mi router 3g, haven't seen any releases beyond 4.14 yet, where are they?

For ramips there arent, I thought that you are maybe using ipq40xx

so I am waiting for summer, right?

I really cant guess, you will have to wait until someone does it

What does it take to build one? is there any kind of guide or example?

No, there is no guide on kernel version update.
It is not easy and is quite tedious process, believe me I have done 4.14 to 4.19 update for ipq40xx and it took a lot of time and help from other developers

1 Like

I mean as long as it's done for one device, shouldn't be easier to do it for another one?

Only if its the same target, ipq40xx and ramips are wildly different things

I see, thank you