From owner-freebsd-current@FreeBSD.ORG Fri Jul 27 19:04:57 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E399816A41F for ; Fri, 27 Jul 2007 19:04:57 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by mx1.freebsd.org (Postfix) with ESMTP id 6CA7C13C459 for ; Fri, 27 Jul 2007 19:04:56 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by ug-out-1314.google.com with SMTP id o4so843028uge for ; Fri, 27 Jul 2007 12:04:56 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=qv3Y2eyrdBxNxtXh5B6YdzLPL7cRhDnHUHJx5OhdSg//6WCCkpsPi0QoVpqM4JEWdBrUJDJ5ef3aNY2sEWAHSBYzJtFOrywpuy6o500/kO7f+Z8ef3GvUtgB1p4f6W/so/4Pqw23iz1Vs4CtvOd7nuwFCpmxj4+gM7hlXprYcjg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=k/u8bS4A+3Yn51LfIMmPEhDnR5fYsM56NJ2idKqV0eYSSVVDokWogUD/i873leS0xjCWi7Rt8zdhMnBStBo41mjnLgpUwkKM7AIEe7K8jkXc2k2NRxwWQj6+qB2v+EI6QPkZh6Ke/S7ETtEpsyNkUmDM6mtMrFk+fovoE/1IFBQ= Received: by 10.86.60.7 with SMTP id i7mr2167583fga.1185563096022; Fri, 27 Jul 2007 12:04:56 -0700 (PDT) Received: by 10.86.31.8 with HTTP; Fri, 27 Jul 2007 12:04:56 -0700 (PDT) Message-ID: Date: Fri, 27 Jul 2007 12:04:56 -0700 From: "Maksim Yevmenkin" To: "Julian Elischer" In-Reply-To: <46A94194.5010207@elischer.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46A94194.5010207@elischer.org> Cc: freebsd-current@freebsd.org Subject: Re: nmdm(4) does not call .l_close X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2007 19:04:58 -0000 On 7/26/07, Julian Elischer wrote: > Maksim Yevmenkin wrote: > > Dear All, > > > > it seems to me that nmdm(4) is not calling .l_close (i.e. does not > > close whatever line discipline might be installed onto /dev/nmdmXX). > > the problem is easy to reproduce - just open /dev/nmdm0A and install, > > say, ng_tty(4) line discipline onto it. after that, simply close the > > /dev/nmdm0A. in theory, the ng_tty(4) node should disappear when > > device is closed, but it does not. > > when I originally wrote this I copied what the pty code was doing. > This has all been redone since then however. > I'm guessing it should do whatever the pty code is now doing :-) . it looks like pty close calls ttyld_close() before calling tty_close(). so at the very least, imo, nmdm close should call ttyld_close() before tty_close(). ttyclose(), infact, calls ttyld_close() and tt_close(), so it seemed like the right thing to do :) > > the following patch fixes things for me > > > > === > > > > beetle% diff -u nmdm.c.orig nmdm.c > > --- nmdm.c.orig 2006-11-21 16:59:40.000000000 -0800 > > +++ nmdm.c 2007-07-26 17:01:47.000000000 -0700 > > @@ -402,7 +402,7 @@ > > nmdmclose(struct cdev *dev, int flag, int mode, struct thread *td) > > { > > > > - return (tty_close(dev->si_tty)); > > + return (ttyclose(dev, flag, mode, td)); > > sounds believable.. > but I don't really know offhand. nor do i :) hence my question. can someone, with more tty fu, please look at it? > does it work with other disciplines? it does with ng_h4(4). since i cannot make my bluetooth xircom pccard work, i decided to use my old trick - emulate bluetooth device. so i'm testing my patches to make ng_h4(4) mp-safe by installing h4 line discipline onto /dev/nmdm and feeding h4 packets to it. i have not tried other disciplines yet, i.e. ppp and slip, thanks, max