]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
e1000e: restore flow control settings properly
authorAuke Kok <auke-jan.h.kok@intel.com>
Fri, 5 Oct 2007 22:22:02 +0000 (15:22 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:55:25 +0000 (16:55 -0700)
After a cable unplug the forced flow control settings were lost
accidentally and the flow control settings fell back to the default
EEPROM determined values. This breaks for people who want to
run without fc enabled - after a cable reset the driver would
refuse to run with fc disabled.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/e1000e/ethtool.c
drivers/net/e1000e/lib.c
drivers/net/e1000e/netdev.c

index 2e8218fb05795c906d1c731812f61751af8a50c6..b7a7e2ae5e139c6f37bb5021220d943cb0f5573a 100644 (file)
@@ -301,6 +301,7 @@ static int e1000_set_pauseparam(struct net_device *netdev,
        hw->mac.original_fc = hw->mac.fc;
 
        if (adapter->fc_autoneg == AUTONEG_ENABLE) {
+               hw->mac.fc = e1000_fc_default;
                if (netif_running(adapter->netdev)) {
                        e1000e_down(adapter);
                        e1000e_up(adapter);
index 3bbfe605e11170721fed97dc9c92e99854870343..0bdeca30c75fd3348f5b56fe49e8c03ed581d600 100644 (file)
@@ -639,9 +639,15 @@ s32 e1000e_setup_link(struct e1000_hw *hw)
        if (e1000_check_reset_block(hw))
                return 0;
 
-       ret_val = e1000_set_default_fc_generic(hw);
-       if (ret_val)
-               return ret_val;
+       /*
+        * If flow control is set to default, set flow control based on
+        * the EEPROM flow control settings.
+        */
+       if (mac->fc == e1000_fc_default) {
+               ret_val = e1000_set_default_fc_generic(hw);
+               if (ret_val)
+                       return ret_val;
+       }
 
        /* We want to save off the original Flow Control configuration just
         * in case we get disconnected and then reconnected into a different
index 600538bc932f76b2c5367c0749cf745c625d9ce9..033e124d1c1f5424c70e633f726d92f4c68d4c7d 100644 (file)
@@ -4195,6 +4195,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 
        /* Initialize link parameters. User can change them with ethtool */
        adapter->hw.mac.autoneg = 1;
+       adapter->fc_autoneg = 1;
        adapter->hw.mac.original_fc = e1000_fc_default;
        adapter->hw.mac.fc = e1000_fc_default;
        adapter->hw.phy.autoneg_advertised = 0x2f;