Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Oct 2000 05:30:58 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        gcorcoran@lucent.com (Gary T. Corcoran)
Cc:        tlambert@primenet.com (Terry Lambert), freebsd-hackers@FreeBSD.ORG
Subject:   Re: Module parameters?  (WildWire DSL card driver)
Message-ID:  <200010200530.WAA10151@usr09.primenet.com>
In-Reply-To: <39EF60AE.B9498195@lucent.com> from "Gary T. Corcoran" at Oct 19, 2000 04:59:26 PM

next in thread | previous in thread | raw e-mail | index | archive | help
> > You would send the data down to the parameter module before you
> > load the driver module; thus:
> > 
> > 1)      Load paramter module
> > 2)      Open parameter module psuedo device
> > 3)      Ioctl parameters up/down via the pseudo device
> > 4)      Load the deriver module
> > 5)      Driver module attach routine call parameter_fetch()
> >         routine out of parameter module
> > 6)      Parameter module returns static parameter structure,
> >         by reference
> > 7)      Driver dereferences parameters out of static struct
> > 8)      Driver completes attach
> 
> I'm implementing this suggested method, but I have one problem.  I don't
> know what "device" to access to allow me to do ioctl's to it.
> That is, I've created a parameter module (which loads and is accessible
> by my driver) - but I don't think that (alone) has created a "device",
> has it?  If so, what is it named?  Realize that at step 3, my real
> device doesn't exist yet, so I can't reference that...
> Do I need to somehow "create" a (pseudo-)device in my parameter module
> - and if so how do I do that?

Yes, you need to have a pseudo device.

There are examples in the modules stuff, in particular, the "bpf"
code.

But it basically just means a device with an attach routine that
does nothing, and with an open routine that returns an fd handle
that points to the global data structure that you put your parameters
in, a close routine, and an ioctl() routine.  Everything else can
be ENOTIMP (well, you might want a detach routine, and any other
load/unload houskeeping, but you get the idea).


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010200530.WAA10151>