Patchwork [net-next] gianfar: Restore promisc mode on gfar_init_mac()

login
register
mail settings
Submitter Claudiu Manoil
Date Jan. 23, 2013, 10:18 a.m.
Message ID <1358936316-8195-1-git-send-email-claudiu.manoil@freescale.com>
Download mbox | patch
Permalink /patch/214877/
State Accepted
Delegated to: David Miller
Headers show

Comments

Claudiu Manoil - Jan. 23, 2013, 10:18 a.m.
Reactivate promiscuous mode in H/W upon gfar_init_mac(), if the
net dev requires it (IFF_PROMISC flag set).
This way the promisc mode is preserved accross device reset conditions
like tx timeout, device restore, a.s.o.

Signed-off-by: Voncken C Acksys <cedric.voncken@acksys.fr>
Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
---
 drivers/net/ethernet/freescale/gianfar.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
David Miller - Jan. 23, 2013, 6:54 p.m.
From: Claudiu Manoil <claudiu.manoil@freescale.com>
Date: Wed, 23 Jan 2013 12:18:36 +0200

> Reactivate promiscuous mode in H/W upon gfar_init_mac(), if the
> net dev requires it (IFF_PROMISC flag set).
> This way the promisc mode is preserved accross device reset conditions
> like tx timeout, device restore, a.s.o.
> 
> Signed-off-by: Voncken C Acksys <cedric.voncken@acksys.fr>
> Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index bffb2ed..e765b9b 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -355,6 +355,10 @@  static void gfar_init_mac(struct net_device *ndev)
 		gfar_write(&regs->rir0, DEFAULT_RIR0);
 	}
 
+	/* Restore PROMISC mode */
+	if (ndev->flags & IFF_PROMISC)
+		rctrl |= RCTRL_PROM;
+
 	if (ndev->features & NETIF_F_RXCSUM)
 		rctrl |= RCTRL_CHECKSUMMING;