diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2005-12-14 18:47:44 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-12-24 09:36:05 -0500 |
commit | ee294dcda1d5dea5b909164cdc459a8483ee2983 (patch) | |
tree | 35141a9b95b0713bf79bd44de75517eb37c937c7 /drivers/net/skge.c | |
parent | aa84505fb0fb9504c61d77e8e6930a417fc404d6 (diff) |
[PATCH] skge: avoid up/down on speed changes
Change the speed settings doesn't need to cause link to go down/up.
It can be handled by doing the same logic as nway_reset.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/skge.c')
-rw-r--r-- | drivers/net/skge.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 00d683063c01..f77658192a14 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -88,15 +88,14 @@ MODULE_DEVICE_TABLE(pci, skge_id_table); | |||
88 | 88 | ||
89 | static int skge_up(struct net_device *dev); | 89 | static int skge_up(struct net_device *dev); |
90 | static int skge_down(struct net_device *dev); | 90 | static int skge_down(struct net_device *dev); |
91 | static void skge_phy_reset(struct skge_port *skge); | ||
91 | static void skge_tx_clean(struct skge_port *skge); | 92 | static void skge_tx_clean(struct skge_port *skge); |
92 | static int xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); | 93 | static int xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); |
93 | static int gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); | 94 | static int gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); |
94 | static void genesis_get_stats(struct skge_port *skge, u64 *data); | 95 | static void genesis_get_stats(struct skge_port *skge, u64 *data); |
95 | static void yukon_get_stats(struct skge_port *skge, u64 *data); | 96 | static void yukon_get_stats(struct skge_port *skge, u64 *data); |
96 | static void yukon_init(struct skge_hw *hw, int port); | 97 | static void yukon_init(struct skge_hw *hw, int port); |
97 | static void yukon_reset(struct skge_hw *hw, int port); | ||
98 | static void genesis_mac_init(struct skge_hw *hw, int port); | 98 | static void genesis_mac_init(struct skge_hw *hw, int port); |
99 | static void genesis_reset(struct skge_hw *hw, int port); | ||
100 | static void genesis_link_up(struct skge_port *skge); | 99 | static void genesis_link_up(struct skge_port *skge); |
101 | 100 | ||
102 | /* Avoid conditionals by using array */ | 101 | /* Avoid conditionals by using array */ |
@@ -276,10 +275,9 @@ static int skge_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
276 | skge->autoneg = ecmd->autoneg; | 275 | skge->autoneg = ecmd->autoneg; |
277 | skge->advertising = ecmd->advertising; | 276 | skge->advertising = ecmd->advertising; |
278 | 277 | ||
279 | if (netif_running(dev)) { | 278 | if (netif_running(dev)) |
280 | skge_down(dev); | 279 | skge_phy_reset(skge); |
281 | skge_up(dev); | 280 | |
282 | } | ||
283 | return (0); | 281 | return (0); |
284 | } | 282 | } |
285 | 283 | ||
@@ -430,21 +428,11 @@ static void skge_set_msglevel(struct net_device *netdev, u32 value) | |||
430 | static int skge_nway_reset(struct net_device *dev) | 428 | static int skge_nway_reset(struct net_device *dev) |
431 | { | 429 | { |
432 | struct skge_port *skge = netdev_priv(dev); | 430 | struct skge_port *skge = netdev_priv(dev); |
433 | struct skge_hw *hw = skge->hw; | ||
434 | int port = skge->port; | ||
435 | 431 | ||
436 | if (skge->autoneg != AUTONEG_ENABLE || !netif_running(dev)) | 432 | if (skge->autoneg != AUTONEG_ENABLE || !netif_running(dev)) |
437 | return -EINVAL; | 433 | return -EINVAL; |
438 | 434 | ||
439 | spin_lock_bh(&hw->phy_lock); | 435 | skge_phy_reset(skge); |
440 | if (hw->chip_id == CHIP_ID_GENESIS) { | ||
441 | genesis_reset(hw, port); | ||
442 | genesis_mac_init(hw, port); | ||
443 | } else { | ||
444 | yukon_reset(hw, port); | ||
445 | yukon_init(hw, port); | ||
446 | } | ||
447 | spin_unlock_bh(&hw->phy_lock); | ||
448 | return 0; | 436 | return 0; |
449 | } | 437 | } |
450 | 438 | ||
@@ -2019,6 +2007,25 @@ static void yukon_phy_intr(struct skge_port *skge) | |||
2019 | /* XXX restart autonegotiation? */ | 2007 | /* XXX restart autonegotiation? */ |
2020 | } | 2008 | } |
2021 | 2009 | ||
2010 | static void skge_phy_reset(struct skge_port *skge) | ||
2011 | { | ||
2012 | struct skge_hw *hw = skge->hw; | ||
2013 | int port = skge->port; | ||
2014 | |||
2015 | netif_stop_queue(skge->netdev); | ||
2016 | netif_carrier_off(skge->netdev); | ||
2017 | |||
2018 | spin_lock_bh(&hw->phy_lock); | ||
2019 | if (hw->chip_id == CHIP_ID_GENESIS) { | ||
2020 | genesis_reset(hw, port); | ||
2021 | genesis_mac_init(hw, port); | ||
2022 | } else { | ||
2023 | yukon_reset(hw, port); | ||
2024 | yukon_init(hw, port); | ||
2025 | } | ||
2026 | spin_unlock_bh(&hw->phy_lock); | ||
2027 | } | ||
2028 | |||
2022 | /* Basic MII support */ | 2029 | /* Basic MII support */ |
2023 | static int skge_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | 2030 | static int skge_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) |
2024 | { | 2031 | { |