From owner-freebsd-bugs Tue Oct 23 9:10: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 0F37437B403 for ; Tue, 23 Oct 2001 09:10:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9NGA1729732; Tue, 23 Oct 2001 09:10:01 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 63A5837B406 for ; Tue, 23 Oct 2001 09:05:20 -0700 (PDT) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9NG5Ku28308; Tue, 23 Oct 2001 09:05:20 -0700 (PDT) (envelope-from nobody) Message-Id: <200110231605.f9NG5Ku28308@freefall.freebsd.org> Date: Tue, 23 Oct 2001 09:05:20 -0700 (PDT) From: Hiroyuki Aizu To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/31455: [PATCH] ohci driver probrem when send data with USBD_FORCE_SHORT_XFER flag. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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