Skip to contentSkip to conversation

netconsole support for b44

PATCH In review Con Kolivas 2 participants 5 messages Oct 12, 2004

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

PATCH 1/1 netconsole support for b44

This patch adds poll support to the b44 driver to allow netconsole support. Style lifted straight from 8139too.c

here is the dmesg output with it in place:

netconsole: device eth0 not up yet, forcing it
netconsole: carrier detect appears flaky, waiting 10 seconds
b44: eth0: Link is down.
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is on for TX and on for RX.
netconsole: network logging started

output confirmed by netcat on other system.

drivers/net/b44.c +20 -0
Index: linux-2.6.9-rc4-ck1/drivers/net/b44.c
===================================================================
@@ -97,6 +97,10 @@ MODULE_DEVICE_TABLE(pci, b44_pci_tbl);
 static void b44_halt(struct b44 *);
 static void b44_init_rings(struct b44 *);
 static void b44_init_hw(struct b44 *);
+static int b44_poll(struct net_device *dev, int *budget);
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void b44_poll_controller(struct net_device *dev);
+#endif
 
 static inline unsigned long br32(const struct b44 *bp, unsigned long reg)
 {
@@ -1297,6 +1301,19 @@ err_out_free:
 }
 #endif
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling receive - used by netconsole and other diagnostic tools
+ * to allow network i/o with interrupts disabled.
+ */
+static void b44_poll_controller(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	b44_interrupt (dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
+
 static int b44_close(struct net_device *dev)
 {
 	struct b44 *bp = netdev_priv(dev);
@@ -1793,6 +1810,9 @@ static int __devinit b44_init_one(struct
 	dev->poll = b44_poll;
 	dev->weight = 64;
 	dev->watchdog_timeo = B44_TX_TIMEOUT;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = b44_poll_controller;
+#endif
 	dev->change_mtu = b44_change_mtu;
 	dev->irq = pdev->irq;
 	SET_ETHTOOL_OPS(dev, &b44_ethtool_ops);
#1 lore raw
Quoted 12 lines · Con Kolivas

This patch adds poll support to the b44 driver to allow netconsole support. Style lifted straight from 8139too.c

here is the dmesg output with it in place:

netconsole: device eth0 not up yet, forcing it
netconsole: carrier detect appears flaky, waiting 10 seconds
b44: eth0: Link is down.
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is on for TX and on for RX.
netconsole: network logging started

Quoted 3 lines

output confirmed by netcat on other system.

+       disable_irq(dev->irq);
+       b44_interrupt (dev->irq, dev, NULL);
+       enable_irq(dev->irq);

Aside from this bizarre whitespace convention and neglecting to cc:
me, looks good.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#2 lore raw
Quoted 22 lines · Matt Mackall
Quoted 14 lines · Con Kolivas

This patch adds poll support to the b44 driver to allow netconsole support. Style lifted straight from 8139too.c

here is the dmesg output with it in place:

netconsole: device eth0 not up yet, forcing it
netconsole: carrier detect appears flaky, waiting 10 seconds
b44: eth0: Link is down.
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is on for TX and on for RX.
netconsole: network logging started

output confirmed by netcat on other system.

drivers/net/b44.c +3 -0
+       disable_irq(dev->irq);
+       b44_interrupt (dev->irq, dev, NULL);
+       enable_irq(dev->irq);
Quoted 3 lines

Aside from this bizarre whitespace convention and neglecting to cc:
me, looks good.

sorry,sorry,thanks.

Can you explain where I went wrong in the whitespace so I don't make the same mistake again? It looked pretty standard to me.

Should I nudge akpm with this or will it go via another route?

Cheers,
Con

#3 lore raw
Quoted 24 lines · Con Kolivas
Quoted 23 lines · Matt Mackall
Quoted 15 lines · Con Kolivas

This patch adds poll support to the b44 driver to allow netconsole support. Style lifted straight from 8139too.c

here is the dmesg output with it in place:

netconsole: device eth0 not up yet, forcing it
netconsole: carrier detect appears flaky, waiting 10 seconds
b44: eth0: Link is down.
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is on for TX and on for RX.
netconsole: network logging started

output confirmed by netcat on other system.

drivers/net/b44.c +3 -0
+       disable_irq(dev->irq);
+       b44_interrupt (dev->irq, dev, NULL);
+       enable_irq(dev->irq);
Quoted 8 lines
Quoted 3 lines

Aside from this bizarre whitespace convention and neglecting to cc:
me, looks good.

sorry,sorry,thanks.

Can you explain where I went wrong in the whitespace so I don't make the same mistake again? It looked pretty standard to me.

Stray space between b44_interrupt and args.

Quoted 1 line

Should I nudge akpm with this or will it go via another route?

Jeff Garzik usually picks up net driver stuff, I think he got this one.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#4 lore raw

PATCH 1/1 b44poll - whitespace

Quoted 5 lines
Quoted 4 lines

Review

Quoted 4 lines
(quoted diff) +3 -0
+       disable_irq(dev->irq);
+       b44_interrupt (dev->irq, dev, NULL);
+       enable_irq(dev->irq);

Stray space between b44_interrupt and args.

Must have had my eyes closed. Trivial cleanup patch attached, thanks.

Con

drivers/net/b44.c +1 -1
Index: linux-2.6.9-rc4-ck1/drivers/net/b44.c
===================================================================
@@ -1309,7 +1309,7 @@ err_out_free:
 static void b44_poll_controller(struct net_device *dev)
 {
 	disable_irq(dev->irq);
-	b44_interrupt (dev->irq, dev, NULL);
+	b44_interrupt(dev->irq, dev, NULL);
 	enable_irq(dev->irq);
 }
 #endif