aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorXiao Jiang <jgq516@gmail.com>2011-09-28 22:15:57 -0400
committerDavid S. Miller <davem@davemloft.net>2011-09-29 14:46:49 -0400
commit7f5c6addcdc039c1a7c435857e6284ecac5d97c8 (patch)
treed1e94c06750d05dd471d8d6341f5dec2eb017167 /drivers/net
parentc7c83d1c95b84cf0e71e947613a5d409cf0ebca1 (diff)
net/fec: add poll controller function for fec nic
Add poll controller function for fec nic. Signed-off-by: Xiao Jiang <jgq516@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/freescale/fec.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 1794ea446a9e..1124ce0a1594 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -242,6 +242,7 @@ struct fec_enet_private {
242 int link; 242 int link;
243 int full_duplex; 243 int full_duplex;
244 struct completion mdio_done; 244 struct completion mdio_done;
245 int irq[FEC_IRQ_NUM];
245}; 246};
246 247
247/* FEC MII MMFR bits definition */ 248/* FEC MII MMFR bits definition */
@@ -1363,6 +1364,29 @@ fec_set_mac_address(struct net_device *ndev, void *p)
1363 return 0; 1364 return 0;
1364} 1365}
1365 1366
1367#ifdef CONFIG_NET_POLL_CONTROLLER
1368/*
1369 * fec_poll_controller: FEC Poll controller function
1370 * @dev: The FEC network adapter
1371 *
1372 * Polled functionality used by netconsole and others in non interrupt mode
1373 *
1374 */
1375void fec_poll_controller(struct net_device *dev)
1376{
1377 int i;
1378 struct fec_enet_private *fep = netdev_priv(dev);
1379
1380 for (i = 0; i < FEC_IRQ_NUM; i++) {
1381 if (fep->irq[i] > 0) {
1382 disable_irq(fep->irq[i]);
1383 fec_enet_interrupt(fep->irq[i], dev);
1384 enable_irq(fep->irq[i]);
1385 }
1386 }
1387}
1388#endif
1389
1366static const struct net_device_ops fec_netdev_ops = { 1390static const struct net_device_ops fec_netdev_ops = {
1367 .ndo_open = fec_enet_open, 1391 .ndo_open = fec_enet_open,
1368 .ndo_stop = fec_enet_close, 1392 .ndo_stop = fec_enet_close,
@@ -1373,6 +1397,9 @@ static const struct net_device_ops fec_netdev_ops = {
1373 .ndo_tx_timeout = fec_timeout, 1397 .ndo_tx_timeout = fec_timeout,
1374 .ndo_set_mac_address = fec_set_mac_address, 1398 .ndo_set_mac_address = fec_set_mac_address,
1375 .ndo_do_ioctl = fec_enet_ioctl, 1399 .ndo_do_ioctl = fec_enet_ioctl,
1400#ifdef CONFIG_NET_POLL_CONTROLLER
1401 .ndo_poll_controller = fec_poll_controller,
1402#endif
1376}; 1403};
1377 1404
1378 /* 1405 /*