aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
diff options
context:
space:
mode:
authorVitaly Wool <vwool@ru.mvista.com>2006-11-07 05:27:02 -0500
committerJeff Garzik <jeff@garzik.org>2006-12-02 00:12:03 -0500
commitf2d71c2d800e68f158a5949e38b23f5140948548 (patch)
treeedfb6149981f13fe5e90850bf656cf2a35d1077f /drivers/net/gianfar.c
parent02e0e5e935cad59a2d30a004df9065e8697543e3 (diff)
[PATCH] add netpoll support for gianfar: respin
The patch inlined below adds NET_POLL_CONTROLLER support for gianfar network driver, slightly modified wrt the comments from Andy Fleming. drivers/net/gianfar.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) Signed-off-by: Vitaly Wool <vwool@ru.mvista.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r--drivers/net/gianfar.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index a06d8d1aaceb..6bf18c82083d 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -133,6 +133,9 @@ static void gfar_set_hash_for_addr(struct net_device *dev, u8 *addr);
133#ifdef CONFIG_GFAR_NAPI 133#ifdef CONFIG_GFAR_NAPI
134static int gfar_poll(struct net_device *dev, int *budget); 134static int gfar_poll(struct net_device *dev, int *budget);
135#endif 135#endif
136#ifdef CONFIG_NET_POLL_CONTROLLER
137static void gfar_netpoll(struct net_device *dev);
138#endif
136int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit); 139int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit);
137static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb, int length); 140static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb, int length);
138static void gfar_vlan_rx_register(struct net_device *netdev, 141static void gfar_vlan_rx_register(struct net_device *netdev,
@@ -260,6 +263,9 @@ static int gfar_probe(struct platform_device *pdev)
260 dev->poll = gfar_poll; 263 dev->poll = gfar_poll;
261 dev->weight = GFAR_DEV_WEIGHT; 264 dev->weight = GFAR_DEV_WEIGHT;
262#endif 265#endif
266#ifdef CONFIG_NET_POLL_CONTROLLER
267 dev->poll_controller = gfar_netpoll;
268#endif
263 dev->stop = gfar_close; 269 dev->stop = gfar_close;
264 dev->get_stats = gfar_get_stats; 270 dev->get_stats = gfar_get_stats;
265 dev->change_mtu = gfar_change_mtu; 271 dev->change_mtu = gfar_change_mtu;
@@ -1536,6 +1542,33 @@ static int gfar_poll(struct net_device *dev, int *budget)
1536} 1542}
1537#endif 1543#endif
1538 1544
1545#ifdef CONFIG_NET_POLL_CONTROLLER
1546/*
1547 * Polling 'interrupt' - used by things like netconsole to send skbs
1548 * without having to re-enable interrupts. It's not called while
1549 * the interrupt routine is executing.
1550 */
1551static void gfar_netpoll(struct net_device *dev)
1552{
1553 struct gfar_private *priv = netdev_priv(dev);
1554
1555 /* If the device has multiple interrupts, run tx/rx */
1556 if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) {
1557 disable_irq(priv->interruptTransmit);
1558 disable_irq(priv->interruptReceive);
1559 disable_irq(priv->interruptError);
1560 gfar_interrupt(priv->interruptTransmit, dev);
1561 enable_irq(priv->interruptError);
1562 enable_irq(priv->interruptReceive);
1563 enable_irq(priv->interruptTransmit);
1564 } else {
1565 disable_irq(priv->interruptTransmit);
1566 gfar_interrupt(priv->interruptTransmit, dev);
1567 enable_irq(priv->interruptTransmit);
1568 }
1569}
1570#endif
1571
1539/* The interrupt handler for devices with one interrupt */ 1572/* The interrupt handler for devices with one interrupt */
1540static irqreturn_t gfar_interrupt(int irq, void *dev_id) 1573static irqreturn_t gfar_interrupt(int irq, void *dev_id)
1541{ 1574{