diff options
Diffstat (limited to 'drivers/net/e1000e/82571.c')
-rw-r--r-- | drivers/net/e1000e/82571.c | 76 |
1 files changed, 40 insertions, 36 deletions
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c index c1a42cfc80ba..3c95acb3a87d 100644 --- a/drivers/net/e1000e/82571.c +++ b/drivers/net/e1000e/82571.c | |||
@@ -237,6 +237,8 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter) | |||
237 | /* Set if manageability features are enabled. */ | 237 | /* Set if manageability features are enabled. */ |
238 | mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) | 238 | mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) |
239 | ? true : false; | 239 | ? true : false; |
240 | /* Adaptive IFS supported */ | ||
241 | mac->adaptive_ifs = true; | ||
240 | 242 | ||
241 | /* check for link */ | 243 | /* check for link */ |
242 | switch (hw->phy.media_type) { | 244 | switch (hw->phy.media_type) { |
@@ -265,8 +267,14 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter) | |||
265 | } | 267 | } |
266 | 268 | ||
267 | switch (hw->mac.type) { | 269 | switch (hw->mac.type) { |
270 | case e1000_82573: | ||
271 | func->set_lan_id = e1000_set_lan_id_single_port; | ||
272 | func->check_mng_mode = e1000e_check_mng_mode_generic; | ||
273 | func->led_on = e1000e_led_on_generic; | ||
274 | break; | ||
268 | case e1000_82574: | 275 | case e1000_82574: |
269 | case e1000_82583: | 276 | case e1000_82583: |
277 | func->set_lan_id = e1000_set_lan_id_single_port; | ||
270 | func->check_mng_mode = e1000_check_mng_mode_82574; | 278 | func->check_mng_mode = e1000_check_mng_mode_82574; |
271 | func->led_on = e1000_led_on_82574; | 279 | func->led_on = e1000_led_on_82574; |
272 | break; | 280 | break; |
@@ -920,9 +928,12 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) | |||
920 | ew32(IMC, 0xffffffff); | 928 | ew32(IMC, 0xffffffff); |
921 | icr = er32(ICR); | 929 | icr = er32(ICR); |
922 | 930 | ||
923 | if (hw->mac.type == e1000_82571 && | 931 | /* Install any alternate MAC address into RAR0 */ |
924 | hw->dev_spec.e82571.alt_mac_addr_is_present) | 932 | ret_val = e1000_check_alt_mac_addr_generic(hw); |
925 | e1000e_set_laa_state_82571(hw, true); | 933 | if (ret_val) |
934 | return ret_val; | ||
935 | |||
936 | e1000e_set_laa_state_82571(hw, true); | ||
926 | 937 | ||
927 | /* Reinitialize the 82571 serdes link state machine */ | 938 | /* Reinitialize the 82571 serdes link state machine */ |
928 | if (hw->phy.media_type == e1000_media_type_internal_serdes) | 939 | if (hw->phy.media_type == e1000_media_type_internal_serdes) |
@@ -1223,32 +1234,6 @@ static s32 e1000_led_on_82574(struct e1000_hw *hw) | |||
1223 | } | 1234 | } |
1224 | 1235 | ||
1225 | /** | 1236 | /** |
1226 | * e1000_update_mc_addr_list_82571 - Update Multicast addresses | ||
1227 | * @hw: pointer to the HW structure | ||
1228 | * @mc_addr_list: array of multicast addresses to program | ||
1229 | * @mc_addr_count: number of multicast addresses to program | ||
1230 | * @rar_used_count: the first RAR register free to program | ||
1231 | * @rar_count: total number of supported Receive Address Registers | ||
1232 | * | ||
1233 | * Updates the Receive Address Registers and Multicast Table Array. | ||
1234 | * The caller must have a packed mc_addr_list of multicast addresses. | ||
1235 | * The parameter rar_count will usually be hw->mac.rar_entry_count | ||
1236 | * unless there are workarounds that change this. | ||
1237 | **/ | ||
1238 | static void e1000_update_mc_addr_list_82571(struct e1000_hw *hw, | ||
1239 | u8 *mc_addr_list, | ||
1240 | u32 mc_addr_count, | ||
1241 | u32 rar_used_count, | ||
1242 | u32 rar_count) | ||
1243 | { | ||
1244 | if (e1000e_get_laa_state_82571(hw)) | ||
1245 | rar_count--; | ||
1246 | |||
1247 | e1000e_update_mc_addr_list_generic(hw, mc_addr_list, mc_addr_count, | ||
1248 | rar_used_count, rar_count); | ||
1249 | } | ||
1250 | |||
1251 | /** | ||
1252 | * e1000_setup_link_82571 - Setup flow control and link settings | 1237 | * e1000_setup_link_82571 - Setup flow control and link settings |
1253 | * @hw: pointer to the HW structure | 1238 | * @hw: pointer to the HW structure |
1254 | * | 1239 | * |
@@ -1290,7 +1275,6 @@ static s32 e1000_setup_link_82571(struct e1000_hw *hw) | |||
1290 | static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw) | 1275 | static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw) |
1291 | { | 1276 | { |
1292 | u32 ctrl; | 1277 | u32 ctrl; |
1293 | u32 led_ctrl; | ||
1294 | s32 ret_val; | 1278 | s32 ret_val; |
1295 | 1279 | ||
1296 | ctrl = er32(CTRL); | 1280 | ctrl = er32(CTRL); |
@@ -1305,11 +1289,6 @@ static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw) | |||
1305 | break; | 1289 | break; |
1306 | case e1000_phy_igp_2: | 1290 | case e1000_phy_igp_2: |
1307 | ret_val = e1000e_copper_link_setup_igp(hw); | 1291 | ret_val = e1000e_copper_link_setup_igp(hw); |
1308 | /* Setup activity LED */ | ||
1309 | led_ctrl = er32(LEDCTL); | ||
1310 | led_ctrl &= IGP_ACTIVITY_LED_MASK; | ||
1311 | led_ctrl |= (IGP_ACTIVITY_LED_ENABLE | IGP_LED3_MODE); | ||
1312 | ew32(LEDCTL, led_ctrl); | ||
1313 | break; | 1292 | break; |
1314 | default: | 1293 | default: |
1315 | return -E1000_ERR_PHY; | 1294 | return -E1000_ERR_PHY; |
@@ -1625,6 +1604,29 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) | |||
1625 | } | 1604 | } |
1626 | 1605 | ||
1627 | /** | 1606 | /** |
1607 | * e1000_read_mac_addr_82571 - Read device MAC address | ||
1608 | * @hw: pointer to the HW structure | ||
1609 | **/ | ||
1610 | static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw) | ||
1611 | { | ||
1612 | s32 ret_val = 0; | ||
1613 | |||
1614 | /* | ||
1615 | * If there's an alternate MAC address place it in RAR0 | ||
1616 | * so that it will override the Si installed default perm | ||
1617 | * address. | ||
1618 | */ | ||
1619 | ret_val = e1000_check_alt_mac_addr_generic(hw); | ||
1620 | if (ret_val) | ||
1621 | goto out; | ||
1622 | |||
1623 | ret_val = e1000_read_mac_addr_generic(hw); | ||
1624 | |||
1625 | out: | ||
1626 | return ret_val; | ||
1627 | } | ||
1628 | |||
1629 | /** | ||
1628 | * e1000_power_down_phy_copper_82571 - Remove link during PHY power down | 1630 | * e1000_power_down_phy_copper_82571 - Remove link during PHY power down |
1629 | * @hw: pointer to the HW structure | 1631 | * @hw: pointer to the HW structure |
1630 | * | 1632 | * |
@@ -1699,10 +1701,11 @@ static struct e1000_mac_operations e82571_mac_ops = { | |||
1699 | .cleanup_led = e1000e_cleanup_led_generic, | 1701 | .cleanup_led = e1000e_cleanup_led_generic, |
1700 | .clear_hw_cntrs = e1000_clear_hw_cntrs_82571, | 1702 | .clear_hw_cntrs = e1000_clear_hw_cntrs_82571, |
1701 | .get_bus_info = e1000e_get_bus_info_pcie, | 1703 | .get_bus_info = e1000e_get_bus_info_pcie, |
1704 | .set_lan_id = e1000_set_lan_id_multi_port_pcie, | ||
1702 | /* .get_link_up_info: media type dependent */ | 1705 | /* .get_link_up_info: media type dependent */ |
1703 | /* .led_on: mac type dependent */ | 1706 | /* .led_on: mac type dependent */ |
1704 | .led_off = e1000e_led_off_generic, | 1707 | .led_off = e1000e_led_off_generic, |
1705 | .update_mc_addr_list = e1000_update_mc_addr_list_82571, | 1708 | .update_mc_addr_list = e1000e_update_mc_addr_list_generic, |
1706 | .write_vfta = e1000_write_vfta_generic, | 1709 | .write_vfta = e1000_write_vfta_generic, |
1707 | .clear_vfta = e1000_clear_vfta_82571, | 1710 | .clear_vfta = e1000_clear_vfta_82571, |
1708 | .reset_hw = e1000_reset_hw_82571, | 1711 | .reset_hw = e1000_reset_hw_82571, |
@@ -1710,6 +1713,7 @@ static struct e1000_mac_operations e82571_mac_ops = { | |||
1710 | .setup_link = e1000_setup_link_82571, | 1713 | .setup_link = e1000_setup_link_82571, |
1711 | /* .setup_physical_interface: media type dependent */ | 1714 | /* .setup_physical_interface: media type dependent */ |
1712 | .setup_led = e1000e_setup_led_generic, | 1715 | .setup_led = e1000e_setup_led_generic, |
1716 | .read_mac_addr = e1000_read_mac_addr_82571, | ||
1713 | }; | 1717 | }; |
1714 | 1718 | ||
1715 | static struct e1000_phy_operations e82_phy_ops_igp = { | 1719 | static struct e1000_phy_operations e82_phy_ops_igp = { |