Hi, 

the usbserial driver can have two parameters, vendor=0xXXXX and
product=0xYYYY. Currently they are defined as 'h' which is 16 bit
(correct), but _signed_. This means that IDs larger than 0x7FFF do not
work right now. 

The fix below is my quickhack - maybe somebody has a better idea. 

Robert


diff -urN linux-2.6.5/drivers/usb/serial/generic.c 
linux-2.6.5-hynixusbhost1/drivers/usb/serial/generic.c
--- linux-2.6.5/drivers/usb/serial/generic.c    2004-04-04 05:36:18.000000000 +0200
+++ linux-2.6.5-hynixusbhost1/drivers/usb/serial/generic.c      2004-04-15 
19:49:58.000000000 +0200
@@ -29,13 +29,14 @@
 
        
 #ifdef CONFIG_USB_SERIAL_GENERIC
-static __u16 vendor  = 0x05f9;
-static __u16 product = 0xffff;
+/* 'h' is signed, so we use 'l' here to get full 16 bits */
+static long vendor  = 0x05f9;
+static long product = 0xffff;
 
-MODULE_PARM(vendor, "h");
+MODULE_PARM(vendor, "l");
 MODULE_PARM_DESC(vendor, "User specified USB idVendor");
 
-MODULE_PARM(product, "h");
+MODULE_PARM(product, "l");
 MODULE_PARM_DESC(product, "User specified USB idProduct");
 
 static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
@@ -60,8 +61,12 @@
 
        debug = _debug;
 #ifdef CONFIG_USB_SERIAL_GENERIC
-       generic_device_ids[0].idVendor = vendor;
-       generic_device_ids[0].idProduct = product;
+       if ((vendor & 0xFFFF0000) || (product & 0xFFFF0000)) {
+               printk("vendor and product id have to be 16 bit - using defaults\n");
+               vendor = 0x05f9; product = 0xffff;
+       }
+       generic_device_ids[0].idVendor = (u16)vendor;
+       generic_device_ids[0].idProduct = (u16)product;
        generic_device_ids[0].match_flags = USB_DEVICE_ID_MATCH_VENDOR | 
USB_DEVICE_ID_MATCH_PRODUCT;
 
        /* register our generic driver with ourselves */

-- 
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hornemannstra�e 12,  31137 Hildesheim, Germany
    Phone: +49-5121-28619-0 |  Fax: +49-5121-28619-4


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to