Bug 6175 - ipaq module won't work with devices with multiple endpoints
Summary: ipaq module won't work with devices with multiple endpoints
Status: REJECTED INVALID
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Greg Kroah-Hartman
URL:
Keywords:
Depends on:
Blocks: USB
  Show dependency tree
 
Reported: 2006-03-06 12:41 UTC by Danny Backx
Modified: 2006-03-15 11:23 UTC (History)
0 users

See Also:
Kernel Version: 2.6.* , up to 2.6.17
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Danny Backx 2006-03-06 12:41:11 UTC
Most recent kernel where this bug did not occur: n/a
Distribution: Mandriva
Hardware Environment:PC
Software Environment:Mandriva Linux 2006.0 (any other 2.6.* will do)
Problem Description:The IPAQ USB module won't work with devices with multiple
endpoints. The SYNCE website and source code has carried a fix for over a year
now, which the Linux kernel doesn't seem to pick up. Maybe nobody has reported
this? Their patch is included below. I've personally tested this against at
least five of the 2.6.* revisions and found it to work.

Steps to reproduce:
Plug in a device such as my Mitac Mio 268. 

See also at http://synce.sourceforge.net 

dannypc: {46} diff -c ipaq.c.orig  ipaq.c
*** ipaq.c.orig 2005-06-17 21:48:29.000000000 +0200
--- ipaq.c      2006-03-06 20:15:52.000000000 +0100
***************
*** 9,14 ****
--- 9,23 ----
   *    the Free Software Foundation; either version 2 of the License, or
   *    (at your option) any later version.
   *
+  * (11/09/2004) Pascal
+  *      Added vendor and product id for MiTAC Mio 168 which is also sold as
+  *      Yakumo PDA delta 300 GPS and bluemedia PDA 255.
+  *      Use modprobe ipaq ttyUSB=1 for them.
+  *
+  * (18/11/2003) Olivier
+  *      Added insmod options to specify the ttyUSB port for new iPAQ
+  *      Use modprobe ipaq ttyUSB=1 or ttyUSB=0
+  *
   * (12/12/2002) ganesh
   *    Added support for practically all devices supported by ActiveSync
   *    on Windows. Thanks to Wes Cilldhaire <billybobjoehenrybob@hotmail.com>.
***************
*** 65,76 ****
   * Version Information
   */
  
! #define DRIVER_VERSION "v0.5"
  #define DRIVER_AUTHOR "Ganesh Varadarajan <ganesh@veritas.com>"
  #define DRIVER_DESC "USB PocketPC PDA driver"
  
  static __u16 product, vendor;
  static int debug;
  
  /* Function prototypes for an ipaq */
  static int  ipaq_open (struct usb_serial_port *port, struct file *filp);
--- 74,86 ----
   * Version Information
   */
  
! #define DRIVER_VERSION "v0.6"
  #define DRIVER_AUTHOR "Ganesh Varadarajan <ganesh@veritas.com>"
  #define DRIVER_DESC "USB PocketPC PDA driver"
  
  static __u16 product, vendor;
  static int debug;
+ static int ttyUSB = 0;
  
  /* Function prototypes for an ipaq */
  static int  ipaq_open (struct usb_serial_port *port, struct file *filp);
***************
*** 937,943 ****
--- 947,959 ----
                ipaq_id_table[0].idVendor = vendor;
                ipaq_id_table[0].idProduct = product;
        }
+ 
+       ipaq_device.num_bulk_in = ttyUSB + 1;
+       ipaq_device.num_bulk_out = ttyUSB + 1;
+       ipaq_device.num_ports = ttyUSB + 1;
+ 
        retval = usb_register(&ipaq_driver);
+       dbg("%s - iPAQ module configured for port ttyUSB%d", __FUNCTION__, ttyUSB);
        if (retval)
                goto failed_usb_register;
                  
***************
*** 966,971 ****
--- 982,990 ----
  module_param(debug, bool, S_IRUGO | S_IWUSR);
  MODULE_PARM_DESC(debug, "Debug enabled or not");
  
+ module_param(ttyUSB, int, 0);
+ MODULE_PARM_DESC(ttyUSB, "User specified ttyUSB port number");
+ 
  module_param(vendor, ushort, 0);
  MODULE_PARM_DESC(vendor, "User specified USB idVendor");
