Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

igb: add IGB_DCA instead of selecting INTEL_IOATDMA

Add a bool IGB_DCA defined to y if IGB and DCA are enabled, but IGB isn't y while DCA=m. And thus remove the need to select INTEL_IOATDMA when IGB is enabled, so that non-x86 architectures can build the igb driver.
Based on work/patch from Brice Goglin <brice@myri.com>

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

authored by

Jeff Kirsher and committed by
Jeff Garzik
421e02f0 c54106bb

+21 -16
+5
drivers/net/Kconfig
··· 2003 2003 2004 2004 If in doubt, say N. 2005 2005 2006 + config IGB_DCA 2007 + bool "Enable DCA" 2008 + default y 2009 + depends on IGB && DCA && !(IGB=y && DCA=m) 2010 + 2006 2011 source "drivers/net/ixp2000/Kconfig" 2007 2012 2008 2013 config MYRI_SBUS
+16 -16
drivers/net/igb/igb_main.c
··· 42 42 #include <linux/delay.h> 43 43 #include <linux/interrupt.h> 44 44 #include <linux/if_ether.h> 45 - #ifdef CONFIG_DCA 45 + #ifdef CONFIG_IGB_DCA 46 46 #include <linux/dca.h> 47 47 #endif 48 48 #include "igb.h" ··· 107 107 static irqreturn_t igb_msix_rx(int irq, void *); 108 108 static irqreturn_t igb_msix_tx(int irq, void *); 109 109 static int igb_clean_rx_ring_msix(struct napi_struct *, int); 110 - #ifdef CONFIG_DCA 110 + #ifdef CONFIG_IGB_DCA 111 111 static void igb_update_rx_dca(struct igb_ring *); 112 112 static void igb_update_tx_dca(struct igb_ring *); 113 113 static void igb_setup_dca(struct igb_adapter *); 114 - #endif /* CONFIG_DCA */ 114 + #endif /* CONFIG_IGB_DCA */ 115 115 static bool igb_clean_tx_irq(struct igb_ring *); 116 116 static int igb_poll(struct napi_struct *, int); 117 117 static bool igb_clean_rx_irq_adv(struct igb_ring *, int *, int); ··· 132 132 static int igb_resume(struct pci_dev *); 133 133 #endif 134 134 static void igb_shutdown(struct pci_dev *); 135 - #ifdef CONFIG_DCA 135 + #ifdef CONFIG_IGB_DCA 136 136 static int igb_notify_dca(struct notifier_block *, unsigned long, void *); 137 137 static struct notifier_block dca_notifier = { 138 138 .notifier_call = igb_notify_dca, ··· 208 208 global_quad_port_a = 0; 209 209 210 210 ret = pci_register_driver(&igb_driver); 211 - #ifdef CONFIG_DCA 211 + #ifdef CONFIG_IGB_DCA 212 212 dca_register_notify(&dca_notifier); 213 213 #endif 214 214 return ret; ··· 224 224 **/ 225 225 static void __exit igb_exit_module(void) 226 226 { 227 - #ifdef CONFIG_DCA 227 + #ifdef CONFIG_IGB_DCA 228 228 dca_unregister_notify(&dca_notifier); 229 229 #endif 230 230 pci_unregister_driver(&igb_driver); ··· 1261 1261 if (err) 1262 1262 goto err_register; 1263 1263 1264 - #ifdef CONFIG_DCA 1264 + #ifdef CONFIG_IGB_DCA 1265 1265 if ((adapter->flags & IGB_FLAG_HAS_DCA) && 1266 1266 (dca_add_requester(&pdev->dev) == 0)) { 1267 1267 adapter->flags |= IGB_FLAG_DCA_ENABLED; ··· 1335 1335 { 1336 1336 struct net_device *netdev = pci_get_drvdata(pdev); 1337 1337 struct igb_adapter *adapter = netdev_priv(netdev); 1338 - #ifdef CONFIG_DCA 1338 + #ifdef CONFIG_IGB_DCA 1339 1339 struct e1000_hw *hw = &adapter->hw; 1340 1340 #endif 1341 1341 ··· 1347 1347 1348 1348 flush_scheduled_work(); 1349 1349 1350 - #ifdef CONFIG_DCA 1350 + #ifdef CONFIG_IGB_DCA 1351 1351 if (adapter->flags & IGB_FLAG_DCA_ENABLED) { 1352 1352 dev_info(&pdev->dev, "DCA disabled\n"); 1353 1353 dca_remove_requester(&pdev->dev); ··· 3295 3295 struct igb_adapter *adapter = tx_ring->adapter; 3296 3296 struct e1000_hw *hw = &adapter->hw; 3297 3297 3298 - #ifdef CONFIG_DCA 3298 + #ifdef CONFIG_IGB_DCA 3299 3299 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3300 3300 igb_update_tx_dca(tx_ring); 3301 3301 #endif ··· 3347 3347 if (netif_rx_schedule_prep(adapter->netdev, &rx_ring->napi)) 3348 3348 __netif_rx_schedule(adapter->netdev, &rx_ring->napi); 3349 3349 3350 - #ifdef CONFIG_DCA 3350 + #ifdef CONFIG_IGB_DCA 3351 3351 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3352 3352 igb_update_rx_dca(rx_ring); 3353 3353 #endif 3354 3354 return IRQ_HANDLED; 3355 3355 } 3356 3356 3357 - #ifdef CONFIG_DCA 3357 + #ifdef CONFIG_IGB_DCA 3358 3358 static void igb_update_rx_dca(struct igb_ring *rx_ring) 3359 3359 { 3360 3360 u32 dca_rxctrl; ··· 3474 3474 3475 3475 return ret_val ? NOTIFY_BAD : NOTIFY_DONE; 3476 3476 } 3477 - #endif /* CONFIG_DCA */ 3477 + #endif /* CONFIG_IGB_DCA */ 3478 3478 3479 3479 /** 3480 3480 * igb_intr_msi - Interrupt Handler ··· 3553 3553 int tx_clean_complete, work_done = 0; 3554 3554 3555 3555 /* this poll routine only supports one tx and one rx queue */ 3556 - #ifdef CONFIG_DCA 3556 + #ifdef CONFIG_IGB_DCA 3557 3557 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3558 3558 igb_update_tx_dca(&adapter->tx_ring[0]); 3559 3559 #endif 3560 3560 tx_clean_complete = igb_clean_tx_irq(&adapter->tx_ring[0]); 3561 3561 3562 - #ifdef CONFIG_DCA 3562 + #ifdef CONFIG_IGB_DCA 3563 3563 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3564 3564 igb_update_rx_dca(&adapter->rx_ring[0]); 3565 3565 #endif ··· 3587 3587 struct net_device *netdev = adapter->netdev; 3588 3588 int work_done = 0; 3589 3589 3590 - #ifdef CONFIG_DCA 3590 + #ifdef CONFIG_IGB_DCA 3591 3591 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3592 3592 igb_update_rx_dca(rx_ring); 3593 3593 #endif