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

Message ID 1359075418-9031-7-git-send-email-judge.packham@gmail.com
State RFC
Delegated to: Joe Hershberger
Headers show

Commit Message

Chris Packham Jan. 25, 2013, 12:56 a.m.
From: Chris Packham <chris.packham@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@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))
+	/* Enable promiscuous mode */
+	setbits_be32(&regs->rctrl, 0x8);
 	/* Enable Transmit and Receive */
 	setbits_be32(&regs->maccfg1, MACCFG1_RX_EN | MACCFG1_TX_EN);