From owner-freebsd-hackers Fri Oct 20 1: 6: 6 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp05.primenet.com (smtp05.primenet.com [206.165.6.135]) by hub.freebsd.org (Postfix) with ESMTP id 32C0137B4D7 for ; Fri, 20 Oct 2000 01:06:04 -0700 (PDT) Received: (from daemon@localhost) by smtp05.primenet.com (8.9.3/8.9.3) id BAA11073; Fri, 20 Oct 2000 01:05:30 -0700 (MST) Received: from usr09.primenet.com(206.165.6.209) via SMTP by smtp05.primenet.com, id smtpdAAAHraWbU; Thu Oct 19 22:31:26 2000 Received: (from tlambert@localhost) by usr09.primenet.com (8.8.5/8.8.5) id WAA10151; Thu, 19 Oct 2000 22:30:58 -0700 (MST) From: Terry Lambert Message-Id: <200010200530.WAA10151@usr09.primenet.com> Subject: Re: Module parameters? (WildWire DSL card driver) To: gcorcoran@lucent.com (Gary T. Corcoran) Date: Fri, 20 Oct 2000 05:30:58 +0000 (GMT) Cc: tlambert@primenet.com (Terry Lambert), freebsd-hackers@FreeBSD.ORG In-Reply-To: <39EF60AE.B9498195@lucent.com> from "Gary T. Corcoran" at Oct 19, 2000 04:59:26 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > 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