NetBSD Problem Report #10573

Received: (qmail 17838 invoked from network); 12 Jul 2000 17:47:43 -0000
Message-Id: <200007121747.e6CHlRG00614@kiku.my.domain>
Date: Thu, 13 Jul 2000 02:47:27 +0900 (JST)
From: IWAMOTO Toshihiro <iwamoto@sat.t..u-tokyo.ac.jp>
Reply-To: IWAMOTO Toshihiro <iwamoto@sat.t.u-tokyo.ac.jp>
To: gnats-bugs@gnats.netbsd.org
Subject: uftdi drops characters
X-Send-Pr-Version: 3.95

>Number:         10573
>Category:       kern
>Synopsis:       uftdi drops characters
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 12 17:49:00 +0000 2000
>Closed-Date:    Sun Sep 03 19:32:03 +0000 2000
>Last-Modified:  Sun Sep 03 19:32:03 +0000 2000
>Originator:     IWAMOTO Toshihiro
>Release:        a few days ago -current
>Organization:

>Environment:

System: NetBSD kiku.my.domain 1.5B NetBSD 1.5B (KIKU) #44: Tue Jul 11 22:11:25 JST 2000 toshii@kiku.my.domain:/usr/src/syssrc/sys/arch/i386/compile/KIKU i386


>Description:
	The uftdi/ucom driver drops one byte for every 64 bytes of output,
	if output data are written in large chunks.
	This is because ucomwritecb considers the amount of written data
	is the same as the amount of transferred bytes in USB layer.
	This is not true for the uftdi case as each outgoing USB packet
	has one byte padding.

>How-To-Repeat:
	I discovered this bug while trying to create a slip link over
	/dev/ttyU0.
>Fix:
	The code below works around the problem.
	The real fix will be to add a member to ucom_softc to hold
	padding length (or a function which converts USB transferred bytes
	to tty written bytes).

--- /sys/dev/usb/ucom.c	Thu Mar  2 11:45:38 2000
+++ ./ucom.c	Thu Jul 13 02:03:49 2000
@@ -913,6 +913,9 @@
 	usbd_get_xfer_status(xfer, NULL, NULL, &cc, NULL);
 	DPRINTFN(5,("ucomwritecb: cc=%d\n", cc));

+	/* XXX uftdi specific */
+	cc = (cc > 0) ? cc - 1 : 0;
+
 	s = spltty();
 	CLR(tp->t_state, TS_BUSY);
 	if (ISSET(tp->t_state, TS_FLUSH))
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: augustss 
State-Changed-When: Sun Sep 3 12:31:11 PDT 2000 
State-Changed-Why:  
New patch applied. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.