]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: bcmgenet: Add netconsole support
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 31 Jul 2015 18:42:54 +0000 (11:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 31 Jul 2015 22:45:36 +0000 (15:45 -0700)
Implement a poll controller for netconsole which invokes both of our
interrupt handlers for the different RX/TX queues.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c

index c6f2d396edf0aa674ba613de7e76429a2042371d..eb080ef8ee97fec11fe3c03eee9f9ce8cac8eeb7 100644 (file)
@@ -2388,6 +2388,23 @@ static irqreturn_t bcmgenet_wol_isr(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void bcmgenet_poll_controller(struct net_device *dev)
+{
+       struct bcmgenet_priv *priv = netdev_priv(dev);
+
+       /* Invoke the main RX/TX interrupt handler */
+       disable_irq(priv->irq0);
+       bcmgenet_isr0(priv->irq0, priv);
+       enable_irq(priv->irq0);
+
+       /* And the interrupt handler for RX/TX priority queues */
+       disable_irq(priv->irq1);
+       bcmgenet_isr1(priv->irq1, priv);
+       enable_irq(priv->irq1);
+}
+#endif
+
 static void bcmgenet_umac_reset(struct bcmgenet_priv *priv)
 {
        u32 reg;
@@ -2939,6 +2956,9 @@ static const struct net_device_ops bcmgenet_netdev_ops = {
        .ndo_set_mac_address    = bcmgenet_set_mac_addr,
        .ndo_do_ioctl           = bcmgenet_ioctl,
        .ndo_set_features       = bcmgenet_set_features,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller    = bcmgenet_poll_controller,
+#endif
 };
 
 /* Array of GENET hardware parameters/characteristics */