summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorremko <remko@FreeBSD.org>2007-06-26 13:50:48 +0000
committerremko <remko@FreeBSD.org>2007-06-26 13:50:48 +0000
commit93ac668bf71fd1bd008c6dce7736ac19ddbbe19d (patch)
treeb7648f3a4b68c3b34a10ee814b95459a3e829080 /sys/dev
parenta1038f1089b14425a41d477038cc37e90f8fe0d8 (diff)
downloadFreeBSD-src-93ac668bf71fd1bd008c6dce7736ac19ddbbe19d.zip
FreeBSD-src-93ac668bf71fd1bd008c6dce7736ac19ddbbe19d.tar.gz
Fix Rocketport so that it does not crash the system when a device pointer
changes for example: (From Craig Leres): tip to a rocketport line run "/etc/rc.d/devfs restart" exit tip (wait for the system to reboot) Thanks to Robert Watson for poking me to fix this. PR: kern/109152 Approved by: imp (mentor) Approved by: re (kensmith) Reviewed by: jhb Submitted by: Craig Leres <leres@ee dot lbl dot gov>
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/rp/rp.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/rp/rp.c b/sys/dev/rp/rp.c
index 6d9690d..0e7fb2e 100644
--- a/sys/dev/rp/rp.c
+++ b/sys/dev/rp/rp.c
@@ -573,6 +573,7 @@ static struct rp_port *p_rp_table[MAX_RP_PORTS];
static void rpbreak(struct tty *, int);
static void rpclose(struct tty *tp);
+static void rphardclose(struct tty *tp);
static int rpmodem(struct tty *, int, int);
static int rpparam(struct tty *, struct termios *);
static void rpstart(struct tty *);
@@ -697,7 +698,7 @@ static void rp_handle_port(struct rp_port *rp)
if((tp->t_state & TS_CARR_ON)) {
(void)ttyld_modem(tp, 0);
if(ttyld_modem(tp, 0) == 0) {
- rpclose(tp);
+ rphardclose(tp);
}
}
}
@@ -935,6 +936,16 @@ static void
rpclose(struct tty *tp)
{
struct rp_port *rp;
+
+ rp = tp->t_sc;
+ rphardclose(tp);
+ device_unbusy(rp->rp_ctlp->dev);
+}
+
+static void
+rphardclose(struct tty *tp)
+{
+ struct rp_port *rp;
CHANNEL_t *cp;
rp = tp->t_sc;
@@ -958,7 +969,6 @@ rpclose(struct tty *tp)
tp->t_actout = FALSE;
wakeup(&tp->t_actout);
wakeup(TSA_CARR_ON(tp));
- device_unbusy(rp->rp_ctlp->dev);
}
static void
OpenPOWER on IntegriCloud