浏览代码

r8169: napi config

Don't call napi_disable if not configured and make sure that any
misuse of napi_xxx in future fails with a compile error.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
Stephen Hemminger 17 年之前
父节点
当前提交
7fab06c0ca
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      drivers/net/r8169.c

+ 4 - 0
drivers/net/r8169.c

@@ -392,7 +392,9 @@ struct rtl8169_private {
 	void __iomem *mmio_addr;	/* memory map physical address */
 	void __iomem *mmio_addr;	/* memory map physical address */
 	struct pci_dev *pci_dev;	/* Index of PCI device */
 	struct pci_dev *pci_dev;	/* Index of PCI device */
 	struct net_device *dev;
 	struct net_device *dev;
+#ifdef CONFIG_R8169_NAPI
 	struct napi_struct napi;
 	struct napi_struct napi;
+#endif
 	spinlock_t lock;		/* spin lock flag */
 	spinlock_t lock;		/* spin lock flag */
 	u32 msg_enable;
 	u32 msg_enable;
 	int chipset;
 	int chipset;
@@ -3010,7 +3012,9 @@ core_down:
 	synchronize_irq(dev->irq);
 	synchronize_irq(dev->irq);
 
 
 	if (!poll_locked) {
 	if (!poll_locked) {
+#ifdef CONFIG_R8169_NAPI
 		napi_disable(&tp->napi);
 		napi_disable(&tp->napi);
+#endif
 		poll_locked++;
 		poll_locked++;
 	}
 	}