Discussion:
[Synce-devel] USB RNDIS Tethering
John Carr
2007-08-16 19:50:15 UTC
Permalink
After talking to bof on #synce today i've concocted a patch to allow all
you lucky WM5/WM6 users out there to browse the internets on your laptop
from your phone.

Please note that i've only tested it on one WM6 device, and I offer no
promises as to whether it will or won't eat your cat and run away with
your lover. It's also possible that I made a patch that will only work for
my phone :-) Time will tell...


You will need the latest usb-rndis-lite sources from SynCE *borrows
liberally from the wiki*. Note that I'm using 2.6.22, but don't see any
problems cropping up in earlier versions...

svn co http://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite
cd usb-rndis-lite/
patch -p0 < tethering.diff


To compile, its the usual:

make
sudo ./clean.sh
sudo make install


To actually try this out..

* I disconnected ethernet
* I toggled the kill switch on my wireless to OFF.
* I enabled connection sharing and plugged in my device.
* dmesg showed that an RNDIS device had been detected (no descriptor errors)
* NetworkManager /might/ kick in and configure it.. otherwise..
* I ran sudo dhclient3 eth2 to assign it an IP address (obviously eth2
depends on what hardware you have)

Then I went to google.com, ipchicken.com and a few others. It worked, and
lagged as expected.

Toggling the sharing off on the phone broke the connection :-)

Have fun, and let me know how it works. If there isn't any breakage i'll
commit this in the next day or so and we'll see what needs to happen to
upstream this.

John
watson540
2007-09-04 08:02:08 UTC
Permalink
i meant to reply to this thread and acidentally replied to author instead. i
wrote to say this patch wont apply for me. it has made me very hopeful to at
least see one other person interested in usb linux tethering with wm6
though. can we apply this to sock kernel drivers cause usb-rndis-lite never
has worked for me
Post by John Carr
After talking to bof on #synce today i've concocted a patch to allow all
you lucky WM5/WM6 users out there to browse the internets on your laptop
from your phone.
Please note that i've only tested it on one WM6 device, and I offer no
promises as to whether it will or won't eat your cat and run away with
your lover. It's also possible that I made a patch that will only work for
my phone :-) Time will tell...
You will need the latest usb-rndis-lite sources from SynCE *borrows
liberally from the wiki*. Note that I'm using 2.6.22, but don't see any
problems cropping up in earlier versions...
svn co http://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite
cd usb-rndis-lite/
patch -p0 < tethering.diff
make
sudo ./clean.sh
sudo make install
To actually try this out..
* I disconnected ethernet
* I toggled the kill switch on my wireless to OFF.
* I enabled connection sharing and plugged in my device.
* dmesg showed that an RNDIS device had been detected (no descriptor errors)
* NetworkManager /might/ kick in and configure it.. otherwise..
* I ran sudo dhclient3 eth2 to assign it an IP address (obviously eth2
depends on what hardware you have)
Then I went to google.com, ipchicken.com and a few others. It worked, and
lagged as expected.
Toggling the sharing off on the phone broke the connection :-)
Have fun, and let me know how it works. If there isn't any breakage i'll
commit this in the next day or so and we'll see what needs to happen to
upstream this.
John
Index: cdc_ether.c
===================================================================
--- cdc_ether.c (revision 2997)
+++ cdc_ether.c (working copy)
@@ -18,8 +18,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
*/
-// #define DEBUG // error path messages, extra info
-// #define VERBOSE // more; success messages
+#define DEBUG // error path messages, extra info
+#define VERBOSE // more; success messages
#include <linux/module.h>
#include <linux/version.h>
@@ -58,6 +58,13 @@
&& desc->bInterfaceProtocol == 1;
}
+static int is_wireless(struct usb_interface_descriptor *desc)
+{
+ return desc->bInterfaceClass == USB_CLASS_WIRELESS_CONTROLLER
+ && desc->bInterfaceSubClass == 1
+ && desc->bInterfaceProtocol == 3;
+}
+
#else
#define is_rndis(desc) 0
@@ -102,7 +109,8 @@
* of cdc-acm, it'll fail RNDIS requests cleanly.
*/
rndis = is_rndis(&intf->cur_altsetting->desc)
- || is_activesync(&intf->cur_altsetting->desc);
+ || is_activesync(&intf->cur_altsetting->desc)
+ || is_wireless(&intf->cur_altsetting->desc);
memset(info, 0, sizeof *info);
info->control = intf;
@@ -222,7 +230,7 @@
/* Microsoft ActiveSync based RNDIS devices lack the CDC descriptors,
* so we'll hard-wire the interfaces and not check for descriptors.
*/
- if (is_activesync(&intf->cur_altsetting->desc)) {
+ if (is_activesync(&intf->cur_altsetting->desc) ||
is_wireless(&intf->cur_altsetting->desc)) {
if (!info->u) {
info->control = usb_ifnum_to_if(dev->udev, 0);
info->data = usb_ifnum_to_if(dev->udev, 1);
Index: rndis_host.c
===================================================================
--- rndis_host.c (revision 2997)
+++ rndis_host.c (working copy)
@@ -707,7 +707,11 @@
/* "ActiveSync" is an undocumented variant of RNDIS, used in WM5 */
USB_INTERFACE_INFO(USB_CLASS_MISC, 1, 1),
.driver_info = (unsigned long) &rndis_info,
-},
+}, {
+ /* RNDIS for HTC tethering */
+ USB_INTERFACE_INFO(USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
+ .driver_info = (unsigned long) &rndis_info,
+},
{ }, // END
};
MODULE_DEVICE_TABLE(usb, products);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
SynCE-Devel mailing list
https://lists.sourceforge.net/lists/listinfo/synce-devel
--
View this message in context: http://www.nabble.com/USB-RNDIS-Tethering-tf4281738.html#a12473632
Sent from the iPAQ - SynCE - Dev mailing list archive at Nabble.com.
Loading...