Fw: PATCH: ehci-q.c

"Sergio Arcangeli" <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <006e01c82dc7$cae22820$635a6dc1@tlbsergio>
Hi all,

    I'm workig on a porting on linux of a device driver for a double-side 
scanner.

    This device is equipped by a Cypress FX2 usb2.0 controller that, by the 
OEM, is configured
for bulk I/O with EndPoint "MaxPacketSize=1024", non usb2.0-compliant but 
supported by hardware and software device drivers on MS-Windows systems.

This problem is known (cfr the J. C. Andrus - 
http://lkml.org/lkml/2007/4/13/199) but is still present also in the recent 
kernel release: When the device send packets which were 1024 bytes in size, 
the urb came back with a status set to -EOVERFLOW.

    Instead of the solution proposed by J. C. Andrus, that is implemented 
for backward compatibility with a special urb flag that implies a more 
complex coding of bulk transfers, I made a simple "Endpoint Descriptor" 
driven solution, using the same logic alwais used for "INTERRUPT" EndPoint, 
that is still backward-compatible, but supports also new devices 
non-usb2.0-compliants.

    This solution is also "transparent" to current usb libraries and no 
special urb-flags are required, permitting the use of the high-level 
functions of current usblibs.

    In all tests I made, all USB devices working with Bulk transfer I 
connected (External HD&DVD, PenDrives, TV-Tuner and SkypePhone) are still 
working with their alredy installed drivers.

    It's possible to include this patch (or an analogue but working 
solution) in next releases of usb kernel module ?


All comments will be appreciated !

Thanks and ciao,
  Sergio
s.arcangeli[at]telematica.it

___________________________________________________________________________________________________________

--- ehci-q.c_old 2007-07-09 01:32:17.000000000 +0200
+++ ehci-q.c 2007-11-23 02:16:14.000000000 +0100
@@ -20,6 +20,14 @@

 /*-------------------------------------------------------------------------*/+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTENOTE+ * Patched by S.Arcangeli to let it work with Cypress FX2 chipset thatallows+ * non 2.0-compliant Bulk transfers. The queue always uses theMaxPacketSize+ * value declared by the EndPoint Descriptor instead of the 512 Fixedvalue.+ * By this way the queue is well working also with these non standarddevices.+ * See down rows 459-460, 764-765+ */+ /*  * EHCI hardware queue manipulation ... the core.  QH/QTD manipulation.  *@@ -448,6 +456,8 @@ #define hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03)) // ... and packet size, for any kind of endpoint descriptor #define max_packet(wMaxPacketSize) ((wMaxPacketSize) & 0x07ff)+// ...
  but bulk endpoints can work only with packetsize of 512 or 1024bytes+#define max_bulkpacket(wMaxPacketSize) (max_packet(wMaxPacketSize) > 512 ?1024 : 512) /*  * reverse of qh_urb_transactio
 n:  free

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.