ChangeSet 1.2181.4.11, 2005/03/17 17:33:44-08:00, [EMAIL PROTECTED]

        [PATCH] USB: ohci zero length control IN transfers
        
        This fixes a longstanding bug in the OHCI driver, inherited from the 2.4
        code.  It also fixes a related comment in the EHCI driver, which came 
when
        the EHCI code was first derived from OHCI.  (The EHCI code doesn't have
        that bug; the comment was effectively "FIXME add bug".)
        
        The bug: control-IN transfers with no data stages have status stages 
with
        an IN packet (like a control-OUT transfer), instead of using an OUT 
packet.
        See figure 8-37 of the USB spec.  The current code makes trouble with 
some
        peripheral hardware and zero length IN transfers (scarce in the Real 
World).
        
        Signed-off-by: David Brownell <[EMAIL PROTECTED]>
        Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>



 ehci-q.c |    2 +-
 ohci-q.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
--- a/drivers/usb/host/ehci-q.c 2005-03-30 15:06:27 -08:00
+++ b/drivers/usb/host/ehci-q.c 2005-03-30 15:06:27 -08:00
@@ -522,7 +522,7 @@
        else
                buf = 0;
 
-       // FIXME this 'buf' check break some zlps...
+       /* for zero length DATA stages, STATUS is always IN */
        if (!buf || is_input)
                token |= (1 /* "in" */ << 8);
        /* else it's already initted to "out" pid (0 << 8) */
diff -Nru a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
--- a/drivers/usb/host/ohci-q.c 2005-03-30 15:06:27 -08:00
+++ b/drivers/usb/host/ohci-q.c 2005-03-30 15:06:27 -08:00
@@ -663,7 +663,7 @@
                        /* NOTE:  mishandles transfers >8K, some >4K */
                        td_fill (ohci, info, data, data_len, urb, cnt++);
                }
-               info = is_out
+               info = (is_out || data_len == 0)
                        ? TD_CC | TD_DP_IN | TD_T_DATA1
                        : TD_CC | TD_DP_OUT | TD_T_DATA1;
                td_fill (ohci, info, data, 0, urb, cnt++);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to