From owner-freebsd-arch@FreeBSD.ORG Tue Apr 8 15:56:09 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C61C106566C for ; Tue, 8 Apr 2008 15:56:09 +0000 (UTC) (envelope-from jhein@timing.com) Received: from Daffy.timing.com (daffy.timing.com [206.168.13.218]) by mx1.freebsd.org (Postfix) with ESMTP id 58B838FC1E for ; Tue, 8 Apr 2008 15:56:09 +0000 (UTC) (envelope-from jhein@timing.com) Received: from gromit.timing.com (gromit.timing.com [206.168.13.209]) by Daffy.timing.com (8.13.1/8.13.1) with ESMTP id m38Fu8vQ066809 for ; Tue, 8 Apr 2008 09:56:08 -0600 (MDT) (envelope-from jhein@timing.com) Received: from gromit.timing.com (localhost [127.0.0.1]) by gromit.timing.com (8.14.2/8.14.2) with ESMTP id m38Fu7GE026499; Tue, 8 Apr 2008 09:56:07 -0600 (MDT) (envelope-from jhein@gromit.timing.com) Received: (from jhein@localhost) by gromit.timing.com (8.14.2/8.14.2/Submit) id m38Fu7NT026496; Tue, 8 Apr 2008 09:56:07 -0600 (MDT) (envelope-from jhein) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18427.38295.399422.305048@gromit.timing.com> Date: Tue, 8 Apr 2008 09:56:07 -0600 From: John E Hein To: arch@freebsd.org In-Reply-To: <18427.36758.266944.74378@gromit.timing.com> References: <18427.36758.266944.74378@gromit.timing.com> X-Mailer: VM 7.19 under Emacs 22.1.1 X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on Daffy.timing.com X-Virus-Status: Clean Cc: Subject: Re: tt_ioctl X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2008 15:56:09 -0000 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)); }