[PATCH 2/2 v2] pasemi_mac: Netpoll support

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <jgarzik@...>
Cc: <linuxppc-dev@...>, <pasemi-linux@...>, <netdev@...>, <ncase@...>
Date: Thursday, March 27, 2008 - 6:40 pm

Add netpoll support to allow use of netconsole.
    
Signed-off-by: Nate Case <ncase@xes-inc.com>
Signed-off-by: Olof Johansson <olof@lixom.net>

---
Changed the interrupt handler arguments as found by Valentine. Will push
through powerpc.git with Jeff's ACKs (that were already given).


-Olof

diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index abb1dc4..965f2e4 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -1648,6 +1648,26 @@ static int pasemi_mac_poll(struct napi_struct *napi, int budget)
 	return pkts;
 }
 
+#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 pasemi_mac_netpoll(struct net_device *dev)
+{
+	const struct pasemi_mac *mac = netdev_priv(dev);
+
+	disable_irq(mac->tx->chan.irq);
+	pasemi_mac_tx_intr(mac->tx->chan.irq, mac->tx);
+	enable_irq(mac->tx->chan.irq);
+
+	disable_irq(mac->rx->chan.irq);
+	pasemi_mac_rx_intr(mac->rx->chan.irq, mac->rx);
+	enable_irq(mac->rx->chan.irq);
+}
+#endif
+
 static int pasemi_mac_change_mtu(struct net_device *dev, int new_mtu)
 {
 	struct pasemi_mac *mac = netdev_priv(dev);
@@ -1807,6 +1827,9 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	dev->mtu = PE_DEF_MTU;
 	/* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */
 	mac->bufsz = dev->mtu + ETH_HLEN + ETH_FCS_LEN + LOCAL_SKB_ALIGN + 128;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = pasemi_mac_netpoll;
+#endif
 
 	dev->change_mtu = pasemi_mac_change_mtu;
 	dev->ethtool_ops = &pasemi_mac_ethtool_ops;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/2] Two more pasemi_mac patches for 2.6.26, Olof Johansson, (Tue Mar 25, 9:56 pm)
Re: [PATCH 0/2] Two more pasemi_mac patches for 2.6.26, Jeff Garzik, (Wed Mar 26, 12:12 am)
Re: [PATCH 0/2] Two more pasemi_mac patches for 2.6.26, Olof Johansson, (Thu Mar 27, 3:22 pm)
Re: [PATCH 0/2] Two more pasemi_mac patches for 2.6.26, Jeff Garzik, (Thu Mar 27, 3:41 pm)
[PATCH 2/2] pasemi_mac: Netpoll support, Olof Johansson, (Tue Mar 25, 9:58 pm)
[PATCH 2/2 v2] pasemi_mac: Netpoll support, Olof Johansson, (Thu Mar 27, 6:40 pm)
Re: [PATCH 2/2 v2] pasemi_mac: Netpoll support, Jeff Garzik, (Fri Mar 28, 10:11 pm)
Re: [PATCH 2/2] pasemi_mac: Netpoll support, Valentine Barshak, (Wed Mar 26, 8:41 am)
Re: [PATCH 2/2] pasemi_mac: Netpoll support, Olof Johansson, (Wed Mar 26, 11:08 am)
[PATCH 1/2] pasemi_mac: Jumbo frame bugfixes, Olof Johansson, (Tue Mar 25, 9:57 pm)