Greetings all.  The usb developers are playing with the sizes of
the /proc/bus/usb device descriptor files:

(1) In 2.5.2 the files say they have size zero (but you can read 18 bytes from them)
(2) But they are going to have
  size = size of device descriptor (18) + size of current config's descriptors 
(variable),
and that's how many bytes you will be able to read.

The code in pusb-linux.c
(a) stats the files and checks if they have size 18.
If they do, it tries to
(b) read 18 bytes and checks if 18 bytes were indeed read.

As you can see, (a) is redundant since (b) in effect checks that
the file contains at least 18 bytes.  What is more, (a) is no good
because of (1) and (2) above.  The only use of (a) that I can see
is to check that the file has NO MORE than 18 bytes; but that is
no good because of (2); it is also pointless (as far as I can see).

So here is a patch to remove (a).  This allows the driver to work
with eg the 2.5.2 kernel.

All the best,

Duncan.

--- speedtouch/src/pusb-linux.c Sun Nov 11 16:48:06 2001
+++ speedtouch-new/src/pusb-linux.c     Tue Jan 22 08:39:36 2002
@@ -489,13 +489,6 @@
                
                if (S_ISREG(statbuf.st_mode)) {
 
-                       /*
-                       * Check the file size, which must be 18 
-                       * == sizeof(struct usb_device_descriptor)
-                       */
-                       if (statbuf.st_size != sizeof(struct usb_device_descriptor))
-                               continue;
-                       
                        if ((result=test_file(file,vendorID,productID)) < 0)
                                continue;
                        else


Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se d�sinscrire : mailto:[EMAIL PROTECTED]?subject=unsubscribe

        

Reply via email to