aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/ttydevsw.h
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2008-09-04 16:39:02 +0000
committerEd Schouten <ed@FreeBSD.org>2008-09-04 16:39:02 +0000
commit64308260f6178be5b789d75a8c2dce5d9c6bc38a (patch)
tree6bcb50bb7647bbcb35ec5448b727635dbae46897 /sys/sys/ttydevsw.h
parent2bda9238e5aea77465cd7973a2045cd91cfc2843 (diff)
downloadsrc-64308260f6178be5b789d75a8c2dce5d9c6bc38a.tar.gz
src-64308260f6178be5b789d75a8c2dce5d9c6bc38a.zip
Implement pts(4) packet mode.
As reported by several users on the mailing lists, applications like screen(1) fail to properly handle ^S and ^Q characters. This was because MPSAFE TTY didn't implement packet mode (TIOCPKT) yet. Add basic packet mode support to make these applications work again. Obtained from: //depot/projects/mpsafetty/...
Notes
Notes: svn path=/head/; revision=182764
Diffstat (limited to 'sys/sys/ttydevsw.h')
-rw-r--r--sys/sys/ttydevsw.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/sys/ttydevsw.h b/sys/sys/ttydevsw.h
index a4f5afbbc572..63b2db468950 100644
--- a/sys/sys/ttydevsw.h
+++ b/sys/sys/ttydevsw.h
@@ -48,6 +48,7 @@ typedef int tsw_ioctl_t(struct tty *, u_long, caddr_t, struct thread *);
typedef int tsw_param_t(struct tty *, struct termios *);
typedef int tsw_modem_t(struct tty *, int, int);
typedef int tsw_mmap_t(struct tty *, vm_offset_t, vm_paddr_t *, int);
+typedef void tsw_pktnotify_t(struct tty *, char);
typedef void tsw_free_t(void *);
struct ttydevsw {
@@ -64,6 +65,7 @@ struct ttydevsw {
tsw_modem_t *tsw_modem; /* Modem sigon/sigoff. */
tsw_mmap_t *tsw_mmap; /* mmap() hooks. */
+ tsw_pktnotify_t *tsw_pktnotify; /* TIOCPKT events. */
tsw_free_t *tsw_free; /* Destructor. */
};
@@ -148,6 +150,15 @@ ttydevsw_mmap(struct tty *tp, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
}
static __inline void
+ttydevsw_pktnotify(struct tty *tp, char event)
+{
+ tty_lock_assert(tp, MA_OWNED);
+ MPASS(!tty_gone(tp));
+
+ tp->t_devsw->tsw_pktnotify(tp, event);
+}
+
+static __inline void
ttydevsw_free(struct tty *tp)
{
MPASS(tty_gone(tp));