From owner-cvs-all@FreeBSD.ORG Tue Jun 1 15:53:01 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E00516A4CF; Tue, 1 Jun 2004 15:53:01 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E3EE43D1F; Tue, 1 Jun 2004 15:53:01 -0700 (PDT) (envelope-from phk@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i51Mr0DC022415; Tue, 1 Jun 2004 15:53:00 -0700 (PDT) (envelope-from phk@repoman.freebsd.org) Received: (from phk@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i51Mr06C022410; Tue, 1 Jun 2004 15:53:00 -0700 (PDT) (envelope-from phk) Message-Id: <200406012253.i51Mr06C022410@repoman.freebsd.org> From: Poul-Henning Kamp Date: Tue, 1 Jun 2004 15:53:00 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/dev/nmdm nmdm.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2004 22:53:01 -0000 phk 2004/06/01 15:53:00 PDT FreeBSD src repository Modified files: sys/dev/nmdm nmdm.c Log: A major overhaul of the nmdm(4) driver: It was based on the pty(4) driver which as a tty side an a non-tty side. Nmdm(4) seems to have inherited two symmetric sides from pty but unfortunately they are not quite ttys. Running a getty one one side and tip on the other failed to produce NL->CRNL mapping for instance. Rip out the basically bogus cdevsw->{read,write} functions and rely on ttyread() and ttywrite() which does the same thing. Use taskqueue_swi_giant to run a task for either side to do what needs to be done. (Direct calling is not an option as it leads to recursion.) Trigger the task from the t_oproc and t_stop methods. Default the ports to not ECHO. Since we neither rate limiting nor emulation, two ports echoing each other is a really bad idea, which can only be properly mitigated by rate limiting, rate emulation or intelligent detection. Rate emulation would be a neat feature. Ditch the modem-line emulation, if needed for some app, it needs to be thought much more about how it interacts with the open/close logic. Revision Changes Path 1.25 +81 -375 src/sys/dev/nmdm/nmdm.c