aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macb.c
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2009-05-04 14:08:41 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-04 14:08:41 -0400
commit6e8cf5c069c6cb7b316e9b1715eac38873dd5cab (patch)
treefdbe28f7cf062c7e2dfaf4bdbb3e55345cf4bf60 /drivers/net/macb.c
parent255cac91c3c9ce7dca7713b93ab03c75b7902e0e (diff)
macb: Add support of the netpoll API
With this patch in place, I'm successfully able to use the netconsole mechanism with the Calao USB-A9263 board, which uses the AT91SAM9263 CPU, which in terms of Ethernet controller is supported by the macb driver. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> [haavard.skinnemoen@atmel.com: disable_irq() -> local_irq_save()] [haavard.skinnemoen@atmel.com: convert to net_device_ops] Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r--drivers/net/macb.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index e82aee41d77e..722265920da8 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -599,6 +599,21 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
599 return IRQ_HANDLED; 599 return IRQ_HANDLED;
600} 600}
601 601
602#ifdef CONFIG_NET_POLL_CONTROLLER
603/*
604 * Polling receive - used by netconsole and other diagnostic tools
605 * to allow network i/o with interrupts disabled.
606 */
607static void macb_poll_controller(struct net_device *dev)
608{
609 unsigned long flags;
610
611 local_irq_save(flags);
612 macb_interrupt(dev->irq, dev);
613 local_irq_restore(flags);
614}
615#endif
616
602static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) 617static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
603{ 618{
604 struct macb *bp = netdev_priv(dev); 619 struct macb *bp = netdev_priv(dev);
@@ -1094,6 +1109,9 @@ static const struct net_device_ops macb_netdev_ops = {
1094 .ndo_validate_addr = eth_validate_addr, 1109 .ndo_validate_addr = eth_validate_addr,
1095 .ndo_change_mtu = eth_change_mtu, 1110 .ndo_change_mtu = eth_change_mtu,
1096 .ndo_set_mac_address = eth_mac_addr, 1111 .ndo_set_mac_address = eth_mac_addr,
1112#ifdef CONFIG_NET_POLL_CONTROLLER
1113 .ndo_poll_controller = macb_poll_controller,
1114#endif
1097}; 1115};
1098 1116
1099static int __init macb_probe(struct platform_device *pdev) 1117static int __init macb_probe(struct platform_device *pdev)