aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-02-03 03:15:35 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-03 03:15:35 -0500
commitb3ff29d2ccfe3af065a9b393699a8fbf2abd1b15 (patch)
tree99e5b423473097756353d038f922b2623f3edd2a /drivers/net/igb
parent1bded710a574f20d41bc9e7fb531301db282d623 (diff)
parentfb53fde9762432d091dac209bdf4f3f850117c55 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/Kconfig
Diffstat (limited to 'drivers/net/igb')
-rw-r--r--drivers/net/igb/e1000_82575.c11
-rw-r--r--drivers/net/igb/igb.h9
-rw-r--r--drivers/net/igb/igb_main.c24
3 files changed, 23 insertions, 21 deletions
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index 9b367ba8e26f..f5e4cad7971a 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 7d8c88739154..30657ddf4842 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -284,11 +284,10 @@ struct igb_adapter {
284 284
285#define IGB_FLAG_HAS_MSI (1 << 0) 285#define IGB_FLAG_HAS_MSI (1 << 0)
286#define IGB_FLAG_MSI_ENABLE (1 << 1) 286#define IGB_FLAG_MSI_ENABLE (1 << 1)
287#define IGB_FLAG_HAS_DCA (1 << 2) 287#define IGB_FLAG_DCA_ENABLED (1 << 2)
288#define IGB_FLAG_DCA_ENABLED (1 << 3) 288#define IGB_FLAG_IN_NETPOLL (1 << 3)
289#define IGB_FLAG_IN_NETPOLL (1 << 5) 289#define IGB_FLAG_QUAD_PORT_A (1 << 4)
290#define IGB_FLAG_QUAD_PORT_A (1 << 6) 290#define IGB_FLAG_NEED_CTX_IDX (1 << 5)
291#define IGB_FLAG_NEED_CTX_IDX (1 << 7)
292 291
293enum e1000_state_t { 292enum e1000_state_t {
294 __IGB_TESTING, 293 __IGB_TESTING,
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index cd794bac8b80..8b80fe343435 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -203,10 +203,11 @@ static int __init igb_init_module(void)
203 203
204 global_quad_port_a = 0; 204 global_quad_port_a = 0;
205 205
206 ret = pci_register_driver(&igb_driver);
207#ifdef CONFIG_IGB_DCA 206#ifdef CONFIG_IGB_DCA
208 dca_register_notify(&dca_notifier); 207 dca_register_notify(&dca_notifier);
209#endif 208#endif
209
210 ret = pci_register_driver(&igb_driver);
210 return ret; 211 return ret;
211} 212}
212 213
@@ -1153,11 +1154,10 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1153 1154
1154 /* set flags */ 1155 /* set flags */
1155 switch (hw->mac.type) { 1156 switch (hw->mac.type) {
1156 case e1000_82576:
1157 case e1000_82575: 1157 case e1000_82575:
1158 adapter->flags |= IGB_FLAG_HAS_DCA;
1159 adapter->flags |= IGB_FLAG_NEED_CTX_IDX; 1158 adapter->flags |= IGB_FLAG_NEED_CTX_IDX;
1160 break; 1159 break;
1160 case e1000_82576:
1161 default: 1161 default:
1162 break; 1162 break;
1163 } 1163 }
@@ -1306,8 +1306,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1306 goto err_register; 1306 goto err_register;
1307 1307
1308#ifdef CONFIG_IGB_DCA 1308#ifdef CONFIG_IGB_DCA
1309 if ((adapter->flags & IGB_FLAG_HAS_DCA) && 1309 if (dca_add_requester(&pdev->dev) == 0) {
1310 (dca_add_requester(&pdev->dev) == 0)) {
1311 adapter->flags |= IGB_FLAG_DCA_ENABLED; 1310 adapter->flags |= IGB_FLAG_DCA_ENABLED;
1312 dev_info(&pdev->dev, "DCA enabled\n"); 1311 dev_info(&pdev->dev, "DCA enabled\n");
1313 /* Always use CB2 mode, difference is masked 1312 /* Always use CB2 mode, difference is masked
@@ -1819,11 +1818,11 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
1819 rctl |= E1000_RCTL_SECRC; 1818 rctl |= E1000_RCTL_SECRC;
1820 1819
1821 /* 1820 /*
1822 * disable store bad packets, long packet enable, and clear size bits. 1821 * disable store bad packets and clear size bits.
1823 */ 1822 */
1824 rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_LPE | E1000_RCTL_SZ_256); 1823 rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256);
1825 1824
1826 if (adapter->netdev->mtu > ETH_DATA_LEN) 1825 /* enable LPE when to prevent packets larger than max_frame_size */
1827 rctl |= E1000_RCTL_LPE; 1826 rctl |= E1000_RCTL_LPE;
1828 1827
1829 /* Setup buffer sizes */ 1828 /* Setup buffer sizes */
@@ -1849,7 +1848,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
1849 */ 1848 */
1850 /* allocations using alloc_page take too long for regular MTU 1849 /* allocations using alloc_page take too long for regular MTU
1851 * so only enable packet split for jumbo frames */ 1850 * so only enable packet split for jumbo frames */
1852 if (rctl & E1000_RCTL_LPE) { 1851 if (adapter->netdev->mtu > ETH_DATA_LEN) {
1853 adapter->rx_ps_hdr_size = IGB_RXBUFFER_128; 1852 adapter->rx_ps_hdr_size = IGB_RXBUFFER_128;
1854 srrctl |= adapter->rx_ps_hdr_size << 1853 srrctl |= adapter->rx_ps_hdr_size <<
1855 E1000_SRRCTL_BSIZEHDRSIZE_SHIFT; 1854 E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
@@ -3442,19 +3441,16 @@ static int __igb_notify_dca(struct device *dev, void *data)
3442 struct e1000_hw *hw = &adapter->hw; 3441 struct e1000_hw *hw = &adapter->hw;
3443 unsigned long event = *(unsigned long *)data; 3442 unsigned long event = *(unsigned long *)data;
3444 3443
3445 if (!(adapter->flags & IGB_FLAG_HAS_DCA))
3446 goto out;
3447
3448 switch (event) { 3444 switch (event) {
3449 case DCA_PROVIDER_ADD: 3445 case DCA_PROVIDER_ADD:
3450 /* if already enabled, don't do it again */ 3446 /* if already enabled, don't do it again */
3451 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3447 if (adapter->flags & IGB_FLAG_DCA_ENABLED)
3452 break; 3448 break;
3453 adapter->flags |= IGB_FLAG_DCA_ENABLED;
3454 /* Always use CB2 mode, difference is masked 3449 /* Always use CB2 mode, difference is masked
3455 * in the CB driver. */ 3450 * in the CB driver. */
3456 wr32(E1000_DCA_CTRL, 2); 3451 wr32(E1000_DCA_CTRL, 2);
3457 if (dca_add_requester(dev) == 0) { 3452 if (dca_add_requester(dev) == 0) {
3453 adapter->flags |= IGB_FLAG_DCA_ENABLED;
3458 dev_info(&adapter->pdev->dev, "DCA enabled\n"); 3454 dev_info(&adapter->pdev->dev, "DCA enabled\n");
3459 igb_setup_dca(adapter); 3455 igb_setup_dca(adapter);
3460 break; 3456 break;
@@ -3471,7 +3467,7 @@ static int __igb_notify_dca(struct device *dev, void *data)
3471 } 3467 }
3472 break; 3468 break;
3473 } 3469 }
3474out: 3470
3475 return 0; 3471 return 0;
3476} 3472}
3477 3473