Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys/dev/usb Pullup revision 1.27 (approved by thorpej):
details: https://anonhg.NetBSD.org/src/rev/a2a6f7865af8
branches: netbsd-1-5
changeset: 489440:a2a6f7865af8
user: toshii <toshii%NetBSD.org@localhost>
date: Tue Sep 12 08:43:58 2000 +0000
description:
Pullup revision 1.27 (approved by thorpej):
Make the control line handling a little better. Avoid a DTR/RTS issue
from uninitialized sc_mcr by not calling ucom_{dtr,rts} if possible.
diffstat:
sys/dev/usb/ucom.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diffs (39 lines):
diff -r c07ada452b32 -r a2a6f7865af8 sys/dev/usb/ucom.c
--- a/sys/dev/usb/ucom.c Tue Sep 12 00:56:57 2000 +0000
+++ b/sys/dev/usb/ucom.c Tue Sep 12 08:43:58 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ucom.c,v 1.24.2.2 2000/09/09 02:11:30 toshii Exp $ */
+/* $NetBSD: ucom.c,v 1.24.2.3 2000/09/12 08:43:58 toshii Exp $ */
/*
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -642,8 +642,10 @@
break;
}
- ucom_dtr(sc, (sc->sc_mcr & UMCR_DTR) != 0);
- ucom_rts(sc, (sc->sc_mcr & UMCR_RTS) != 0);
+ if (how == TIOCMSET || ISSET(combits, UMCR_DTR))
+ ucom_dtr(sc, (sc->sc_mcr & UMCR_DTR) != 0);
+ if (how == TIOCMSET || ISSET(combits, UMCR_RTS))
+ ucom_rts(sc, (sc->sc_mcr & UMCR_RTS) != 0);
}
Static int
@@ -712,9 +714,16 @@
void
ucom_status_change(struct ucom_softc *sc)
{
+ struct tty *tp = sc->sc_tty;
+ u_char old_msr;
+
if (sc->sc_methods->ucom_get_status != NULL) {
+ old_msr = sc->sc_msr;
sc->sc_methods->ucom_get_status(sc->sc_parent, sc->sc_portno,
&sc->sc_lsr, &sc->sc_msr);
+ if (ISSET((sc->sc_msr ^ old_msr), UMSR_DCD))
+ (*linesw[tp->t_line].l_modem)(tp,
+ ISSET(sc->sc_msr, UMSR_DCD));
} else {
sc->sc_lsr = 0;
sc->sc_msr = 0;
Home |
Main Index |
Thread Index |
Old Index