Date: Tue, 8 Apr 2008 09:56:07 -0600 From: John E Hein <jhein@timing.com> To: arch@freebsd.org Subject: Re: tt_ioctl Message-ID: <18427.38295.399422.305048@gromit.timing.com> In-Reply-To: <18427.36758.266944.74378@gromit.timing.com> References: <18427.36758.266944.74378@gromit.timing.com>
next in thread | previous in thread | raw e-mail | index | archive | help
John E Hein wrote at 09:30 -0600 on Apr 8, 2008: > Back in 2005-10, phk added the tt_{open,ioctl,etc.} inline calls in > sys/tty.h allowing drivers that hook into the tty layer a way to > override or supplement the basic tty functions with their own > flavoring. > > They were also connected up in kern/tty.c - well most of them. > > tt_ioctl remains unused. > > What about the following: Woops... updated patch for missing 'td' in ttyld_ioctl call... Index: kern/tty.c =================================================================== RCS file: /base/FreeBSD-CVS/src/sys/kern/tty.c,v retrieving revision 1.275 diff -u -p -r1.275 tty.c --- kern/tty.c 19 Mar 2008 06:19:00 -0000 1.275 +++ kern/tty.c 8 Apr 2008 15:36:43 -0000 @@ -3297,7 +3297,9 @@ ttyioctl(struct cdev *dev, u_long cmd, c dt->c_ospeed = tp->t_ospeed; } - error = ttyld_ioctl(tp, cmd, data, flag, td); + error = tt_ioctl(tp, cmd, data, flag, td); + if (error == ENOIOCTL) + error = ttyld_ioctl(tp, cmd, data, flag, td); if (error == ENOIOCTL) error = ttioctl(tp, cmd, data, flag); ttyldoptim(tp); Index: sys/tty.h =================================================================== RCS file: /base/FreeBSD-CVS/src/sys/sys/tty.h,v retrieving revision 1.102 diff -u -p -r1.102 tty.h --- sys/tty.h 16 Dec 2007 06:12:53 -0000 1.102 +++ sys/tty.h 8 Apr 2008 05:30:04 -0000 @@ -442,6 +442,8 @@ tt_ioctl(struct tty *t, u_long cmd, void int fflag, struct thread *td) { + if (t->t_ioctl == NULL) + return (ENOIOCTL); return (t->t_ioctl(t, cmd, data, fflag, td)); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?18427.38295.399422.305048>