diff options
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r-- | drivers/net/igb/igb_main.c | 24 |
1 files changed, 10 insertions, 14 deletions
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 | ||