* [PATCH] Add polling support to Sungem
@ 2004-09-29 12:57 Colin Leroy
2004-09-29 16:00 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Colin Leroy @ 2004-09-29 12:57 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linux-kernel
[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 <colin@colino.net>
--- a/drivers/net/sungem.c 2004-09-29 12:22:41.802346664 +0200
+++ b/drivers/net/sungem.c 2004-09-29 12:15:56.000000000 +0200
@@ -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;
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Add polling support to Sungem
2004-09-29 12:57 [PATCH] Add polling support to Sungem Colin Leroy
@ 2004-09-29 16:00 ` Jeff Garzik
2004-09-29 16:05 ` Colin Leroy
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2004-09-29 16:00 UTC (permalink / raw)
To: Colin Leroy; +Cc: Benjamin Herrenschmidt, linux-kernel
Colin Leroy wrote:
> [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 <colin@colino.net>
>
> --- a/drivers/net/sungem.c 2004-09-29 12:22:41.802346664 +0200
> +++ b/drivers/net/sungem.c 2004-09-29 12:15:56.000000000 +0200
> @@ -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
Check BK snapshots, this support is already in sungem.
Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-09-29 16:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-29 12:57 [PATCH] Add polling support to Sungem Colin Leroy
2004-09-29 16:00 ` Jeff Garzik
2004-09-29 16:05 ` Colin Leroy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox