* [PATCH 1/2] net/fec: replace hardcoded irq num with macro.
@ 2011-09-24 2:19 jgq516
2011-09-24 2:19 ` [PATCH 2/2] net/fec: add poll controller function for fec nic jgq516
2011-09-28 7:24 ` [PATCH 1/2] net/fec: replace hardcoded irq num with macro David Miller
0 siblings, 2 replies; 4+ messages in thread
From: jgq516 @ 2011-09-24 2:19 UTC (permalink / raw)
To: netdev, linux-kernel; +Cc: jgq516
From: Xiao Jiang <jgq516@gmail.com>
Don't use hardcoded irq num and replace it with
FEC_IRQ_NUM macro.
Signed-off-by: Xiao Jiang <jgq516@gmail.com>
---
drivers/net/fec.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index e8266cc..5705def 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -170,6 +170,8 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address");
#define PKT_MINBUF_SIZE 64
#define PKT_MAXBLR_SIZE 1520
+/* This device has up to three irqs on some platforms */
+#define FEC_IRQ_NUM 3
/*
* The 5270/5271/5280/5282/532x RX control register also contains maximum frame
@@ -1503,8 +1505,7 @@ fec_probe(struct platform_device *pdev)
fec_reset_phy(pdev);
- /* This device has up to three irqs on some platforms */
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < FEC_IRQ_NUM; i++) {
irq = platform_get_irq(pdev, i);
if (i && irq < 0)
break;
@@ -1549,7 +1550,7 @@ failed_init:
clk_disable(fep->clk);
clk_put(fep->clk);
failed_clk:
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < FEC_IRQ_NUM; i++) {
irq = platform_get_irq(pdev, i);
if (irq > 0)
free_irq(irq, ndev);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] net/fec: add poll controller function for fec nic
2011-09-24 2:19 [PATCH 1/2] net/fec: replace hardcoded irq num with macro jgq516
@ 2011-09-24 2:19 ` jgq516
2011-09-28 7:24 ` [PATCH 1/2] net/fec: replace hardcoded irq num with macro David Miller
1 sibling, 0 replies; 4+ messages in thread
From: jgq516 @ 2011-09-24 2:19 UTC (permalink / raw)
To: netdev, linux-kernel; +Cc: jgq516
From: Xiao Jiang <jgq516@gmail.com>
Add poll controller function for fec nic.
Signed-off-by: Xiao Jiang <jgq516@gmail.com>
---
drivers/net/fec.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 5705def..00eb5c7 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -235,6 +235,7 @@ struct fec_enet_private {
int link;
int full_duplex;
struct completion mdio_done;
+ int irq[FEC_IRQ_NUM];
};
/* FEC MII MMFR bits definition */
@@ -1323,6 +1324,29 @@ fec_set_mac_address(struct net_device *ndev, void *p)
return 0;
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * fec_poll_controller: FEC Poll controller function
+ * @dev: The FEC network adapter
+ *
+ * Polled functionality used by netconsole and others in non interrupt mode
+ *
+ */
+void fec_poll_controller(struct net_device *dev)
+{
+ int i;
+ struct fec_enet_private *fep = netdev_priv(dev);
+
+ for (i = 0; i < FEC_IRQ_NUM; i++) {
+ if (fep->irq[i] > 0) {
+ disable_irq(fep->irq[i]);
+ fec_enet_interrupt(fep->irq[i], dev);
+ enable_irq(fep->irq[i]);
+ }
+ }
+}
+#endif
+
static const struct net_device_ops fec_netdev_ops = {
.ndo_open = fec_enet_open,
.ndo_stop = fec_enet_close,
@@ -1333,6 +1357,9 @@ static const struct net_device_ops fec_netdev_ops = {
.ndo_tx_timeout = fec_timeout,
.ndo_set_mac_address = fec_set_mac_address,
.ndo_do_ioctl = fec_enet_ioctl,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = fec_poll_controller,
+#endif
};
/*
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] net/fec: replace hardcoded irq num with macro.
2011-09-24 2:19 [PATCH 1/2] net/fec: replace hardcoded irq num with macro jgq516
2011-09-24 2:19 ` [PATCH 2/2] net/fec: add poll controller function for fec nic jgq516
@ 2011-09-28 7:24 ` David Miller
2011-09-28 8:09 ` Xiao Jiang
1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2011-09-28 7:24 UTC (permalink / raw)
To: jgq516; +Cc: netdev, linux-kernel
Please respin these patches against net-next, where the FEC driver
lives in a different directory.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] net/fec: replace hardcoded irq num with macro.
2011-09-28 7:24 ` [PATCH 1/2] net/fec: replace hardcoded irq num with macro David Miller
@ 2011-09-28 8:09 ` Xiao Jiang
0 siblings, 0 replies; 4+ messages in thread
From: Xiao Jiang @ 2011-09-28 8:09 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-kernel
David Miller wrote:
> Please respin these patches against net-next, where the FEC driver
> lives in a different directory.
>
> Thanks.
>
Got it.
Thanks,
Xiao Jiang
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-09-28 8:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-24 2:19 [PATCH 1/2] net/fec: replace hardcoded irq num with macro jgq516
2011-09-24 2:19 ` [PATCH 2/2] net/fec: add poll controller function for fec nic jgq516
2011-09-28 7:24 ` [PATCH 1/2] net/fec: replace hardcoded irq num with macro David Miller
2011-09-28 8:09 ` Xiao Jiang
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).