]> git.karo-electronics.de Git - linux-beck.git/commitdiff
e1000e: move settting of flow control refresh timer to link setup code
authorBruce Allan <bruce.w.allan@intel.com>
Mon, 10 May 2010 15:02:12 +0000 (15:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 May 2010 06:31:13 +0000 (23:31 -0700)
The flow control refresh timer value needs to be saved off so that it can
be programmed into the approrpiate register when applicable but without a
reset, e.g. when changing flow control parameters via ethtool.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/e1000e/hw.h
drivers/net/e1000e/ich8lan.c
drivers/net/e1000e/netdev.c

index 287ee954448f42ed626f655186872ff467a6f4e8..fa314b4a68c1f9ed4c7ba74d1ce6570181ed19ec 100644 (file)
@@ -901,6 +901,7 @@ struct e1000_fc_info {
        u32 high_water;          /* Flow control high-water mark */
        u32 low_water;           /* Flow control low-water mark */
        u16 pause_time;          /* Flow control pause timer */
+       u16 refresh_time;        /* Flow control refresh timer */
        bool send_xon;           /* Flow control send XON */
        bool strict_ieee;        /* Strict IEEE mode */
        enum e1000_fc_mode current_mode; /* FC mode in effect */
index 8efe9a7cbaadaf3aa0040d496928b667c2ca883c..2b2cffc017be4ec6309107a980be803646ce4bea 100644 (file)
@@ -2823,6 +2823,8 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
        ew32(FCTTV, hw->fc.pause_time);
        if ((hw->phy.type == e1000_phy_82578) ||
            (hw->phy.type == e1000_phy_82577)) {
+               ew32(FCRTV_PCH, hw->fc.refresh_time);
+
                ret_val = hw->phy.ops.write_reg(hw,
                                             PHY_REG(BM_PORT_CTRL_PAGE, 27),
                                             hw->fc.pause_time);
index 16a03c553299d70d6063c8de407db18f2147d6fa..d1f60c570c0e7a4fdc88e019b869871527ffd5f6 100644 (file)
@@ -3134,6 +3134,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
                        fc->high_water = 0x5000;
                        fc->low_water  = 0x3000;
                }
+               fc->refresh_time = 0x1000;
        } else {
                if ((adapter->flags & FLAG_HAS_ERT) &&
                    (adapter->netdev->mtu > ETH_DATA_LEN))
@@ -3171,10 +3172,6 @@ void e1000e_reset(struct e1000_adapter *adapter)
        if (mac->ops.init_hw(hw))
                e_err("Hardware Error\n");
 
-       /* additional part of the flow-control workaround above */
-       if (hw->mac.type == e1000_pchlan)
-               ew32(FCRTV_PCH, 0x1000);
-
        e1000_update_mng_vlan(adapter);
 
        /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */