diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-10-21 17:30:39 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-10-21 17:30:39 +0000 |
commit | a2ed9819fde93a50acfadbe82af68759f4a9b35a (patch) | |
tree | 1e24e76356b0dbb61a6d9f63945fdbb34bf7c7a6 /sys/arch/sparc64/dev | |
parent | cc4b3f9c11cac9322eb63811991b2ace799251ca (diff) |
Clear a pending channel reset when a device is opened.
Diffstat (limited to 'sys/arch/sparc64/dev')
-rw-r--r-- | sys/arch/sparc64/dev/vldcp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/arch/sparc64/dev/vldcp.c b/sys/arch/sparc64/dev/vldcp.c index 17763652934..e8973f348c7 100644 --- a/sys/arch/sparc64/dev/vldcp.c +++ b/sys/arch/sparc64/dev/vldcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vldcp.c,v 1.2 2012/10/17 12:11:32 kettenis Exp $ */ +/* $OpenBSD: vldcp.c,v 1.3 2012/10/21 17:30:38 kettenis Exp $ */ /* * Copyright (c) 2009, 2012 Mark Kettenis * @@ -264,6 +264,7 @@ vldcpopen(dev_t dev, int flag, int mode, struct proc *p) { struct vldcp_softc *sc; struct ldc_conn *lc; + uint64_t rx_head, rx_tail, rx_state; int err; sc = vldcp_lookup(dev); @@ -281,6 +282,11 @@ vldcpopen(dev_t dev, int flag, int mode, struct proc *p) if (err != H_EOK) printf("%d: hv_ldc_rx_qconf %d\n", __func__, err); + /* Clear a pending channel reset. */ + err = hv_ldc_rx_get_state(lc->lc_id, &rx_head, &rx_tail, &rx_state); + if (err != H_EOK) + printf("%s: hv_ldc_rx_get_state %d\n", __func__, err); + device_unref(&sc->sc_dv); return (0); } |