Skip to content

Commit 7f5c6ad

Browse files
GuoqingJiang-Linuxdavem330
authored andcommitted
net/fec: add poll controller function for fec nic
Add poll controller function for fec nic. Signed-off-by: Xiao Jiang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c7c83d1 commit 7f5c6ad

File tree

1 file changed

+27
-0
lines changed
  • drivers/net/ethernet/freescale

1 file changed

+27
-0
lines changed

drivers/net/ethernet/freescale/fec.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ struct fec_enet_private {
242242
int link;
243243
int full_duplex;
244244
struct completion mdio_done;
245+
int irq[FEC_IRQ_NUM];
245246
};
246247

247248
/* FEC MII MMFR bits definition */
@@ -1363,6 +1364,29 @@ fec_set_mac_address(struct net_device *ndev, void *p)
13631364
return 0;
13641365
}
13651366

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+
*/
1375+
void 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+
13661390
static const struct net_device_ops fec_netdev_ops = {
13671391
.ndo_open = fec_enet_open,
13681392
.ndo_stop = fec_enet_close,
@@ -1373,6 +1397,9 @@ static const struct net_device_ops fec_netdev_ops = {
13731397
.ndo_tx_timeout = fec_timeout,
13741398
.ndo_set_mac_address = fec_set_mac_address,
13751399
.ndo_do_ioctl = fec_enet_ioctl,
1400+
#ifdef CONFIG_NET_POLL_CONTROLLER
1401+
.ndo_poll_controller = fec_poll_controller,
1402+
#endif
13761403
};
13771404

13781405
/*

0 commit comments

Comments
 (0)