[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1328735457-29986-24-git-send-email-danny.kukawka@bisect.de>
Date: Wed, 8 Feb 2012 22:10:30 +0100
From: Danny Kukawka <danny.kukawka@...ect.de>
To: "David S. Miller" <davem@...emloft.net>
Cc: Danny Kukawka <dkukawka@...e.de>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
"Solarflare linux maintainers" <linux-net-drivers@...arflare.com>,
Ben Hutchings <bhutchings@...arflare.com>
Subject: [PATCH 23/50] efx: use dev_hw_addr_random() instead of random_ether_addr()
Use dev_hw_addr_random() instead of calling random_ether_addr()
to set addr_assign_type correctly to NET_ADDR_RANDOM.
Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.
Signed-off-by: Danny Kukawka <danny.kukawka@...ect.de>
---
drivers/net/ethernet/sfc/efx.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index e43702f..cce339a 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -940,7 +940,7 @@ static int efx_probe_port(struct efx_nic *efx)
rc = -EINVAL;
goto err;
}
- random_ether_addr(efx->net_dev->dev_addr);
+ dev_hw_addr_random(efx->net_dev, efx->net_dev->dev_addr);
netif_info(efx, probe, efx->net_dev,
"using locally-generated MAC %pM\n",
efx->net_dev->dev_addr);
@@ -1858,6 +1858,8 @@ static int efx_set_mac_address(struct net_device *net_dev, void *data)
}
memcpy(net_dev->dev_addr, new_addr, net_dev->addr_len);
+ if (net_dev->addr_assign_type & NET_ADDR_RANDOM)
+ net_dev->addr_assign_type ^= NET_ADDR_RANDOM;
/* Reconfigure the MAC */
mutex_lock(&efx->mac_lock);
--
1.7.7.3
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists