Browse Source

Plan 9 from Bell Labs 2003-11-03

David du Colombier 20 years ago
parent
commit
4668c0248d

+ 11 - 2
dist/replica/plan9.db

@@ -2995,6 +2995,14 @@ rc/bin/mapdemo - 775 sys sys 945617207 4075
 rc/bin/membername - 775 sys sys 945617207 89
 rc/bin/mousereset - 775 sys sys 1015089542 37
 rc/bin/nroff - 775 sys sys 945617208 27
+rc/bin/patch - 20000000775 sys sys 1067803227 0
+rc/bin/patch/apply - 775 sys sys 1067804403 1234
+rc/bin/patch/create - 775 sys sys 1067804404 1129
+rc/bin/patch/diff - 775 sys sys 1067804404 466
+rc/bin/patch/list - 775 sys sys 1067804541 321
+rc/bin/patch/note - 664 sys sys 1067804405 593
+rc/bin/patch/okay - 775 sys sys 1067803227 240
+rc/bin/patch/undo - 775 sys sys 1067804405 549
 rc/bin/pc - 20000000775 sys sys 960857447 0
 rc/bin/pc/bootfloppy - 775 sys sys 964455816 439
 rc/bin/pc/bootplan9 - 775 sys sys 960857446 1639
@@ -4600,6 +4608,7 @@ sys/man/1/ns - 664 sys sys 944959677 893
 sys/man/1/p - 664 sys sys 944959673 504
 sys/man/1/page - 664 sys sys 969499885 4870
 sys/man/1/passwd - 664 sys sys 1022163988 2053
+sys/man/1/patch - 664 sys sys 1067804449 2176
 sys/man/1/pcc - 664 sys sys 1015024740 3478
 sys/man/1/pic - 664 sys sys 1022625353 8229
 sys/man/1/pipefile - 664 sys sys 984709628 1861
@@ -5233,7 +5242,7 @@ sys/src/9/pc/etherelnk3.c - 664 sys sys 1063857363 48522
 sys/src/9/pc/etherga620.c - 664 sys sys 1067723192 28788
 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 1067722636 43330
+sys/src/9/pc/etherigbe.c - 664 sys sys 1067792708 42430
 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/ethersink.c - 664 sys sys 1048644103 1076
@@ -5252,7 +5261,7 @@ sys/src/9/pc/l.s - 664 sys sys 1067722634 23586
 sys/src/9/pc/main.c - 664 sys sys 1067722634 14685
 sys/src/9/pc/mem.h - 664 sys sys 1018553448 4573
 sys/src/9/pc/memory.c - 664 sys sys 1032303986 12994
-sys/src/9/pc/mkfile - 664 sys sys 1067722635 3217
+sys/src/9/pc/mkfile - 664 sys sys 1067810339 3219
 sys/src/9/pc/mmu.c - 664 sys sys 1049509456 10014
 sys/src/9/pc/mouse.c - 664 sys sys 1065717607 6625
 sys/src/9/pc/mp.c - 664 sys sys 1048644112 16928

+ 16 - 0
dist/replica/plan9.log

@@ -14135,3 +14135,19 @@
 1067742100 1 a sys/src/cmd/upas/smtp/greylist.c - 664 sys sys 1067741333 5588
 1067742845 0 a sys/src/cmd/jpg/readyuv.c - 664 sys sys 1067742240 3502
 1067746800 0 c sys/src/cmd/vi/stats.c - 664 sys sys 1067746789 5386
+1067794284 0 c sys/src/9/pc/etherigbe.c - 664 sys sys 1067792708 42430
+1067803286 0 a rc/bin/patch - 20000000775 sys sys 1067803227 0
+1067803286 1 a rc/bin/patch/apply - 775 sys sys 1067803226 1214
+1067803286 2 a rc/bin/patch/create - 775 sys sys 1067803226 1119
+1067803286 3 a rc/bin/patch/diff - 775 sys sys 1067803226 441
+1067803286 4 a rc/bin/patch/list - 775 sys sys 1067803227 297
+1067803286 5 a rc/bin/patch/okay - 775 sys sys 1067803227 240
+1067803286 6 a rc/bin/patch/undo - 775 sys sys 1067803227 462
+1067805086 0 c rc/bin/patch/apply - 775 sys sys 1067804403 1234
+1067805086 1 c rc/bin/patch/create - 775 sys sys 1067804404 1129
+1067805086 2 c rc/bin/patch/diff - 775 sys sys 1067804404 466
+1067805086 3 c rc/bin/patch/list - 775 sys sys 1067804541 321
+1067805086 4 a rc/bin/patch/note - 664 sys sys 1067804405 593
+1067805086 5 c rc/bin/patch/undo - 775 sys sys 1067804405 549
+1067805086 6 a sys/man/1/patch - 664 sys sys 1067804449 2176
+1067810488 0 c sys/src/9/pc/mkfile - 664 sys sys 1067810339 3219

