Add polling support to Sungem
PATCH 1/1 Add polling support to Sungem
[sending again, forgot Cc:, sorry]
Hi Benjamin!
This patch adds polling support to Sungem ethernet card. It makes netconsole usable on iBook G4, for example.
I hope it's fine.
Signed-off-by Colin Leroy <[email protected]>
drivers/net/sungem.c +20 -0
@@ -2687,6 +2687,23 @@ }#endif /* not Sparc and not PPC */ +#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 gem_netpoll (struct net_device *netdev) +{ +struct gem *gp = netdev->priv; +if (!gp->pdev) +return ; +disable_irq (gp->pdev->irq); +gem_interrupt (gp->pdev->irq, netdev,NULL ); +enable_irq (gp->pdev->irq); +} +#endif +static int __devinit gem_get_device_address (struct gem *gp) {#if defined(__sparc__) || defined(CONFIG_PPC_PMAC )
@@ -2882,6 +2899,9 @@ dev->set_multicast_list = gem_set_multicast; dev->do_ioctl = gem_ioctl; dev->poll = gem_poll; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = gem_netpoll; +#endif dev->weight =64 ; dev->ethtool_ops = &gem_ethtool_ops; dev->tx_timeout = gem_tx_timeout;
Quoted 22 lines · Colin Leroy
[sending again, forgot Cc:, sorry]
Hi Benjamin!
This patch adds polling support to Sungem ethernet card. It makes netconsole usable on iBook G4, for example.
I hope it's fine.Signed-off-by Colin Leroy <[email protected]>drivers/net/sungem.c +6
-0@@ -2687,6 +2687,23 @@ }#endif /* not Sparc and not PPC */ +#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. +*/
drivers/net/sungem.c line 2705
Quoted 10 lines
drivers/net/sungem.c +10
-0+static void gem_netpoll (struct net_device *netdev) +{ +struct gem *gp = netdev->priv; +if (!gp->pdev) +return ; +disable_irq (gp->pdev->irq); +gem_interrupt (gp->pdev->irq, netdev,NULL ); +enable_irq (gp->pdev->irq); +} +#endif
Check BK snapshots, this support is already in sungem.
Jeff
On 29 Sep 2004 at 12h09, Jeff Garzik wrote:
Hi,
Quoted 1 line
Check BK snapshots, this support is already in sungem.
huh, too late. Thanks :)
Signature · 1 line
Colin