Date: Thu, 03 Jun 2004 15:17:31 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: des@des.no Cc: arch@freebsd.org Subject: Re: cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h Message-ID: <20040603.151731.118628002.imp@bsdimp.com> In-Reply-To: <xzp3c5c8i1w.fsf@dwp.des.no> References: <xzp7juo8y8r.fsf@dwp.des.no> <20040603.092954.114645644.imp@bsdimp.com> <xzp3c5c8i1w.fsf@dwp.des.no>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <xzp3c5c8i1w.fsf@dwp.des.no>
des@des.no (Dag-Erling Sm=F8rgrav) writes:
: "M. Warner Losh" <imp@bsdimp.com> writes:
: > des@des.no (Dag-Erling Sm=F8rgrav) writes:
: > : "M. Warner Losh" <imp@bsdimp.com> writes:
: > : > How about an API? How does the driver deal with the global/ins=
tance
: > : > variable split? If I set dev.fxp.gerbil to 1 and dev.fxp.1.ger=
bil to
: > : > 23? Is that order dependent?
: > : that's up to the driver author to decide.
: > That's why I want to know the API the driver will use so that it ca=
n
: > be judged as sufficient or not. I also think we should have some k=
ind
: > of default design pattern.
: =
: The API will be {devclass,device}_get_sysctl_{ctx,tree}(). The drive=
r
: then adds children to these nodes using sysctl_add_*().
We're going to wind up with the same code in a bunch of drivers for
the global sysctls then. It will look like
if (!devclass_get_sysctl("foo"))
add_global_sysctl("foo");
add_local_sysctl(device_get_sysctl(), "foo");
This is going to lead to some drivers not having global settings for
some systclts. The question that I was trying to ask is 'is this
desirable?' Does it make sense to break symmetry like this? Maybe it
does, but I guess I need to see what you do and play with it a little
with cbb to see how well it works in practice...
Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040603.151731.118628002.imp>
