Skip to contentSkip to conversation

natsemi netpoll support

PATCH Applied Kalev Lember 2 participants 4 messages Jul 26, 2004 – Jul 28, 2004

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

PATCH 1/1 natsemi netpoll support

Hi,

I have implemented netpoll support in natsemi.c. I am sending you the patch, it is against linux-2.6.8-rc2. It has not recieved a lot of testing, I can only tell that netconsole now works for me.

Signature · 2 lines
Best regards,
Kalev Lember
drivers/net/natsemi.c renamed from drivers/net/natsemi.c.orig +13 -0
@@ -750,6 +750,7 @@ static void netdev_error(struct net_devi
 static void netdev_rx(struct net_device *dev);
 static void netdev_tx_done(struct net_device *dev);
 static int natsemi_change_mtu(struct net_device *dev, int new_mtu);
+static void natsemi_poll_controller(struct net_device *dev);
 static void __set_rx_mode(struct net_device *dev);
 static void set_rx_mode(struct net_device *dev);
 static void __get_stats(struct net_device *dev);
@@ -920,6 +921,9 @@ static int __devinit natsemi_probe1 (str
 	dev->do_ioctl = &netdev_ioctl;
 	dev->tx_timeout = &tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = &natsemi_poll_controller;
+#endif
 
 	if (mtu)
 		dev->mtu = mtu;
@@ -2364,6 +2368,15 @@ static struct net_device_stats *get_stat
 	return &np->stats;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void natsemi_poll_controller(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	intr_handler(dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
+
 #define HASH_TABLE	0x200
 static void __set_rx_mode(struct net_device *dev)
 {
#2 lore raw
Quoted 1 line · Jeff Garzik

please also #ifdef the prototype

Sorry. Attached updated patch.

Signature · 1 line
Kalev Lember
drivers/net/natsemi.c renamed from drivers/net/natsemi.c.orig +15 -0
@@ -750,6 +750,9 @@ static void netdev_error(struct net_devi
 static void netdev_rx(struct net_device *dev);
 static void netdev_tx_done(struct net_device *dev);
 static int natsemi_change_mtu(struct net_device *dev, int new_mtu);
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void natsemi_poll_controller(struct net_device *dev);
+#endif
 static void __set_rx_mode(struct net_device *dev);
 static void set_rx_mode(struct net_device *dev);
 static void __get_stats(struct net_device *dev);
@@ -920,6 +923,9 @@ static int __devinit natsemi_probe1 (str
 	dev->do_ioctl = &netdev_ioctl;
 	dev->tx_timeout = &tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = &natsemi_poll_controller;
+#endif
 
 	if (mtu)
 		dev->mtu = mtu;
@@ -2364,6 +2370,15 @@ static struct net_device_stats *get_stat
 	return &np->stats;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void natsemi_poll_controller(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	intr_handler(dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
+
 #define HASH_TABLE	0x200
 static void __set_rx_mode(struct net_device *dev)
 {