Re: Driver module access to filesystem

Theodore Y. Ts'o (tytso@MIT.EDU)
Thu, 3 Apr 1997 02:13:18 -0500

From: (Rick Richardson)
Date: Wed, 2 Apr 1997 22:01:10 -0600 (CST)

We'd like to be able to read firmware files to be downloaded
to boards from the init_module() call of a device driver.
Then there is no need for gratuitous daemons to download
firmware through the device driver nor for linking large firmware
loads into the device driver. One could simply do:

Any hints on what kernel functions (preferably ones that are already
exported) that I can call to allocate/free this buffer?
Also, does anybody see a philosophical reason why we shouldn't
be doing this?

Umm.... it adds kernel bloat? Why have initialization code that needs
to be able open files and read them? A much simpler way is to have an
ioctl which loads the firmware, and then having a program which handles
the firmware load. This is hardly a "gratuitous daemon" which has to be
running all the time.

Take a look at the Comtrol Rocketport driver which I wrote for another
way of handling it. There, I provide an /etc/rc boot script which
handles all of your issues; it handles the module load, it creates the
/dev devices, it configures the driver, etc. The Rocketport doesn't
need a firmware load, but that could also be easily done from the
/etc/rc script.

I also provide an installation script which installs said /etc/rc script
into the right place automatically (it determines whether you are using
an /etc/rc.d system, such as RedHat, and creates the symlinks

So the user experience looks like this: she runs the installation
script, and reboot their machine, and she's done! From now on, each
time she reboot, everything is taken care of them automatically. For
those who don't want to reboot their system after that first
installation, the simple execution of "/etc/rc.d/init.d/comtrol start"
will start everything up automatically.

- Ted