cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h
M. Warner Losh
imp at bsdimp.com
Thu Jun 3 14:21:02 PDT 2004
In message: <xzp3c5c8i1w.fsf at dwp.des.no>
des at des.no (Dag-Erling Smørgrav) writes:
: "M. Warner Losh" <imp at bsdimp.com> writes:
: > des at des.no (Dag-Erling Smørgrav) writes:
: > : "M. Warner Losh" <imp at bsdimp.com> writes:
: > : > How about an API? How does the driver deal with the global/instance
: > : > variable split? If I set dev.fxp.gerbil to 1 and dev.fxp.1.gerbil 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 can
: > be judged as sufficient or not. I also think we should have some kind
: > of default design pattern.
:
: The API will be {devclass,device}_get_sysctl_{ctx,tree}(). The driver
: 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
More information about the freebsd-arch
mailing list