Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Oct 2001 09:05:20 -0700 (PDT)
From:      Hiroyuki Aizu <aizu@navi.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/31455: [PATCH] ohci driver probrem when send data with USBD_FORCE_SHORT_XFER flag.
Message-ID:  <200110231605.f9NG5Ku28308@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         31455
>Category:       kern
>Synopsis:       [PATCH] ohci driver probrem when send data with USBD_FORCE_SHORT_XFER flag.
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 23 09:10:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Hiroyuki Aizu
>Release:        4-STABLE and 4.3-RELEASE 4.4-RELEASE
>Organization:
>Environment:
FreeBSD one.navi.org 4.4-STABLE FreeBSD 4.4-STABLE #13: Tue Oct 23 16:55:38 JST 2001     aizu@one.navi.org:/usr/src/sys/compile/ONE  i386
>Description:
The USB Ethernet adoptor that use the aue driver didn't work with OHCI controller machine.
Because when any packet send to anywhere, aue driver try to transfer the data with set USBD_FORCE_SHORT_XFER flag on,
the OHCI driver failed handling 0 size packet.
The NetBSD's code was helpfull to solve this problem.

>How-To-Repeat:
Plug the aue USB Ethernet adoptor to the machine that have USB OHCI controller and send packet anywhere.


>Fix:
Apply following patch.
This fix  effective to both of -stable and -current, I think.

--- ohci.c.orig Wed Nov  1 08:23:29 2000
+++ ohci.c      Tue Oct 23 16:55:12 2001
@@ -551,6 +551,10 @@
        if ((flags & USBD_FORCE_SHORT_XFER) &&
            len % UGETW(opipe->pipe.endpoint->edesc->wMaxPacketSize) == 0) {
                /* Force a 0 length transfer at the end. */
+
+               cur->td.td_flags = LE(tdflags | OHCI_TD_NOINTR);
+               cur = next;
+
                next = ohci_alloc_std(sc);
                if (next == 0)
                        goto nomem;
@@ -559,10 +563,9 @@
                cur->td.td_cbp = 0; /* indicate 0 length packet */
                cur->nexttd = next;
                cur->td.td_nexttd = LE(next->physaddr);
-               cur->td.td_be = LE(dataphys - 1);
+               cur->td.td_be = ~0;
                cur->len = 0;
                cur->flags = 0;
-               cur = next;
                DPRINTFN(2,("ohci_alloc_std_chain: add 0 xfer\n"));
        }
        cur->flags = OHCI_CALL_DONE | OHCI_ADD_LEN;

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110231605.f9NG5Ku28308>