[linux-yocto] [PATCH 43/70] net/acp: add the netpoll support for acp device

Paul Butler butler.paul at gmail.com
Mon Jun 10 18:46:06 PDT 2013


From: Jiang Lu <lu.jiang at windriver.com>

Add the ndo_poll_controller hook function for acp device.

Signed-off-by: Kevin Hao <kexin.hao at windriver.com>
---
 drivers/net/ethernet/lsi/lsi_acp_net.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/lsi/lsi_acp_net.c b/drivers/net/ethernet/lsi/lsi_acp_net.c
index bc5ee3b..c62db95 100644
--- a/drivers/net/ethernet/lsi/lsi_acp_net.c
+++ b/drivers/net/ethernet/lsi/lsi_acp_net.c
@@ -1722,7 +1722,6 @@ static irqreturn_t appnic_isr(int irq, void *device_id)
 				  APPNIC_DMA_INTERRUPT_ENABLE);
 			__napi_schedule(&dev->napi);
 		} else {
-			pr_err("acp-femac: NAPI bug! Int while in poll\n");
 			write_mac(APPNIC_DMA_INTERRUPT_ENABLE_TRANSMIT,
 				  APPNIC_DMA_INTERRUPT_ENABLE);
 		}
@@ -1738,6 +1737,21 @@ static irqreturn_t appnic_isr(int irq, void *device_id)
 	return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling receive - used by netconsole and other diagnostic tools
+ * to allow network i/o with interrupts disabled.
+ */
+static void
+appnic_poll_controller(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	appnic_isr(dev->irq, dev);
+	enable_irq(dev->irq);
+}
+
+#endif
+
 /*
  * ----------------------------------------------------------------------
  * appnic_open
@@ -2149,6 +2163,9 @@ static const struct net_device_ops appnic_netdev_ops = {
 	.ndo_get_stats = appnic_get_stats,
 	.ndo_set_mac_address = appnic_set_mac_address,
 	.ndo_start_xmit = appnic_hard_start_xmit,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	.ndo_poll_controller = appnic_poll_controller,
+#endif
 };
 
 /*
-- 
1.8.3




More information about the linux-yocto mailing list