[U-Boot] [RFC PATCH v3 6/7] tsec: enable promiscuous mode for IPv6

Chris Packham judge.packham at gmail.com
Fri Jan 25 01:56:57 CET 2013


From: Chris Packham <chris.packham at alliedtelesis.co.nz>

For IPv6 neighbor discovery to operate correctly we need to register for
various multicast groups (because some neighbor discovery packets are
sent to various multicast addresses).

Signed-off-by: Chris Packham <chris.packham at alliedtelesis.co.nz>
---
Currently the multicast support in the tsec driver is conditional on
CONFIG_MCAST_TFTP and tsec_mcast_addr, eth_mcast_join and
eth_device->mcast all disagree on what the prototype for the function to
add a multicast address should be. Instead of tackling this I've taken
the cowards way out and just enabled promiscuous mode which means the
device sees any packet regardless of the destination address. At some
point we may need to decide to properly support registering for
multicast groups or just always run in promiscuous mode.

Changes in v3: None
Changes in v2: None

 drivers/net/tsec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index f5e314b..005413b 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -361,6 +361,10 @@ static void startup_tsec(struct eth_device *dev)
 	if ((SVR_MAJ(svr) == 1) || IS_SVR_REV(svr, 2, 0))
 		redundant_init(dev);
 #endif
+#ifdef CONFIG_CMD_NET6
+	/* Enable promiscuous mode */
+	setbits_be32(&regs->rctrl, 0x8);
+#endif
 	/* Enable Transmit and Receive */
 	setbits_be32(&regs->maccfg1, MACCFG1_RX_EN | MACCFG1_TX_EN);
 
-- 
1.7.12.rc2.16.g034161a



More information about the U-Boot mailing list