11200 iPhone usb tethering - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > Peripheral Hardware

Peripheral Hardware Stuff that plugs in via USB, FireWire, eSATA, PS/2, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old August 13th, 2010, 20:40
andrnils andrnils is offline
Junior Member
 
Join Date: Jan 2009
Posts: 36
Thanks: 1
Thanked 1 Time in 1 Post
Default iPhone usb tethering

I got my new iPhone today, and playing around with it found that it had an option for internet tethering ( my old one had that to, but I had no 3g-data service ), so I would like to use it with my FreeBSD install.

A bit of googling gives that it actually works on linux, via a in-kernel driver ipheth and a userland utility to pair the device. Has anyone made any attempt at porting those utilities to fbsd?

For those interested the driver and userland utils are available here here. The author has a bit more info on his site

Any dev wanting to take up the task? Anyone else interested in this functionality?

Best regards
andrnils
Reply With Quote
  #2  
Old August 14th, 2010, 15:07
tobii tobii is offline
Junior Member
 
Join Date: Dec 2009
Location: Hannover/Germany
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Since im only using Windows to tether and put software updates on my iPhone im really interested in this!
Reply With Quote
  #3  
Old August 17th, 2010, 08:04
lme@'s Avatar
lme@ lme@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Düsseldorf, Germany
Posts: 588
Thanks: 44
Thanked 181 Times in 90 Posts
Default

Have you tried cdce(4)?

Last edited by DutchDaemon; August 17th, 2010 at 11:23. Reason: [man=] tags are cool ;)
Reply With Quote
  #4  
Old August 18th, 2010, 06:24
andrnils andrnils is offline
Junior Member
 
Join Date: Jan 2009
Posts: 36
Thanks: 1
Thanked 1 Time in 1 Post
Default

That is interesting. Too bad nothing did happen But I think that may be because one needs to send some magic command to the phone first ( pairing ), so perhaps a port of the userland tools and then a new test
Reply With Quote
  #5  
Old August 18th, 2010, 17:38
andrnils andrnils is offline
Junior Member
 
Join Date: Jan 2009
Posts: 36
Thanks: 1
Thanked 1 Time in 1 Post
Default

Some progress, I have some semi-working ports for libplist and usbmuxd, so only libimobiledevice left before a real try with cdce(4) can happen.

And then a some cleaning of the Makefiles for the ports. I've never written any before so there are bound to be errors, gotchas and so on

Regards
andrnils
Reply With Quote
  #6  
Old August 18th, 2010, 19:07
lme@'s Avatar
lme@ lme@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Düsseldorf, Germany
Posts: 588
Thanks: 44
Thanked 181 Times in 90 Posts
Default

Congrats!
Reply With Quote
  #7  
Old August 18th, 2010, 19:10
andrnils andrnils is offline
Junior Member
 
Join Date: Jan 2009
Posts: 36
Thanks: 1
Thanked 1 Time in 1 Post
Default

So I went ahead and compiled libimobiledevice ( no port yet ), and tested. I can now pair my iPhone with my computer
Code:
[andrnils@t510 /opt/iphone/bin ] 18:57:47 =0
$ sudo usbmuxd -U root -f
[18:57:50.749][3] usbmuxd v1.0.5 starting up
[18:57:50.755][3] Initialization complete
[18:57:56.763][3] Could not check kernel ownership of interface 0 for device 1-5: -99
[18:57:57.743][2] Could not set configuration 4 for device 1-5: -2
[18:57:58.744][3] Could not check kernel ownership of interface 0 for device 1-5: -99
[18:57:58.793][3] Connecting to new device on location 0x10005 as ID 1
[18:57:58.794][3] Connected to v1.0 device 1 on location 0x10005 with serial number 658b072e06fb6fcc6aa9a440a7dbd7594cec8417
To test the internet tethering I just added a device identifier to /usr/src/sys/dev/usb/net/if_cdce.
Code:
{USB_VPI(USB_VENDOR_APPLE, 0x1297, CDCE_FLAG_NO_UNION)},
which was enough to get the iphone registerad as a usb ethernet ( actually 3 nics ). Perhaps someone could #define
Code:
#define USB_PRODUCT_APPLE_IPHONE_4G     0x1297          /* iPhone 4G */
in the correct place.


Code:
cdce0: <Apple Inc. iPhone, class 0/0, rev 2.00/0.01, addr 5> on usbus1
cdce0: faking MAC address
ue0: <USB Ethernet> on cdce0
ue0: Ethernet address: 2a:ba:b8:d4:02:00
cdce1: <Apple Inc. iPhone, class 0/0, rev 2.00/0.01, addr 5> on usbus1
cdce1: faking MAC address
ue1: cdce2: <USB Ethernet> on cdce1<Apple Inc. iPhone, class 0/0, rev 2.00/0.01, addr 5> on usbus1
ue1: 
Ethernet address: 2a:07:b9:d4:02:01
cdce2: faking MAC address
ue2: <USB Ethernet> on cdce2
ue2: Ethernet address: 2a:32:b9:d4:02:02
cdce0: <Apple Inc. iPhone, class 0/0, rev 2.00/0.01, addr 5> on usbus1
cdce0: faking MAC address
ue0: <USB Ethernet> on cdce0
ue0: Ethernet address: 2a:75:5f:d7:02:00
cdce1: <Apple Inc. iPhone, class 0/0, rev 2.00/0.01, addr 5> on usbus1
cdce1: faking MAC address
cdce2: <Apple Inc. iPhone, class 0/0, rev 2.00/0.01, addr 5> on usbus1
ue1: <USB Ethernet> on cdce1
ue1: Ethernet address: 2a:df:5f:d7:02:01
cdce2: faking MAC address
ue2: <USB Ethernet> on cdce2
ue2: Ethernet address: 2a:2a:60:d7:02:02
None of the nics responded to dhclient, so perhaps the cdce(4) driver is not up to the task with a bit of mangling. There should also be some sanity checks that are now missing: The ethernet interface should only be exposed when internet tethering is turned on on the phone and when the phone has been succsessfully paired with the computer.

Regards
andrnils

Last edited by DutchDaemon; August 18th, 2010 at 22:13. Reason: proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #8  
Old August 19th, 2010, 15:14
andrnils andrnils is offline
Junior Member
 
Join Date: Jan 2009
Posts: 36
Thanks: 1
Thanked 1 Time in 1 Post
Default

And now there is a port for libimobiledevices too. Just the kernel part left And of course a bit of clean up...

And as for the kernel part I'm probably not up to doing that on my own

Regards
andrnils
Reply With Quote
  #9  
Old August 19th, 2010, 22:34
hselasky hselasky is offline
Junior Member
 
Join Date: Jun 2010
Posts: 16
Thanks: 0
Thanked 5 Times in 3 Posts
Default

FYI:

http://p4web.freebsd.org/@@182630?ac=10

--HPS
Reply With Quote
The Following 3 Users Say Thank You to hselasky For This Useful Post:
andrnils (August 30th, 2010), bsdgooch (October 16th, 2010), t0ken (January 27th, 2013)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mount iphone sk8harddiefast Peripheral Hardware 21 January 30th, 2012 14:36
usb-modem not switching to usb wokko Peripheral Hardware 4 May 11th, 2010 19:33
FreeBSD on usb stick (Live USB) zeiz Installing & Upgrading 19 March 1st, 2010 11:49
pci usb 2.0 card serves as only usb 1.1 on Asus P4S333/c zeiz System Hardware 6 August 26th, 2009 02:21
iPhone and personal domain name email Pushrod Web & Network Services 0 December 22nd, 2008 16:06


All times are GMT +1. The time now is 14:28.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0