[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: nmdm(4) does not call .l_close
- To: "Julian Elischer" <julian_(_at_)_elischer_(_dot_)_org>
- Subject: Re: nmdm(4) does not call .l_close
- From: "Maksim Yevmenkin" <maksim_(_dot_)_yevmenkin_(_at_)_gmail_(_dot_)_com>
- Date: Fri, 27 Jul 2007 12:04:56 -0700
- Cc: freebsd-current_(_at_)_freebsd_(_dot_)_org
- 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=
On 7/26/07, Julian Elischer <julian_(_at_)_elischer_(_dot_)_org> 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
_______________________________________________
freebsd-current_(_at_)_freebsd_(_dot_)_org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe_(_at_)_freebsd_(_dot_)_org"
Visit your host, monkey.org