aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Klassert <klassert@mathematik.tu-chemnitz.de>2005-05-12 19:34:31 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-05-12 19:34:31 -0400
commit7502cd1058152791fec94f32b719fec45e7f5de2 (patch)
tree7ccc018d8125fde70ed7fe5a880f50d16b3828eb
parente21ba28262037f5fe7ca8746502c7c03c3da817f (diff)
[PATCH] 8139cp - add netpoll support
Patch adds netpoll support to the 8139cp driver. The patch needs some tests because I have no NIC of this type for testing. Applies against linux-2.6.9-rc2-mm3 Signed-off-by: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
-rw-r--r--drivers/net/8139cp.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 18946a56d9b5..050d7602bbe9 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -398,6 +398,9 @@ struct cp_private {
398static void __cp_set_rx_mode (struct net_device *dev); 398static void __cp_set_rx_mode (struct net_device *dev);
399static void cp_tx (struct cp_private *cp); 399static void cp_tx (struct cp_private *cp);
400static void cp_clean_rings (struct cp_private *cp); 400static void cp_clean_rings (struct cp_private *cp);
401#ifdef CONFIG_NET_POLL_CONTROLLER
402static void cp_poll_controller(struct net_device *dev);
403#endif
401 404
402static struct pci_device_id cp_pci_tbl[] = { 405static struct pci_device_id cp_pci_tbl[] = {
403 { PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139, 406 { PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139,
@@ -692,6 +695,19 @@ cp_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
692 return IRQ_HANDLED; 695 return IRQ_HANDLED;
693} 696}
694 697
698#ifdef CONFIG_NET_POLL_CONTROLLER
699/*
700 * Polling receive - used by netconsole and other diagnostic tools
701 * to allow network i/o with interrupts disabled.
702 */
703static void cp_poll_controller(struct net_device *dev)
704{
705 disable_irq(dev->irq);
706 cp_interrupt(dev->irq, dev, NULL);
707 enable_irq(dev->irq);
708}
709#endif
710
695static void cp_tx (struct cp_private *cp) 711static void cp_tx (struct cp_private *cp)
696{ 712{
697 unsigned tx_head = cp->tx_head; 713 unsigned tx_head = cp->tx_head;
@@ -1763,6 +1779,9 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1763 dev->get_stats = cp_get_stats; 1779 dev->get_stats = cp_get_stats;
1764 dev->do_ioctl = cp_ioctl; 1780 dev->do_ioctl = cp_ioctl;
1765 dev->poll = cp_rx_poll; 1781 dev->poll = cp_rx_poll;
1782#ifdef CONFIG_NET_POLL_CONTROLLER
1783 dev->poll_controller = cp_poll_controller;
1784#endif
1766 dev->weight = 16; /* arbitrary? from NAPI_HOWTO.txt. */ 1785 dev->weight = 16; /* arbitrary? from NAPI_HOWTO.txt. */
1767#ifdef BROKEN 1786#ifdef BROKEN
1768 dev->change_mtu = cp_change_mtu; 1787 dev->change_mtu = cp_change_mtu;