Re: [PATCH Resubmission] drivers/net/usb: Add new driver ipheth

Previous thread: 2.6.34-rc3-git6: Reported regressions from 2.6.33 by Rafael J. Wysocki on Wednesday, April 7, 2010 - 2:08 pm. (64 messages)

Next thread: 2.6.34-rc3++ looses PS2 keyboard eventually in xterms by Hans-Peter Jansen on Wednesday, April 7, 2010 - 3:40 pm. (2 messages)
From: =?UTF-8?q?L=2E=20Alberto=20Gim=C3=A9nez?=
Date: Wednesday, April 7, 2010 - 3:11 pm

From: dborca@yahoo.com

Add new driver to use tethering with an iPhone device. After initial submission,
apply fixes to fit the new driver into the kernel standards.

There are still a couple of minor (almost cosmetic-level) issues, but the driver
is fully functional right now.

Signed-off-by: L. Alberto Giménez <agimenez@sysvalve.es>
---
 drivers/net/usb/Kconfig  |   12 +
 drivers/net/usb/Makefile |    1 +
 drivers/net/usb/ipheth.c |  562 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 575 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/usb/ipheth.c

diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig
index ba56ce4..63be4ca 100644
--- a/drivers/net/usb/Kconfig
+++ b/drivers/net/usb/Kconfig
@@ -385,4 +385,16 @@ config USB_CDC_PHONET
 	  cellular modem, as found on most Nokia handsets with the
 	  "PC suite" USB profile.
 
+config USB_IPHETH
+	tristate "Apple iPhone USB Ethernet driver"
+	default n
+	---help---
+	  Module used to share Internet connection (tethering) from your
+	  iPhone (Original, 3G and 3GS) to your system.
+	  Note that you need userspace libraries and programs that are needed
+	  to pair your device with your system and that understand the iPhone
+	  protocol.
+
+	  For more information: http://giagio.com/wiki/moin.cgi/iPhoneEthernetDriver
+
 endmenu
diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile
index 82ea629..edb09c0 100644
--- a/drivers/net/usb/Makefile
+++ b/drivers/net/usb/Makefile
@@ -23,4 +23,5 @@ obj-$(CONFIG_USB_NET_MCS7830)	+= mcs7830.o
 obj-$(CONFIG_USB_USBNET)	+= usbnet.o
 obj-$(CONFIG_USB_NET_INT51X1)	+= int51x1.o
 obj-$(CONFIG_USB_CDC_PHONET)	+= cdc-phonet.o
+obj-$(CONFIG_USB_IPHETH)	+= ipheth.o
 
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
new file mode 100644
index 0000000..677ae4a
--- /dev/null
+++ b/drivers/net/usb/ipheth.c
@@ -0,0 +1,562 @@
+/*
+ * ipheth.c - Apple iPhone USB Ethernet driver
+ *
+ * Copyright (c) 2009 Diego Giagio ...
From: Roland Dreier
Date: Wednesday, April 7, 2010 - 3:37 pm

These are a few of the cosmetic issues alluded to, and by no means merge
blockers, but:

 > +	schedule_delayed_work(&dev->carrier_work, IPHETH_CARRIER_CHECK_TIMEOUT);

Seems this might as well be round_jiffies_relative(IPHETH_CARRIER_CHECK_TIMEOUT)
to avoid extra wakeups.

 > +	netdev = alloc_etherdev(sizeof(struct ipheth_device));

This means that the interface will get an ethX name and look to
networkmanager et al like an ethernet device.  Seems we would maybe want
to make this a "wwan" type device (cf drivers/net/usb/usbnet.c and how
it handles FLAG_WWAN)?

 - R.
-- 
Roland Dreier <rolandd@cisco.com> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--

From: Oliver Neukum
Date: Wednesday, April 7, 2010 - 11:35 pm

Looks good to me.

	Regards
		Oliver
--

From: David Miller
Date: Tuesday, April 13, 2010 - 1:15 am

From: L. Alberto Giménez <agimenez@sysvalve.es>

I can't apply this.

Unless you add a rule to drivers/net/Makefile, the build won't
actually get to your driver unless one of the other USB networking
devices are configured.

Please fix this up and resubmit.
--

From: "L. Alberto Giménez"
Date: Tuesday, April 13, 2010 - 12:03 pm

Hi David,

Thanks for the info. I didn't know that I had to add an entry on the 
upper level Makefile. I guess that something like 
obj-$(CONFIG_USB_IPHETH) += usb/ should be enough? (I got it from the 
other USB net drivers).

I won't be able to work on it today, I've been very busy today and can't 

I have also in my queue a patch sent from upstream to fix the latest 
issues pointed out by Roland Dreier, and I need to test it a little bit 
more.

Thanks for your comments and patience!


Best regards,
L. Alberto Giménez
--

From: David Miller
Date: Tuesday, April 13, 2010 - 2:29 pm

From: "L. Alberto Giménez" <agimenez@sysvalve.es>

Yes.
--

Previous thread: 2.6.34-rc3-git6: Reported regressions from 2.6.33 by Rafael J. Wysocki on Wednesday, April 7, 2010 - 2:08 pm. (64 messages)

Next thread: 2.6.34-rc3++ looses PS2 keyboard eventually in xterms by Hans-Peter Jansen on Wednesday, April 7, 2010 - 3:40 pm. (2 messages)