ChangeSet 1.790, 2002/12/05 14:21:30-08:00, ganesh@tuxtop.vxindia.veritas.com [PATCH] USB ipaq: added support for insmod options to specify vendor/product id this will allow people to try out new wince/pocketpc2k devices without having to recompile the module. diff -Nru a/Documentation/usb/usb-serial.txt b/Documentation/usb/usb-serial.txt --- a/Documentation/usb/usb-serial.txt Thu Dec 5 14:48:28 2002 +++ b/Documentation/usb/usb-serial.txt Thu Dec 5 14:48:28 2002 @@ -98,10 +98,11 @@ Compaq iPAQ, HP Jornada and Casio EM500 driver This driver can be used to connect to Compaq iPAQ, HP Jornada and Casio EM500 - PDAs running Windows CE 3.0 or PocketPC 2002 using a USB cable/cradle. It - has been tested only on the Compaq H3135, but is rumoured to work on - with the H3600 and later models as well as the Jornada 548 and 568. - With minor modifications, it may work for other CE based handhelds too. + PDAs running Windows CE 3.0 or PocketPC 2002 using a USB cable/cradle. + It's very likely that every device supported by ActiveSync USB works with this + driver. The driver supports the Compaq iPAQ, Jornada 548/568 and the Casio + EM500 out of the box. For others, please use module parameters to specify + the product and vendor id. e.g. modprobe ipaq vendor=0x3f0 product=0x1125 The driver presents a serial interface (usually on /dev/ttyUSB0) over which one may run ppp and establish a TCP/IP link to the iPAQ. Once this @@ -109,36 +110,12 @@ significant advantage of using USB is speed - you can get 73 to 113 kbytes/sec for download/upload to the iPAQ. - The driver works intermittently with the usb-uhci driver but quite - reliably with the uhci driver. However, performance is much better - with usb-uhci. It does not seem to work with ohci at all. + This driver is only one of a set of components required to utilize + the USB connection. Please visit http://synce.sourceforge.net which + contains the necessary packages and a simple step-by-step howto. - You must setup hotplug to invoke pppd as soon as the iPAQ is connected. - A ppp script like the one below should be kept in the file - /etc/hotplug/usb/ipaq Remember to chmod +x. Make sure there are no - options in /etc/ppp/options or ~/.ppprc which conflict with the ones - given below. - - #!/bin/bash - - MYIP=linux.box.ip - REMOTEIP=ipaq.ip - MYDNS=my.dns.server - killall -9 pppd - /usr/sbin/pppd /dev/ttyUSB0 \ - connect "/usr/sbin/chat -v TIMEOUT 60 CLIENT 'CLIENTSERVER\c'" \ - nocrtscts local debug passive $MYIP:$REMOTEIP ms-dns $MYDNS noauth \ - proxyarp - - You must also download and install asyncd from http://synce.sourceforge.net - This is required to emulate keep-alive packets which are exchanged by - ActiveSync and the iPAQ. - - On connecting the cable, you should see the usual "Device Connected", - "User Authenticated" messages flash by on your iPAQ. Once connected, - you can use Win CE programs like ftpView, Pocket Outlook from the iPAQ - and xcerdisp, synce utilities from the Linux side. Remember to enable IP - forwarding. + Once connected, you can use Win CE programs like ftpView, Pocket Outlook + from the iPAQ and xcerdisp, synce utilities from the Linux side. To use Pocket IE, follow the instructions given at http://www.tekguru.co.uk/EM500/usbtonet.htm to achieve the same thing diff -Nru a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c --- a/drivers/usb/serial/ipaq.c Thu Dec 5 14:48:28 2002 +++ b/drivers/usb/serial/ipaq.c Thu Dec 5 14:48:28 2002 @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * (26/11/2002) ganesh + * Added insmod options to specify product and vendor id. + * Use modprobe ipaq vendor=0xfoo product=0xbar + * * (26/7/2002) ganesh * Fixed up broken error handling in ipaq_open. Retry the "kickstart" * packet much harder - this drastically reduces connection failures. @@ -63,10 +67,13 @@ /* * Version Information */ -#define DRIVER_VERSION "v0.3" + +#define DRIVER_VERSION "v0.4" #define DRIVER_AUTHOR "Ganesh Varadarajan " #define DRIVER_DESC "USB Compaq iPAQ, HP Jornada, Casio EM500 driver" +static int product, vendor; + /* Function prototypes for an ipaq */ static int ipaq_open (struct usb_serial_port *port, struct file *filp); static void ipaq_close (struct usb_serial_port *port, struct file *filp); @@ -85,6 +92,8 @@ static struct usb_device_id ipaq_id_table [] = { + /* The first entry is a placeholder for the insmod-specified device */ + { USB_DEVICE(COMPAQ_VENDOR_ID, COMPAQ_IPAQ_ID) }, { USB_DEVICE(COMPAQ_VENDOR_ID, COMPAQ_IPAQ_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_JORNADA_548_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_JORNADA_568_ID) }, @@ -517,8 +526,12 @@ static int __init ipaq_init(void) { spin_lock_init(&write_list_lock); - usb_serial_register(&ipaq_device); info(DRIVER_DESC " " DRIVER_VERSION); + if (vendor) { + ipaq_id_table[0].idVendor = vendor; + ipaq_id_table[0].idProduct = product; + } + usb_serial_register(&ipaq_device); return 0; } @@ -540,3 +553,8 @@ MODULE_PARM(debug, "i"); MODULE_PARM_DESC(debug, "Debug enabled or not"); +MODULE_PARM(vendor, "h"); +MODULE_PARM_DESC(vendor, "User specified USB idVendor"); + +MODULE_PARM(product, "h"); +MODULE_PARM_DESC(product, "User specified USB idProduct");