diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2008-11-21 19:57:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-21 19:57:36 -0500 |
commit | 5c48ef3e2028677a890d46d9a38b19174274f2e9 (patch) | |
tree | 1ef4a75e9054eafa127609bd31f7999dc1fe085f /drivers/net/e1000e/lib.c | |
parent | 8f12fe8653eb699a6bc4f88f1a80312466ea2b0e (diff) |
e1000e: sync change flow control variables with ixgbe
Sync flow control variables and usage model with that found in the ixgbe
driver.
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>
Diffstat (limited to 'drivers/net/e1000e/lib.c')
-rw-r--r-- | drivers/net/e1000e/lib.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c index 37753d13cd22..66741104ffd1 100644 --- a/drivers/net/e1000e/lib.c +++ b/drivers/net/e1000e/lib.c | |||
@@ -645,12 +645,12 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw) | |||
645 | } | 645 | } |
646 | 646 | ||
647 | if ((nvm_data & NVM_WORD0F_PAUSE_MASK) == 0) | 647 | if ((nvm_data & NVM_WORD0F_PAUSE_MASK) == 0) |
648 | hw->fc.type = e1000_fc_none; | 648 | hw->fc.requested_mode = e1000_fc_none; |
649 | else if ((nvm_data & NVM_WORD0F_PAUSE_MASK) == | 649 | else if ((nvm_data & NVM_WORD0F_PAUSE_MASK) == |
650 | NVM_WORD0F_ASM_DIR) | 650 | NVM_WORD0F_ASM_DIR) |
651 | hw->fc.type = e1000_fc_tx_pause; | 651 | hw->fc.requested_mode = e1000_fc_tx_pause; |
652 | else | 652 | else |
653 | hw->fc.type = e1000_fc_full; | 653 | hw->fc.requested_mode = e1000_fc_full; |
654 | 654 | ||
655 | return 0; | 655 | return 0; |
656 | } | 656 | } |
@@ -678,23 +678,23 @@ s32 e1000e_setup_link(struct e1000_hw *hw) | |||
678 | return 0; | 678 | return 0; |
679 | 679 | ||
680 | /* | 680 | /* |
681 | * If flow control is set to default, set flow control based on | 681 | * If requested flow control is set to default, set flow control |
682 | * the EEPROM flow control settings. | 682 | * based on the EEPROM flow control settings. |
683 | */ | 683 | */ |
684 | if (hw->fc.type == e1000_fc_default) { | 684 | if (hw->fc.requested_mode == e1000_fc_default) { |
685 | ret_val = e1000_set_default_fc_generic(hw); | 685 | ret_val = e1000_set_default_fc_generic(hw); |
686 | if (ret_val) | 686 | if (ret_val) |
687 | return ret_val; | 687 | return ret_val; |
688 | } | 688 | } |
689 | 689 | ||
690 | /* | 690 | /* |
691 | * We want to save off the original Flow Control configuration just | 691 | * Save off the requested flow control mode for use later. Depending |
692 | * in case we get disconnected and then reconnected into a different | 692 | * on the link partner's capabilities, we may or may not use this mode. |
693 | * hub or switch with different Flow Control capabilities. | ||
694 | */ | 693 | */ |
695 | hw->fc.original_type = hw->fc.type; | 694 | hw->fc.current_mode = hw->fc.requested_mode; |
696 | 695 | ||
697 | hw_dbg(hw, "After fix-ups FlowControl is now = %x\n", hw->fc.type); | 696 | hw_dbg(hw, "After fix-ups FlowControl is now = %x\n", |
697 | hw->fc.current_mode); | ||
698 | 698 | ||
699 | /* Call the necessary media_type subroutine to configure the link. */ | 699 | /* Call the necessary media_type subroutine to configure the link. */ |
700 | ret_val = mac->ops.setup_physical_interface(hw); | 700 | ret_val = mac->ops.setup_physical_interface(hw); |
@@ -746,7 +746,7 @@ static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw) | |||
746 | * do not support receiving pause frames). | 746 | * do not support receiving pause frames). |
747 | * 3: Both Rx and Tx flow control (symmetric) are enabled. | 747 | * 3: Both Rx and Tx flow control (symmetric) are enabled. |
748 | */ | 748 | */ |
749 | switch (hw->fc.type) { | 749 | switch (hw->fc.current_mode) { |
750 | case e1000_fc_none: | 750 | case e1000_fc_none: |
751 | /* Flow control completely disabled by a software over-ride. */ | 751 | /* Flow control completely disabled by a software over-ride. */ |
752 | txcw = (E1000_TXCW_ANE | E1000_TXCW_FD); | 752 | txcw = (E1000_TXCW_ANE | E1000_TXCW_FD); |
@@ -928,7 +928,7 @@ s32 e1000e_set_fc_watermarks(struct e1000_hw *hw) | |||
928 | * ability to transmit pause frames is not enabled, then these | 928 | * ability to transmit pause frames is not enabled, then these |
929 | * registers will be set to 0. | 929 | * registers will be set to 0. |
930 | */ | 930 | */ |
931 | if (hw->fc.type & e1000_fc_tx_pause) { | 931 | if (hw->fc.current_mode & e1000_fc_tx_pause) { |
932 | /* | 932 | /* |
933 | * We need to set up the Receive Threshold high and low water | 933 | * We need to set up the Receive Threshold high and low water |
934 | * marks as well as (optionally) enabling the transmission of | 934 | * marks as well as (optionally) enabling the transmission of |
@@ -967,7 +967,7 @@ s32 e1000e_force_mac_fc(struct e1000_hw *hw) | |||
967 | * receive flow control. | 967 | * receive flow control. |
968 | * | 968 | * |
969 | * The "Case" statement below enables/disable flow control | 969 | * The "Case" statement below enables/disable flow control |
970 | * according to the "hw->fc.type" parameter. | 970 | * according to the "hw->fc.current_mode" parameter. |
971 | * | 971 | * |
972 | * The possible values of the "fc" parameter are: | 972 | * The possible values of the "fc" parameter are: |
973 | * 0: Flow control is completely disabled | 973 | * 0: Flow control is completely disabled |
@@ -978,9 +978,9 @@ s32 e1000e_force_mac_fc(struct e1000_hw *hw) | |||
978 | * 3: Both Rx and Tx flow control (symmetric) is enabled. | 978 | * 3: Both Rx and Tx flow control (symmetric) is enabled. |
979 | * other: No other values should be possible at this point. | 979 | * other: No other values should be possible at this point. |
980 | */ | 980 | */ |
981 | hw_dbg(hw, "hw->fc.type = %u\n", hw->fc.type); | 981 | hw_dbg(hw, "hw->fc.current_mode = %u\n", hw->fc.current_mode); |
982 | 982 | ||
983 | switch (hw->fc.type) { | 983 | switch (hw->fc.current_mode) { |
984 | case e1000_fc_none: | 984 | case e1000_fc_none: |
985 | ctrl &= (~(E1000_CTRL_TFCE | E1000_CTRL_RFCE)); | 985 | ctrl &= (~(E1000_CTRL_TFCE | E1000_CTRL_RFCE)); |
986 | break; | 986 | break; |
@@ -1124,11 +1124,11 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1124 | * ONLY. Hence, we must now check to see if we need to | 1124 | * ONLY. Hence, we must now check to see if we need to |
1125 | * turn OFF the TRANSMISSION of PAUSE frames. | 1125 | * turn OFF the TRANSMISSION of PAUSE frames. |
1126 | */ | 1126 | */ |
1127 | if (hw->fc.original_type == e1000_fc_full) { | 1127 | if (hw->fc.requested_mode == e1000_fc_full) { |
1128 | hw->fc.type = e1000_fc_full; | 1128 | hw->fc.current_mode = e1000_fc_full; |
1129 | hw_dbg(hw, "Flow Control = FULL.\r\n"); | 1129 | hw_dbg(hw, "Flow Control = FULL.\r\n"); |
1130 | } else { | 1130 | } else { |
1131 | hw->fc.type = e1000_fc_rx_pause; | 1131 | hw->fc.current_mode = e1000_fc_rx_pause; |
1132 | hw_dbg(hw, "Flow Control = " | 1132 | hw_dbg(hw, "Flow Control = " |
1133 | "RX PAUSE frames only.\r\n"); | 1133 | "RX PAUSE frames only.\r\n"); |
1134 | } | 1134 | } |
@@ -1146,7 +1146,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1146 | (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && | 1146 | (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && |
1147 | (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && | 1147 | (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && |
1148 | (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { | 1148 | (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { |
1149 | hw->fc.type = e1000_fc_tx_pause; | 1149 | hw->fc.current_mode = e1000_fc_tx_pause; |
1150 | hw_dbg(hw, "Flow Control = Tx PAUSE frames only.\r\n"); | 1150 | hw_dbg(hw, "Flow Control = Tx PAUSE frames only.\r\n"); |
1151 | } | 1151 | } |
1152 | /* | 1152 | /* |
@@ -1162,14 +1162,14 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1162 | (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && | 1162 | (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && |
1163 | !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && | 1163 | !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && |
1164 | (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { | 1164 | (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { |
1165 | hw->fc.type = e1000_fc_rx_pause; | 1165 | hw->fc.current_mode = e1000_fc_rx_pause; |
1166 | hw_dbg(hw, "Flow Control = Rx PAUSE frames only.\r\n"); | 1166 | hw_dbg(hw, "Flow Control = Rx PAUSE frames only.\r\n"); |
1167 | } else { | 1167 | } else { |
1168 | /* | 1168 | /* |
1169 | * Per the IEEE spec, at this point flow control | 1169 | * Per the IEEE spec, at this point flow control |
1170 | * should be disabled. | 1170 | * should be disabled. |
1171 | */ | 1171 | */ |
1172 | hw->fc.type = e1000_fc_none; | 1172 | hw->fc.current_mode = e1000_fc_none; |
1173 | hw_dbg(hw, "Flow Control = NONE.\r\n"); | 1173 | hw_dbg(hw, "Flow Control = NONE.\r\n"); |
1174 | } | 1174 | } |
1175 | 1175 | ||
@@ -1185,7 +1185,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1185 | } | 1185 | } |
1186 | 1186 | ||
1187 | if (duplex == HALF_DUPLEX) | 1187 | if (duplex == HALF_DUPLEX) |
1188 | hw->fc.type = e1000_fc_none; | 1188 | hw->fc.current_mode = e1000_fc_none; |
1189 | 1189 | ||
1190 | /* | 1190 | /* |
1191 | * Now we call a subroutine to actually force the MAC | 1191 | * Now we call a subroutine to actually force the MAC |