summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2015-02-05 12:04:58 +0000
committermiod <miod@openbsd.org>2015-02-05 12:04:58 +0000
commit243b91c00853df26882e32c7bbc36679961bbe10 (patch)
tree803d0169614f2c339f4885f5dbc700f5bd194a4d
parentReset bracket paste mode on detach. (diff)
downloadwireguard-openbsd-243b91c00853df26882e32c7bbc36679961bbe10.tar.xz
wireguard-openbsd-243b91c00853df26882e32c7bbc36679961bbe10.zip
Do what the comments suggest and check for port-[ab]-ignore-cd properties,
and if so, force soft carrier mode.
-rw-r--r--sys/arch/sparc/dev/zs.c16
-rw-r--r--sys/arch/sparc64/dev/zs.c12
-rw-r--r--sys/dev/ic/z8530tty.c7
3 files changed, 26 insertions, 9 deletions
diff --git a/sys/arch/sparc/dev/zs.c b/sys/arch/sparc/dev/zs.c
index ff36ff0e1d7..9ce511747b3 100644
--- a/sys/arch/sparc/dev/zs.c
+++ b/sys/arch/sparc/dev/zs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zs.c,v 1.54 2013/12/19 20:11:04 miod Exp $ */
+/* $OpenBSD: zs.c,v 1.55 2015/02/05 12:04:58 miod Exp $ */
/* $NetBSD: zs.c,v 1.50 1997/10/18 00:00:40 gwr Exp $ */
/*-
@@ -140,7 +140,7 @@ u_char zs_init_reg[16] = {
0, /* 1: No interrupts yet. */
0, /* 2: IVECT */
ZSWR3_RX_8 | ZSWR3_RX_ENABLE,
- ZSWR4_CLK_X16 | ZSWR4_ONESB | ZSWR4_EVENP,
+ ZSWR4_CLK_X16 | ZSWR4_ONESB,
ZSWR5_TX_8 | ZSWR5_TX_ENABLE,
0, /* 6: TXSYNC/SYNCLO */
0, /* 7: RXSYNC/SYNCHI */
@@ -236,8 +236,7 @@ zs_match(parent, vcf, aux)
/*
* Attach a found zs.
*
- * USE ROM PROPERTIES port-a-ignore-cd AND port-b-ignore-cd FOR
- * SOFT CARRIER, AND keyboard PROPERTY FOR KEYBOARD/MOUSE?
+ * USE ROM PROPERTY keyboard FOR KEYBOARD/MOUSE?
*/
void
zs_attach(parent, self, aux)
@@ -285,6 +284,15 @@ zs_attach(parent, self, aux)
zsc_args.channel = channel;
zsc_args.hwflags = zs_hwflags[zs_unit][channel];
+
+ if ((ca->ca_bustype == BUS_MAIN &&
+ (CPU_ISSUN4C || CPU_ISSUN4E)) ||
+ (ca->ca_bustype == BUS_OBIO && CPU_ISSUN4M)) {
+ if (getproplen(ra->ra_node, channel == 0 ?
+ "port-a-ignore-cd" : "port-b-ignore-cd") == 0)
+ zsc_args.hwflags |= ZS_HWFLAG_NO_DCD;
+ }
+
cs = zsc->zsc_cs[channel] =
(struct zs_chanstate *)&zsc->zsc_cs_store[channel];
diff --git a/sys/arch/sparc64/dev/zs.c b/sys/arch/sparc64/dev/zs.c
index f81d9d84615..3e6c99b6fa6 100644
--- a/sys/arch/sparc64/dev/zs.c
+++ b/sys/arch/sparc64/dev/zs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zs.c,v 1.26 2013/11/01 21:22:31 miod Exp $ */
+/* $OpenBSD: zs.c,v 1.27 2015/02/05 12:04:58 miod Exp $ */
/* $NetBSD: zs.c,v 1.29 2001/05/30 15:24:24 lukem Exp $ */
/*-
@@ -104,7 +104,7 @@ static u_char zs_init_reg[16] = {
0, /* 1: No interrupts yet. */
0, /* 2: IVECT */
ZSWR3_RX_8 | ZSWR3_RX_ENABLE,
- ZSWR4_CLK_X16 | ZSWR4_ONESB | ZSWR4_EVENP,
+ ZSWR4_CLK_X16 | ZSWR4_ONESB,
ZSWR5_TX_8 | ZSWR5_TX_ENABLE,
0, /* 6: TXSYNC/SYNCLO */
0, /* 7: RXSYNC/SYNCHI */
@@ -305,8 +305,7 @@ zs_attach_fhc(parent, self, aux)
/*
* Attach a found zs.
*
- * USE ROM PROPERTIES port-a-ignore-cd AND port-b-ignore-cd FOR
- * SOFT CARRIER, AND keyboard PROPERTY FOR KEYBOARD/MOUSE?
+ * USE ROM PROPERTY keyboard FOR KEYBOARD/MOUSE?
*/
static void
zs_attach(zsc, zsd, pri)
@@ -361,6 +360,11 @@ zs_attach(zsc, zsd, pri)
zsc_args.consdev = &zs_consdev;
}
+ if (getproplen(zsc->zsc_node, channel == 0 ?
+ "port-a-ignore-cd" : "port-b-ignore-cd") == 0) {
+ zsc_args.hwflags |= ZS_HWFLAG_NO_DCD;
+ }
+
if ((zsc_args.hwflags & ZS_HWFLAG_CONSOLE_INPUT) != 0) {
zs_conschan_get = zc;
}
diff --git a/sys/dev/ic/z8530tty.c b/sys/dev/ic/z8530tty.c
index 1d9bc0b6f25..9bb7b961907 100644
--- a/sys/dev/ic/z8530tty.c
+++ b/sys/dev/ic/z8530tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530tty.c,v 1.25 2014/07/13 23:10:23 deraadt Exp $ */
+/* $OpenBSD: z8530tty.c,v 1.26 2015/02/05 12:04:58 miod Exp $ */
/* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */
/*-
@@ -286,6 +286,9 @@ zstty_attach(struct device *parent, struct device *self, void *aux)
if (zst->zst_swflags)
printf(" flags 0x%x", zst->zst_swflags);
+ if (ISSET(zst->zst_hwflags, ZS_HWFLAG_NO_DCD))
+ SET(zst->zst_swflags, TIOCFLAG_SOFTCAR);
+
/*
* Check whether we serve as a console device.
* XXX - split console input/output channels aren't
@@ -791,6 +794,8 @@ zsioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
if (error)
break;
zst->zst_swflags = *(int *)data;
+ if (ISSET(zst->zst_hwflags, ZS_HWFLAG_NO_DCD))
+ SET(zst->zst_swflags, TIOCFLAG_SOFTCAR);
break;
case TIOCSDTR: