diff options
Diffstat (limited to 'drivers/net/igb')
-rw-r--r-- | drivers/net/igb/e1000_82575.c | 11 | ||||
-rw-r--r-- | drivers/net/igb/igb.h | 9 | ||||
-rw-r--r-- | drivers/net/igb/igb_main.c | 24 |
3 files changed, 23 insertions, 21 deletions
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c index f5e2e7235fcb..13ca73f96ec6 100644 --- a/drivers/net/igb/e1000_82575.c +++ b/drivers/net/igb/e1000_82575.c | |||
@@ -699,11 +699,18 @@ static s32 igb_check_for_link_82575(struct e1000_hw *hw) | |||
699 | 699 | ||
700 | /* SGMII link check is done through the PCS register. */ | 700 | /* SGMII link check is done through the PCS register. */ |
701 | if ((hw->phy.media_type != e1000_media_type_copper) || | 701 | if ((hw->phy.media_type != e1000_media_type_copper) || |
702 | (igb_sgmii_active_82575(hw))) | 702 | (igb_sgmii_active_82575(hw))) { |
703 | ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed, | 703 | ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed, |
704 | &duplex); | 704 | &duplex); |
705 | else | 705 | /* |
706 | * Use this flag to determine if link needs to be checked or | ||
707 | * not. If we have link clear the flag so that we do not | ||
708 | * continue to check for link. | ||
709 | */ | ||
710 | hw->mac.get_link_status = !hw->mac.serdes_has_link; | ||
711 | } else { | ||
706 | ret_val = igb_check_for_copper_link(hw); | 712 | ret_val = igb_check_for_copper_link(hw); |
713 | } | ||
707 | 714 | ||
708 | return ret_val; | 715 | return ret_val; |
709 | } | 716 | } |
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 5a27825cc48a..aebef8e48e76 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h | |||
@@ -300,11 +300,10 @@ struct igb_adapter { | |||
300 | 300 | ||
301 | #define IGB_FLAG_HAS_MSI (1 << 0) | 301 | #define IGB_FLAG_HAS_MSI (1 << 0) |
302 | #define IGB_FLAG_MSI_ENABLE (1 << 1) | 302 | #define IGB_FLAG_MSI_ENABLE (1 << 1) |
303 | #define IGB_FLAG_HAS_DCA (1 << 2) | 303 | #define IGB_FLAG_DCA_ENABLED (1 << 2) |
304 | #define IGB_FLAG_DCA_ENABLED (1 << 3) | 304 | #define IGB_FLAG_IN_NETPOLL (1 << 3) |
305 | #define IGB_FLAG_IN_NETPOLL (1 << 5) | 305 | #define IGB_FLAG_QUAD_PORT_A (1 << 4) |
306 | #define IGB_FLAG_QUAD_PORT_A (1 << 6) | 306 | #define IGB_FLAG_NEED_CTX_IDX (1 << 5) |
307 | #define IGB_FLAG_NEED_CTX_IDX (1 << 7) | ||
308 | 307 | ||
309 | enum e1000_state_t { | 308 | enum e1000_state_t { |
310 | __IGB_TESTING, | 309 | __IGB_TESTING, |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index b82b0fb2056c..a50db5398fa5 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -206,10 +206,11 @@ static int __init igb_init_module(void) | |||
206 | 206 | ||
207 | global_quad_port_a = 0; | 207 | global_quad_port_a = 0; |
208 | 208 | ||
209 | ret = pci_register_driver(&igb_driver); | ||
210 | #ifdef CONFIG_IGB_DCA | 209 | #ifdef CONFIG_IGB_DCA |
211 | dca_register_notify(&dca_notifier); | 210 | dca_register_notify(&dca_notifier); |
212 | #endif | 211 | #endif |
212 | |||
213 | ret = pci_register_driver(&igb_driver); | ||
213 | return ret; | 214 | return ret; |
214 | } | 215 | } |
215 | 216 | ||
@@ -1156,11 +1157,10 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1156 | 1157 | ||
1157 | /* set flags */ | 1158 | /* set flags */ |
1158 | switch (hw->mac.type) { | 1159 | switch (hw->mac.type) { |
1159 | case e1000_82576: | ||
1160 | case e1000_82575: | 1160 | case e1000_82575: |
1161 | adapter->flags |= IGB_FLAG_HAS_DCA; | ||
1162 | adapter->flags |= IGB_FLAG_NEED_CTX_IDX; | 1161 | adapter->flags |= IGB_FLAG_NEED_CTX_IDX; |
1163 | break; | 1162 | break; |
1163 | case e1000_82576: | ||
1164 | default: | 1164 | default: |
1165 | break; | 1165 | break; |
1166 | } | 1166 | } |
@@ -1310,8 +1310,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1310 | goto err_register; | 1310 | goto err_register; |
1311 | 1311 | ||
1312 | #ifdef CONFIG_IGB_DCA | 1312 | #ifdef CONFIG_IGB_DCA |
1313 | if ((adapter->flags & IGB_FLAG_HAS_DCA) && | 1313 | if (dca_add_requester(&pdev->dev) == 0) { |
1314 | (dca_add_requester(&pdev->dev) == 0)) { | ||
1315 | adapter->flags |= IGB_FLAG_DCA_ENABLED; | 1314 | adapter->flags |= IGB_FLAG_DCA_ENABLED; |
1316 | dev_info(&pdev->dev, "DCA enabled\n"); | 1315 | dev_info(&pdev->dev, "DCA enabled\n"); |
1317 | /* Always use CB2 mode, difference is masked | 1316 | /* Always use CB2 mode, difference is masked |
@@ -1835,11 +1834,11 @@ static void igb_setup_rctl(struct igb_adapter *adapter) | |||
1835 | rctl |= E1000_RCTL_SECRC; | 1834 | rctl |= E1000_RCTL_SECRC; |
1836 | 1835 | ||
1837 | /* | 1836 | /* |
1838 | * disable store bad packets, long packet enable, and clear size bits. | 1837 | * disable store bad packets and clear size bits. |
1839 | */ | 1838 | */ |
1840 | rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_LPE | E1000_RCTL_SZ_256); | 1839 | rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256); |
1841 | 1840 | ||
1842 | if (adapter->netdev->mtu > ETH_DATA_LEN) | 1841 | /* enable LPE when to prevent packets larger than max_frame_size */ |
1843 | rctl |= E1000_RCTL_LPE; | 1842 | rctl |= E1000_RCTL_LPE; |
1844 | 1843 | ||
1845 | /* Setup buffer sizes */ | 1844 | /* Setup buffer sizes */ |
@@ -1865,7 +1864,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter) | |||
1865 | */ | 1864 | */ |
1866 | /* allocations using alloc_page take too long for regular MTU | 1865 | /* allocations using alloc_page take too long for regular MTU |
1867 | * so only enable packet split for jumbo frames */ | 1866 | * so only enable packet split for jumbo frames */ |
1868 | if (rctl & E1000_RCTL_LPE) { | 1867 | if (adapter->netdev->mtu > ETH_DATA_LEN) { |
1869 | adapter->rx_ps_hdr_size = IGB_RXBUFFER_128; | 1868 | adapter->rx_ps_hdr_size = IGB_RXBUFFER_128; |
1870 | srrctl |= adapter->rx_ps_hdr_size << | 1869 | srrctl |= adapter->rx_ps_hdr_size << |
1871 | E1000_SRRCTL_BSIZEHDRSIZE_SHIFT; | 1870 | E1000_SRRCTL_BSIZEHDRSIZE_SHIFT; |
@@ -3473,19 +3472,16 @@ static int __igb_notify_dca(struct device *dev, void *data) | |||
3473 | struct e1000_hw *hw = &adapter->hw; | 3472 | struct e1000_hw *hw = &adapter->hw; |
3474 | unsigned long event = *(unsigned long *)data; | 3473 | unsigned long event = *(unsigned long *)data; |
3475 | 3474 | ||
3476 | if (!(adapter->flags & IGB_FLAG_HAS_DCA)) | ||
3477 | goto out; | ||
3478 | |||
3479 | switch (event) { | 3475 | switch (event) { |
3480 | case DCA_PROVIDER_ADD: | 3476 | case DCA_PROVIDER_ADD: |
3481 | /* if already enabled, don't do it again */ | 3477 | /* if already enabled, don't do it again */ |
3482 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) | 3478 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) |
3483 | break; | 3479 | break; |
3484 | adapter->flags |= IGB_FLAG_DCA_ENABLED; | ||
3485 | /* Always use CB2 mode, difference is masked | 3480 | /* Always use CB2 mode, difference is masked |
3486 | * in the CB driver. */ | 3481 | * in the CB driver. */ |
3487 | wr32(E1000_DCA_CTRL, 2); | 3482 | wr32(E1000_DCA_CTRL, 2); |
3488 | if (dca_add_requester(dev) == 0) { | 3483 | if (dca_add_requester(dev) == 0) { |
3484 | adapter->flags |= IGB_FLAG_DCA_ENABLED; | ||
3489 | dev_info(&adapter->pdev->dev, "DCA enabled\n"); | 3485 | dev_info(&adapter->pdev->dev, "DCA enabled\n"); |
3490 | igb_setup_dca(adapter); | 3486 | igb_setup_dca(adapter); |
3491 | break; | 3487 | break; |
@@ -3502,7 +3498,7 @@ static int __igb_notify_dca(struct device *dev, void *data) | |||
3502 | } | 3498 | } |
3503 | break; | 3499 | break; |
3504 | } | 3500 | } |
3505 | out: | 3501 | |
3506 | return 0; | 3502 | return 0; |
3507 | } | 3503 | } |
3508 | 3504 | ||