Browse Source

Plan 9 from Bell Labs 2007-12-19

David du Colombier 16 years ago
parent
commit
0a0f26c0d1

+ 2 - 2
dist/replica/_plan9.db

@@ -8099,7 +8099,7 @@ sys/src/9/pc/ether8139.c - 664 sys sys 1185650567 19974
 sys/src/9/pc/ether8169.c - 664 sys sys 1185812348 26931
 sys/src/9/pc/ether82543gc.c - 664 sys sys 1131290377 32294
 sys/src/9/pc/ether82557.c - 664 sys sys 1191886292 30411
-sys/src/9/pc/ether82563.c - 664 sys sys 1192047088 34689
+sys/src/9/pc/ether82563.c - 664 sys sys 1198011483 34697
 sys/src/9/pc/ether83815.c - 664 sys sys 1172259521 26346
 sys/src/9/pc/ether8390.c - 664 sys sys 1131290377 17702
 sys/src/9/pc/ether8390.h - 664 sys sys 1015014517 1511
@@ -9178,7 +9178,7 @@ sys/src/boot/pc/ether8003.c - 664 sys sys 1015007950 6446
 sys/src/boot/pc/ether8139.c - 664 sys sys 1121393459 14823
 sys/src/boot/pc/ether8169.c - 664 sys sys 1156429147 21582
 sys/src/boot/pc/ether82557.c - 664 sys sys 1140802406 19090
-sys/src/boot/pc/ether82563.c - 664 sys sys 1193335413 25390
+sys/src/boot/pc/ether82563.c - 664 sys sys 1198011456 25413
 sys/src/boot/pc/ether83815.c - 664 sys sys 1144961190 21993
 sys/src/boot/pc/ether8390.c - 664 sys sys 1112382847 16209
 sys/src/boot/pc/ether8390.h - 664 sys sys 1015007951 1392

+ 2 - 2
dist/replica/plan9.db

@@ -8099,7 +8099,7 @@ sys/src/9/pc/ether8139.c - 664 sys sys 1185650567 19974
 sys/src/9/pc/ether8169.c - 664 sys sys 1185812348 26931
 sys/src/9/pc/ether82543gc.c - 664 sys sys 1131290377 32294
 sys/src/9/pc/ether82557.c - 664 sys sys 1191886292 30411
-sys/src/9/pc/ether82563.c - 664 sys sys 1192047088 34689
+sys/src/9/pc/ether82563.c - 664 sys sys 1198011483 34697
 sys/src/9/pc/ether83815.c - 664 sys sys 1172259521 26346
 sys/src/9/pc/ether8390.c - 664 sys sys 1131290377 17702
 sys/src/9/pc/ether8390.h - 664 sys sys 1015014517 1511
@@ -9178,7 +9178,7 @@ sys/src/boot/pc/ether8003.c - 664 sys sys 1015007950 6446
 sys/src/boot/pc/ether8139.c - 664 sys sys 1121393459 14823
 sys/src/boot/pc/ether8169.c - 664 sys sys 1156429147 21582
 sys/src/boot/pc/ether82557.c - 664 sys sys 1140802406 19090
-sys/src/boot/pc/ether82563.c - 664 sys sys 1193335413 25390
+sys/src/boot/pc/ether82563.c - 664 sys sys 1198011456 25413
 sys/src/boot/pc/ether83815.c - 664 sys sys 1144961190 21993
 sys/src/boot/pc/ether8390.c - 664 sys sys 1112382847 16209
 sys/src/boot/pc/ether8390.h - 664 sys sys 1015007951 1392

+ 2 - 0
dist/replica/plan9.log

@@ -18179,3 +18179,5 @@
 1197743406 0 c sys/src/9/port/devproc.c - 664 sys sys 1197732969 28473
 1197745273 0 c sys/src/9/port/devproc.c - 664 sys sys 1197732969 28473
 1197745273 1 c sys/src/9/port/qio.c - 664 sys sys 1197732972 23616
+1198011604 0 c sys/src/9/pc/ether82563.c - 664 sys sys 1198011483 34697
+1198011604 1 c sys/src/boot/pc/ether82563.c - 664 sys sys 1198011456 25413

+ 4 - 3
sys/src/9/pc/ether82563.c

@@ -141,7 +141,7 @@ enum {					/* Ctrl */
 
 enum {					/* Status */
 	Lu		= 1<<1,		/* Link Up */
-	Lanid		= 3<<2,		/* mask for Lan ID.
+	Lanid		= 3<<2,		/* mask for Lan ID. */
 	Txoff		= 1<<4,		/* Transmission Paused */
 	Tbimode		= 1<<5,		/* TBI Mode Indication */
 	Phyra		= 1<<10,	/* PHY Reset Asserted */
@@ -1332,8 +1332,9 @@ i82563reset(Ctlr *ctlr)
 		ctlr->ra[2*i]   = ctlr->eeprom[i];
 		ctlr->ra[2*i+1] = ctlr->eeprom[i] >> 8;
 	}
-	r = csr32r(ctlr, Status) >> 2;
-	ctlr->ra[5] += r & 3;		/* ea ctlr[1] = ea ctlr[0] + 1 */
+	r = (csr32r(ctlr, Status) & Lanid) >> 2;
+	ctlr->ra[5] += r;		/* ea ctlr[1] = ea ctlr[0]+1 */
+
 	r = ctlr->ra[3]<<24 | ctlr->ra[2]<<16 | ctlr->ra[1]<<8 | ctlr->ra[0];
 	csr32w(ctlr, Ral, r);
 	r = 0x80000000 | ctlr->ra[5]<<8 | ctlr->ra[4];

+ 4 - 4
sys/src/boot/pc/ether82563.c

@@ -1,6 +1,6 @@
 /*
  * bootstrap driver for
- * Intel 82563, 82571, 82573 Gigabit Ethernet Controllers
+ * Intel 82563, 82571, 82573 Gigabit Ethernet PCI-Express Controllers
  */
 #include "u.h"
 #include "lib.h"
@@ -155,7 +155,7 @@ enum {					/* Ctrl */
 
 enum {					/* Status */
 	Lu		= 1<<1,		/* Link Up */
-	Lanid		= 3<<2,		/* mask for Lan ID.
+	Lanid		= 3<<2,		/* mask for Lan ID. */
 	Txoff		= 1<<4,		/* Transmission Paused */
 	Tbimode		= 1<<5,		/* TBI Mode Indication */
 	SpeedMASK	= 0x000000C0,
@@ -806,8 +806,8 @@ i82563reset(Ctlr* ctlr)
 		ctlr->ra[2*i]   = ctlr->eeprom[i];
 		ctlr->ra[2*i+1] = ctlr->eeprom[i]>>8;
 	}
-	r = csr32r(ctlr, Status)>>2;
-	ctlr->ra[5] += r & 3;		/* ea ctlr[1] = ea ctlr[0]+1 */
+	r = (csr32r(ctlr, Status) & Lanid) >> 2;
+	ctlr->ra[5] += r;		/* ea ctlr[1] = ea ctlr[0]+1 */
 
 	r = ctlr->ra[3]<<24 | ctlr->ra[2]<<16 | ctlr->ra[1]<<8 | ctlr->ra[0];
 	csr32w(ctlr, Ral, r);