Connecting your Windows Mobile 2005 device via USB (usb-rndis-lite)


From SynCE-Wiki

Windows Mobile 2005 Support: Installing SynCE, Connecting Your Device, Using SynCE, Troubleshooting

These instructions let you connect your Windows Mobile 2005 device, via USB, to your computer, using the usb-rdnis-lite kernel module.

Contents

Instructions for kernels >= 2.6.21

As of version 2.6.21, the Linux kernel has most of the required support built in, and thus doesn't require the usb-rndis-lite driver. However, you still need to apply a patch to the kernel source for it to work.

For kernel version 2.6.21:

 cd /usr/src/linux
 wget http://synce.svn.sourceforge.net/svnroot/synce/trunk/patches/linux-2.6.21-rndis_host-wm5.patch
 patch -p1 < linux-2.6.21-rndis_host-wm5.patch

For kernel version 2.6.22:

 cd /usr/src/linux
 wget http://synce.svn.sourceforge.net/svnroot/synce/trunk/patches/linux-2.6.22-rndis_host-wm5.patch
 patch -p1 < linux-2.6.22-rndis_host-wm5.patch

You need the following options in your kernel config:

 CONFIG_USB_USBNET=y
 CONFIG_USB_NET_CDCETHER=y
 CONFIG_USB_NET_RNDIS_HOST=y

Compiling them as modules should also work. Finally, build and install your kernel as usual.

Instructions for kernels < 2.6.21

Download the Driver

Package

Download synce-usb-rndis-lite-0.10.0.tar.gz and then:

tar zxf synce-usb-rndis-lite-0.10.0.tar.gz
cd synce-usb-rndis-lite-0.10.0/

Subversion

Download the usb-rndis driver from the Subversion repository. For this you must have a subversion installed. Execute:

svn co https://svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite
cd usb-rndis-lite/

Compile and Install

Note: you must have your Kernel Headers installed:

Note: You need to have CONFIG_USB_NET_CDCETHER compiled either into the kernel, or as a module, in your kernel config. Located in Device Drivers -> USB support -> USB Gadget support -> Ethernet Gadget

Then you have to

cd usb-rndis-lite/
make
sudo ./clean.sh
sudo make install

If you don't use or understand sudo, you can use normal su for the last two commands:

cd usb-rndis-lite/
make
su
(enter root password)
./clean.sh
make install

If you get no errors with the last step, you can plug your device into the computer. This should automatically load the new usb-rndis driver that was just installed.

Success

Well done! You now have the device and computer successfully connected! Next, you must install SynCE to use your connection to your device. Next step:

Starting A Connection

Troubleshooting

Bad CDC Errors

If you get an error as below:

usb 2-1: new full speed USB device using ohci_hcd and address 13
usb 2-1: configuration #1 chosen from 1 choice
usbcore: registered new driver cdc_ether
usb 2-1: bad CDC descriptors
usbcore: registered new driver rndis_host
usb 2-1: USB disconnect, address 13

Then there a couple of things to try. First of all, make sure your kernel is configured with the CONFIG_USB_NET_RNDIS_HOST or CONFIG_USB_NET_RNDIS_HOST_MODULE option. Without this, the driver will be built without ActiveSync support.

The module can be found in:

Device Drivers
 > USB Support
  > USB Network Adapters
   > Multipurpose USB Networking Framework
    > Host for RNDIS Devices

If this doesn't help, then please uncomment the lines "#DEBUG" and "#VERBOSE" at the top of cdc_ether.c. They should look like this:

#define	DEBUG			// error path messages, extra info
#define	VERBOSE			// more; success messages

Then run through the make / clean / make install procedure and you should have an extra message.

usb 2-1: new full speed USB device using ohci_hcd and address 13
usb 2-1: configuration #1 chosen from 1 choice
usbcore: registered new driver cdc_ether
rndis_host 2-1:1.0: missing cdc header union ether descriptor
usb 2-1: bad CDC descriptors
usbcore: registered new driver rndis_host
usb 2-1: USB disconnect, address 13

As you can see, it now gives us a message from rndis_host. Please include this in a message to the mailing list or when you are on IRC.

Find Device Interface

The synce will take care of identifying your device and assigning it an ip address, but for debugging and to prove everything worked it may be handy to know a little about the interface it is creating for you. To do this, execute the following command:

dmesg | grep "rndis[0-9]: register" | grep "rndis_host" | tail -1

If everything went smoothly then you should have been outputted a line like this:

rndis0: register 'rndis_host' at usb-0000:00:10.1-2.1, RNDIS device, 80:00:60:0f:e8:00

The interface in this example is rndis0.