+ 74 - 0
rc/bin/patch/apply

@@ -0,0 +1,74 @@
+#!/bin/rc
+
+if(! ~ $#* 1){
+	echo 'usage: patch/apply patch-name' >[1=2]
+	exit usage
+}
+
+if(! test -d /n/sources/patch){
+	rfork n
+	9fs sources
+}
+
+if(! test -d /n/sources/patch/$1){
+	echo 'no such patch' /n/sources/patch/$1 >[1=2]
+	exit nopatch
+}
+
+cd /n/sources/patch/$1 || exit nopatch
+if(! patch/okay .){
+	echo 'bad patch: '$status >[1=2]
+	exit badpatch
+}
+
+if(! echo >.tmp || ! rm .tmp){
+	echo no write permission >[1=2]
+	exit 'no write permission'
+}
+
+echo -n merge... >[1=2]
+fn xxx {
+	ape/diff3 -m $1 $2.orig $2 >$2.new
+	if(grep -s '^<<<<' $2.new){
+		echo conflicts merging $1';' see $d/$2.new >[1=2]
+		
+		touch failed
+	}
+}
+rm -f failed
+cat files | sed 's/^/xxx /' | rc
+if(test -f failed){
+	echo exiting without changes >[1=2]
+	exit failed
+}
+
+echo -n backup... >[1=2]
+fn xxx {
+	# echo cp $1 $2.backup
+	cp $1 $2.backup
+}
+cat files | sed 's/^/xxx /' |rc
+
+echo -n copy... >[1=2]
+fn xxx {
+	# echo cp $2.new $1
+	cp $2.new $1 || touch failed
+}
+cat files | sed 's/^/xxx /' | rc
+
+fn xxx {
+	# echo cp $2.backup $1
+	cp $2.backup $1
+}
+
+if(test -f failed){
+	echo copying failed, restoring backups >[1=2]
+	cat files | sed 's/^/xxx /' | rc
+	exit failed
+}
+
+echo >[1=2]
+
+echo to update sources: >[1=2]
+cat files | awk '{print "	update " $1 }' >[1=2]
+

+ 69 - 0
rc/bin/patch/create

