Date: Thu, 04 Jun 2009 01:17:58 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: marc.loerner@hob.de Cc: freebsd-drivers@FreeBSD.org Subject: Re: How do I pass configuration parameters to a FreeBSD Device Driver ? Message-ID: <20090604.011758.87764865.imp@bsdimp.com> In-Reply-To: <200906040822.41153.marc.loerner@hob.de> References: <4A272BF7.8060604@yahoo.com> <75E1A2A7D185F841A975979B0906BBA65A4D0C6595@AVEXMB1.qlogic.org> <200906040822.41153.marc.loerner@hob.de>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <200906040822.41153.marc.loerner@hob.de> Marc Loerner <marc.loerner@hob.de> writes: : Am Donnerstag 04 Juni 2009 04:27:25 schrieb David Somayajulu: : > Larry Maloney wrote: : > > David Somayajulu wrote: : > > > Hi All, : > > > I would appreciate if you could let me know, how I can pass : > > : > > configuration parameters to a device driver, which can be processed : > > during either probe() or attach() ? Is there a way to read them from a : > > conf file of some sort ? Basically, I am interested in setting some : > > tunable parameters during driver initialization, without needing to : > > recompile the driver every time. : > > : > > > thanks : > > > david Somayajulu : > > > : > > > _______________________________________________ : > > > freebsd-drivers@freebsd.org mailing list : > > > http://lists.freebsd.org/mailman/listinfo/freebsd-drivers : > > > To unsubscribe, send any mail to "freebsd-drivers- : > > : > > unsubscribe@freebsd.org" : > > : > > : > > Isn't that what the hints file is for? : > : > Sorry, I am sort of new to FreeBSD. From what I understand : > /boot/device.hints gets read during boot time, the values cannot be changed : > by the user while the kernel is running - am I correct ? : > : > 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. : > : : I think exactly what you search is sysctls. There you have tunables to change : at runtime It depends a lot on how the sysctl/tunable is used/set. If you are using pure hints, then you need to use the kenv method I talked about. If you are using a more general tunable (eg hw.DRIVERNAME.rx_buffers, say), then that can be set at runtime, and there's hooks into the driver that allow it to react to the new value. This can be a better choice than hints, but is a little harder to code up. But the different isn't that huge... Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090604.011758.87764865.imp>