diff options
author | David S. Miller <davem@davemloft.net> | 2017-03-03 18:44:28 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-03 18:44:28 +0100 |
commit | e28599800a1274357492d85a653012ed3220b45c (patch) | |
tree | e8563495264c20d363e421cdcd9aa3291b0d5bf8 /drivers/net/ethernet/broadcom/bgmac.c | |
parent | Merge branch 'xen-netback-fixes' (diff) | |
parent | net: ethernet: bgmac: mac address change bug (diff) | |
download | linux-e28599800a1274357492d85a653012ed3220b45c.tar.xz linux-e28599800a1274357492d85a653012ed3220b45c.zip |
Merge branch 'bgmac-fixes'
Jon Mason says:
====================
net: ethernet: bgmac: bug fixes
Changes in v5:
* Rebased to the latest code and fixed up a compile error due to the
mac_addr struct going away (found by David Miller)
Changes in v4:
* Added the udelays from the previous code (per David Miller)
Changes in v3:
* Reworked the init sequence patch to only remove the device reset if
the device is actually in reset. Given that this code doesn't bear
much resemblance to the original code, I'm changing the author of the
patch. This was tested on NS2 SVK.
Changes in v2:
* Reworked the first match to make it more obvious what portions of the
register were being preserved (Per Rafal Mileki)
* Style change to reorder the function variables in patch 2 (per Sergei
Shtylyov)
Bug fixes for bgmac driver
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bgmac.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bgmac.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c index 415046750bb4..fd66fca00e01 100644 --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c @@ -1223,12 +1223,16 @@ static netdev_tx_t bgmac_start_xmit(struct sk_buff *skb, static int bgmac_set_mac_address(struct net_device *net_dev, void *addr) { struct bgmac *bgmac = netdev_priv(net_dev); + struct sockaddr *sa = addr; int ret; ret = eth_prepare_mac_addr_change(net_dev, addr); if (ret < 0) return ret; - bgmac_write_mac_address(bgmac, (u8 *)addr); + + ether_addr_copy(net_dev->dev_addr, sa->sa_data); + bgmac_write_mac_address(bgmac, net_dev->dev_addr); + eth_commit_mac_addr_change(net_dev, addr); return 0; } |