From 191e9dab58aa6ef57afb28a1f2094c4fd51f364e Mon Sep 17 00:00:00 2001 From: augustss Date: Wed, 18 May 2005 11:26:11 +0000 Subject: [PATCH] Handle DCD differently so it's not always asserted. From kern/30268 from Wolfgang Stukenbrock. --- sys/dev/usb/ucom.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index c2db5734c358..c0b7725554b7 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -1,4 +1,4 @@ -/* $NetBSD: ucom.c,v 1.53 2004/09/13 12:55:49 drochner Exp $ */ +/* $NetBSD: ucom.c,v 1.54 2005/05/18 11:26:11 augustss Exp $ */ /* * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.53 2004/09/13 12:55:49 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.54 2005/05/18 11:26:11 augustss Exp $"); #include #include @@ -793,7 +793,8 @@ ucom_status_change(struct ucom_softc *sc) ISSET(sc->sc_msr, UMSR_DCD)); } else { sc->sc_lsr = 0; - sc->sc_msr = 0; + /* Assume DCD is present, if we have no chance to check it. */ + sc->sc_msr = UMSR_DCD; } } @@ -850,7 +851,7 @@ ucomparam(struct tty *tp, struct termios *t) * explicit request. */ DPRINTF(("ucomparam: l_modem\n")); - (void) (*tp->t_linesw->l_modem)(tp, 1 /* XXX carrier */ ); + (void) (*tp->t_linesw->l_modem)(tp, ISSET(sc->sc_msr, UMSR_DCD)); #if 0 XXX what if the hardware is not open