netdev
[Top] [All Lists]

Re: [PATCH 2.6.9] skge: netpoll support

To: Matt Mackall <mpm@xxxxxxxxxxx>
Subject: Re: [PATCH 2.6.9] skge: netpoll support
From: Michal Schmidt <xschmi00@xxxxxxxxxxxxxxxxxx>
Date: Wed, 20 Oct 2004 01:11:48 +0200
Cc: Jeff Garzik <jgarzik@xxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <20041019220611.GE28904@waste.org>
References: <41758E11.2040402@stud.feec.vutbr.cz> <20041019220611.GE28904@waste.org>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla Thunderbird 0.8 (X11/20041005)
Matt Mackall wrote:
On Tue, Oct 19, 2004 at 11:58:41PM +0200, Michal Schmidt wrote:

Hi,
The attached patch adds netconsole support for sk98lin.


Looks good. Would be nice to use actual kernel-doc style documentation
blocks for new function comments though.


Like this? (attached)

Signed-off-by: Michal Schmidt <xschmi00@xxxxxxxxxxxxxxxxxx>
diff -Nurp linux-2.6.9/drivers/net/sk98lin/skge.c 
linux-2.6.9-mich/drivers/net/sk98lin/skge.c
--- linux-2.6.9/drivers/net/sk98lin/skge.c      2004-10-18 23:53:22.000000000 
+0200
+++ linux-2.6.9-mich/drivers/net/sk98lin/skge.c 2004-10-20 01:09:07.566181320 
+0200
@@ -1126,6 +1126,21 @@ SK_U32           IntSrc;         /* interrupts source re
                return SkIsrRetHandled;
 } /* SkGeIsrOnePort */
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/**
+ * SkGePollController - polling receive, for netconsole
+ * @dev: network device
+ *
+ * Polling receive - used by netconsole and other diagnostic tools
+ * to allow network i/o with interrupts disabled.
+ */
+static void SkGePollController(struct net_device *dev)
+{
+       disable_irq(dev->irq);
+       SkGeIsr(dev->irq, dev, NULL);
+       enable_irq(dev->irq);
+}
+#endif
 
 /****************************************************************************
  *
@@ -4960,6 +4975,9 @@ static int __devinit skge_probe_one(stru
        dev->set_mac_address =  &SkGeSetMacAddr;
        dev->do_ioctl =         &SkGeIoctl;
        dev->change_mtu =       &SkGeChangeMtu;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       dev->poll_controller =  &SkGePollController;
+#endif
        dev->flags &=           ~IFF_RUNNING;
        SET_NETDEV_DEV(dev, &pdev->dev);
 
<Prev in Thread] Current Thread [Next in Thread>