From owner-freebsd-current@FreeBSD.ORG Sun Sep 20 09:25:44 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D00F10656A6 for ; Sun, 20 Sep 2009 09:25:44 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.swip.net [212.247.154.193]) by mx1.freebsd.org (Postfix) with ESMTP id 87AA58FC1F for ; Sun, 20 Sep 2009 09:25:43 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=J56WAFSd9XEA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=6I5d2MoRAAAA:8 a=NoP2jsijBYDE3IZBBMQA:9 a=BxZhHmUpnnJzSMqHOoQA:7 a=JyrkJIhivALdUCG4bD_eoGCUKPcA:4 a=6QAPRyzfe0AA:10 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe07.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 1300746551; Sun, 20 Sep 2009 11:25:39 +0200 From: Hans Petter Selasky To: Greg Rivers Date: Sun, 20 Sep 2009 11:26:14 +0200 User-Agent: KMail/1.11.4 (FreeBSD/9.0-CURRENT; KDE/4.2.4; i386; ; ) References: <200909191553.12645.hselasky@c2i.net> In-Reply-To: X-Face: (%:6u[ldzJ`0qjD7sCkfdMmD*RxpOwEEQ+KWt[{J#x6ow~JO:,zwp.(t; @Aq :4:&nFCgDb8[3oIeTb^'",;u{5{}C9>"PuY\)!=#\u9SSM-nz8+SR~B\!qBv MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909201126.15417.hselasky@c2i.net> Cc: freebsd-current@freebsd.org Subject: Re: USB-to-serial adapter no longer working in 8.0-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 09:25:44 -0000 On Saturday 19 September 2009 20:13:33 Greg Rivers wrote: > On Sat, 19 Sep 2009, Hans Petter Selasky wrote: > > On Saturday 19 September 2009 05:40:28 Greg Rivers wrote: > >> Last May, Hans Petter Selasky fixed up the umct driver for 8.0-CURRENT > >> (http://lists.freebsd.org/pipermail/freebsd-current/2009-May/007125.html > >>). After updating to 8.0-RC1 I find that the driver has a new problem. > >> > >> Testing with cu(1) and a modem, I can see by watching the lights on the > >> modem and on the usb-serial adapter that it still asserts DTR and sends > >> and receives characters properly, but no characters reach the terminal. > >> That seems to be the only problem: characters from the attached serial > >> device seem to disappear before reaching whatever program has the serial > >> device open. But strangely enough, power cycling the modem results in a > >> few "line noise" characters appearing. Perhaps the driver is no longer > >> responding appropriately to DSR? > >> > >> Any insight or troubleshooting clues would be much appreciated. > > > > Hi, > > > > You need to provide debug output from: > > > > sysctl hw.usb.ucom.debug=15 > > > > and > > > > sysctl hw.usb.umct.debug=15 > > > > If it exists. > > hw.usb.umct does not exist, but hw.usb.ucom does. Here's debug output with > hw.usb.ucom.debug set to 15. I tested with a modem because it's easy to > interact with. > > Attach USB-serial adapter to USB port: > ugen1.2: at usbus1 > umct0: addr 2> on usbus1 ucom_attach_tty:317: tp = 0xc5644200, unit = 0 > ucom_attach_tty:346: ttycreate: U0 > > Open /dev/cuaU0 via 'cu -l cuaU0 -s 115200 dir': > ucom_open:554: tp = 0xc5644200 > ucom_dtr:827: onoff = 1 > ucom_line_state:799: on=0x01, off=0x00 > ucom_rts:838: onoff = 1 > ucom_line_state:799: on=0x02, off=0x00 > ucom_break:816: onoff = 0 > ucom_line_state:799: on=0x00, off=0x04 > ucom_status_change:901: > ucom_param:950: sc = 0xc5433230 > ucom_dtr:827: onoff = 1 > ucom_line_state:799: on=0x01, off=0x00 > ucom_rts:838: onoff = 1 > ucom_line_state:799: on=0x02, off=0x00 > ucom_cfg_open:520: > ucom_ioctl:653: cmd = 0x402c7413 > ucom_ioctl:653: cmd = 0x802c7416 > ucom_ioctl:653: cmd = 0x2000740d > ucom_ioctl:653: cmd = 0x402c7413 > ucom_ioctl:653: cmd = 0x802c7416 > ucom_param:950: sc = 0xc5433230 > ucom_ioctl:653: cmd = 0x8004667e > ucom_ioctl:653: cmd = 0x8004667d > ucom_get_data:1064: cnt=0 > > Type "atz" (modem resets, responds with "OK"): > ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > ucom_status_change:901: > > Type "atdt" (modem goes off hook, > finds no dial tone, prints "NO DIALTONE", hangs up): > ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > ucom_status_change:901: > last message repeated 2 times > > Type "atz" (modem resets, responds with "OK"): > ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > ucom_status_change:901: > > Type "~." to exit cu: > ucom_ioctl:653: cmd = 0x2000740e > ucom_ioctl:653: cmd = 0x2000740e > ucom_close:623: tp=0xc5644200 > ucom_shutdown:446: > ucom_dtr:827: onoff = 0 > ucom_line_state:799: on=0x00, off=0x01 > ucom_rts:838: onoff = 1 > ucom_line_state:799: on=0x02, off=0x00 > ucom_cfg_close:605: > > Detach USB-serial adapter from USB port: > ugen1.2: at usbus1 (disconnected) > umct0: at uhub0, port 1, addr 2 (disconnected) > ucom_detach_tty:358: sc = 0xc5433230, tp = 0xc5644200 > ucom_close:623: tp=0xc5644200 > ucom_close:626: tp=0xc5644200 already closed > > Note that none of the characters output by the modem made it to cu. Each > sequence of ucom_outwakeup:1009: sc = 0xc5433230 > ucom_get_data:1064: cnt=1 > ucom_get_data:1064: cnt=0 > corresponds to me typing a character. There are no debug lines > corresponding to characters output by the modem, so they must be getting > dropped prior to reaching the ucom driver. > > I also tested with a 8.0-BETA2 system from July 18; it has the same > problem. But I know that it was working on 8.0-CURRENT as recently as > the first week of June. It still works fine on recent 7.2-STABLE. /* * The real bulk-in endpoint is also marked as an interrupt. * The only way to differentiate it from the real interrupt * endpoint is to look at the wMaxPacketSize field. */ #ifdef XXX maxp = UGETW(sc->sc_xfer[UMCT_BULK_DT_RD]->endpoint->edesc->wMaxPacketSize); if (maxp == 0x2) { /* guessed wrong - switch around endpoints */ struct usb_xfer *temp = sc->sc_xfer[UMCT_INTR_DT_RD]; sc->sc_xfer[UMCT_INTR_DT_RD] = sc->sc_xfer[UMCT_BULK_DT_RD]; sc->sc_xfer[UMCT_BULK_DT_RD] = temp; sc->sc_xfer[UMCT_BULK_DT_RD]->callback = &umct_read_callback; sc->sc_xfer[UMCT_INTR_DT_RD]->callback = &umct_intr_callback; } #endif Could you try to change this into #if 1 ? --HPS Hi, I see some code was commented out in umct.c: