[Prism54-devel] [PATCH] nameif compatibility

Jean Tourrilhes jt@hpl.hp.com
Mon, 23 Feb 2004 18:05:57 -0800


--6TrnltStXW4iwmi0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, Feb 23, 2004 at 08:49:13PM -0500, Luis R. Rodriguez wrote:
> 
> What patch? 8)
> 
> 	Luis

	Doh ! I must bee sleeping...

	Jean

--6TrnltStXW4iwmi0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="prism54-nameif.diff"

--- prism54-orig/islpci_dev.c	Fri Feb 20 17:53:52 2004
+++ prism54/islpci_dev.c	Mon Feb 23 14:41:31 2004
@@ -50,6 +50,15 @@
 #define ISL3877_IMAGE_FILE	"isl3877"
 #define ISL3890_IMAGE_FILE	"isl3890"
 
+/* Temporary dummy MAC address to use until firmware is loaded.
+ * The idea there is that some tools (such as nameif) may query
+ * the MAC address before the netdev is 'open'. By using a valid
+ * OUI prefix, they can process the netdev properly.
+ * Of course, this is not the final/real MAC address. It doesn't
+ * matter, as you are suppose to be able to change it anytime via
+ * ndev->set_mac_address. Jean II */
+const unsigned char	dummy_mac[6] = { 0x00, 0x30, 0xB4, 0x00, 0x00, 0x00 };
+
 /******************************************************************************
     Device Interrupt Handler
 ******************************************************************************/
@@ -705,7 +714,9 @@ islpci_setup(struct pci_dev *pdev)
 	/* ndev->set_multicast_list = &islpci_set_multicast_list; */
 	ndev->addr_len = ETH_ALEN;
 	ndev->set_mac_address = &prism54_set_mac_address;
-	
+	/* Get a non-zero dummy MAC address for nameif. Jean II */
+	memcpy(ndev->dev_addr, dummy_mac, 6);
+
 #ifdef HAVE_TX_TIMEOUT
 	ndev->watchdog_timeo = ISLPCI_TX_TIMEOUT;
 	ndev->tx_timeout = &islpci_eth_tx_timeout;

--6TrnltStXW4iwmi0--