diff options
Diffstat (limited to 'drivers/net/e1000e/ich8lan.c')
-rw-r--r-- | drivers/net/e1000e/ich8lan.c | 77 |
1 files changed, 28 insertions, 49 deletions
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index d86cc083272..5328a292773 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -1395,22 +1395,6 @@ void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw) | |||
1395 | } | 1395 | } |
1396 | } | 1396 | } |
1397 | 1397 | ||
1398 | static u32 e1000_calc_rx_da_crc(u8 mac[]) | ||
1399 | { | ||
1400 | u32 poly = 0xEDB88320; /* Polynomial for 802.3 CRC calculation */ | ||
1401 | u32 i, j, mask, crc; | ||
1402 | |||
1403 | crc = 0xffffffff; | ||
1404 | for (i = 0; i < 6; i++) { | ||
1405 | crc = crc ^ mac[i]; | ||
1406 | for (j = 8; j > 0; j--) { | ||
1407 | mask = (crc & 1) * (-1); | ||
1408 | crc = (crc >> 1) ^ (poly & mask); | ||
1409 | } | ||
1410 | } | ||
1411 | return ~crc; | ||
1412 | } | ||
1413 | |||
1414 | /** | 1398 | /** |
1415 | * e1000_lv_jumbo_workaround_ich8lan - required for jumbo frame operation | 1399 | * e1000_lv_jumbo_workaround_ich8lan - required for jumbo frame operation |
1416 | * with 82579 PHY | 1400 | * with 82579 PHY |
@@ -1453,8 +1437,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
1453 | mac_addr[4] = (addr_high & 0xFF); | 1437 | mac_addr[4] = (addr_high & 0xFF); |
1454 | mac_addr[5] = ((addr_high >> 8) & 0xFF); | 1438 | mac_addr[5] = ((addr_high >> 8) & 0xFF); |
1455 | 1439 | ||
1456 | ew32(PCH_RAICC(i), | 1440 | ew32(PCH_RAICC(i), ~ether_crc_le(ETH_ALEN, mac_addr)); |
1457 | e1000_calc_rx_da_crc(mac_addr)); | ||
1458 | } | 1441 | } |
1459 | 1442 | ||
1460 | /* Write Rx addresses to the PHY */ | 1443 | /* Write Rx addresses to the PHY */ |
@@ -2977,7 +2960,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2977 | { | 2960 | { |
2978 | struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; | 2961 | struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; |
2979 | u16 reg; | 2962 | u16 reg; |
2980 | u32 ctrl, icr, kab; | 2963 | u32 ctrl, kab; |
2981 | s32 ret_val; | 2964 | s32 ret_val; |
2982 | 2965 | ||
2983 | /* | 2966 | /* |
@@ -3067,7 +3050,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
3067 | ew32(CRC_OFFSET, 0x65656565); | 3050 | ew32(CRC_OFFSET, 0x65656565); |
3068 | 3051 | ||
3069 | ew32(IMC, 0xffffffff); | 3052 | ew32(IMC, 0xffffffff); |
3070 | icr = er32(ICR); | 3053 | er32(ICR); |
3071 | 3054 | ||
3072 | kab = er32(KABGTXD); | 3055 | kab = er32(KABGTXD); |
3073 | kab |= E1000_KABGTXD_BGSQLBIAS; | 3056 | kab |= E1000_KABGTXD_BGSQLBIAS; |
@@ -3118,7 +3101,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw) | |||
3118 | * Reset the phy after disabling host wakeup to reset the Rx buffer. | 3101 | * Reset the phy after disabling host wakeup to reset the Rx buffer. |
3119 | */ | 3102 | */ |
3120 | if (hw->phy.type == e1000_phy_82578) { | 3103 | if (hw->phy.type == e1000_phy_82578) { |
3121 | hw->phy.ops.read_reg(hw, BM_WUC, &i); | 3104 | e1e_rphy(hw, BM_WUC, &i); |
3122 | ret_val = e1000_phy_hw_reset_ich8lan(hw); | 3105 | ret_val = e1000_phy_hw_reset_ich8lan(hw); |
3123 | if (ret_val) | 3106 | if (ret_val) |
3124 | return ret_val; | 3107 | return ret_val; |
@@ -3276,9 +3259,8 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw) | |||
3276 | (hw->phy.type == e1000_phy_82577)) { | 3259 | (hw->phy.type == e1000_phy_82577)) { |
3277 | ew32(FCRTV_PCH, hw->fc.refresh_time); | 3260 | ew32(FCRTV_PCH, hw->fc.refresh_time); |
3278 | 3261 | ||
3279 | ret_val = hw->phy.ops.write_reg(hw, | 3262 | ret_val = e1e_wphy(hw, PHY_REG(BM_PORT_CTRL_PAGE, 27), |
3280 | PHY_REG(BM_PORT_CTRL_PAGE, 27), | 3263 | hw->fc.pause_time); |
3281 | hw->fc.pause_time); | ||
3282 | if (ret_val) | 3264 | if (ret_val) |
3283 | return ret_val; | 3265 | return ret_val; |
3284 | } | 3266 | } |
@@ -3342,8 +3324,7 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw) | |||
3342 | return ret_val; | 3324 | return ret_val; |
3343 | break; | 3325 | break; |
3344 | case e1000_phy_ife: | 3326 | case e1000_phy_ife: |
3345 | ret_val = hw->phy.ops.read_reg(hw, IFE_PHY_MDIX_CONTROL, | 3327 | ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, ®_data); |
3346 | ®_data); | ||
3347 | if (ret_val) | 3328 | if (ret_val) |
3348 | return ret_val; | 3329 | return ret_val; |
3349 | 3330 | ||
@@ -3361,8 +3342,7 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw) | |||
3361 | reg_data |= IFE_PMC_AUTO_MDIX; | 3342 | reg_data |= IFE_PMC_AUTO_MDIX; |
3362 | break; | 3343 | break; |
3363 | } | 3344 | } |
3364 | ret_val = hw->phy.ops.write_reg(hw, IFE_PHY_MDIX_CONTROL, | 3345 | ret_val = e1e_wphy(hw, IFE_PHY_MDIX_CONTROL, reg_data); |
3365 | reg_data); | ||
3366 | if (ret_val) | 3346 | if (ret_val) |
3367 | return ret_val; | 3347 | return ret_val; |
3368 | break; | 3348 | break; |
@@ -3646,7 +3626,8 @@ static s32 e1000_led_off_ich8lan(struct e1000_hw *hw) | |||
3646 | { | 3626 | { |
3647 | if (hw->phy.type == e1000_phy_ife) | 3627 | if (hw->phy.type == e1000_phy_ife) |
3648 | return e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED, | 3628 | return e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED, |
3649 | (IFE_PSCL_PROBE_MODE | IFE_PSCL_PROBE_LEDS_OFF)); | 3629 | (IFE_PSCL_PROBE_MODE | |
3630 | IFE_PSCL_PROBE_LEDS_OFF)); | ||
3650 | 3631 | ||
3651 | ew32(LEDCTL, hw->mac.ledctl_mode1); | 3632 | ew32(LEDCTL, hw->mac.ledctl_mode1); |
3652 | return 0; | 3633 | return 0; |
@@ -3660,8 +3641,7 @@ static s32 e1000_led_off_ich8lan(struct e1000_hw *hw) | |||
3660 | **/ | 3641 | **/ |
3661 | static s32 e1000_setup_led_pchlan(struct e1000_hw *hw) | 3642 | static s32 e1000_setup_led_pchlan(struct e1000_hw *hw) |
3662 | { | 3643 | { |
3663 | return hw->phy.ops.write_reg(hw, HV_LED_CONFIG, | 3644 | return e1e_wphy(hw, HV_LED_CONFIG, (u16)hw->mac.ledctl_mode1); |
3664 | (u16)hw->mac.ledctl_mode1); | ||
3665 | } | 3645 | } |
3666 | 3646 | ||
3667 | /** | 3647 | /** |
@@ -3672,8 +3652,7 @@ static s32 e1000_setup_led_pchlan(struct e1000_hw *hw) | |||
3672 | **/ | 3652 | **/ |
3673 | static s32 e1000_cleanup_led_pchlan(struct e1000_hw *hw) | 3653 | static s32 e1000_cleanup_led_pchlan(struct e1000_hw *hw) |
3674 | { | 3654 | { |
3675 | return hw->phy.ops.write_reg(hw, HV_LED_CONFIG, | 3655 | return e1e_wphy(hw, HV_LED_CONFIG, (u16)hw->mac.ledctl_default); |
3676 | (u16)hw->mac.ledctl_default); | ||
3677 | } | 3656 | } |
3678 | 3657 | ||
3679 | /** | 3658 | /** |
@@ -3704,7 +3683,7 @@ static s32 e1000_led_on_pchlan(struct e1000_hw *hw) | |||
3704 | } | 3683 | } |
3705 | } | 3684 | } |
3706 | 3685 | ||
3707 | return hw->phy.ops.write_reg(hw, HV_LED_CONFIG, data); | 3686 | return e1e_wphy(hw, HV_LED_CONFIG, data); |
3708 | } | 3687 | } |
3709 | 3688 | ||
3710 | /** | 3689 | /** |
@@ -3735,7 +3714,7 @@ static s32 e1000_led_off_pchlan(struct e1000_hw *hw) | |||
3735 | } | 3714 | } |
3736 | } | 3715 | } |
3737 | 3716 | ||
3738 | return hw->phy.ops.write_reg(hw, HV_LED_CONFIG, data); | 3717 | return e1e_wphy(hw, HV_LED_CONFIG, data); |
3739 | } | 3718 | } |
3740 | 3719 | ||
3741 | /** | 3720 | /** |
@@ -3844,20 +3823,20 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw) | |||
3844 | if ((hw->phy.type == e1000_phy_82578) || | 3823 | if ((hw->phy.type == e1000_phy_82578) || |
3845 | (hw->phy.type == e1000_phy_82579) || | 3824 | (hw->phy.type == e1000_phy_82579) || |
3846 | (hw->phy.type == e1000_phy_82577)) { | 3825 | (hw->phy.type == e1000_phy_82577)) { |
3847 | hw->phy.ops.read_reg(hw, HV_SCC_UPPER, &phy_data); | 3826 | e1e_rphy(hw, HV_SCC_UPPER, &phy_data); |
3848 | hw->phy.ops.read_reg(hw, HV_SCC_LOWER, &phy_data); | 3827 | e1e_rphy(hw, HV_SCC_LOWER, &phy_data); |
3849 | hw->phy.ops.read_reg(hw, HV_ECOL_UPPER, &phy_data); | 3828 | e1e_rphy(hw, HV_ECOL_UPPER, &phy_data); |
3850 | hw->phy.ops.read_reg(hw, HV_ECOL_LOWER, &phy_data); | 3829 | e1e_rphy(hw, HV_ECOL_LOWER, &phy_data); |
3851 | hw->phy.ops.read_reg(hw, HV_MCC_UPPER, &phy_data); | 3830 | e1e_rphy(hw, HV_MCC_UPPER, &phy_data); |
3852 | hw->phy.ops.read_reg(hw, HV_MCC_LOWER, &phy_data); | 3831 | e1e_rphy(hw, HV_MCC_LOWER, &phy_data); |
3853 | hw->phy.ops.read_reg(hw, HV_LATECOL_UPPER, &phy_data); | 3832 | e1e_rphy(hw, HV_LATECOL_UPPER, &phy_data); |
3854 | hw->phy.ops.read_reg(hw, HV_LATECOL_LOWER, &phy_data); | 3833 | e1e_rphy(hw, HV_LATECOL_LOWER, &phy_data); |
3855 | hw->phy.ops.read_reg(hw, HV_COLC_UPPER, &phy_data); | 3834 | e1e_rphy(hw, HV_COLC_UPPER, &phy_data); |
3856 | hw->phy.ops.read_reg(hw, HV_COLC_LOWER, &phy_data); | 3835 | e1e_rphy(hw, HV_COLC_LOWER, &phy_data); |
3857 | hw->phy.ops.read_reg(hw, HV_DC_UPPER, &phy_data); | 3836 | e1e_rphy(hw, HV_DC_UPPER, &phy_data); |
3858 | hw->phy.ops.read_reg(hw, HV_DC_LOWER, &phy_data); | 3837 | e1e_rphy(hw, HV_DC_LOWER, &phy_data); |
3859 | hw->phy.ops.read_reg(hw, HV_TNCRS_UPPER, &phy_data); | 3838 | e1e_rphy(hw, HV_TNCRS_UPPER, &phy_data); |
3860 | hw->phy.ops.read_reg(hw, HV_TNCRS_LOWER, &phy_data); | 3839 | e1e_rphy(hw, HV_TNCRS_LOWER, &phy_data); |
3861 | } | 3840 | } |
3862 | } | 3841 | } |
3863 | 3842 | ||