@@ -0,0 +1,69 @@
+#!/bin/rc
+
+if(~ $#* 0 1){
+	echo 'usage: patch/create name file... [< description]' >[1=2]
+	exit usage
+}
+
+if(! echo $1 | grep -s '^[a-z_0-9.\-]+$'){
+	echo bad name
+	exit usage
+}
+
+if(! test -d /n/sources/patch){
+	rfork n
+	9fs sources
+}
+
+d=/n/sources/patch/$1
+if(! mkdir $d){
+	echo mkdir $d/$1 failed >[1=2]
+	exit mkdir
+}
+
+chmod o-w $d
+>$d/readme
+>$d/files
+>$d/notes
+shift
+for(i in $*){
+	i=`{cleanname -d `{pwd} $i}
+	if(! test -f $i){
+		echo error: cannot find $i >[1=2]
+		rm -rf $d
+		exit oops
+	}
+	short=`{basename $i}
+	uniq=$short
+	n=0
+	while(test -f $d/$uniq){
+		uniq=$short.$n
+		n=`{echo 1+$n | hoc}
+	}
+	cp $i $d/$uniq
+	if(test -f /n/sources/plan9/$i){
+		if(cmp -s /n/sources/plan9/$i $i)
+			echo warning: new file $i does not differ from sources >[1=2]
+		cp /n/sources/plan9/$i $d/$uniq.orig
+	}
+	if not
+		echo warning: new file $i not on sources >[1=2]
+	echo $i $uniq >>$d/files
+}
+
+if(~ `{cat /proc/$pid/fd | awk 'NR==2{print $NF}'} */dev/cons){
+	>/dev/consctl {
+		echo holdon
+		cat >$d/readme
+	}
+}
+if not
+	cat >$d/readme
+
+if(! test -s $d/readme){
+	echo 'no description given; aborting' >[1=2]
+	rm -rf $d
+	exit oops
+}
+
+echo $d

+ 29 - 0
rc/bin/patch/diff

@@ -0,0 +1,29 @@
+#!/bin/rc
+
+if(! ~ $#* 1){
+	echo 'usage: patch/diff patch-name' >[1=2]
+	exit usage
+}
+
+if(! test -d /n/sources/patch){
+	rfork n
+	9fs sources
+}
+
+if(! test -d /n/sources/patch/$1){
+	echo 'no such patch' /n/sources/patch/$1 >[1=2]
+	exit nopatch
+}
+
+cd /n/sources/patch/$1 || exit nopatch
+if(! patch/okay .){
+	echo 'bad patch: '$status >[1=2]
+	exit badpatch
+}
+
+d=/n/sources/patch/$1
+fn xxx {
+	echo $1
+	diff -n $2.orig $d/$2 | sed 's/^/	/'
+}
+cat files | sed 's/^/xxx /' |rc

+ 23 - 0
rc/bin/patch/list

@@ -0,0 +1,23 @@
+#!/bin/rc
+
+if(! test -d /n/sources/patch){
+	rfork n
+	9fs sources
+}
+
+cd /n/sources/patch
+if(~ $#* 0)
+	*=(`{ls -t})
+
+for(i in $*){
+	ls -ld $i
+	if(patch/okay $i){
+		cat $i/files | awk '{print "	" $1}'
+		cat $i/readme | sed 's/^/	/;5q'
+		if(test -f $i/notes)
+			cat $i/notes
+	}
+	if not
+		echo '	'bad patch: $status >[2=1]
+}
+

+ 32 - 0
rc/bin/patch/note

