]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
sfc: Store MAC address from NVRAM in net_device::perm_addr
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 2 Dec 2010 13:48:28 +0000 (13:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Dec 2010 17:08:11 +0000 (09:08 -0800)
For some reason we failed to make this change when perm_addr was
introduced.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/sfc/efx.c
drivers/net/sfc/falcon.c
drivers/net/sfc/net_driver.h
drivers/net/sfc/siena.c

index 7e820d90e6baa2c783c64067842352c40dff223a..f3e4043d70eee852a98d7fe7eddc8bef1e219a6f 100644 (file)
@@ -909,6 +909,7 @@ static void efx_mac_work(struct work_struct *data)
 
 static int efx_probe_port(struct efx_nic *efx)
 {
+       unsigned char *perm_addr;
        int rc;
 
        netif_dbg(efx, probe, efx->net_dev, "create port\n");
@@ -922,11 +923,12 @@ static int efx_probe_port(struct efx_nic *efx)
                return rc;
 
        /* Sanity check MAC address */
-       if (is_valid_ether_addr(efx->mac_address)) {
-               memcpy(efx->net_dev->dev_addr, efx->mac_address, ETH_ALEN);
+       perm_addr = efx->net_dev->perm_addr;
+       if (is_valid_ether_addr(perm_addr)) {
+               memcpy(efx->net_dev->dev_addr, perm_addr, ETH_ALEN);
        } else {
                netif_err(efx, probe, efx->net_dev, "invalid MAC address %pM\n",
-                         efx->mac_address);
+                         perm_addr);
                if (!allow_bad_hwaddr) {
                        rc = -EINVAL;
                        goto err;
index 07f684ed2d9be5acb204cf7044b19da03ccf9081..70e4f7dcce8198b5484a2045f73165cfefa896e8 100644 (file)
@@ -1297,7 +1297,7 @@ static int falcon_probe_nvconfig(struct efx_nic *efx)
        }
 
        /* Read the MAC addresses */
-       memcpy(efx->mac_address, nvconfig->mac_address[0], ETH_ALEN);
+       memcpy(efx->net_dev->perm_addr, nvconfig->mac_address[0], ETH_ALEN);
 
        netif_dbg(efx, probe, efx->net_dev, "PHY is %d phy_id %d\n",
                  efx->phy_type, efx->mdio.prtad);
index 6dd5e6d65dfea1508a03bc0f5bf4a90a803b369d..0d19fbfc5c2c08e916c6bb74116c004ea0216051 100644 (file)
@@ -678,7 +678,6 @@ struct efx_filter_state;
  * @stats_buffer: DMA buffer for statistics
  * @stats_lock: Statistics update lock. Serialises statistics fetches
  * @mac_op: MAC interface
- * @mac_address: Permanent MAC address
  * @phy_type: PHY type
  * @phy_op: PHY interface
  * @phy_data: PHY private data (including PHY-specific stats)
@@ -762,7 +761,6 @@ struct efx_nic {
        spinlock_t stats_lock;
 
        struct efx_mac_operations *mac_op;
-       unsigned char mac_address[ETH_ALEN];
 
        unsigned int phy_type;
        struct efx_phy_operations *phy_op;
index b31598079c3da37ec4c84d568bab7481a7127877..bf8456176443a5a12bc2fb4bdb31a6c704d37f7e 100644 (file)
@@ -194,13 +194,7 @@ static int siena_reset_hw(struct efx_nic *efx, enum reset_type method)
 
 static int siena_probe_nvconfig(struct efx_nic *efx)
 {
-       int rc;
-
-       rc = efx_mcdi_get_board_cfg(efx, efx->mac_address, NULL);
-       if (rc)
-               return rc;
-
-       return 0;
+       return efx_mcdi_get_board_cfg(efx, efx->net_dev->perm_addr, NULL);
 }
 
 static int siena_probe_nic(struct efx_nic *efx)