How do I pass configuration parameters to a FreeBSD Device Driver ?

David Somayajulu david.somayajulu at qlogic.com
Thu Jun 4 19:13:43 UTC 2009


M. Warner Losh wrote:
<clip>
> : I have a loadable driver module and would like to do the following:
> : 1. Set some tunable parameters of the driver.
> : 2. Load the driver. Run a few tests.
> : 3. Unload the driver.
> : 4. repeat steps 1 thru 3.
> 
> kenv can set hints.
> 
> Hints are properly retrieved with things like resource_int_value.
> 
> 	prefer_iomap = 0;
> 	resource_int_value(device_get_name(dev), device_get_unit(dev),
> 	    "prefer_iomap", &prefer_iomap);
> 
> would look for the hint "hints.<driver>.<unit>.prefer_iomap" and
> return the value if it finds it.
> 
> Warner
Thanks a lot. This is exactly what I need. Appreciate everyone's responses.
thanks
david S.


More information about the freebsd-drivers mailing list