@@ -0,0 +1,32 @@
+if(! ~ $#* 1){
+	echo 'usage: patch/note patch-name' >[1=2]
+	exit usage
+}
+
+if(! test -d /n/sources/patch){
+	rfork n
+	9fs sources
+}
+
+if(! test -d /n/sources/patch/$1){
+	echo 'no such patch' /n/sources/patch/$1 >[1=2]
+	exit nopatch
+}
+
+cd /n/sources/patch/$1 || exit nopatch
+if(! patch/okay .){
+	echo 'bad patch: '$status >[1=2]
+	exit badpatch
+}
+
+if(~ `{cat /proc/$pid/fd | awk 'NR==2{print $NF}'} */dev/cons){
+	>/dev/consctl {
+		echo holdon
+		{echo `{date} `{cat /dev/user}
+		cat |sed 's/^/    /'; echo } >>notes
+	}
+}
+if not
+	{echo `{date} `{cat /dev/user}
+	cat |sed 's/^/    /'; echo } >>notes
+

+ 13 - 0
rc/bin/patch/okay

@@ -0,0 +1,13 @@
+#!/bin/rc
+
+if(! ~ $#* 1){
+	echo usage: patch/okay dir >[1=2]
+	exit usage
+}
+
+i=$1
+if(! test -s $i/files || ! test -s $i/readme)
+	exit 'missing files'
+if(grep -v '^/[a-zA-Z0-9.\-+/]+ [a-zA-Z0-9.\-+]+$' $i/files)
+	exit 'bad file list' 
+exit 0

+ 34 - 0
rc/bin/patch/undo

@@ -0,0 +1,34 @@
+#!/bin/rc
+
+if(! ~ $#* 1){
+	echo 'usage: patch/undo patch-name' >[1=2]
+	exit usage
+}
+
+if(! test -d /n/sources/patch){
+	rfork n
+	9fs sources
+}
+
+if(! test -d /n/sources/patch/$1){
+	echo 'no such patch' /n/sources/patch/$1 >[1=2]
+	exit nopatch
+}
+
+d=$1
+cd /n/sources/patch/$1 || exit nopatch
+if(! patch/okay .){
+	echo 'bad patch: '$status >[1=2]
+	exit badpatch
+}
+
+fn xxx {
+	if(cmp $2.new $1){
+		echo cp /n/sources/patch/$d/$2.backup $1
+		cp $2.backup $1
+	}
+	if not
+		echo $1 has changed since patch was applied! >[2=1]
+}
+cat files | sed 's/^/xxx /' |rc
+

+ 113 - 0
sys/man/1/patch

@@ -0,0 +1,113 @@
+.TH PATCH 1
+.SH NAME
+patch \- simple patch creation and tracking system
+.SH SYNOPSIS
+.B patch/create
+.I name
+.I files ...
+[
+.B < 
+.I description
+]
+.PP
+.B patch/list
+[
+.I name ...
+]
+.PP
+.B patch/diff
+.I name
+.PP
+.B patch/apply
+.I name
+.PP
+.B patch/undo
+.I name
+.PP
+.B patch/note
+.I name 
+[
+.B <
+.I note
+]
+.SH DESCRIPTION
+These scripts are a simple patch submission and tracking system
+used to propose additions or changes to Plan 9.
+Each patch has a 
+.I name
+and is stored in
+.BI /n/sources/patch/ name \fR.
+.PP
+.I Patch/create
+creates a new patch consisting of the changes to
+the listed files, reading
+a description of the patch from standard input.
+.PP
+.I Patch/list
+displays information about the named patches,
+or all currently pending patches if none are specified.
+.PP
+.I Patch/diff
+shows a patch as diffs between the original
+source files and the patched source files.
+.PP
+.I Patch/apply
+applies the patch to the current source tree.
+It is intended to be run by the Plan 9 developers 
+with emelie as their root file system.
+If the source has changed since the patch was
+created,
+.I apply
+will report the conflict and not change any files.
+Before changing any files,
+.I patch/apply
+makes backup copies of the current source tree's
+files.  The backups are stored in the patch directory.
+.PP
+.I Patch/undo
+will copy the backups saved by
+.I patch/apply
+back into the source tree.
+It will not restore a backup if the file
+being replaced is not byte-identical to the one
+created by 
+.I patch/apply.
+.SH EXAMPLES
+.PP
+Propose a change to
+.IR pwd ,
+which you have modified locally:
+.EX
+% patch/create pwd-errors /sys/src/cmd/pwd.c
+Fix pwd to print errors to fd 2 rather than 1.
+^D
+% 
+.EE
+.PP
+Then the developers at Bell Labs run
+.EX
+patch/diff pwd-errors
+.EE
+to inspect the change (possibly viewing
+.B /n/sources/patch/pwd-errors/pwd.c
+to see the larger context).
+To make the change, they run
+.EX
+patch/apply pwd-errors
+.EE
+Otherwise they run
+.EX
+% patch/note pwd-errors
+Pwd should definitely print errors to fd 1 because ...
+^D
+% 
+.EE
+to add a note to the 
+.B /n/sources/pwd-errors/notes
+file.
+.SH FILES
+.B /n/sources/patch
+.SH SOURCE
+.B /rc/bin/patch
+.SH SEE ALSO
+.IR diff (1)

+ 30 - 81
sys/src/9/pc/etherigbe.c

@@ -13,15 +13,6 @@
  *	add tuning control via ctl file;
  *	this driver is little-endian specific.
  */
-
-#ifdef FS
-#include "all.h"
-#include "io.h"
-#include "mem.h"
-#include "../ip/ip.h"
-
-#else
-
 #include "u.h"
 #include "../port/lib.h"
 #include "mem.h"
@@ -30,22 +21,10 @@
 #include "io.h"
 #include "../port/error.h"
 #include "../port/netif.h"
-#endif			/* FS */
 
 #include "etherif.h"
 #include "ethermii.h"
-#include "compat.h"
-
-/* from pci.c */
-enum
-{					/* command register (pcidev->pcr) */
-	IOen		= (1<<0),
-	MEMen		= (1<<1),
-	MASen		= (1<<2),
-	MemWrInv	= (1<<4),
-	PErrEn		= (1<<6),
-	SErrEn		= (1<<8),
-};
+
 enum {
 	Ctrl		= 0x00000000,	/* Device Control */
 	Status		= 0x00000008,	/* Device Status */
@@ -194,8 +173,6 @@ enum {					/* EEPROM content offsets */
 	Ea		= 0x00,		/* Ethernet Address */
 	Cf		= 0x03,		/* Compatibility Field */
 	Pba		= 0x08,		/* Printed Board Assembly number */
-	/* in fs kernel, Icw1 is defined in io.h; changed it here */
-#define Icw1 Igbe_icw1
 	Icw1		= 0x0A,		/* Initialization Control Word 1 */
 	Sid		= 0x0B,		/* Subsystem ID */
 	Svid		= 0x0C,		/* Subsystem Vendor ID */
@@ -580,7 +557,6 @@ static char* statistics[Nstatistics] = {
 	"TCP Segmentation Context Fail",
 };
 
-#ifndef FS
 static long
 igbeifstat(Ether* edev, void* a, long n, ulong offset)
 {
@@ -592,8 +568,6 @@ igbeifstat(Ether* edev, void* a, long n, ulong offset)
 	ctlr = edev->ctlr;
 	qlock(&ctlr->slock);
 	p = malloc(2*READSTR);
-	if (p == nil)
-		panic("igbeifstat: no mem");
 	l = 0;
 	for(i = 0; i < Nstatistics; i++){
 		r = csr32r(ctlr, Statistics+i*4);
@@ -704,7 +678,6 @@ igbectl(Ether* edev, void* buf, long n)
 
 	return n;
 }
-#endif		/* FS */
 
 static void
 igbepromiscuous(void* arg, int on)
@@ -744,7 +717,9 @@ igberballoc(void)
 static void
 igberbfree(Block* bp)
 {
-	BLKRESET(bp);
+	bp->rp = bp->lim - Rbsz;
+	bp->wp = bp->rp;
+
 	ilock(&igberblock);
 	bp->next = igberbpool;
 	igberbpool = bp;
@@ -767,14 +742,14 @@ igbelim(void* ctlr)
 }
 
 static void
-igbelproc(PROCARG(void *arg))
+igbelproc(void* arg)
 {
 	Ctlr *ctlr;
 	Ether *edev;
 	MiiPhy *phy;
 	int ctrl, r;
 
-	edev = GETARG(arg);
+	edev = arg;
 	ctlr = edev->ctlr;
 	for(;;){
 		if(ctlr->mii == nil || ctlr->mii->curphy == nil)
@@ -811,7 +786,8 @@ print("lproc status ok\n");
 					ctrl |= Fd;
 			}
 			break;
-		case (0x100E<<16)|0x8086:	/* 82540 */
+		case (0x100E<<16)|0x8086:	/* 82540EM */
+		case (0x101E<<16)|0x8086:	/* 82540EPLP */
 			break;
 		}
 
@@ -859,6 +835,7 @@ igbetxinit(Ctlr* ctlr)
 	case (0x1004<<16)|0x8086:	/* 82543GC */
 	case (0x1008<<16)|0x8086:	/* 82544EI */
 	case (0x100E<<16)|0x8086:	/* 82440EM */
+	case (0x101E<<16)|0x8086:	/* 82540EPLP */
 		r = 8;
 		break;
 	}
@@ -889,7 +866,8 @@ igbetxinit(Ctlr* ctlr)
 	switch(ctlr->id){
 	default:
 		break;
-	case (0x100E<<16)|0x8086:
+	case (0x100E<<16)|0x8086:	/* 82540EM */
+	case (0x101E<<16)|0x8086:	/* 82540EPLP */
 		r = csr32r(ctlr, Txdctl);
 		r &= ~WthreshMASK;
 		r |= Gran|(4<<WthreshSHIFT);
@@ -936,7 +914,7 @@ igbetransmit(Ether* edev)
 	 */
 	tdt = ctlr->tdt;
 	while(NEXT(tdt, ctlr->ntd) != tdh){
-		if((bp = etheroq(edev)) == nil)
+		if((bp = qget(edev->oq)) == nil)
 			break;
 		td = &ctlr->tdba[tdt];
 		td->addr[0] = PCIWADDR(bp->rp);
@@ -1016,6 +994,7 @@ igberxinit(Ctlr* ctlr)
 
 	switch(ctlr->id){
 	case (0x100E<<16)|0x8086:		/* 82540EM */
+	case (0x101E<<16)|0x8086:		/* 82540EPLP */
 		csr32w(ctlr, Radv, 64);
 		break;
 	}
@@ -1034,7 +1013,7 @@ igberim(void* ctlr)
 }
 
 static void
-igberproc(PROCARG(void *arg))
+igberproc(void* arg)
 {
 	Rd *rd;
 	Block *bp;
@@ -1042,7 +1021,7 @@ igberproc(PROCARG(void *arg))
 	int r, rdh;
 	Ether *edev;
 
-	edev = GETARG(arg);
+	edev = arg;
 	ctlr = edev->ctlr;
 
 	igberxinit(ctlr);
@@ -1073,7 +1052,7 @@ igberproc(PROCARG(void *arg))
 			if((rd->status & Reop) && rd->errors == 0){
 				bp = ctlr->rb[rdh];
 				ctlr->rb[rdh] = nil;
-				INCRPTR(bp, rd->length);
+				bp->wp += rd->length;
 				bp->next = nil;
 				if(!(rd->status & Ixsm)){
 					ctlr->ixsm++;
@@ -1083,9 +1062,7 @@ igberproc(PROCARG(void *arg))
 						 * (and valid as errors == 0).
 						 */
 						ctlr->ipcs++;
-#ifndef FS
 						bp->flag |= Bipck;
-#endif
 					}
 					if(rd->status & Tcpcs){
 						/*
@@ -1093,16 +1070,12 @@ igberproc(PROCARG(void *arg))
 						 * (and valid as errors == 0).
 						 */
 						ctlr->tcpcs++;
-#ifndef FS
 						bp->flag |= Btcpck|Budpck;
-#endif
 					}
-#ifndef FS
 					bp->checksum = rd->checksum;
 					bp->flag |= Bpktck;
-#endif
 				}
-				ETHERIQ(edev, bp, 1);
+				etheriq(edev, bp, 1);
 			}
 			else if(ctlr->rb[rdh] != nil){
 				freeb(ctlr->rb[rdh]);
@@ -1147,8 +1120,6 @@ igbeattach(Ether* edev)
 
 	ctlr->rb = malloc(ctlr->nrd*sizeof(Block*));
 	ctlr->tb = malloc(ctlr->ntd*sizeof(Block*));
-	if (ctlr->tb == nil)
-		panic("igbeattach: no mem");
 
 	if(waserror()){
 		while(ctlr->nrb > 0){
@@ -1411,6 +1382,7 @@ igbemii(Ctlr* ctlr)
 		break;
 	case (0x1008<<16)|0x8086:		/* 82544EI*/
 	case (0x100E<<16)|0x8086:		/* 82540EM */
+	case (0x101E<<16)|0x8086:		/* 82540EPLP */
 		ctrl &= ~(Frcdplx|Frcspd);
 		csr32w(ctlr, Ctrl, ctrl);
 		ctlr->mii->mir = igbemiimir;
@@ -1560,6 +1532,7 @@ at93c46r(Ctlr* ctlr)
 		areq = 0;
 		break;
 	case (0x100E<<16)|0x8086:		/* 82540EM */
+	case (0x101E<<16)|0x8086:		/* 82540EPLP */
 		areq = 1;
 		csr32w(ctlr, Eecd, eecd|Areq);
 		for(i = 0; i < 1000; i++){
@@ -1600,22 +1573,20 @@ release:
 static void
 igbedetach(Ctlr* ctlr)
 {
-	int r, s;
+	int r;
 
 	/*
 	 * Perform a device reset to get the chip back to the
 	 * power-on state, followed by an EEPROM reset to read
 	 * the defaults for some internal registers.
 	 */
-	s = splhi();		/* in case reset generates an interrupt */
 	csr32w(ctlr, Imc, ~0);
 	csr32w(ctlr, Rctl, 0);
 	csr32w(ctlr, Tctl, 0);
 
-	delay(100);		/* was 10 */
+	delay(10);
 
 	csr32w(ctlr, Ctrl, Devrst);
-	delay(100);		/* new */
 	while(csr32r(ctlr, Ctrl) & Devrst)
 		;
 
@@ -1627,6 +1598,7 @@ igbedetach(Ctlr* ctlr)
 	default:
 		break;
 	case (0x100E<<16)|0x8086:		/* 82540EM */
+	case (0x101E<<16)|0x8086:		/* 82540EPLP */
 		r = csr32r(ctlr, Manc);
 		r &= ~Arpen;
 		csr32w(ctlr, Manc, r);
@@ -1634,14 +1606,12 @@ igbedetach(Ctlr* ctlr)
 	}
 
 	csr32w(ctlr, Imc, ~0);
-	delay(100);		/* new */
 	while(csr32r(ctlr, Icr))
 		;
-	splx(s);
 }
 
-int
-etherigbereset(Ctlr* ctlr)
+static int
+igbereset(Ctlr* ctlr)
 {
 	int ctrl, i, pause, r, swdpio, txcw;
 
@@ -1770,6 +1740,7 @@ igbepci(void)
 		case (0x1004<<16)|0x8086:	/* 82543GC - copper */
 		case (0x1008<<16)|0x8086:	/* 82544EI - copper */
 		case (0x100E<<16)|0x8086:	/* 82540EM - copper */
+		case (0x101E<<16)|0x8086:	/* 82540EPLP - copper */
 			break;
 		}
 
@@ -1778,46 +1749,27 @@ igbepci(void)
 			print("igbe: can't map %8.8luX\n", p->mem[0].bar);
 			continue;
 		}
-
-		/*
-		 * from etherga620.c:
-		 * If PCI Write-and-Invalidate is enabled set the max write DMA
-		 * value to the host cache-line size (32 on Pentium or later).
-		 */
-		if(p->pcr & MemWrInv){
-			cls = pcicfgr8(p, PciCLS) * 4;
-			if(cls != CACHELINESZ)
-				pcicfgw8(p, PciCLS, CACHELINESZ/4);
-		}
-
 		cls = pcicfgr8(p, PciCLS);
 		switch(cls){
 			default:
-				print("igbe: unexpected CLS - %d bytes\n",
-					cls*sizeof(long));
+				print("igbe: unexpected CLS - %d\n", cls*4);
 				break;
 			case 0x00:
 			case 0xFF:
-				/* alphapc 164lx returns 0 */
-				print("igbe: unusable PciCLS: %d, using %d longs\n",
-					cls, CACHELINESZ/sizeof(long));
-				cls = CACHELINESZ/sizeof(long);
-				pcicfgw8(p, PciCLS, cls);
-				break;
+				print("igbe: unusable CLS\n");
+				continue;
 			case 0x08:
 			case 0x10:
 				break;
 		}
 		ctlr = malloc(sizeof(Ctlr));
-		if (ctlr == nil)
-			panic("ibgepci: no mem");
 		ctlr->port = port;
 		ctlr->pcidev = p;
 		ctlr->id = (p->did<<16)|p->vid;
 		ctlr->cls = cls*4;
 		ctlr->nic = KADDR(ctlr->port);
 
-		if(etherigbereset(ctlr)){
+		if(igbereset(ctlr)){
 			free(ctlr);
 			continue;
 		}
@@ -1867,21 +1819,18 @@ igbepnp(Ether* edev)
 	edev->attach = igbeattach;
 	edev->transmit = igbetransmit;
 	edev->interrupt = igbeinterrupt;
-#ifndef FS
 	edev->ifstat = igbeifstat;
 	edev->ctl = igbectl;
 
 	edev->arg = edev;
 	edev->promiscuous = igbepromiscuous;
-#endif
+
 	return 0;
 }
 
-#ifndef FS
 void
 etherigbelink(void)
 {
 	addethercard("i82543", igbepnp);
 	addethercard("igbe", igbepnp);
 }
-#endif

+ 1 - 1
sys/src/9/pc/mkfile

@@ -75,7 +75,7 @@ $p$CONF.gz: $p$CONF
 
 install:V: $p$CONF $p$CONF.gz
 	cp $p$CONF $p$CONF.gz /$objtype/
-	import lookout / /n/lookout && cp $p$CONF $p$CONF.gz /n/lookout/$objtype/
+	# import lookout / /n/lookout && cp $p$CONF $p$CONF.gz /n/lookout/$objtype/
 
 <../boot/bootmkfile
 <../port/portmkfile