diff options
Diffstat (limited to 'drivers/net/e1000e/netdev.c')
-rw-r--r-- | drivers/net/e1000e/netdev.c | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index fe50242aa9e..fa5b6045254 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -1980,15 +1980,15 @@ static void e1000_irq_enable(struct e1000_adapter *adapter) | |||
1980 | } | 1980 | } |
1981 | 1981 | ||
1982 | /** | 1982 | /** |
1983 | * e1000_get_hw_control - get control of the h/w from f/w | 1983 | * e1000e_get_hw_control - get control of the h/w from f/w |
1984 | * @adapter: address of board private structure | 1984 | * @adapter: address of board private structure |
1985 | * | 1985 | * |
1986 | * e1000_get_hw_control sets {CTRL_EXT|SWSM}:DRV_LOAD bit. | 1986 | * e1000e_get_hw_control sets {CTRL_EXT|SWSM}:DRV_LOAD bit. |
1987 | * For ASF and Pass Through versions of f/w this means that | 1987 | * For ASF and Pass Through versions of f/w this means that |
1988 | * the driver is loaded. For AMT version (only with 82573) | 1988 | * the driver is loaded. For AMT version (only with 82573) |
1989 | * of the f/w this means that the network i/f is open. | 1989 | * of the f/w this means that the network i/f is open. |
1990 | **/ | 1990 | **/ |
1991 | static void e1000_get_hw_control(struct e1000_adapter *adapter) | 1991 | void e1000e_get_hw_control(struct e1000_adapter *adapter) |
1992 | { | 1992 | { |
1993 | struct e1000_hw *hw = &adapter->hw; | 1993 | struct e1000_hw *hw = &adapter->hw; |
1994 | u32 ctrl_ext; | 1994 | u32 ctrl_ext; |
@@ -2005,16 +2005,16 @@ static void e1000_get_hw_control(struct e1000_adapter *adapter) | |||
2005 | } | 2005 | } |
2006 | 2006 | ||
2007 | /** | 2007 | /** |
2008 | * e1000_release_hw_control - release control of the h/w to f/w | 2008 | * e1000e_release_hw_control - release control of the h/w to f/w |
2009 | * @adapter: address of board private structure | 2009 | * @adapter: address of board private structure |
2010 | * | 2010 | * |
2011 | * e1000_release_hw_control resets {CTRL_EXT|SWSM}:DRV_LOAD bit. | 2011 | * e1000e_release_hw_control resets {CTRL_EXT|SWSM}:DRV_LOAD bit. |
2012 | * For ASF and Pass Through versions of f/w this means that the | 2012 | * For ASF and Pass Through versions of f/w this means that the |
2013 | * driver is no longer loaded. For AMT version (only with 82573) i | 2013 | * driver is no longer loaded. For AMT version (only with 82573) i |
2014 | * of the f/w this means that the network i/f is closed. | 2014 | * of the f/w this means that the network i/f is closed. |
2015 | * | 2015 | * |
2016 | **/ | 2016 | **/ |
2017 | static void e1000_release_hw_control(struct e1000_adapter *adapter) | 2017 | void e1000e_release_hw_control(struct e1000_adapter *adapter) |
2018 | { | 2018 | { |
2019 | struct e1000_hw *hw = &adapter->hw; | 2019 | struct e1000_hw *hw = &adapter->hw; |
2020 | u32 ctrl_ext; | 2020 | u32 ctrl_ext; |
@@ -2445,7 +2445,7 @@ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | |||
2445 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN) && | 2445 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN) && |
2446 | (vid == adapter->mng_vlan_id)) { | 2446 | (vid == adapter->mng_vlan_id)) { |
2447 | /* release control to f/w */ | 2447 | /* release control to f/w */ |
2448 | e1000_release_hw_control(adapter); | 2448 | e1000e_release_hw_control(adapter); |
2449 | return; | 2449 | return; |
2450 | } | 2450 | } |
2451 | 2451 | ||
@@ -2734,6 +2734,9 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) | |||
2734 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true); | 2734 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true); |
2735 | else | 2735 | else |
2736 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false); | 2736 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false); |
2737 | |||
2738 | if (ret_val) | ||
2739 | e_dbg("failed to enable jumbo frame workaround mode\n"); | ||
2737 | } | 2740 | } |
2738 | 2741 | ||
2739 | /* Program MC offset vector base */ | 2742 | /* Program MC offset vector base */ |
@@ -3184,7 +3187,6 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
3184 | ew32(PBA, pba); | 3187 | ew32(PBA, pba); |
3185 | } | 3188 | } |
3186 | 3189 | ||
3187 | |||
3188 | /* | 3190 | /* |
3189 | * flow control settings | 3191 | * flow control settings |
3190 | * | 3192 | * |
@@ -3272,7 +3274,7 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
3272 | * that the network interface is in control | 3274 | * that the network interface is in control |
3273 | */ | 3275 | */ |
3274 | if (adapter->flags & FLAG_HAS_AMT) | 3276 | if (adapter->flags & FLAG_HAS_AMT) |
3275 | e1000_get_hw_control(adapter); | 3277 | e1000e_get_hw_control(adapter); |
3276 | 3278 | ||
3277 | ew32(WUC, 0); | 3279 | ew32(WUC, 0); |
3278 | 3280 | ||
@@ -3285,6 +3287,13 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
3285 | ew32(VET, ETH_P_8021Q); | 3287 | ew32(VET, ETH_P_8021Q); |
3286 | 3288 | ||
3287 | e1000e_reset_adaptive(hw); | 3289 | e1000e_reset_adaptive(hw); |
3290 | |||
3291 | if (!netif_running(adapter->netdev) && | ||
3292 | !test_bit(__E1000_TESTING, &adapter->state)) { | ||
3293 | e1000_power_down_phy(adapter); | ||
3294 | return; | ||
3295 | } | ||
3296 | |||
3288 | e1000_get_phy_info(hw); | 3297 | e1000_get_phy_info(hw); |
3289 | 3298 | ||
3290 | if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN) && | 3299 | if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN) && |
@@ -3570,7 +3579,7 @@ static int e1000_open(struct net_device *netdev) | |||
3570 | * interface is now open and reset the part to a known state. | 3579 | * interface is now open and reset the part to a known state. |
3571 | */ | 3580 | */ |
3572 | if (adapter->flags & FLAG_HAS_AMT) { | 3581 | if (adapter->flags & FLAG_HAS_AMT) { |
3573 | e1000_get_hw_control(adapter); | 3582 | e1000e_get_hw_control(adapter); |
3574 | e1000e_reset(adapter); | 3583 | e1000e_reset(adapter); |
3575 | } | 3584 | } |
3576 | 3585 | ||
@@ -3634,7 +3643,7 @@ static int e1000_open(struct net_device *netdev) | |||
3634 | return 0; | 3643 | return 0; |
3635 | 3644 | ||
3636 | err_req_irq: | 3645 | err_req_irq: |
3637 | e1000_release_hw_control(adapter); | 3646 | e1000e_release_hw_control(adapter); |
3638 | e1000_power_down_phy(adapter); | 3647 | e1000_power_down_phy(adapter); |
3639 | e1000e_free_rx_resources(adapter); | 3648 | e1000e_free_rx_resources(adapter); |
3640 | err_setup_rx: | 3649 | err_setup_rx: |
@@ -3689,8 +3698,9 @@ static int e1000_close(struct net_device *netdev) | |||
3689 | * If AMT is enabled, let the firmware know that the network | 3698 | * If AMT is enabled, let the firmware know that the network |
3690 | * interface is now closed | 3699 | * interface is now closed |
3691 | */ | 3700 | */ |
3692 | if (adapter->flags & FLAG_HAS_AMT) | 3701 | if ((adapter->flags & FLAG_HAS_AMT) && |
3693 | e1000_release_hw_control(adapter); | 3702 | !test_bit(__E1000_TESTING, &adapter->state)) |
3703 | e1000e_release_hw_control(adapter); | ||
3694 | 3704 | ||
3695 | if ((adapter->flags & FLAG_HAS_ERT) || | 3705 | if ((adapter->flags & FLAG_HAS_ERT) || |
3696 | (adapter->hw.mac.type == e1000_pch2lan)) | 3706 | (adapter->hw.mac.type == e1000_pch2lan)) |
@@ -5209,7 +5219,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake, | |||
5209 | * Release control of h/w to f/w. If f/w is AMT enabled, this | 5219 | * Release control of h/w to f/w. If f/w is AMT enabled, this |
5210 | * would have already happened in close and is redundant. | 5220 | * would have already happened in close and is redundant. |
5211 | */ | 5221 | */ |
5212 | e1000_release_hw_control(adapter); | 5222 | e1000e_release_hw_control(adapter); |
5213 | 5223 | ||
5214 | pci_disable_device(pdev); | 5224 | pci_disable_device(pdev); |
5215 | 5225 | ||
@@ -5366,7 +5376,7 @@ static int __e1000_resume(struct pci_dev *pdev) | |||
5366 | * under the control of the driver. | 5376 | * under the control of the driver. |
5367 | */ | 5377 | */ |
5368 | if (!(adapter->flags & FLAG_HAS_AMT)) | 5378 | if (!(adapter->flags & FLAG_HAS_AMT)) |
5369 | e1000_get_hw_control(adapter); | 5379 | e1000e_get_hw_control(adapter); |
5370 | 5380 | ||
5371 | return 0; | 5381 | return 0; |
5372 | } | 5382 | } |
@@ -5613,7 +5623,7 @@ static void e1000_io_resume(struct pci_dev *pdev) | |||
5613 | * under the control of the driver. | 5623 | * under the control of the driver. |
5614 | */ | 5624 | */ |
5615 | if (!(adapter->flags & FLAG_HAS_AMT)) | 5625 | if (!(adapter->flags & FLAG_HAS_AMT)) |
5616 | e1000_get_hw_control(adapter); | 5626 | e1000e_get_hw_control(adapter); |
5617 | 5627 | ||
5618 | } | 5628 | } |
5619 | 5629 | ||
@@ -5636,7 +5646,7 @@ static void e1000_print_device_info(struct e1000_adapter *adapter) | |||
5636 | ret_val = e1000_read_pba_string_generic(hw, pba_str, | 5646 | ret_val = e1000_read_pba_string_generic(hw, pba_str, |
5637 | E1000_PBANUM_LENGTH); | 5647 | E1000_PBANUM_LENGTH); |
5638 | if (ret_val) | 5648 | if (ret_val) |
5639 | strcpy(pba_str, "Unknown"); | 5649 | strncpy((char *)pba_str, "Unknown", sizeof(pba_str) - 1); |
5640 | e_info("MAC: %d, PHY: %d, PBA No: %s\n", | 5650 | e_info("MAC: %d, PHY: %d, PBA No: %s\n", |
5641 | hw->mac.type, hw->phy.type, pba_str); | 5651 | hw->mac.type, hw->phy.type, pba_str); |
5642 | } | 5652 | } |
@@ -5963,9 +5973,9 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
5963 | * under the control of the driver. | 5973 | * under the control of the driver. |
5964 | */ | 5974 | */ |
5965 | if (!(adapter->flags & FLAG_HAS_AMT)) | 5975 | if (!(adapter->flags & FLAG_HAS_AMT)) |
5966 | e1000_get_hw_control(adapter); | 5976 | e1000e_get_hw_control(adapter); |
5967 | 5977 | ||
5968 | strcpy(netdev->name, "eth%d"); | 5978 | strncpy(netdev->name, "eth%d", sizeof(netdev->name) - 1); |
5969 | err = register_netdev(netdev); | 5979 | err = register_netdev(netdev); |
5970 | if (err) | 5980 | if (err) |
5971 | goto err_register; | 5981 | goto err_register; |
@@ -5982,12 +5992,11 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
5982 | 5992 | ||
5983 | err_register: | 5993 | err_register: |
5984 | if (!(adapter->flags & FLAG_HAS_AMT)) | 5994 | if (!(adapter->flags & FLAG_HAS_AMT)) |
5985 | e1000_release_hw_control(adapter); | 5995 | e1000e_release_hw_control(adapter); |
5986 | err_eeprom: | 5996 | err_eeprom: |
5987 | if (!e1000_check_reset_block(&adapter->hw)) | 5997 | if (!e1000_check_reset_block(&adapter->hw)) |
5988 | e1000_phy_hw_reset(&adapter->hw); | 5998 | e1000_phy_hw_reset(&adapter->hw); |
5989 | err_hw_init: | 5999 | err_hw_init: |
5990 | |||
5991 | kfree(adapter->tx_ring); | 6000 | kfree(adapter->tx_ring); |
5992 | kfree(adapter->rx_ring); | 6001 | kfree(adapter->rx_ring); |
5993 | err_sw_init: | 6002 | err_sw_init: |
@@ -6053,7 +6062,7 @@ static void __devexit e1000_remove(struct pci_dev *pdev) | |||
6053 | * Release control of h/w to f/w. If f/w is AMT enabled, this | 6062 | * Release control of h/w to f/w. If f/w is AMT enabled, this |
6054 | * would have already happened in close and is redundant. | 6063 | * would have already happened in close and is redundant. |
6055 | */ | 6064 | */ |
6056 | e1000_release_hw_control(adapter); | 6065 | e1000e_release_hw_control(adapter); |
6057 | 6066 | ||
6058 | e1000e_reset_interrupt_capability(adapter); | 6067 | e1000e_reset_interrupt_capability(adapter); |
6059 | kfree(adapter->tx_ring); | 6068 | kfree(adapter->tx_ring); |