Subject: Re: hme driver: multicast-capable?
To: Jason Wright <jason@thought.net>
From: None <itojun@iijlab.net>
List: port-sparc
Date: 06/15/2000 22:26:54
>Just took a quick look through sys/dev/ic/hme.c.  Looks like the multicast
>address filter is never enabled (HME_MAC_RXCFG_HENABLE) in NetBSD; unless
>I'm missing something (altogether possible, since I'm browsing netbsd via
>cvs web).  The multicast filter on hme definately works, though.  I had a
>ss5 with a quad hme acting as an OSPF router under OpenBSD up until a few
>months ago.

	hmm, you right...  does it make the situation better?
	(I have no environment to test)

itojun


Index: hme.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ic/hme.c,v
retrieving revision 1.13
diff -u -r1.13 hme.c
--- hme.c	2000/05/18 14:00:46	1.13
+++ hme.c	2000/06/15 13:26:31
@@ -1318,7 +1318,10 @@
 	u_int32_t crc;
 	u_int32_t hash[4];
 	int len;
+	u_int32_t v;
 
+	v = bus_space_read_4(t, mac, HME_MACI_RXCFG);
+
 	/*
 	 * Set up multicast address filter by passing all multicast addresses
 	 * through a crc generator, and then using the high order 6 bits as an
@@ -1328,12 +1331,13 @@
 	 */
 
 	if ((ifp->if_flags & IFF_PROMISC) != 0) {
-		u_int32_t v = bus_space_read_4(t, mac, HME_MACI_RXCFG);
 		v |= HME_MAC_RXCFG_PMISC;
-		bus_space_write_4(t, mac, HME_MACI_RXCFG, v);
 		goto allmulti;
 	}
 
+	/* Make sure to turn off promiscuous mode */
+	v &= ~HME_MAC_RXCFG_PMISC;
+
 	/* Clear hash table */
 	hash[3] = hash[2] = hash[1] = hash[0] = 0;
 	ETHER_FIRST_MULTI(step, ec, enm);
@@ -1382,6 +1386,9 @@
 	bus_space_write_4(t, mac, HME_MACI_HASHTAB2, hash[2]);
 	bus_space_write_4(t, mac, HME_MACI_HASHTAB3, hash[3]);
 
+	v |= HME_MAC_RXCFG_HENABLE;
+	bus_space_write_4(t, mac, HME_MACI_RXCFG, v);
+
 	ifp->if_flags &= ~IFF_ALLMULTI;
 	return;
 
@@ -1391,6 +1398,9 @@
 	bus_space_write_4(t, mac, HME_MACI_HASHTAB1, 0xffff);
 	bus_space_write_4(t, mac, HME_MACI_HASHTAB2, 0xffff);
 	bus_space_write_4(t, mac, HME_MACI_HASHTAB3, 0xffff);
+
+	v |= HME_MAC_RXCFG_HENABLE;
+	bus_space_write_4(t, mac, HME_MACI_RXCFG, v);
 }
 
 /*