[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

tg3 driver works without the firmware

Nathanael Nerode wrote:
> Update: I have tg3 compiling.  Since I can't actually test it, if anyone
> else would like to, email me and I'll send you the patches.

I was hit by the removal of the tg3 driver from kernel-source-2.6.5
(on a server with two Broadcom BCM5704 controllers on a MSI K8D board). 

Looking at the tg3 driver, I found that the firmware is needed only for 
TSO support (which can easily be disabled in the driver) and for one 
special chipset (5701_a0). 

I wrote a small patch (see below) making the firmware optional and 
easily removable from the source file by simply leaving out all the 
firmware related stuff between the second occurence of 
#ifdef CONFIG_TIGON3_FIRMWARE and the corresponding #endif. 

The patch works for me and others with disabled firmware. 

However, neither upstream nor the kernel-source maintainer seem to be 
willing to accept such a patch.

Please send me your own patches for the tg3 driver so that I can test 
them on my hardware.

Andreas Jochens

diff -urN linux-2.6.5.orig/drivers/net/Kconfig linux-2.6.5/drivers/net/Kconfig
--- linux-2.6.5.orig/drivers/net/Kconfig	2004-04-03 21:38:10.000000000 -0600
+++ linux-2.6.5/drivers/net/Kconfig	2004-04-19 01:16:17.726738720 -0500
@@ -2060,6 +2060,14 @@
 	  To compile this driver as a module, choose M here: the module
 	  will be called tg3.  This is recommended.
+	bool "Include firmware (for TSO support and for 5701_a0)" 
+	depends on TIGON3
+	default y
+	help
+	  This includes binary-only firmware for TSO support and a 
+          binary-only firmware fix for the 5701_a0 chipset. If unsure, say Y.
diff -urN linux-2.6.5.orig/drivers/net/tg3.c linux-2.6.5/drivers/net/tg3.c
--- linux-2.6.5.orig/drivers/net/tg3.c	2004-04-03 21:37:23.000000000 -0600
+++ linux-2.6.5/drivers/net/tg3.c	2004-04-19 01:24:48.284122200 -0500
@@ -46,6 +46,10 @@
 #define TG3_VLAN_TAG_USED 0
+#undef NETIF_F_TSO
 #ifdef NETIF_F_TSO
 #define TG3_TSO_SUPPORT	1
@@ -3541,6 +3545,8 @@
 	return 0;
 #define TG3_FW_RELEASE_MAJOR	0x0
 #define TG3_FW_RELASE_MINOR	0x0
 #define TG3_FW_RELEASE_FIX	0x0
@@ -4411,6 +4417,8 @@
 #endif /* TG3_TSO_SUPPORT != 0 */
+#endif /* CONFIG_TG3_FIRMWARE */
 /* tp->lock is held. */
 static void __tg3_set_mac_addr(struct tg3 *tp)
@@ -4947,9 +4955,17 @@
 	if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) {
 		err = tg3_load_5701_a0_firmware_fix(tp);
 		if (err)
 			return err;
+		printk(KERN_ERR PFX "%s: tg3_reset_hardware - "
+			"5701_a0 firmware fix not loaded\n",
+			tp->dev->name );
+		return -ENODEV;
 #if TG3_TSO_SUPPORT != 0

Reply to: