PERFORCE change 146763 for review
Ed Schouten
ed at FreeBSD.org
Wed Aug 6 11:27:20 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=146763
Change 146763 by ed at ed_flippo on 2008/08/06 11:26:38
Minor fixes to nmdm(4):
- Also hook up the wakeup routine to the input side.
- Don't pass privileges for now. This makes nmdm(4) root-only,
like it originally works.
- Don't depend on vnode_if.h.
Right now nmdm(4) supports no actual hotplugging. I tried to add
this, but it's harder than it seems. One of the problems I was
dealing with, is when the task is queued again right after the
taskqueue is unlocked and the task is being executed.
There's no rush.
Affected files ...
.. //depot/projects/mpsafetty/sys/dev/nmdm/nmdm.c#6 edit
.. //depot/projects/mpsafetty/sys/modules/nmdm/Makefile#3 edit
Differences ...
==== //depot/projects/mpsafetty/sys/dev/nmdm/nmdm.c#6 (text+ko) ====
@@ -54,13 +54,14 @@
MALLOC_DEFINE(M_NMDM, "nullmodem", "nullmodem data structures");
-static tsw_outwakeup_t nmdm_outwakeup;
+static void nmdm_wakeup(struct tty *);
static tsw_param_t nmdm_param;
static tsw_modem_t nmdm_modem;
static struct ttydevsw nmdm_class = {
.tsw_flags = TF_NOPREFIX,
- .tsw_outwakeup = nmdm_outwakeup,
+ .tsw_inwakeup = nmdm_wakeup,
+ .tsw_outwakeup = nmdm_wakeup,
.tsw_param = nmdm_param,
.tsw_modem = nmdm_modem,
};
@@ -93,7 +94,7 @@
static int nmdm_count = 0;
static struct nmdmsoftc *
-nmdm_alloc(unsigned long unit, struct ucred *cr)
+nmdm_alloc(unsigned long unit)
{
struct nmdmsoftc *ns;
struct tty *tp;
@@ -117,11 +118,11 @@
/* Create device nodes */
tp = ns->ns_part1.np_tty = tty_alloc(&nmdm_class, &ns->ns_part1,
&ns->ns_mtx);
- tty_makedev(tp, cr, "nmdm%luA", unit);
+ tty_makedev(tp, NULL, "nmdm%luA", unit);
tp = ns->ns_part2.np_tty = tty_alloc(&nmdm_class, &ns->ns_part2,
&ns->ns_mtx);
- tty_makedev(tp, cr, "nmdm%luB", unit);
+ tty_makedev(tp, NULL, "nmdm%luB", unit);
return (ns);
}
@@ -147,7 +148,8 @@
if ((end[0] != 'A' && end[0] != 'B') || end[1] != '\0')
return;
- ns = nmdm_alloc(unit, cred);
+ /* XXX: pass privileges? */
+ ns = nmdm_alloc(unit);
if (end[0] == 'A')
*dev = ns->ns_part1.np_tty->t_dev;
@@ -318,11 +320,10 @@
}
static void
-nmdm_outwakeup(struct tty *tp)
+nmdm_wakeup(struct tty *tp)
{
struct nmdmpart *np = tty_softc(tp);
- np = tty_softc(tp);
taskqueue_enqueue(taskqueue_swi, &np->np_task);
}
==== //depot/projects/mpsafetty/sys/modules/nmdm/Makefile#3 (text+ko) ====
@@ -4,6 +4,5 @@
KMOD= nmdm
SRCS= nmdm.c
-SRCS+= vnode_if.h
.include <bsd.kmod.mk>
More information about the p4-projects
mailing list