* [patch 2.6.9-rc4] r8169: netconsole support
@ 2004-10-18 17:53 John W. Linville
0 siblings, 0 replies; only message in thread
From: John W. Linville @ 2004-10-18 17:53 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel, jgarzik, romieu
Add a netconsole polling routine to the r8169 driver.
Tested w/ netconsole (& netdump) on x86_64 w/ FC3 Test3...
Signed-off-by: John W. Linville <linville@tuxdriver.com>
--- linux-2.6/drivers/net/r8169.c.orig
+++ linux-2.6/drivers/net/r8169.c
@@ -376,6 +376,10 @@ static struct net_device_stats *rtl8169_
#ifdef CONFIG_R8169_NAPI
static int rtl8169_poll(struct net_device *dev, int *budget);
#endif
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/* for netdump / net console */
+static void rtl8169_netpoll(struct net_device *netdev);
+#endif
static const u16 rtl8169_intr_mask =
SYSErr | LinkChg | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK;
@@ -1120,6 +1124,9 @@ rtl8169_init_one(struct pci_dev *pdev, c
dev->weight = R8169_NAPI_WEIGHT;
printk(KERN_INFO PFX "NAPI enabled\n");
#endif
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ dev->poll_controller = rtl8169_netpoll;
+#endif
tp->intr_mask = 0xffff;
tp->pci_dev = pdev;
tp->mmio_addr = ioaddr;
@@ -1950,6 +1957,22 @@ static struct net_device_stats *rtl8169_
return &tp->stats;
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+static void
+rtl8169_netpoll (struct net_device *dev)
+{
+ struct rtl8169_private *tp = netdev_priv(dev);
+ disable_irq(tp->pci_dev->irq);
+ rtl8169_interrupt(tp->pci_dev->irq, dev, NULL);
+ enable_irq(tp->pci_dev->irq);
+}
+#endif
+
static struct pci_driver rtl8169_pci_driver = {
.name = MODULENAME,
.id_table = rtl8169_pci_tbl,
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-10-18 17:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-18 17:53 [patch 2.6.9-rc4] r8169: netconsole support John W. Linville
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).