bnx2: Add firmware decompression
Subsystems (2)
PATCH 4/6 bnx2: Add firmware decompression
Add functions to decompress firmware before loading to the internal CPUs. Compressing the firmware reduces the driver size significantly.
drivers/net/Kconfig +2 -0
@@ -2163,6 +2163,8 @@ config TIGON3 config BNX2 tristate "Broadcom NetXtremeII support" depends on PCI + select CRC32 + select ZLIB_INFLATE help This driver supports Broadcom NetXtremeII gigabit Ethernet cards.
drivers/net/bnx2.c +147 -12
238 lines not on this page · raw message
drivers/net/bnx2.h +3 -0
@@ -4048,6 +4048,9 @@ struct bnx2 {u32 flash_size;int status_stats_size; + +struct z_stream_s *strm; +void *gunzip_buf; };static u32 bnx2_reg_rd_ind (struct bnx2 *bp,u32 offset);
David Miller
maintainerFrom: "Michael Chan" <[email protected]>
Date: Mon, 12 Jun 2006 17:17:18 -0700
Quoted 4 lines
Add functions to decompress firmware before loading to the internal CPUs. Compressing the firmware reduces the driver size significantly.
Signed-off-by Michael Chan <[email protected]>
...
drivers/net/bnx2.c bnx2_set_rx_mode(struct net_device *dev) · line 2146
Quoted 3 lines
drivers/net/bnx2.c +3
-0+#define FNAME 0x8 +if (zbuf[3 ] &FNAME ) +while (zbuf[n++] !=0 );
This can potentially loop past the end of zbuf[], so maybe put a sanity check against 'len' and return non-zero if we traverse past the end?
Quoted 7 lines · David Miller
From: "Michael Chan" <[email protected]>
Date: Mon, 12 Jun 2006 17:17:18 -0700Quoted 4 lines
Add functions to decompress firmware before loading to the internal CPUs. Compressing the firmware reduces the driver size significantly.
Signed-off-by Michael Chan <[email protected]>
Quoted 8 lines
...
Review
Quoted 3 lines
(quoted diff) +3
-0+#define FNAME 0x8 + if (zbuf[3] & FNAME) + while (zbuf[n++] != 0);This can potentially loop past the end of zbuf[], so maybe put a sanity check against 'len' and return non-zero if we traverse past the end?
Add functions to decompress firmware before loading to the internal CPUs. Compressing the firmware reduces the driver size significantly.
Added file name length sanity check in the gzip header to prevent going past the end of buffer [suggested by DaveM].
drivers/net/Kconfig +2 -0
@@ -2163,6 +2163,8 @@ config TIGON3 config BNX2 tristate "Broadcom NetXtremeII support" depends on PCI + select CRC32 + select ZLIB_INFLATE help This driver supports Broadcom NetXtremeII gigabit Ethernet cards.
drivers/net/bnx2.c +147 -12
238 lines not on this page · raw message
drivers/net/bnx2.h +3 -0
@@ -4048,6 +4048,9 @@ struct bnx2 {u32 flash_size;int status_stats_size; + +struct z_stream_s *strm; +void *gunzip_buf; };static u32 bnx2_reg_rd_ind (struct bnx2 *bp,u32 offset);
David Miller
maintainerFrom: "Michael Chan" <[email protected]>
Date: Mon, 12 Jun 2006 18:42:29 -0700
Quoted 17 lines · David Miller
Quoted 7 lines
From: "Michael Chan" <[email protected]>
Date: Mon, 12 Jun 2006 17:17:18 -0700Quoted 4 lines
Add functions to decompress firmware before loading to the internal CPUs. Compressing the firmware reduces the driver size significantly.
Signed-off-by Michael Chan <[email protected]>Quoted 8 lines
...
drivers/net/bnx2.c bnx2_set_rx_mode(struct net_device *dev)
Quoted 3 lines
drivers/net/bnx2.c +3
-0+#define FNAME 0x8 +if (zbuf[3 ] &FNAME ) +while (zbuf[n++] !=0 );This can potentially loop past the end of zbuf[], so maybe put a sanity check against 'len' and return non-zero if we traverse past the end?
Quoted 7 lines
Add functions to decompress firmware before loading to the internal CPUs. Compressing the firmware reduces the driver size significantly.
Added file name length sanity check in the gzip header to prevent going past the end of buffer [suggested by DaveM].
Signed-off-by Michael Chan <[email protected]>
This looks great, applied.
Thanks a lot.