Changes to deal with mac serial ports having clock sources on DCD or CTS.
- When doing a first open, don't enable receive & status interupts before the MD layer has had a chance to set things up. - Enable logic to only enable DCD/CTS interupts if we are looking for/ expecting interupts on those pins. Disable otherwise. - in zs_param, only pass up the state of ZSRR0_DCD if we have enabled interupts on that pin. Henry Hotz (<hotz@jpl.nasa.gov>) and Greg walsh <gwalsh@artec.com> have tried these changes to get certain printers from hanging at boot. They work in a 1.3.2 kernel for Greg.
This commit is contained in:
parent
3ebca7fd4e
commit
f0559087e0
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: z8530tty.c,v 1.52 1998/10/01 18:52:42 drochner Exp $ */
|
||||
/* $NetBSD: z8530tty.c,v 1.53 1998/11/23 22:10:09 wrstuden Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998
|
||||
@ -309,10 +309,6 @@ zstty_attach(parent, self, aux)
|
||||
|
||||
s = splzs();
|
||||
|
||||
/* Turn on interrupts. */
|
||||
cs->cs_creg[1] = cs->cs_preg[1] = ZSWR1_RIE | ZSWR1_SIE;
|
||||
zs_write_reg(cs, 1, cs->cs_creg[1]);
|
||||
|
||||
/* Fetch the current modem control status, needed later. */
|
||||
cs->cs_rr0 = zs_read_csr(cs);
|
||||
|
||||
@ -324,6 +320,10 @@ zstty_attach(parent, self, aux)
|
||||
t.c_cflag = cs->cs_defcflag;
|
||||
/* Make sure zsparam will see changes. */
|
||||
tp->t_ospeed = 0;
|
||||
|
||||
/* Turn on interrupts when zsparam writes the chip. */
|
||||
cs->cs_creg[1] = cs->cs_preg[1] = ZSWR1_RIE | ZSWR1_SIE;
|
||||
|
||||
(void) zsparam(tp, &t);
|
||||
|
||||
s = splzs();
|
||||
@ -826,7 +826,7 @@ zsparam(tp, t)
|
||||
|
||||
cs->cs_rr0_mask = cs->cs_rr0_cts | cs->cs_rr0_dcd;
|
||||
tmp15 = cs->cs_preg[15];
|
||||
#if 0
|
||||
#if 1
|
||||
if (ISSET(cs->cs_rr0_mask, ZSRR0_DCD))
|
||||
SET(tmp15, ZSWR15_DCD_IE);
|
||||
else
|
||||
@ -924,9 +924,15 @@ zsparam(tp, t)
|
||||
/*
|
||||
* Update the tty layer's idea of the carrier bit, in case we changed
|
||||
* CLOCAL or MDMBUF. We don't hang up here; we only do that by
|
||||
* explicit request.
|
||||
* explicit request. Do this only if we have enabled interrupts on
|
||||
* this pin. mac68k and macppc serial ports might have a clock on
|
||||
* DCD, and so it makes no sense to pass the clock state further up
|
||||
* the tty system.
|
||||
*/
|
||||
(void) (*linesw[tp->t_line].l_modem)(tp, ISSET(cs->cs_rr0, ZSRR0_DCD));
|
||||
if (ISSET(cs->cs_rr0_mask, ZSRR0_DCD)) {
|
||||
(void) (*linesw[tp->t_line].l_modem)(tp,
|
||||
ISSET(cs->cs_rr0, ZSRR0_DCD));
|
||||
}
|
||||
|
||||
if (!ISSET(cflag, CHWFLOW)) {
|
||||
if (zst->zst_tx_stopped) {
|
||||
|
Loading…
Reference in New Issue
Block a user