diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-01-30 14:37:57 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-02-07 02:00:35 -0500 |
commit | a8ab1ec0c3ef4ce2033abe3441d032fe1490a71a (patch) | |
tree | 0f21945a91501921dfed6f891e05c2fe70b1865c /drivers/net | |
parent | d28d4870279c5d184804b6ac1775b130972ffecd (diff) |
[PATCH] sky2: set mac address fix
Using the sky2 driver with bonding can result in oopses related to
reinitializing the PHY when the MAC address is changed (which bonding
is wont to do). This patch changes sky2_set_mac_address to take less
drastic measures.
This is analagous to the skge patch here:
http://lkml.org/lkml/2005/9/29/399
which fixed the issue here:
http://bugzilla.kernel.org/show_bug.cgi?id=5271
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/sky2.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 12ff1c857bf9..6cd075e1f38a 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -2555,19 +2555,24 @@ static struct net_device_stats *sky2_get_stats(struct net_device *dev) | |||
2555 | static int sky2_set_mac_address(struct net_device *dev, void *p) | 2555 | static int sky2_set_mac_address(struct net_device *dev, void *p) |
2556 | { | 2556 | { |
2557 | struct sky2_port *sky2 = netdev_priv(dev); | 2557 | struct sky2_port *sky2 = netdev_priv(dev); |
2558 | struct sockaddr *addr = p; | 2558 | struct sky2_hw *hw = sky2->hw; |
2559 | unsigned port = sky2->port; | ||
2560 | const struct sockaddr *addr = p; | ||
2559 | 2561 | ||
2560 | if (!is_valid_ether_addr(addr->sa_data)) | 2562 | if (!is_valid_ether_addr(addr->sa_data)) |
2561 | return -EADDRNOTAVAIL; | 2563 | return -EADDRNOTAVAIL; |
2562 | 2564 | ||
2563 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); | 2565 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); |
2564 | memcpy_toio(sky2->hw->regs + B2_MAC_1 + sky2->port * 8, | 2566 | memcpy_toio(hw->regs + B2_MAC_1 + port * 8, |
2565 | dev->dev_addr, ETH_ALEN); | 2567 | dev->dev_addr, ETH_ALEN); |
2566 | memcpy_toio(sky2->hw->regs + B2_MAC_2 + sky2->port * 8, | 2568 | memcpy_toio(hw->regs + B2_MAC_2 + port * 8, |
2567 | dev->dev_addr, ETH_ALEN); | 2569 | dev->dev_addr, ETH_ALEN); |
2568 | 2570 | ||
2569 | if (netif_running(dev)) | 2571 | /* virtual address for data */ |
2570 | sky2_phy_reinit(sky2); | 2572 | gma_set_addr(hw, port, GM_SRC_ADDR_2L, dev->dev_addr); |
2573 | |||
2574 | /* physical address: used for pause frames */ | ||
2575 | gma_set_addr(hw, port, GM_SRC_ADDR_1L, dev->dev_addr); | ||
2571 | 2576 | ||
2572 | return 0; | 2577 | return 0; |
2573 | } | 2578 | } |