public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] binary firmware and modules
@ 2006-04-15  8:10 Jon Masters
  2006-04-15  9:54 ` Oliver Neukum
  2006-04-18 13:16 ` Jon Masters
  0 siblings, 2 replies; 19+ messages in thread
From: Jon Masters @ 2006-04-15  8:10 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1073 bytes --]

Hi folks,

Right now, various kernel modules are being migrated over to use
request_firmware in order to pull in binary firmware blobs from userland
when the module is loaded. This makes sense.

However, there is right now little mechanism in place to automatically
determine which binary firmware blobs must be included with a kernel in
order to satisfy the prerequisites of these drivers. This affects
vendors, but also regular users to a certain extent too.

The attached patch introduces MODULE_FIRMWARE as one way of advertising
that a particular firmware file is to be loaded - it will then show up
via modinfo and could be used e.g. when packaging a kernel. I've also
given an example via the QLogic gla2xxx driver.

I expect that there are better ways to do this, so I'd like comments
from those closer to the ground on this problem. In particular, it would
be better if drivers didn't have to list the firmware twice - once in
request_firmware and then via MODULE_FIRMWARE. Maybe API change time?

Jon.

P.S. Until I fix evolution again, I'm using an attachment.


[-- Attachment #2: module_firmware.patch --]
[-- Type: text/x-patch, Size: 1205 bytes --]

diff -urN linux-2.6.16.2_orig/drivers/scsi/qla2xxx/qla_os.c linux-2.6.16.2_dev/drivers/scsi/qla2xxx/qla_os.c
--- linux-2.6.16.2_orig/drivers/scsi/qla2xxx/qla_os.c   2006-04-07 17:56:47.000000000 +0100
+++ linux-2.6.16.2_dev/drivers/scsi/qla2xxx/qla_os.c    2006-04-12 20:22:15.000000000 +0100
@@ -2765,3 +2765,9 @@
 MODULE_DESCRIPTION("QLogic Fibre Channel HBA Driver");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(QLA2XXX_VERSION);
+MODULE_FIRMWARE("ql2100_fw.bin");
+MODULE_FIRMWARE("ql2200_fw.bin");
+MODULE_FIRMWARE("ql2300_fw.bin");
+MODULE_FIRMWARE("ql2322_fw.bin");
+MODULE_FIRMWARE("ql6312_fw.bin");
+MODULE_FIRMWARE("ql2400_fw.bin");
diff -urN linux-2.6.16.2_orig/include/linux/module.h linux-2.6.16.2_dev/include/linux/module.h
--- linux-2.6.16.2_orig/include/linux/module.h  2006-04-07 17:56:47.000000000 +0100
+++ linux-2.6.16.2_dev/include/linux/module.h   2006-04-12 13:51:56.000000000 +0100
@@ -155,6 +155,8 @@
 */
 #define MODULE_VERSION(_version) MODULE_INFO(version, _version)

+#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware)
+
 /* Given an address, look for it in the exception tables */
 const struct exception_table_entry *search_exception_tables(unsigned long add);

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2006-04-19 14:10 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-15  8:10 [RFC] binary firmware and modules Jon Masters
2006-04-15  9:54 ` Oliver Neukum
2006-04-17 14:22   ` John W. Linville
2006-04-17 14:29     ` Arjan van de Ven
2006-04-17 14:38       ` Marcel Holtmann
2006-04-17 15:15       ` Duncan Sands
2006-04-17 16:10         ` Marcel Holtmann
2006-04-18 13:16 ` Jon Masters
2006-04-18 13:37   ` Duncan Sands
2006-04-18 14:14     ` Jon Masters
2006-04-18 15:14       ` Duncan Sands
2006-04-19  0:01         ` Jon Masters
2006-04-18 14:22     ` Marcel Holtmann
2006-04-18 14:59       ` Duncan Sands
2006-04-18 15:41         ` Marcel Holtmann
2006-04-19 13:28           ` Mark Lord
2006-04-19 13:37             ` Marcel Holtmann
2006-04-19 14:10               ` Jon Masters
2006-04-18 14:25   ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox