aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e1000e/mac.c
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2013-01-16 03:54:35 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-02-01 01:34:59 -0500
commitc2ade1a41d69b8b734dd9947bf7ec25bb2fd2f33 (patch)
treef88da6ec776ec517f2e3fdce040c060ec7663590 /drivers/net/ethernet/intel/e1000e/mac.c
parent8bb628697fb05172f10a0960385b8369be15cb6c (diff)
e1000e: use generic IEEE MII definitions
For standard IEEE MII-compatible transceivers, the kernel has generic register and bit definitions. Use those instead of redundant local defines. Do not replace references of MII_CR_SPEED_10 with BMCR_SPEED10 (0x0000) when it is not necessary (i.e. when it is bitwise OR'ed with another value). Some whitespace issues in the surrounding context of the above changes are also cleaned up. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e/mac.c')
-rw-r--r--drivers/net/ethernet/intel/e1000e/mac.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
index 7365288f20f7..b78e02174601 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.c
+++ b/drivers/net/ethernet/intel/e1000e/mac.c
@@ -1053,14 +1053,14 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
1053 * has completed. We read this twice because this reg has 1053 * has completed. We read this twice because this reg has
1054 * some "sticky" (latched) bits. 1054 * some "sticky" (latched) bits.
1055 */ 1055 */
1056 ret_val = e1e_rphy(hw, PHY_STATUS, &mii_status_reg); 1056 ret_val = e1e_rphy(hw, MII_BMSR, &mii_status_reg);
1057 if (ret_val) 1057 if (ret_val)
1058 return ret_val; 1058 return ret_val;
1059 ret_val = e1e_rphy(hw, PHY_STATUS, &mii_status_reg); 1059 ret_val = e1e_rphy(hw, MII_BMSR, &mii_status_reg);
1060 if (ret_val) 1060 if (ret_val)
1061 return ret_val; 1061 return ret_val;
1062 1062
1063 if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) { 1063 if (!(mii_status_reg & BMSR_ANEGCOMPLETE)) {
1064 e_dbg("Copper PHY and Auto Neg has not completed.\n"); 1064 e_dbg("Copper PHY and Auto Neg has not completed.\n");
1065 return ret_val; 1065 return ret_val;
1066 } 1066 }
@@ -1071,11 +1071,10 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
1071 * Page Ability Register (Address 5) to determine how 1071 * Page Ability Register (Address 5) to determine how
1072 * flow control was negotiated. 1072 * flow control was negotiated.
1073 */ 1073 */
1074 ret_val = e1e_rphy(hw, PHY_AUTONEG_ADV, &mii_nway_adv_reg); 1074 ret_val = e1e_rphy(hw, MII_ADVERTISE, &mii_nway_adv_reg);
1075 if (ret_val) 1075 if (ret_val)
1076 return ret_val; 1076 return ret_val;
1077 ret_val = e1e_rphy(hw, PHY_LP_ABILITY, 1077 ret_val = e1e_rphy(hw, MII_LPA, &mii_nway_lp_ability_reg);
1078 &mii_nway_lp_ability_reg);
1079 if (ret_val) 1078 if (ret_val)
1080 return ret_val; 1079 return ret_val;
1081 1080
@@ -1112,8 +1111,8 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
1112 * 1 | DC | 1 | DC | E1000_fc_full 1111 * 1 | DC | 1 | DC | E1000_fc_full
1113 * 1112 *
1114 */ 1113 */
1115 if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && 1114 if ((mii_nway_adv_reg & ADVERTISE_PAUSE_CAP) &&
1116 (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE)) { 1115 (mii_nway_lp_ability_reg & LPA_PAUSE_CAP)) {
1117 /* Now we need to check if the user selected Rx ONLY 1116 /* Now we need to check if the user selected Rx ONLY
1118 * of pause frames. In this case, we had to advertise 1117 * of pause frames. In this case, we had to advertise
1119 * FULL flow control because we could not advertise Rx 1118 * FULL flow control because we could not advertise Rx
@@ -1135,10 +1134,10 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
1135 *-------|---------|-------|---------|-------------------- 1134 *-------|---------|-------|---------|--------------------
1136 * 0 | 1 | 1 | 1 | e1000_fc_tx_pause 1135 * 0 | 1 | 1 | 1 | e1000_fc_tx_pause
1137 */ 1136 */
1138 else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) && 1137 else if (!(mii_nway_adv_reg & ADVERTISE_PAUSE_CAP) &&
1139 (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && 1138 (mii_nway_adv_reg & ADVERTISE_PAUSE_ASYM) &&
1140 (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && 1139 (mii_nway_lp_ability_reg & LPA_PAUSE_CAP) &&
1141 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { 1140 (mii_nway_lp_ability_reg & LPA_PAUSE_ASYM)) {
1142 hw->fc.current_mode = e1000_fc_tx_pause; 1141 hw->fc.current_mode = e1000_fc_tx_pause;
1143 e_dbg("Flow Control = Tx PAUSE frames only.\n"); 1142 e_dbg("Flow Control = Tx PAUSE frames only.\n");
1144 } 1143 }
@@ -1149,10 +1148,10 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
1149 *-------|---------|-------|---------|-------------------- 1148 *-------|---------|-------|---------|--------------------
1150 * 1 | 1 | 0 | 1 | e1000_fc_rx_pause 1149 * 1 | 1 | 0 | 1 | e1000_fc_rx_pause
1151 */ 1150 */
1152 else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && 1151 else if ((mii_nway_adv_reg & ADVERTISE_PAUSE_CAP) &&
1153 (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && 1152 (mii_nway_adv_reg & ADVERTISE_PAUSE_ASYM) &&
1154 !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && 1153 !(mii_nway_lp_ability_reg & LPA_PAUSE_CAP) &&
1155 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { 1154 (mii_nway_lp_ability_reg & LPA_PAUSE_ASYM)) {
1156 hw->fc.current_mode = e1000_fc_rx_pause; 1155 hw->fc.current_mode = e1000_fc_rx_pause;
1157 e_dbg("Flow Control = Rx PAUSE frames only.\n"); 1156 e_dbg("Flow Control = Rx PAUSE frames only.\n");
1158 } else { 1157 } else {