summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/bluetooth/drivers
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-06-26 08:44:04 +0000
committerphk <phk@FreeBSD.org>2004-06-26 08:44:04 +0000
commit1aa6c5a754b178a4700e8508f2e7a2f5136fd9b6 (patch)
tree04c3b44b676c0a500305ae7636bab0655dde9123 /sys/netgraph/bluetooth/drivers
parent772718717b358bd1045f527cb6842b45a4838f18 (diff)
downloadFreeBSD-src-1aa6c5a754b178a4700e8508f2e7a2f5136fd9b6.zip
FreeBSD-src-1aa6c5a754b178a4700e8508f2e7a2f5136fd9b6.tar.gz
Fix line discipline switching issues: If opening a new ldisc fails,
we have to revert to TTYDISC which we know will successfully open rather than try the previous ldisc which might also fail to open. Do not let ldisc implementations muck about with ->t_line, and remove code which checks for reopens, it should never happen. Move ldisc->l_hotchar to tty->t_hotchar and have ldisc implementation initialize it in their open routines. Reset to zero when we enter TTYDISC. ("no" should really be -1 since zero could be a valid hotchar for certain old european mainframe protocols.)
Diffstat (limited to 'sys/netgraph/bluetooth/drivers')
-rw-r--r--sys/netgraph/bluetooth/drivers/h4/ng_h4.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c
index 27b6641..1710a4c 100644
--- a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c
+++ b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c
@@ -97,8 +97,7 @@ static struct linesw ng_h4_disc = {
ng_h4_ioctl, /* ioctl */
ng_h4_input, /* input */
ng_h4_start, /* start */
- ttymodem, /* modem */
- 0 /* hotchar (don't really care which one) */
+ ttymodem /* modem */
};
/* Netgraph methods */
@@ -161,13 +160,6 @@ ng_h4_open(struct cdev *dev, struct tty *tp)
s = splnet(); /* XXX */
spltty(); /* XXX */
- /* Already installed? */
- if (tp->t_line == H4DISC) {
- sc = (ng_h4_info_p) tp->t_sc;
- if (sc != NULL && sc->tp == tp)
- goto out;
- }
-
/* Initialize private struct */
MALLOC(sc, ng_h4_info_p, sizeof(*sc), M_NETGRAPH_H4, M_NOWAIT|M_ZERO);
if (sc == NULL) {
@@ -243,7 +235,6 @@ ng_h4_close(struct tty *tp, int flag)
ttyflush(tp, FREAD | FWRITE);
clist_free_cblocks(&tp->t_outq);
- tp->t_line = 0;
if (sc != NULL) {
tp->t_sc = NULL;
OpenPOWER on IntegriCloud