Comment 1 Danny Backx 2006-03-06 12:49:55 UTC
The page http://synce.sourceforge.net/synce/usb_linux.php describes one way to
deal with the situation in the paragraph titled "Special information for HP iPAQ
5550 owners" (pasted below). The final line (then configure SynCE to use ttyUSB1
instead of ttyUSB0) depends on your actual setup, on my system the scripts based
on udev are handling this.

Also applies to the MiTAC Mio 168, also known as Bluemedia PDA 255 and Yakumo
Delta GPS 300!

    The HP iPAQ 5550 and some other newer devices, probably including the HP
iPAQ 4150, do not work with any currently existing version of the ipaq module.

    The problem is that these devices have more than one pair of USB endpoints.
(Compare the output from the usbview program for iPAQ 3970 and iPAQ 5550.)

    To fix this, apply ipaq-0.6-olivier.patch (courtesy of Olivier Dugeon),
compile the kernel module, and insert it like this:

    modprobe ipaq ttyUSB=1

    You could also put a line in your /etc/modules.conf or /etc/modprobe.conf
file for this:

    option ipaq ttyUSB=1

    Then configure SynCE to use ttyUSB1 instead of ttyUSB0.
Comment 2 Greg Kroah-Hartman 2006-03-06 14:22:29 UTC
Eeek, no, that patch is not correct.  Please work with the driver's author
and maintainer to fix this issue properly.
Comment 3 Danny Backx 2006-03-09 11:43:27 UTC
Should I be talking to Ganesh ?
Comment 4 Greg Kroah-Hartman 2006-03-09 14:06:22 UTC
Yup :)
Comment 5 Danny Backx 2006-03-14 09:38:24 UTC
I've sent Ganesh an E-mail but so far no reply has come.

Why did you say the patch was wrong? Did I do a diff against the wrong version,
or is there something wrong with the code itself ?
Comment 6 Greg Kroah-Hartman 2006-03-14 09:43:17 UTC
On Tue, Mar 14, 2006 at 09:38:25AM -0800, bugme-daemon@bugzilla.kernel.org wrote:
> Why did you say the patch was wrong? Did I do a diff against the wrong
> version,
> or is there something wrong with the code itself ?

The code itself.

It's not in the proper documented way to do a patch (as per
Documentation/SubmittingPatches), and you are trying to hard code a tty
number in the module paramater, which will not work properly if you have
more than one usb-serial device in the system at a time.
Comment 7 Danny Backx 2006-03-14 15:34:16 UTC
I'm not terribly familiar with kernel drivers.

Does this mean duplicating the ipaq_device structure (creating an array or a
linked list or so) ?
Could you point me to other drivers that deal with this issue ?

Thanks !
Comment 8 Greg Kroah-Hartman 2006-03-14 16:03:04 UTC
On Tue, Mar 14, 2006 at 03:34:17PM -0800, bugme-daemon@bugzilla.kernel.org wrote:
> Does this mean duplicating the ipaq_device structure (creating an array or a
> linked list or so) ?
> Could you point me to other drivers that deal with this issue ?

I don't really understand what you are trying to accomplish by this
patch.  How about describing your needs first.
Comment 9 Danny Backx 2006-03-15 11:23:17 UTC
Actually I didn't write the fixes.

I do own a Mio which is one of the devices that won't work without the patch,
the texts accompanying it make me believe this is related to the Mio having more
than the average number of 'endpoints'.

I've been tracking the released Linux kernel versions for a while, and every
time I upgrade, I need to recompile this module, and I wonder why the fixes from
the synce project don't make it into the mainstream kernel.

So here we are.

My last question was inspired by your remark that the patch hardcodes stuff
which won't work when multiple devices are attached.

My problem is that I can see the logic in your argument but I don't have
sufficient knowledge about USB and the way the USB drivers work to start
adapting the patch to meet the standards you request.

The other problem is I only have one Mio :-)

Do you see a way in which we can cooperate on this ?
Comment 10 Greg Kroah-Hartman 2006-03-15 14:16:13 UTC
On Wed, Mar 15, 2006 at 11:23:18AM -0800, bugme-daemon@bugzilla.kernel.org wrote:
> I've been tracking the released Linux kernel versions for a while, and every
> time I upgrade, I need to recompile this module, and I wonder why the fixes
> from
> the synce project don't make it into the mainstream kernel.

Because no one has submited them to the kernel developers?  Try working
with the author of the fixes and tell them to submit them to the
linux-usb-devel mailing list and we can take it from there.

Note You need to log in before you can comment on or make changes to this bug.