]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: pxa168_eth: add netconsole support
authorAlexander Monakov <amonakov@ispras.ru>
Thu, 1 Feb 2018 19:45:17 +0000 (22:45 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Feb 2018 19:58:37 +0000 (14:58 -0500)
This implements ndo_poll_controller callback which is necessary to
enable netconsole.

Signed-off-by: Alexander Monakov <amonakov@ispras.ru>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/pxa168_eth.c

index 7bbd86f08e5ff369f43af9b22818add8745cfe80..3a9730612a704d318b5ab2297a31822775dad1a4 100644 (file)
@@ -1362,6 +1362,15 @@ static int pxa168_eth_do_ioctl(struct net_device *dev, struct ifreq *ifr,
        return -EOPNOTSUPP;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void pxa168_eth_netpoll(struct net_device *dev)
+{
+       disable_irq(dev->irq);
+       pxa168_eth_int_handler(dev->irq, dev);
+       enable_irq(dev->irq);
+}
+#endif
+
 static void pxa168_get_drvinfo(struct net_device *dev,
                               struct ethtool_drvinfo *info)
 {
@@ -1390,6 +1399,9 @@ static const struct net_device_ops pxa168_eth_netdev_ops = {
        .ndo_do_ioctl           = pxa168_eth_do_ioctl,
        .ndo_change_mtu         = pxa168_eth_change_mtu,
        .ndo_tx_timeout         = pxa168_eth_tx_timeout,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller    = pxa168_eth_netpoll,
+#endif
 };
 
 static int pxa168_eth_probe(struct platform_device *pdev)