Passing Parameters to Device Drivers and ethtool like functionality
Warner Losh
imp at bsdimp.com
Mon May 13 13:58:15 UTC 2013
On May 13, 2013, at 6:15 AM, Dr. Rolf Jansen wrote:
> Am 13.05.2013 um 08:22 schrieb Oded Shanoon <odeds at mellanox.com>:
>
>> ... that the only way to pass parameters to modules is by using sysctl. Is this correct?
>
> In the sense of something that you can set at the command line, I cannot think of anything either.
>
>> Is there no other way to pass parameters when I load my driver (dynamically)?
>
> You could write a wrapper to kldload, that calls appropriate ioctl() commands directly after your module has been loaded. In this scenario, you could read the settings to be passed via ioctl() from the wrapper's command line arguments.
We have a shell script that sets things in kenv before doing the kldload for our driver.
>> Another question I have is - what's the equivalent in FreeBSD for Linux's ethtool?
>> I googled it and found that not all functionalities of ethtool are implemented with ifconfig.
>> Is this correct?
>> Do you know if I can find a detailed doc specifying the equivalent FreeBSD commands for Linux ethtool?
>
> In regard to Linux, I know only that it exists, so I cannot respond to that exact question. I guess, you could generate better/more responses, if you would rephrase you question by describing what you want to achieve, and by asking how this could be done using ifconfig and/or other FreeBSD tools and facilities.
It would be better to ask 'The ethtool command can generate a forced retune of the interface with command X, how do I do that in FreeBSD' rather than what you asked, since it is more likely to be answered (specific questions are) and more likely to get the answer you are looking for (vague questions give vague answers).
Warner
More information about the freebsd-drivers
mailing list