Skip to content

Commit

Permalink
macb: Add support of the netpoll API
Browse files Browse the repository at this point in the history
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 <[email protected]>
[[email protected]: disable_irq() -> local_irq_save()]
[[email protected]: convert to net_device_ops]
Signed-off-by: Haavard Skinnemoen <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
tpetazzoni authored and davem330 committed May 4, 2009
1 parent 255cac9 commit 6e8cf5c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions drivers/net/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,21 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}

#ifdef CONFIG_NET_POLL_CONTROLLER
/*
* Polling receive - used by netconsole and other diagnostic tools
* to allow network i/o with interrupts disabled.
*/
static void macb_poll_controller(struct net_device *dev)
{
unsigned long flags;

local_irq_save(flags);
macb_interrupt(dev->irq, dev);
local_irq_restore(flags);
}
#endif

static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct macb *bp = netdev_priv(dev);
Expand Down Expand Up @@ -1094,6 +1109,9 @@ static const struct net_device_ops macb_netdev_ops = {
.ndo_validate_addr = eth_validate_addr,
.ndo_change_mtu = eth_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = macb_poll_controller,
#endif
};

static int __init macb_probe(struct platform_device *pdev)
Expand Down

0 comments on commit 6e8cf5c

Please sign in to comment.