Re: firmware separation filesystem (fwfs)

From: David Gibson (david@gibson.dropbear.id.au)
Date: Wed Apr 16 2003 - 20:23:21 EST


On Wed, Apr 16, 2003 at 04:47:09PM +0100, Alan Cox wrote:
> On Mer, 2003-04-16 at 17:36, Manuel Estrada Sainz wrote:
> > On the other hand, there are already many drivers in the kernel that
> > include firmware in headers, keyspan, io_edgeport, dabusb, ser_a2232,
> > sym53c8xx_2, ...
>
> But so would loading it from hotplug via ioctl. It might be we want
> a clean hotplug way to ask for 'firmare for xyz'.

True, but ioctl()s are horrid. And the driver needs to set up a
suitable device to which the ioctl() is applied, and deal with binding
the right image to the right instance, which can get messy in some
cases. As I see it the chief purpose of fwfs, or an equivalent sysfs
formulation would be to provide a clean mechanism for passing firmware
images to the kernel - figuring out which image to provide and
supplying it at the relevant moment can and should be the job of
hotplug or a similar userland helper.

Incidentally another approach that also avoids nasty ioctl()s would be
to invoke the userland helper with specially set up FD 1, which lets
the kernel capture the program's stdout. When the driver needs a
firmware it invokes the helper, which figures out the relevant image
from its parameters and cats it. The driver (presumably sleeping
waiting for this) grabs the image, stuffs it into the hardware, then
throws it away.

-- 
David Gibson			| For every complex problem there is a
david@gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Apr 23 2003 - 22:00:20 EST