Skip to contentSkip to conversation

sis900.c net poll support

PATCH In review Brancaleoni Matteo 2 participants 2 messages Jan 5, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sis900.c net poll support

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.

drivers/net/sis900.c renamed from drivers/net/sis900.orig +18 -0
@@ -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
#1 lore raw

Thanks, it was on my TODO list and now I can just remove the entry :-) I'll try to integrate your patch in the next sis900 update.

Bye.

Quoted 16 lines · Brancaleoni Matteo

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.

drivers/net/sis900.c renamed from drivers/net/sis900.orig +0 -0
Signature · 3 lines
-----------------------------
Daniele Venzano
Web: http://teg.homeunix.org