diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-12-02 08:48:28 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-03 12:08:11 -0500 |
commit | 7e300bc8e6736d41e7b92978f415572ac60fd59b (patch) | |
tree | b48dc8243946bd08e3c7eef5171d910218a43987 /drivers/net | |
parent | 02ebc26865c2755720d2ede90a5ab27c45741823 (diff) |
sfc: Store MAC address from NVRAM in net_device::perm_addr
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/sfc/efx.c | 8 | ||||
-rw-r--r-- | drivers/net/sfc/falcon.c | 2 | ||||
-rw-r--r-- | drivers/net/sfc/net_driver.h | 2 | ||||
-rw-r--r-- | drivers/net/sfc/siena.c | 8 |
4 files changed, 7 insertions, 13 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 7e820d90e6ba..f3e4043d70ee 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
@@ -909,6 +909,7 @@ static void efx_mac_work(struct work_struct *data) | |||
909 | 909 | ||
910 | static int efx_probe_port(struct efx_nic *efx) | 910 | static int efx_probe_port(struct efx_nic *efx) |
911 | { | 911 | { |
912 | unsigned char *perm_addr; | ||
912 | int rc; | 913 | int rc; |
913 | 914 | ||
914 | netif_dbg(efx, probe, efx->net_dev, "create port\n"); | 915 | netif_dbg(efx, probe, efx->net_dev, "create port\n"); |
@@ -922,11 +923,12 @@ static int efx_probe_port(struct efx_nic *efx) | |||
922 | return rc; | 923 | return rc; |
923 | 924 | ||
924 | /* Sanity check MAC address */ | 925 | /* Sanity check MAC address */ |
925 | if (is_valid_ether_addr(efx->mac_address)) { | 926 | perm_addr = efx->net_dev->perm_addr; |
926 | memcpy(efx->net_dev->dev_addr, efx->mac_address, ETH_ALEN); | 927 | if (is_valid_ether_addr(perm_addr)) { |
928 | memcpy(efx->net_dev->dev_addr, perm_addr, ETH_ALEN); | ||
927 | } else { | 929 | } else { |
928 | netif_err(efx, probe, efx->net_dev, "invalid MAC address %pM\n", | 930 | netif_err(efx, probe, efx->net_dev, "invalid MAC address %pM\n", |
929 | efx->mac_address); | 931 | perm_addr); |
930 | if (!allow_bad_hwaddr) { | 932 | if (!allow_bad_hwaddr) { |
931 | rc = -EINVAL; | 933 | rc = -EINVAL; |
932 | goto err; | 934 | goto err; |
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 07f684ed2d9b..70e4f7dcce81 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -1297,7 +1297,7 @@ static int falcon_probe_nvconfig(struct efx_nic *efx) | |||
1297 | } | 1297 | } |
1298 | 1298 | ||
1299 | /* Read the MAC addresses */ | 1299 | /* Read the MAC addresses */ |
1300 | memcpy(efx->mac_address, nvconfig->mac_address[0], ETH_ALEN); | 1300 | memcpy(efx->net_dev->perm_addr, nvconfig->mac_address[0], ETH_ALEN); |
1301 | 1301 | ||
1302 | netif_dbg(efx, probe, efx->net_dev, "PHY is %d phy_id %d\n", | 1302 | netif_dbg(efx, probe, efx->net_dev, "PHY is %d phy_id %d\n", |
1303 | efx->phy_type, efx->mdio.prtad); | 1303 | efx->phy_type, efx->mdio.prtad); |
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 6dd5e6d65dfe..0d19fbfc5c2c 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -678,7 +678,6 @@ struct efx_filter_state; | |||
678 | * @stats_buffer: DMA buffer for statistics | 678 | * @stats_buffer: DMA buffer for statistics |
679 | * @stats_lock: Statistics update lock. Serialises statistics fetches | 679 | * @stats_lock: Statistics update lock. Serialises statistics fetches |
680 | * @mac_op: MAC interface | 680 | * @mac_op: MAC interface |
681 | * @mac_address: Permanent MAC address | ||
682 | * @phy_type: PHY type | 681 | * @phy_type: PHY type |
683 | * @phy_op: PHY interface | 682 | * @phy_op: PHY interface |
684 | * @phy_data: PHY private data (including PHY-specific stats) | 683 | * @phy_data: PHY private data (including PHY-specific stats) |
@@ -762,7 +761,6 @@ struct efx_nic { | |||
762 | spinlock_t stats_lock; | 761 | spinlock_t stats_lock; |
763 | 762 | ||
764 | struct efx_mac_operations *mac_op; | 763 | struct efx_mac_operations *mac_op; |
765 | unsigned char mac_address[ETH_ALEN]; | ||
766 | 764 | ||
767 | unsigned int phy_type; | 765 | unsigned int phy_type; |
768 | struct efx_phy_operations *phy_op; | 766 | struct efx_phy_operations *phy_op; |
diff --git a/drivers/net/sfc/siena.c b/drivers/net/sfc/siena.c index b31598079c3d..bf8456176443 100644 --- a/drivers/net/sfc/siena.c +++ b/drivers/net/sfc/siena.c | |||
@@ -194,13 +194,7 @@ static int siena_reset_hw(struct efx_nic *efx, enum reset_type method) | |||
194 | 194 | ||
195 | static int siena_probe_nvconfig(struct efx_nic *efx) | 195 | static int siena_probe_nvconfig(struct efx_nic *efx) |
196 | { | 196 | { |
197 | int rc; | 197 | return efx_mcdi_get_board_cfg(efx, efx->net_dev->perm_addr, NULL); |
198 | |||
199 | rc = efx_mcdi_get_board_cfg(efx, efx->mac_address, NULL); | ||
200 | if (rc) | ||
201 | return rc; | ||
202 | |||
203 | return 0; | ||
204 | } | 198 | } |
205 | 199 | ||
206 | static int siena_probe_nic(struct efx_nic *efx) | 200 | static int siena_probe_nic(struct efx_nic *efx) |