PATCH: netpoll with xircom_cb
Subsystems (2)
Hi,
I have a headless computer with xircom pcmcia card and needed netconsole on it. After looking around in other drivers I concocted this patch. It survived light testing. I have no documentation for the hw, so it maybe totally bogus. What do you think ?
Petr
lspci -v of the card is:
0000:02:00.1 Serial controller: Xircom Cardbus Ethernet + 56k Modem (rev 03) (prog-if 02 [16550])
Subsystem: Xircom CBEM56G-100 Ethernet + 56k Modem
Flags: medium devsel, IRQ 11
I/O ports at 4080 [size=8]
Memory at 10801000 (32-bit, non-prefetchable) [size=2K]
Memory at 10801800 (32-bit, non-prefetchable) [size=2K]
Expansion ROM at 10404000 [disabled] [size=16K]
Capabilities: [dc] Power Management version 1drivers/net/tulip/xircom_cb.c +14 -0
@@ -117,6 +117,9 @@static int xircom_close (struct net_device *dev);static void xircom_up (struct xircom_private *card);static struct net_device_stats *xircom_get_stats (struct net_device *dev); +#if CONFIG_NET_POLL_CONTROLLER +static void xircom_poll_controller (struct net_device *dev); +#endif static void investigate_read_descriptor (struct net_device *dev,struct xircom_private *card,int descnr,unsigned int bufferoffset);static void investigate_write_descriptor (struct net_device *dev,struct xircom_private *card,int descnr,unsigned int bufferoffset);
@@ -269,6 +272,9 @@ dev->stop = &xircom_close; dev->get_stats = &xircom_get_stats; dev->priv = private; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = &xircom_poll_controller; +#endif SET_ETHTOOL_OPS (dev, &netdev_ethtool_ops);pci_set_drvdata (pdev, dev);
@@ -500,6 +506,14 @@ } +#ifdef CONFIG_NET_POLL_CONTROLLER +static void xircom_poll_controller (struct net_device *dev) +{ +disable_irq (dev->irq); +xircom_interrupt (dev->irq, dev,NULL ); +enable_irq (dev->irq); +} +#endif static void initialize_card (struct xircom_private *card)
Quoted 6 lines · Petr Konecny
Hi,
I have a headless computer with xircom pcmcia card and needed netconsole on it. After looking around in other drivers I concocted this patch. It survived light testing. I have no documentation for the hw, so it maybe totally bogus. What do you think ?
Looks good to me.
In general, this generic approach is fine. We can sometimes avoid the heavyweight IRQ manipulation by using internal driver locking, but this is generally not a performance-critical path.
Jeff, did you take this one?
Signature · 1 line
Mathematics is the supreme nostalgia of our time.
Quoted 10 lines · Matt Mackall
Quoted 6 lines · Petr Konecny
Hi,
I have a headless computer with xircom pcmcia card and needed netconsole on it. After looking around in other drivers I concocted this patch. It survived light testing. I have no documentation for the hw, so it maybe totally bogus. What do you think ?
Quoted 7 lines
Looks good to me.
In general, this generic approach is fine. We can sometimes avoid the heavyweight IRQ manipulation by using internal driver locking, but this is generally not a performance-critical path.
Jeff, did you take this one?
yes