Commit dda9a209 authored by Stephen Hemminger's avatar Stephen Hemminger

[PATCH] (3/3) 8139too -- poll_controller

For net-drivers-2.5-exp, add a poll_controller hook to allow use of netconsole
with this driver.

jeff, don't have netconsole setup to test this so please give it a try before
including it.
parent bcb30967
......@@ -612,6 +612,7 @@ static void rtl8139_init_ring (struct net_device *dev);
static int rtl8139_start_xmit (struct sk_buff *skb,
struct net_device *dev);
static int rtl8139_poll(struct net_device *dev, int *budget);
static void rtl8139_poll_controller(struct net_device *dev);
static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance,
struct pt_regs *regs);
static int rtl8139_close (struct net_device *dev);
......@@ -989,6 +990,9 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
dev->ethtool_ops = &rtl8139_ethtool_ops;
dev->tx_timeout = rtl8139_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;
#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = rtl8139_poll_controller;
#endif
/* note: the hardware is not capable of sg/csum/highdma, however
* through the use of skb_copy_and_csum_dev we enable these
......@@ -2184,6 +2188,18 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance,
return IRQ_RETVAL(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 rtl8139_poll_controller(struct net_device *dev)
{
disable_irq(dev->irq);
rtl8139_interrupt(dev->irq, dev, NULL);
enable_irq(dev->irq);
}
#endif
static int rtl8139_close (struct net_device *dev)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment