Browse Source

Plan 9 from Bell Labs 2004-02-29

David du Colombier 18 years ago
parent
commit
6738f277d5
3 changed files with 24 additions and 1 deletions
  1. 1 1
      dist/replica/plan9.db
  2. 1 0
      dist/replica/plan9.log
  3. 22 0
      sys/src/9/pc/etherigbe.c

+ 1 - 1
dist/replica/plan9.db

@@ -5316,7 +5316,7 @@ sys/src/9/pc/etherelnk3.c - 664 sys sys 1071515332 48521
 sys/src/9/pc/etherga620.c - 664 sys sys 1074785126 28754
 sys/src/9/pc/etherga620fw.h - 644 sys sys 1026847642 222295
 sys/src/9/pc/etherif.h - 664 sys sys 1045063564 961
-sys/src/9/pc/etherigbe.c - 664 sys sys 1071245461 42444
+sys/src/9/pc/etherigbe.c - 664 sys sys 1077985913 42824
 sys/src/9/pc/ethermii.c - 664 sys sys 1039803177 4555
 sys/src/9/pc/ethermii.h - 664 sys sys 1039895684 3259
 sys/src/9/pc/etherrhine.c - 664 sys sys 1072704797 13438

+ 1 - 0
dist/replica/plan9.log

@@ -14013,3 +14013,4 @@
 1077897698 4 c sys/src/cmd/fossil/fossil.c - 664 sys sys 1077896345 2435
 1077942706 0 c 386/bin/fossil/fossil - 775 sys sys 1077940925 349367
 1077942706 1 c 386/lib/libmp.a - 664 sys sys 1077940925 77700
+1077985918 0 c sys/src/9/pc/etherigbe.c - 664 sys sys 1077985913 42824

+ 22 - 0
sys/src/9/pc/etherigbe.c

@@ -700,6 +700,26 @@ igbepromiscuous(void* arg, int on)
 	csr32w(ctlr, Rctl, rctl);
 }
 
+static void
+igbemulticast(void* arg, uchar* addr, int on)
+{
+	int bit, x;
+	Ctlr *ctlr;
+	Ether *edev;
+
+	edev = arg;
+	ctlr = edev->ctlr;
+
+	x = addr[5]>>1;
+	bit = ((addr[5] & 1)<<4)|(addr[4]>>4);
+	if(on)
+		ctlr->mta[x] |= 1<<bit;
+	else
+		ctlr->mta[x] &= ~(1<<bit);
+	
+	csr32w(ctlr, Mta+x*4, ctlr->mta[x]);
+}
+
 static Block*
 igberballoc(void)
 {
@@ -1649,6 +1669,7 @@ igbereset(Ctlr* ctlr)
 	 * Clear the Multicast Table Array.
 	 * It's a 4096 bit vector accessed as 128 32-bit registers.
 	 */
+	memset(ctlr->mta, 0, sizeof(ctlr->mta));
 	for(i = 0; i < 128; i++)
 		csr32w(ctlr, Mta+i*4, 0);
 
@@ -1825,6 +1846,7 @@ igbepnp(Ether* edev)
 
 	edev->arg = edev;
 	edev->promiscuous = igbepromiscuous;
+	edev->multicast = igbemulticast;
 
 	return 0;
 }