diff options
Diffstat (limited to 'drivers/net/e1000e/netdev.c')
-rw-r--r-- | drivers/net/e1000e/netdev.c | 94 |
1 files changed, 68 insertions, 26 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index c5f65a29865a..f5081cf898aa 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -1767,8 +1767,6 @@ void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter) | |||
1767 | pci_disable_msi(adapter->pdev); | 1767 | pci_disable_msi(adapter->pdev); |
1768 | adapter->flags &= ~FLAG_MSI_ENABLED; | 1768 | adapter->flags &= ~FLAG_MSI_ENABLED; |
1769 | } | 1769 | } |
1770 | |||
1771 | return; | ||
1772 | } | 1770 | } |
1773 | 1771 | ||
1774 | /** | 1772 | /** |
@@ -1820,8 +1818,6 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter) | |||
1820 | /* Don't do anything; this is the system default */ | 1818 | /* Don't do anything; this is the system default */ |
1821 | break; | 1819 | break; |
1822 | } | 1820 | } |
1823 | |||
1824 | return; | ||
1825 | } | 1821 | } |
1826 | 1822 | ||
1827 | /** | 1823 | /** |
@@ -2526,10 +2522,10 @@ static void e1000_restore_vlan(struct e1000_adapter *adapter) | |||
2526 | } | 2522 | } |
2527 | } | 2523 | } |
2528 | 2524 | ||
2529 | static void e1000_init_manageability(struct e1000_adapter *adapter) | 2525 | static void e1000_init_manageability_pt(struct e1000_adapter *adapter) |
2530 | { | 2526 | { |
2531 | struct e1000_hw *hw = &adapter->hw; | 2527 | struct e1000_hw *hw = &adapter->hw; |
2532 | u32 manc, manc2h; | 2528 | u32 manc, manc2h, mdef, i, j; |
2533 | 2529 | ||
2534 | if (!(adapter->flags & FLAG_MNG_PT_ENABLED)) | 2530 | if (!(adapter->flags & FLAG_MNG_PT_ENABLED)) |
2535 | return; | 2531 | return; |
@@ -2543,10 +2539,49 @@ static void e1000_init_manageability(struct e1000_adapter *adapter) | |||
2543 | */ | 2539 | */ |
2544 | manc |= E1000_MANC_EN_MNG2HOST; | 2540 | manc |= E1000_MANC_EN_MNG2HOST; |
2545 | manc2h = er32(MANC2H); | 2541 | manc2h = er32(MANC2H); |
2546 | #define E1000_MNG2HOST_PORT_623 (1 << 5) | 2542 | |
2547 | #define E1000_MNG2HOST_PORT_664 (1 << 6) | 2543 | switch (hw->mac.type) { |
2548 | manc2h |= E1000_MNG2HOST_PORT_623; | 2544 | default: |
2549 | manc2h |= E1000_MNG2HOST_PORT_664; | 2545 | manc2h |= (E1000_MANC2H_PORT_623 | E1000_MANC2H_PORT_664); |
2546 | break; | ||
2547 | case e1000_82574: | ||
2548 | case e1000_82583: | ||
2549 | /* | ||
2550 | * Check if IPMI pass-through decision filter already exists; | ||
2551 | * if so, enable it. | ||
2552 | */ | ||
2553 | for (i = 0, j = 0; i < 8; i++) { | ||
2554 | mdef = er32(MDEF(i)); | ||
2555 | |||
2556 | /* Ignore filters with anything other than IPMI ports */ | ||
2557 | if (mdef & !(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664)) | ||
2558 | continue; | ||
2559 | |||
2560 | /* Enable this decision filter in MANC2H */ | ||
2561 | if (mdef) | ||
2562 | manc2h |= (1 << i); | ||
2563 | |||
2564 | j |= mdef; | ||
2565 | } | ||
2566 | |||
2567 | if (j == (E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664)) | ||
2568 | break; | ||
2569 | |||
2570 | /* Create new decision filter in an empty filter */ | ||
2571 | for (i = 0, j = 0; i < 8; i++) | ||
2572 | if (er32(MDEF(i)) == 0) { | ||
2573 | ew32(MDEF(i), (E1000_MDEF_PORT_623 | | ||
2574 | E1000_MDEF_PORT_664)); | ||
2575 | manc2h |= (1 << 1); | ||
2576 | j++; | ||
2577 | break; | ||
2578 | } | ||
2579 | |||
2580 | if (!j) | ||
2581 | e_warn("Unable to create IPMI pass-through filter\n"); | ||
2582 | break; | ||
2583 | } | ||
2584 | |||
2550 | ew32(MANC2H, manc2h); | 2585 | ew32(MANC2H, manc2h); |
2551 | ew32(MANC, manc); | 2586 | ew32(MANC, manc); |
2552 | } | 2587 | } |
@@ -2961,7 +2996,7 @@ static void e1000_configure(struct e1000_adapter *adapter) | |||
2961 | e1000_set_multi(adapter->netdev); | 2996 | e1000_set_multi(adapter->netdev); |
2962 | 2997 | ||
2963 | e1000_restore_vlan(adapter); | 2998 | e1000_restore_vlan(adapter); |
2964 | e1000_init_manageability(adapter); | 2999 | e1000_init_manageability_pt(adapter); |
2965 | 3000 | ||
2966 | e1000_configure_tx(adapter); | 3001 | e1000_configure_tx(adapter); |
2967 | e1000_setup_rctl(adapter); | 3002 | e1000_setup_rctl(adapter); |
@@ -3095,6 +3130,7 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
3095 | fc->high_water = 0x5000; | 3130 | fc->high_water = 0x5000; |
3096 | fc->low_water = 0x3000; | 3131 | fc->low_water = 0x3000; |
3097 | } | 3132 | } |
3133 | fc->refresh_time = 0x1000; | ||
3098 | } else { | 3134 | } else { |
3099 | if ((adapter->flags & FLAG_HAS_ERT) && | 3135 | if ((adapter->flags & FLAG_HAS_ERT) && |
3100 | (adapter->netdev->mtu > ETH_DATA_LEN)) | 3136 | (adapter->netdev->mtu > ETH_DATA_LEN)) |
@@ -3132,10 +3168,6 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
3132 | if (mac->ops.init_hw(hw)) | 3168 | if (mac->ops.init_hw(hw)) |
3133 | e_err("Hardware Error\n"); | 3169 | e_err("Hardware Error\n"); |
3134 | 3170 | ||
3135 | /* additional part of the flow-control workaround above */ | ||
3136 | if (hw->mac.type == e1000_pchlan) | ||
3137 | ew32(FCRTV_PCH, 0x1000); | ||
3138 | |||
3139 | e1000_update_mng_vlan(adapter); | 3171 | e1000_update_mng_vlan(adapter); |
3140 | 3172 | ||
3141 | /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */ | 3173 | /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */ |
@@ -3181,7 +3213,11 @@ int e1000e_up(struct e1000_adapter *adapter) | |||
3181 | netif_wake_queue(adapter->netdev); | 3213 | netif_wake_queue(adapter->netdev); |
3182 | 3214 | ||
3183 | /* fire a link change interrupt to start the watchdog */ | 3215 | /* fire a link change interrupt to start the watchdog */ |
3184 | ew32(ICS, E1000_ICS_LSC); | 3216 | if (adapter->msix_entries) |
3217 | ew32(ICS, E1000_ICS_LSC | E1000_ICR_OTHER); | ||
3218 | else | ||
3219 | ew32(ICS, E1000_ICS_LSC); | ||
3220 | |||
3185 | return 0; | 3221 | return 0; |
3186 | } | 3222 | } |
3187 | 3223 | ||
@@ -3444,6 +3480,15 @@ static int e1000_open(struct net_device *netdev) | |||
3444 | if (err) | 3480 | if (err) |
3445 | goto err_setup_rx; | 3481 | goto err_setup_rx; |
3446 | 3482 | ||
3483 | /* | ||
3484 | * If AMT is enabled, let the firmware know that the network | ||
3485 | * interface is now open and reset the part to a known state. | ||
3486 | */ | ||
3487 | if (adapter->flags & FLAG_HAS_AMT) { | ||
3488 | e1000_get_hw_control(adapter); | ||
3489 | e1000e_reset(adapter); | ||
3490 | } | ||
3491 | |||
3447 | e1000e_power_up_phy(adapter); | 3492 | e1000e_power_up_phy(adapter); |
3448 | 3493 | ||
3449 | adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; | 3494 | adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; |
@@ -3452,13 +3497,6 @@ static int e1000_open(struct net_device *netdev) | |||
3452 | e1000_update_mng_vlan(adapter); | 3497 | e1000_update_mng_vlan(adapter); |
3453 | 3498 | ||
3454 | /* | 3499 | /* |
3455 | * If AMT is enabled, let the firmware know that the network | ||
3456 | * interface is now open | ||
3457 | */ | ||
3458 | if (adapter->flags & FLAG_HAS_AMT) | ||
3459 | e1000_get_hw_control(adapter); | ||
3460 | |||
3461 | /* | ||
3462 | * before we allocate an interrupt, we must be ready to handle it. | 3500 | * before we allocate an interrupt, we must be ready to handle it. |
3463 | * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt | 3501 | * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt |
3464 | * as soon as we call pci_request_irq, so we have to setup our | 3502 | * as soon as we call pci_request_irq, so we have to setup our |
@@ -3496,7 +3534,10 @@ static int e1000_open(struct net_device *netdev) | |||
3496 | pm_runtime_put(&pdev->dev); | 3534 | pm_runtime_put(&pdev->dev); |
3497 | 3535 | ||
3498 | /* fire a link status change interrupt to start the watchdog */ | 3536 | /* fire a link status change interrupt to start the watchdog */ |
3499 | ew32(ICS, E1000_ICS_LSC); | 3537 | if (adapter->msix_entries) |
3538 | ew32(ICS, E1000_ICS_LSC | E1000_ICR_OTHER); | ||
3539 | else | ||
3540 | ew32(ICS, E1000_ICS_LSC); | ||
3500 | 3541 | ||
3501 | return 0; | 3542 | return 0; |
3502 | 3543 | ||
@@ -5102,7 +5143,7 @@ static int __e1000_resume(struct pci_dev *pdev) | |||
5102 | 5143 | ||
5103 | e1000e_reset(adapter); | 5144 | e1000e_reset(adapter); |
5104 | 5145 | ||
5105 | e1000_init_manageability(adapter); | 5146 | e1000_init_manageability_pt(adapter); |
5106 | 5147 | ||
5107 | if (netif_running(netdev)) | 5148 | if (netif_running(netdev)) |
5108 | e1000e_up(adapter); | 5149 | e1000e_up(adapter); |
@@ -5303,7 +5344,7 @@ static void e1000_io_resume(struct pci_dev *pdev) | |||
5303 | struct net_device *netdev = pci_get_drvdata(pdev); | 5344 | struct net_device *netdev = pci_get_drvdata(pdev); |
5304 | struct e1000_adapter *adapter = netdev_priv(netdev); | 5345 | struct e1000_adapter *adapter = netdev_priv(netdev); |
5305 | 5346 | ||
5306 | e1000_init_manageability(adapter); | 5347 | e1000_init_manageability_pt(adapter); |
5307 | 5348 | ||
5308 | if (netif_running(netdev)) { | 5349 | if (netif_running(netdev)) { |
5309 | if (e1000e_up(adapter)) { | 5350 | if (e1000e_up(adapter)) { |
@@ -5849,6 +5890,7 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = { | |||
5849 | 5890 | ||
5850 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LM), board_ich10lan }, | 5891 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LM), board_ich10lan }, |
5851 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LF), board_ich10lan }, | 5892 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LF), board_ich10lan }, |
5893 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_V), board_ich10lan }, | ||
5852 | 5894 | ||
5853 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LM), board_pchlan }, | 5895 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LM), board_pchlan }, |
5854 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LC), board_pchlan }, | 5896 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LC), board_pchlan }, |