diff options
Diffstat (limited to 'drivers/net/e1000e')
-rw-r--r-- | drivers/net/e1000e/82571.c | 8 | ||||
-rw-r--r-- | drivers/net/e1000e/es2lan.c | 2 | ||||
-rw-r--r-- | drivers/net/e1000e/hw.h | 1 | ||||
-rw-r--r-- | drivers/net/e1000e/ich8lan.c | 2 | ||||
-rw-r--r-- | drivers/net/e1000e/lib.c | 54 | ||||
-rw-r--r-- | drivers/net/e1000e/netdev.c | 30 |
6 files changed, 61 insertions, 36 deletions
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c index c1a42cfc80ba..02d67d047d96 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) { |
@@ -1290,7 +1292,6 @@ static s32 e1000_setup_link_82571(struct e1000_hw *hw) | |||
1290 | static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw) | 1292 | static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw) |
1291 | { | 1293 | { |
1292 | u32 ctrl; | 1294 | u32 ctrl; |
1293 | u32 led_ctrl; | ||
1294 | s32 ret_val; | 1295 | s32 ret_val; |
1295 | 1296 | ||
1296 | ctrl = er32(CTRL); | 1297 | ctrl = er32(CTRL); |
@@ -1305,11 +1306,6 @@ static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw) | |||
1305 | break; | 1306 | break; |
1306 | case e1000_phy_igp_2: | 1307 | case e1000_phy_igp_2: |
1307 | ret_val = e1000e_copper_link_setup_igp(hw); | 1308 | 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; | 1309 | break; |
1314 | default: | 1310 | default: |
1315 | return -E1000_ERR_PHY; | 1311 | return -E1000_ERR_PHY; |
diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c index 3028f23da891..e2aa3b788564 100644 --- a/drivers/net/e1000e/es2lan.c +++ b/drivers/net/e1000e/es2lan.c | |||
@@ -224,6 +224,8 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter) | |||
224 | /* Set if manageability features are enabled. */ | 224 | /* Set if manageability features are enabled. */ |
225 | mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) | 225 | mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) |
226 | ? true : false; | 226 | ? true : false; |
227 | /* Adaptive IFS not supported */ | ||
228 | mac->adaptive_ifs = false; | ||
227 | 229 | ||
228 | /* check for link */ | 230 | /* check for link */ |
229 | switch (hw->phy.media_type) { | 231 | switch (hw->phy.media_type) { |
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h index 2784cf44a6f3..eccf29b75c41 100644 --- a/drivers/net/e1000e/hw.h +++ b/drivers/net/e1000e/hw.h | |||
@@ -818,6 +818,7 @@ struct e1000_mac_info { | |||
818 | 818 | ||
819 | u8 forced_speed_duplex; | 819 | u8 forced_speed_duplex; |
820 | 820 | ||
821 | bool adaptive_ifs; | ||
821 | bool arc_subsystem_valid; | 822 | bool arc_subsystem_valid; |
822 | bool autoneg; | 823 | bool autoneg; |
823 | bool autoneg_failed; | 824 | bool autoneg_failed; |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index 9b09246af064..ad08cf3f40c0 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -454,6 +454,8 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter) | |||
454 | mac->rar_entry_count--; | 454 | mac->rar_entry_count--; |
455 | /* Set if manageability features are enabled. */ | 455 | /* Set if manageability features are enabled. */ |
456 | mac->arc_subsystem_valid = true; | 456 | mac->arc_subsystem_valid = true; |
457 | /* Adaptive IFS supported */ | ||
458 | mac->adaptive_ifs = true; | ||
457 | 459 | ||
458 | /* LED operations */ | 460 | /* LED operations */ |
459 | switch (mac->type) { | 461 | switch (mac->type) { |
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c index a86c17548c1e..2fa9b36a2c5a 100644 --- a/drivers/net/e1000e/lib.c +++ b/drivers/net/e1000e/lib.c | |||
@@ -125,6 +125,7 @@ void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value) | |||
125 | void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count) | 125 | void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count) |
126 | { | 126 | { |
127 | u32 i; | 127 | u32 i; |
128 | u8 mac_addr[ETH_ALEN] = {0}; | ||
128 | 129 | ||
129 | /* Setup the receive address */ | 130 | /* Setup the receive address */ |
130 | e_dbg("Programming MAC Address into RAR[0]\n"); | 131 | e_dbg("Programming MAC Address into RAR[0]\n"); |
@@ -133,12 +134,8 @@ void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count) | |||
133 | 134 | ||
134 | /* Zero out the other (rar_entry_count - 1) receive addresses */ | 135 | /* Zero out the other (rar_entry_count - 1) receive addresses */ |
135 | e_dbg("Clearing RAR[1-%u]\n", rar_count-1); | 136 | e_dbg("Clearing RAR[1-%u]\n", rar_count-1); |
136 | for (i = 1; i < rar_count; i++) { | 137 | for (i = 1; i < rar_count; i++) |
137 | E1000_WRITE_REG_ARRAY(hw, E1000_RA, (i << 1), 0); | 138 | e1000e_rar_set(hw, mac_addr, i); |
138 | e1e_flush(); | ||
139 | E1000_WRITE_REG_ARRAY(hw, E1000_RA, ((i << 1) + 1), 0); | ||
140 | e1e_flush(); | ||
141 | } | ||
142 | } | 139 | } |
143 | 140 | ||
144 | /** | 141 | /** |
@@ -164,10 +161,19 @@ void e1000e_rar_set(struct e1000_hw *hw, u8 *addr, u32 index) | |||
164 | 161 | ||
165 | rar_high = ((u32) addr[4] | ((u32) addr[5] << 8)); | 162 | rar_high = ((u32) addr[4] | ((u32) addr[5] << 8)); |
166 | 163 | ||
167 | rar_high |= E1000_RAH_AV; | 164 | /* If MAC address zero, no need to set the AV bit */ |
165 | if (rar_low || rar_high) | ||
166 | rar_high |= E1000_RAH_AV; | ||
168 | 167 | ||
169 | E1000_WRITE_REG_ARRAY(hw, E1000_RA, (index << 1), rar_low); | 168 | /* |
170 | E1000_WRITE_REG_ARRAY(hw, E1000_RA, ((index << 1) + 1), rar_high); | 169 | * Some bridges will combine consecutive 32-bit writes into |
170 | * a single burst write, which will malfunction on some parts. | ||
171 | * The flushes avoid this. | ||
172 | */ | ||
173 | ew32(RAL(index), rar_low); | ||
174 | e1e_flush(); | ||
175 | ew32(RAH(index), rar_high); | ||
176 | e1e_flush(); | ||
171 | } | 177 | } |
172 | 178 | ||
173 | /** | 179 | /** |
@@ -1609,6 +1615,11 @@ void e1000e_reset_adaptive(struct e1000_hw *hw) | |||
1609 | { | 1615 | { |
1610 | struct e1000_mac_info *mac = &hw->mac; | 1616 | struct e1000_mac_info *mac = &hw->mac; |
1611 | 1617 | ||
1618 | if (!mac->adaptive_ifs) { | ||
1619 | e_dbg("Not in Adaptive IFS mode!\n"); | ||
1620 | goto out; | ||
1621 | } | ||
1622 | |||
1612 | mac->current_ifs_val = 0; | 1623 | mac->current_ifs_val = 0; |
1613 | mac->ifs_min_val = IFS_MIN; | 1624 | mac->ifs_min_val = IFS_MIN; |
1614 | mac->ifs_max_val = IFS_MAX; | 1625 | mac->ifs_max_val = IFS_MAX; |
@@ -1617,6 +1628,8 @@ void e1000e_reset_adaptive(struct e1000_hw *hw) | |||
1617 | 1628 | ||
1618 | mac->in_ifs_mode = false; | 1629 | mac->in_ifs_mode = false; |
1619 | ew32(AIT, 0); | 1630 | ew32(AIT, 0); |
1631 | out: | ||
1632 | return; | ||
1620 | } | 1633 | } |
1621 | 1634 | ||
1622 | /** | 1635 | /** |
@@ -1630,6 +1643,11 @@ void e1000e_update_adaptive(struct e1000_hw *hw) | |||
1630 | { | 1643 | { |
1631 | struct e1000_mac_info *mac = &hw->mac; | 1644 | struct e1000_mac_info *mac = &hw->mac; |
1632 | 1645 | ||
1646 | if (!mac->adaptive_ifs) { | ||
1647 | e_dbg("Not in Adaptive IFS mode!\n"); | ||
1648 | goto out; | ||
1649 | } | ||
1650 | |||
1633 | if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) { | 1651 | if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) { |
1634 | if (mac->tx_packet_delta > MIN_NUM_XMITS) { | 1652 | if (mac->tx_packet_delta > MIN_NUM_XMITS) { |
1635 | mac->in_ifs_mode = true; | 1653 | mac->in_ifs_mode = true; |
@@ -1650,6 +1668,8 @@ void e1000e_update_adaptive(struct e1000_hw *hw) | |||
1650 | ew32(AIT, 0); | 1668 | ew32(AIT, 0); |
1651 | } | 1669 | } |
1652 | } | 1670 | } |
1671 | out: | ||
1672 | return; | ||
1653 | } | 1673 | } |
1654 | 1674 | ||
1655 | /** | 1675 | /** |
@@ -2287,10 +2307,12 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw) | |||
2287 | s32 ret_val, hdr_csum, csum; | 2307 | s32 ret_val, hdr_csum, csum; |
2288 | u8 i, len; | 2308 | u8 i, len; |
2289 | 2309 | ||
2310 | hw->mac.tx_pkt_filtering = true; | ||
2311 | |||
2290 | /* No manageability, no filtering */ | 2312 | /* No manageability, no filtering */ |
2291 | if (!e1000e_check_mng_mode(hw)) { | 2313 | if (!e1000e_check_mng_mode(hw)) { |
2292 | hw->mac.tx_pkt_filtering = false; | 2314 | hw->mac.tx_pkt_filtering = false; |
2293 | return 0; | 2315 | goto out; |
2294 | } | 2316 | } |
2295 | 2317 | ||
2296 | /* | 2318 | /* |
@@ -2298,9 +2320,9 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw) | |||
2298 | * reason, disable filtering. | 2320 | * reason, disable filtering. |
2299 | */ | 2321 | */ |
2300 | ret_val = e1000_mng_enable_host_if(hw); | 2322 | ret_val = e1000_mng_enable_host_if(hw); |
2301 | if (ret_val != 0) { | 2323 | if (ret_val) { |
2302 | hw->mac.tx_pkt_filtering = false; | 2324 | hw->mac.tx_pkt_filtering = false; |
2303 | return ret_val; | 2325 | goto out; |
2304 | } | 2326 | } |
2305 | 2327 | ||
2306 | /* Read in the header. Length and offset are in dwords. */ | 2328 | /* Read in the header. Length and offset are in dwords. */ |
@@ -2319,17 +2341,17 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw) | |||
2319 | */ | 2341 | */ |
2320 | if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) { | 2342 | if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) { |
2321 | hw->mac.tx_pkt_filtering = true; | 2343 | hw->mac.tx_pkt_filtering = true; |
2322 | return 1; | 2344 | goto out; |
2323 | } | 2345 | } |
2324 | 2346 | ||
2325 | /* Cookie area is valid, make the final check for filtering. */ | 2347 | /* Cookie area is valid, make the final check for filtering. */ |
2326 | if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING)) { | 2348 | if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING)) { |
2327 | hw->mac.tx_pkt_filtering = false; | 2349 | hw->mac.tx_pkt_filtering = false; |
2328 | return 0; | 2350 | goto out; |
2329 | } | 2351 | } |
2330 | 2352 | ||
2331 | hw->mac.tx_pkt_filtering = true; | 2353 | out: |
2332 | return 1; | 2354 | return hw->mac.tx_pkt_filtering; |
2333 | } | 2355 | } |
2334 | 2356 | ||
2335 | /** | 2357 | /** |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 762b697ce731..c45965a256b6 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -3315,24 +3315,24 @@ void e1000e_update_stats(struct e1000_adapter *adapter) | |||
3315 | if ((hw->phy.type == e1000_phy_82578) || | 3315 | if ((hw->phy.type == e1000_phy_82578) || |
3316 | (hw->phy.type == e1000_phy_82577)) { | 3316 | (hw->phy.type == e1000_phy_82577)) { |
3317 | e1e_rphy(hw, HV_SCC_UPPER, &phy_data); | 3317 | e1e_rphy(hw, HV_SCC_UPPER, &phy_data); |
3318 | e1e_rphy(hw, HV_SCC_LOWER, &phy_data); | 3318 | if (!e1e_rphy(hw, HV_SCC_LOWER, &phy_data)) |
3319 | adapter->stats.scc += phy_data; | 3319 | adapter->stats.scc += phy_data; |
3320 | 3320 | ||
3321 | e1e_rphy(hw, HV_ECOL_UPPER, &phy_data); | 3321 | e1e_rphy(hw, HV_ECOL_UPPER, &phy_data); |
3322 | e1e_rphy(hw, HV_ECOL_LOWER, &phy_data); | 3322 | if (!e1e_rphy(hw, HV_ECOL_LOWER, &phy_data)) |
3323 | adapter->stats.ecol += phy_data; | 3323 | adapter->stats.ecol += phy_data; |
3324 | 3324 | ||
3325 | e1e_rphy(hw, HV_MCC_UPPER, &phy_data); | 3325 | e1e_rphy(hw, HV_MCC_UPPER, &phy_data); |
3326 | e1e_rphy(hw, HV_MCC_LOWER, &phy_data); | 3326 | if (!e1e_rphy(hw, HV_MCC_LOWER, &phy_data)) |
3327 | adapter->stats.mcc += phy_data; | 3327 | adapter->stats.mcc += phy_data; |
3328 | 3328 | ||
3329 | e1e_rphy(hw, HV_LATECOL_UPPER, &phy_data); | 3329 | e1e_rphy(hw, HV_LATECOL_UPPER, &phy_data); |
3330 | e1e_rphy(hw, HV_LATECOL_LOWER, &phy_data); | 3330 | if (!e1e_rphy(hw, HV_LATECOL_LOWER, &phy_data)) |
3331 | adapter->stats.latecol += phy_data; | 3331 | adapter->stats.latecol += phy_data; |
3332 | 3332 | ||
3333 | e1e_rphy(hw, HV_DC_UPPER, &phy_data); | 3333 | e1e_rphy(hw, HV_DC_UPPER, &phy_data); |
3334 | e1e_rphy(hw, HV_DC_LOWER, &phy_data); | 3334 | if (!e1e_rphy(hw, HV_DC_LOWER, &phy_data)) |
3335 | adapter->stats.dc += phy_data; | 3335 | adapter->stats.dc += phy_data; |
3336 | } else { | 3336 | } else { |
3337 | adapter->stats.scc += er32(SCC); | 3337 | adapter->stats.scc += er32(SCC); |
3338 | adapter->stats.ecol += er32(ECOL); | 3338 | adapter->stats.ecol += er32(ECOL); |
@@ -3360,8 +3360,8 @@ void e1000e_update_stats(struct e1000_adapter *adapter) | |||
3360 | if ((hw->phy.type == e1000_phy_82578) || | 3360 | if ((hw->phy.type == e1000_phy_82578) || |
3361 | (hw->phy.type == e1000_phy_82577)) { | 3361 | (hw->phy.type == e1000_phy_82577)) { |
3362 | e1e_rphy(hw, HV_COLC_UPPER, &phy_data); | 3362 | e1e_rphy(hw, HV_COLC_UPPER, &phy_data); |
3363 | e1e_rphy(hw, HV_COLC_LOWER, &phy_data); | 3363 | if (!e1e_rphy(hw, HV_COLC_LOWER, &phy_data)) |
3364 | hw->mac.collision_delta = phy_data; | 3364 | hw->mac.collision_delta = phy_data; |
3365 | } else { | 3365 | } else { |
3366 | hw->mac.collision_delta = er32(COLC); | 3366 | hw->mac.collision_delta = er32(COLC); |
3367 | } | 3367 | } |
@@ -3372,8 +3372,8 @@ void e1000e_update_stats(struct e1000_adapter *adapter) | |||
3372 | if ((hw->phy.type == e1000_phy_82578) || | 3372 | if ((hw->phy.type == e1000_phy_82578) || |
3373 | (hw->phy.type == e1000_phy_82577)) { | 3373 | (hw->phy.type == e1000_phy_82577)) { |
3374 | e1e_rphy(hw, HV_TNCRS_UPPER, &phy_data); | 3374 | e1e_rphy(hw, HV_TNCRS_UPPER, &phy_data); |
3375 | e1e_rphy(hw, HV_TNCRS_LOWER, &phy_data); | 3375 | if (!e1e_rphy(hw, HV_TNCRS_LOWER, &phy_data)) |
3376 | adapter->stats.tncrs += phy_data; | 3376 | adapter->stats.tncrs += phy_data; |
3377 | } else { | 3377 | } else { |
3378 | if ((hw->mac.type != e1000_82574) && | 3378 | if ((hw->mac.type != e1000_82574) && |
3379 | (hw->mac.type != e1000_82583)) | 3379 | (hw->mac.type != e1000_82583)) |
@@ -4674,6 +4674,7 @@ static int e1000_resume(struct pci_dev *pdev) | |||
4674 | 4674 | ||
4675 | pci_set_power_state(pdev, PCI_D0); | 4675 | pci_set_power_state(pdev, PCI_D0); |
4676 | pci_restore_state(pdev); | 4676 | pci_restore_state(pdev); |
4677 | pci_save_state(pdev); | ||
4677 | e1000e_disable_l1aspm(pdev); | 4678 | e1000e_disable_l1aspm(pdev); |
4678 | 4679 | ||
4679 | err = pci_enable_device_mem(pdev); | 4680 | err = pci_enable_device_mem(pdev); |
@@ -4825,6 +4826,7 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev) | |||
4825 | } else { | 4826 | } else { |
4826 | pci_set_master(pdev); | 4827 | pci_set_master(pdev); |
4827 | pci_restore_state(pdev); | 4828 | pci_restore_state(pdev); |
4829 | pci_save_state(pdev); | ||
4828 | 4830 | ||
4829 | pci_enable_wake(pdev, PCI_D3hot, 0); | 4831 | pci_enable_wake(pdev, PCI_D3hot, 0); |
4830 | pci_enable_wake(pdev, PCI_D3cold, 0); | 4832 | pci_enable_wake(pdev, PCI_D3cold, 0); |