Skip to contentSkip to conversation

skge: netpoll support

PATCH In review Michal Schmidt 2 participants 4 messages Oct 19, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 skge: netpoll support

Hi,
The attached patch adds netconsole support for sk98lin.

drivers/net/sk98lin/skge.c +21 -0
diff -Nurp linux-2.6.9/drivers/net/sk98lin/skge.c linux-2.6.9-mich/drivers/net/sk98lin/skge.c
@@ -1126,6 +1126,24 @@ SK_U32		IntSrc;		/* interrupts source re
 		return SkIsrRetHandled;
 } /* SkGeIsrOnePort */
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/****************************************************************************
+ *
+ * 	SkGePollController - polling receive, for netconsole
+ *
+ * Description:
+ *	Polling receive - used by netconsole and other diagnostic tools
+ *	to allow network i/o with interrupts disabled.
+ *
+ * Returns: N/A
+ */
+static void SkGePollController(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	SkGeIsr(dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
 
 /****************************************************************************
  *
@@ -4960,6 +4978,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);
 
#1 lore raw
Quoted 2 lines · Michal Schmidt

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.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#2 lore raw
Quoted 9 lines · Matt Mackall
Quoted 2 lines · Michal Schmidt

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)

drivers/net/sk98lin/skge.c +18 -0
diff -Nurp linux-2.6.9/drivers/net/sk98lin/skge.c linux-2.6.9-mich/drivers/net/sk98lin/skge.c
@@ -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);
 
#3 lore raw
Quoted 7 lines · Michal Schmidt
Quoted 6 lines · Matt Mackall
Quoted 2 lines · Michal Schmidt

Hi,
The attached patch adds netconsole support for sk98lin.

Quoted 5 lines
Quoted 3 lines

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

Like this? (attached)

Yep.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.