All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: hskinnemoen@atmel.com
Cc: netdev@vger.kernel.org, Michael Opdenacker <michael@free-electrons.com>
Subject: [PATCH] macb: Add support of the netpoll API
Date: Wed, 15 Apr 2009 15:46:58 +0200	[thread overview]
Message-ID: <20090415154658.40e3639a@surf> (raw)

macb: Add support of the netpoll API

With this patch in place, I'm successfully able to use the netconsole
mechanism with the Calao USB-A9263 board, which uses the AT91SAM9263
CPU, which in terms of Ethernet controller is supported by the macb
driver.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 drivers/net/macb.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Index: linux/drivers/net/macb.c
===================================================================
--- linux.orig/drivers/net/macb.c
+++ linux/drivers/net/macb.c
@@ -616,6 +616,19 @@
 	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 macb_poll_controller(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	macb_interrupt(dev->irq, dev);
+	enable_irq(dev->irq);
+}
+#endif
+
 static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct macb *bp = netdev_priv(dev);
@@ -1184,6 +1197,9 @@
 	dev->do_ioctl = macb_ioctl;
 	netif_napi_add(dev, &bp->napi, macb_poll, 64);
 	dev->ethtool_ops = &macb_ethtool_ops;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = macb_poll_controller;
+#endif
 
 	dev->base_addr = regs->start;
 


-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

             reply	other threads:[~2009-04-15 13:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-15 13:46 Thomas Petazzoni [this message]
2009-04-16  9:07 ` [PATCH] macb: Add support of the netpoll API Haavard Skinnemoen
2009-04-16  9:24   ` Thomas Petazzoni
2009-04-16 10:31     ` Haavard Skinnemoen
2009-04-17  8:34     ` David Miller
2009-04-17  9:07       ` Haavard Skinnemoen
2009-04-17  9:08         ` David Miller
2009-04-17  9:25           ` Haavard Skinnemoen
2009-04-17  9:33             ` David Miller
2009-04-17  9:50               ` Haavard Skinnemoen
2009-04-17 10:44                 ` David Miller
2009-04-17 11:39                   ` David Miller
2009-04-20 10:57                     ` Haavard Skinnemoen
2009-04-21  8:54                       ` David Miller
2009-05-04 11:54                         ` [PATCH v3] " Haavard Skinnemoen
2009-05-04 18:08                           ` David Miller
2009-04-17 11:41                   ` [PATCH] " Haavard Skinnemoen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090415154658.40e3639a@surf \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=hskinnemoen@atmel.com \
    --cc=michael@free-electrons.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.