From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, pgynther@google.com, jaedon.shin@gmail.com,
Florian Fainelli <f.fainelli@gmail.com>,
vivien.didelot@savoirfairelinux.com,
jerome.oufella@savoirfairelinux.com, linux@roeck-us.net,
andrew@lunn.ch, cphealy@gmail.com, mathieu@codeaurora.org,
jonasj76@gmail.com, andrey.volkov@nexvision.fr,
Chris.Packham@alliedtelesis.co.nz, alexander.h.duyck@redhat.com
Subject: [PATCH net-next v2 2/4] net: systemport: Add netconsole support
Date: Fri, 31 Jul 2015 11:42:55 -0700 [thread overview]
Message-ID: <1438368177-23942-3-git-send-email-f.fainelli@gmail.com> (raw)
In-Reply-To: <1438368177-23942-1-git-send-email-f.fainelli@gmail.com>
Implement a poll controller for netconsole which invokes the RX
interrupt handler to poll for incoming packets, and cleans up all TX
queues by invoking the TX interrupt handler.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v2:
- properly pair the interrupt handler calls with disable/enable_irq
- remove the call to bcm_sysport_tx_reclaim, handler does this
drivers/net/ethernet/broadcom/bcmsysport.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 4566cdf0bc39..b9a5a97ed4dd 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -933,6 +933,21 @@ static irqreturn_t bcm_sysport_wol_isr(int irq, void *dev_id)
return IRQ_HANDLED;
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void bcm_sysport_poll_controller(struct net_device *dev)
+{
+ struct bcm_sysport_priv *priv = netdev_priv(dev);
+
+ disable_irq(priv->irq0);
+ bcm_sysport_rx_isr(priv->irq0, priv);
+ enable_irq(priv->irq0);
+
+ disable_irq(priv->irq1);
+ bcm_sysport_tx_isr(priv->irq1, priv);
+ enable_irq(priv->irq1);
+}
+#endif
+
static struct sk_buff *bcm_sysport_insert_tsb(struct sk_buff *skb,
struct net_device *dev)
{
@@ -1723,6 +1738,9 @@ static const struct net_device_ops bcm_sysport_netdev_ops = {
.ndo_set_features = bcm_sysport_set_features,
.ndo_set_rx_mode = bcm_sysport_set_rx_mode,
.ndo_set_mac_address = bcm_sysport_change_mac,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = bcm_sysport_poll_controller,
+#endif
};
#define REV_FMT "v%2x.%02x"
--
2.1.0
next prev parent reply other threads:[~2015-07-31 18:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-31 18:42 [PATCH net-next v2 0/4] net: GENET, SYSTEMPORT and DSA netconsole Florian Fainelli
2015-07-31 18:42 ` [PATCH net-next v2 1/4] net: bcmgenet: Add netconsole support Florian Fainelli
2015-07-31 18:42 ` Florian Fainelli [this message]
2015-07-31 18:42 ` [PATCH net-next v2 3/4] net: dsa: Refactor transmit path to eliminate duplication Florian Fainelli
2015-07-31 18:42 ` [PATCH net-next v2 4/4] net: dsa: Add netconsole support Florian Fainelli
2015-07-31 22:46 ` [PATCH net-next v2 0/4] net: GENET, SYSTEMPORT and DSA netconsole David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1438368177-23942-3-git-send-email-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=Chris.Packham@alliedtelesis.co.nz \
--cc=alexander.h.duyck@redhat.com \
--cc=andrew@lunn.ch \
--cc=andrey.volkov@nexvision.fr \
--cc=cphealy@gmail.com \
--cc=davem@davemloft.net \
--cc=jaedon.shin@gmail.com \
--cc=jerome.oufella@savoirfairelinux.com \
--cc=jonasj76@gmail.com \
--cc=linux@roeck-us.net \
--cc=mathieu@codeaurora.org \
--cc=netdev@vger.kernel.org \
--cc=pgynther@google.com \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).