[PATCH] sis900.c net poll support

From: Brancaleoni Matteo
Date: Wed Jan 05 2005 - 05:32:27 EST


Hi.

I was in need to use netconsole to trace some lock
of my sata disk, but my onboard network card (sis900)
seems doesn't support net poll.
So searching the web I found out an old patch for enabling
in under 2.4, and ported it to 2.6.10 (looking
also into 2.6.x device drivers already working)

Seems to be ok, netconsole works without issues.
Hope that's ok and can be useful.

Matteo Brancaleoni.
--- linux-2.6.10/drivers/net/sis900.orig 2005-01-05 09:55:46.000000000 +0100
+++ linux-2.6.10/drivers/net/sis900.c 2005-01-05 10:09:04.000000000 +0100
@@ -185,6 +185,7 @@ MODULE_PARM_DESC(multicast_filter_limit,
MODULE_PARM_DESC(max_interrupt_work, "SiS 900/7016 maximum events handled per interrupt");
MODULE_PARM_DESC(debug, "SiS 900/7016 debug level (2-4)");

+static void sis900_poll(struct net_device *dev);
static int sis900_open(struct net_device *net_dev);
static int sis900_mii_probe (struct net_device * net_dev);
static void sis900_init_rxfilter (struct net_device * net_dev);
@@ -454,6 +455,9 @@ static int __devinit sis900_probe(struct
net_dev->tx_timeout = sis900_tx_timeout;
net_dev->watchdog_timeo = TX_TIMEOUT;
net_dev->ethtool_ops = &sis900_ethtool_ops;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ net_dev->poll_controller = &sis900_poll;
+#endif

ret = register_netdev(net_dev);
if (ret)
@@ -928,6 +932,20 @@ static u16 sis900_reset_phy(struct net_d
return status;
}

+#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 sis900_poll(struct net_device *dev)
+{
+ disable_irq(dev->irq);
+ sis900_interrupt(dev->irq, dev, NULL);
+ enable_irq(dev->irq);
+}
+#endif
+
/**
* sis900_open - open sis900 device
* @net_dev: the net device to open