bcm570x: get mac address from environment
authorMike Frysinger <vapier@gentoo.org>
Thu, 12 Feb 2009 00:04:25 +0000 (19:04 -0500)
committerWolfgang Denk <wd@denx.de>
Fri, 20 Mar 2009 21:39:10 +0000 (22:39 +0100)
The environment is the canonical storage location of the mac address, so
we're killing off the global data location and moving everything to
querying the env directly.

Since the address is in the PLM_DEVICE_BLOCK structure already, there is
no need to pass the NodeAddress as a second parameter.  So drop the second
argument to the LM_SetMacAddress() function (and update the tigon3 driver
accordingly).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Ben Warren <biggerbadderben@gmail.com>
drivers/net/bcm570x.c
drivers/net/bcm570x_lm.h
drivers/net/tigon3.c

index 185764ef5e96b7ab20dd79fd6dc474d5f3bc5fdf..c250d446f14528cea4a45ade0f972eccbc34956b 100644 (file)
@@ -450,8 +450,8 @@ int eth_init (bd_t * bis)
                            + 1);
        strcpy (pUmDevice->name, board_info[bcm570xDevices[i].board_id].name);
 
-       memcpy (pDevice->NodeAddress, bis->bi_enetaddr, 6);
-       LM_SetMacAddress (pDevice, bis->bi_enetaddr);
+       eth_getenv_enetaddr("ethaddr", pDevice->NodeAddress);
+       LM_SetMacAddress (pDevice);
        /* Init queues  .. */
        QQ_InitQueue (&pUmDevice->rx_out_of_buf_q.Container,
                      MAX_RX_PACKET_DESC_COUNT);
index 2ea6ca8fa9c5a116f9930ac2762a262d410e124e..c07b76792d33fbfb06fcf0633359a5ed2ce8ec64 100644 (file)
@@ -371,7 +371,7 @@ LM_STATUS LM_Abort (PLM_DEVICE_BLOCK pDevice);
 LM_STATUS LM_MulticastAdd (PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pMcAddress);
 LM_STATUS LM_MulticastDel (PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pMcAddress);
 LM_STATUS LM_MulticastClear (PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_SetMacAddress (PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pMacAddress);
+LM_STATUS LM_SetMacAddress (PLM_DEVICE_BLOCK pDevice);
 LM_STATUS LM_LoopbackAddress (PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pAddress);
 
 LM_UINT32 LM_GetCrcCounter (PLM_DEVICE_BLOCK pDevice);
index e4e004eed6804dc1d1cf08a42fa37ef1ea7b0385..33cb447b1ec1f9e1b72f11d8a3d7928d9ad370f4 100644 (file)
@@ -2463,7 +2463,7 @@ LM_STATUS LM_ResetAdapter (PLM_DEVICE_BLOCK pDevice)
 #endif                         /* T3_JUMBO_RCV_ENTRY_COUNT */
 
        /* Configure the MAC address. */
-       LM_SetMacAddress (pDevice, pDevice->NodeAddress);
+       LM_SetMacAddress (pDevice);
 
        /* Initialize the transmit random backoff seed. */
        Value32 = (pDevice->NodeAddress[0] + pDevice->NodeAddress[1] +
@@ -3428,7 +3428,7 @@ LM_STATUS LM_Halt (PLM_DEVICE_BLOCK pDevice)
                     (pDevice->SubsystemId << 16) | pDevice->SubsystemVendorId);
 
        /* Reprogram the MAC address. */
-       LM_SetMacAddress (pDevice, pDevice->NodeAddress);
+       LM_SetMacAddress (pDevice);
 
        return LM_STATUS_SUCCESS;
 }                              /* LM_Halt */
@@ -3833,9 +3833,10 @@ LM_STATUS LM_MulticastClear (PLM_DEVICE_BLOCK pDevice)
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-LM_STATUS LM_SetMacAddress (PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pMacAddress)
+LM_STATUS LM_SetMacAddress (PLM_DEVICE_BLOCK pDevice)
 {
        LM_UINT32 j;
+       PLM_UINT8 pMacAddress = pDevice->NodeAddress;
 
        for (j = 0; j < 4; j++) {
                REG_WR (pDevice, MacCtrl.MacAddr[j].High,