diff options
author | Denis Kirjanov <dkirjanov@kernel.org> | 2010-12-20 21:02:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-21 16:25:08 -0500 |
commit | 4b4f54670859074cf7670cc6fa96fe34a65846d9 (patch) | |
tree | bea51dbd4869c6a323cc1f0db5e66d7754f49401 /drivers/net/sundance.c | |
parent | 24de5285dce378e4170e068f2662236d2b46c033 (diff) |
sundance: Program station address into HW
Program adapter's StationAddress register when changing device MAC address
Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sundance.c')
-rw-r--r-- | drivers/net/sundance.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 8916f29301d6..e5662962c7bf 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c | |||
@@ -434,6 +434,7 @@ static void netdev_error(struct net_device *dev, int intr_status); | |||
434 | static void netdev_error(struct net_device *dev, int intr_status); | 434 | static void netdev_error(struct net_device *dev, int intr_status); |
435 | static void set_rx_mode(struct net_device *dev); | 435 | static void set_rx_mode(struct net_device *dev); |
436 | static int __set_mac_addr(struct net_device *dev); | 436 | static int __set_mac_addr(struct net_device *dev); |
437 | static int sundance_set_mac_addr(struct net_device *dev, void *data); | ||
437 | static struct net_device_stats *get_stats(struct net_device *dev); | 438 | static struct net_device_stats *get_stats(struct net_device *dev); |
438 | static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 439 | static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
439 | static int netdev_close(struct net_device *dev); | 440 | static int netdev_close(struct net_device *dev); |
@@ -467,7 +468,7 @@ static const struct net_device_ops netdev_ops = { | |||
467 | .ndo_do_ioctl = netdev_ioctl, | 468 | .ndo_do_ioctl = netdev_ioctl, |
468 | .ndo_tx_timeout = tx_timeout, | 469 | .ndo_tx_timeout = tx_timeout, |
469 | .ndo_change_mtu = change_mtu, | 470 | .ndo_change_mtu = change_mtu, |
470 | .ndo_set_mac_address = eth_mac_addr, | 471 | .ndo_set_mac_address = sundance_set_mac_addr, |
471 | .ndo_validate_addr = eth_validate_addr, | 472 | .ndo_validate_addr = eth_validate_addr, |
472 | }; | 473 | }; |
473 | 474 | ||
@@ -1595,6 +1596,19 @@ static int __set_mac_addr(struct net_device *dev) | |||
1595 | return 0; | 1596 | return 0; |
1596 | } | 1597 | } |
1597 | 1598 | ||
1599 | /* Invoked with rtnl_lock held */ | ||
1600 | static int sundance_set_mac_addr(struct net_device *dev, void *data) | ||
1601 | { | ||
1602 | const struct sockaddr *addr = data; | ||
1603 | |||
1604 | if (!is_valid_ether_addr(addr->sa_data)) | ||
1605 | return -EINVAL; | ||
1606 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); | ||
1607 | __set_mac_addr(dev); | ||
1608 | |||
1609 | return 0; | ||
1610 | } | ||
1611 | |||
1598 | static const struct { | 1612 | static const struct { |
1599 | const char name[ETH_GSTRING_LEN]; | 1613 | const char name[ETH_GSTRING_LEN]; |
1600 | } sundance_stats[] = { | 1614 | } sundance_stats[] = { |