Skip to contentSkip to conversation

bnx2 - use request_firmware()

PATCH RESEND New Bastian Blank 1 participant 1 message Jul 4, 2008 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 bnx2 - use request_firmware()

Hi David

This patch is used by Debian since 2.6.25 to use request_firmware in the bnx2 driver. It lacks a small piece of inline patching for now.

The firmware files includes 7 firmwares with up to 3 sections plus some additional initialisation data. The corresponding firmware file generator is located at svn://svn.debian.org/kernel/dists/trunk/firmware-nonfree/bnx2/fwcutter.

Bastian

 drivers/net/Kconfig        |    1 +
 drivers/net/bnx2.c         |  256 ++++++++++++++++++++++----------------------
 drivers/net/bnx2.h         |   40 +-------
 drivers/net/bnx2_fw_file.h |   25 +++++
 4 files changed, 156 insertions(+), 166 deletions(-)
drivers/net/Kconfig +1 -0
index f4182cf..0686d45 100644
@@ -2236,6 +2236,7 @@ config TIGON3
 
 config BNX2
 	tristate "Broadcom NetXtremeII support"
+	select FW_LOADER
 	depends on PCI
 	select CRC32
 	select ZLIB_INFLATE
drivers/net/bnx2.c +128 -128

420 lines not on this page · raw message

drivers/net/bnx2.h +2 -38
index 2377cc1..ec74554 100644
@@ -6812,6 +6812,8 @@ struct bnx2 {
 
 	struct bnx2_irq		irq_tbl[BNX2_MAX_MSIX_VEC];
 	int			irq_nvecs;
+
+	const struct firmware	*firmware;
 };
 
 #define REG_RD(bp, offset)					\
@@ -6842,44 +6844,6 @@ struct cpu_reg {
 	u32 mips_view_base;
 };
 
-struct fw_info {
-	const u32 ver_major;
-	const u32 ver_minor;
-	const u32 ver_fix;
-
-	const u32 start_addr;
-
-	/* Text section. */
-	const u32 text_addr;
-	const u32 text_len;
-	const u32 text_index;
-	__le32 *text;
-	u8 *gz_text;
-	const u32 gz_text_len;
-
-	/* Data section. */
-	const u32 data_addr;
-	const u32 data_len;
-	const u32 data_index;
-	const u32 *data;
-
-	/* SBSS section. */
-	const u32 sbss_addr;
-	const u32 sbss_len;
-	const u32 sbss_index;
-
-	/* BSS section. */
-	const u32 bss_addr;
-	const u32 bss_len;
-	const u32 bss_index;
-
-	/* Read-only section. */
-	const u32 rodata_addr;
-	const u32 rodata_len;
-	const u32 rodata_index;
-	const u32 *rodata;
-};
-
 #define RV2P_PROC1                              0
 #define RV2P_PROC2                              1
 
drivers/net/bnx2_fw_file.h new file +25 -0
new file mode 100644
index 0000000..06c003c
@@ -0,0 +1,25 @@
+struct bnx2_fw_file_section {
+  uint32_t addr;
+  uint32_t len;
+  uint32_t offset;
+};
+
+struct bnx2_fw_file_entry {
+  uint32_t start_addr;
+  struct bnx2_fw_file_section text;
+  struct bnx2_fw_file_section data;
+  struct bnx2_fw_file_section sbss;
+  struct bnx2_fw_file_section bss;
+  struct bnx2_fw_file_section rodata;
+};
+
+struct bnx2_fw_file {
+  struct bnx2_fw_file_entry com;
+  struct bnx2_fw_file_entry cp;
+  struct bnx2_fw_file_entry rxp;
+  struct bnx2_fw_file_entry tpat;
+  struct bnx2_fw_file_entry txp;
+  struct bnx2_fw_file_section rv2p_proc1;
+  struct bnx2_fw_file_section rv2p_proc2;
+};
+
Signature · 2 lines
Extreme feminine beauty is always disturbing.
		-- Spock, "The Cloud Minders", stardate 5818.4