Browse Source

Plan 9 from Bell Labs 2006-04-30

David du Colombier 14 years ago
parent
commit
eb704e2401

+ 12 - 12
dist/replica/_plan9.db

@@ -174,7 +174,7 @@
 386/bin/calendar - 775 sys sys 1144688922 80581
 386/bin/cat - 775 sys sys 1143741965 37482
 386/bin/cb - 775 sys sys 1143777775 77723
-386/bin/cdfs - 775 sys sys 1143777776 167575
+386/bin/cdfs - 775 sys sys 1146338539 167582
 386/bin/cfs - 775 sys sys 1144688922 128366
 386/bin/chgrp - 775 sys sys 1143777776 59617
 386/bin/chmod - 775 sys sys 1143777776 62613
@@ -401,7 +401,7 @@
 386/bin/snap - 775 sys sys 1136346852 313627
 386/bin/snapfs - 775 sys sys 1134389876 388292
 386/bin/sniffer - 775 sys sys 1038443185 99028
-386/bin/snoopy - 775 sys sys 1145033673 183331
+386/bin/snoopy - 775 sys sys 1146338540 183502
 386/bin/sort - 775 sys sys 1143777838 82618
 386/bin/spin - 775 sys sys 1134151359 758520
 386/bin/split - 775 sys sys 1143777838 75981
@@ -411,7 +411,7 @@
 386/bin/ssh - 775 sys sys 1133827764 211090
 386/bin/sshnet - 775 sys sys 1134389877 288327
 386/bin/stats - 775 sys sys 1143777839 190894
-386/bin/strings - 775 sys sys 1143777839 62445
+386/bin/strings - 775 sys sys 1146338540 62457
 386/bin/strip - 775 sys sys 1144264735 80765
 386/bin/sum - 775 sys sys 1143742038 39505
 386/bin/swap - 775 sys sys 1143777840 62468
@@ -5448,7 +5448,7 @@ rc/bin/label - 775 sys sys 945617207 34
 rc/bin/lc - 775 sys sys 945617207 24
 rc/bin/leak - 775 sys sys 1139744263 1052
 rc/bin/lookman - 775 sys sys 1017679344 686
-rc/bin/lp - 775 sys sys 1139839436 5140
+rc/bin/lp - 775 sys sys 1146317617 5154
 rc/bin/mail - 775 sys sys 1045504003 138
 rc/bin/man - 775 sys sys 1138555265 2520
 rc/bin/map - 775 sys sys 945617207 1576
@@ -7740,7 +7740,7 @@ sys/man/8/secstore - 664 sys sys 1105016705 1954
 sys/man/8/securenet - 664 sys sys 954305552 3160
 sys/man/8/send - 664 sys sys 1045501634 2168
 sys/man/8/smtp - 664 sys sys 1133631990 4507
-sys/man/8/snoopy - 664 sys sys 1138463452 4086
+sys/man/8/snoopy - 664 sys sys 1146318297 4288
 sys/man/8/stats - 664 sys sys 1067722908 4291
 sys/man/8/statusbar - 664 sys sys 1141313214 1253
 sys/man/8/stub - 664 sys sys 1044830500 943
@@ -7942,12 +7942,12 @@ sys/src/9/pc/dat.h - 664 sys sys 1142958313 6628
 sys/src/9/pc/devarch.c - 664 sys sys 1143129812 19249
 sys/src/9/pc/devether.c - 664 sys sys 1131290265 10315
 sys/src/9/pc/devfloppy.c - 664 sys sys 1142958305 20139
-sys/src/9/pc/devi82365.c - 664 sys sys 1099761153 20505
+sys/src/9/pc/devi82365.c - 664 sys sys 1146318335 20504
 sys/src/9/pc/devlm78.c - 664 sys sys 1128255048 6291
 sys/src/9/pc/devlml.c - 664 sys sys 1132448361 7502
 sys/src/9/pc/devlml.h - 664 sys sys 1026847636 2948
 sys/src/9/pc/devlpt.c - 664 sys sys 1015014514 4420
-sys/src/9/pc/devpccard.c - 664 sys sys 1141793347 40159
+sys/src/9/pc/devpccard.c - 664 sys sys 1146318335 40443
 sys/src/9/pc/devrtc.c - 664 sys sys 1015014515 7167
 sys/src/9/pc/devtv.c - 664 sys sys 1131290299 45676
 sys/src/9/pc/devusb.c - 664 sys sys 1105193103 18364
@@ -9851,7 +9851,7 @@ sys/src/cmd/cdfs/dat.h - 664 sys sys 1014925665 2334
 sys/src/cmd/cdfs/fns.h - 664 sys sys 969542122 297
 sys/src/cmd/cdfs/main.c - 664 sys sys 1017679316 11040
 sys/src/cmd/cdfs/mkfile - 664 sys sys 959922196 182
-sys/src/cmd/cdfs/mmc.c - 664 sys sys 1143670611 17182
+sys/src/cmd/cdfs/mmc.c - 664 sys sys 1146318348 17198
 sys/src/cmd/cfs - 20000000775 sys sys 1015009266 0
 sys/src/cmd/cfs/bcache.c - 664 sys sys 1014925219 2956
 sys/src/cmd/cfs/bcache.h - 664 sys sys 1014925220 797
@@ -12386,7 +12386,7 @@ sys/src/cmd/ip/rlogind.c - 664 sys sys 1121977161 757
 sys/src/cmd/ip/snoopy - 20000000775 sys sys 1015090062 0
 sys/src/cmd/ip/snoopy/arp.c - 664 sys sys 1128179536 1914
 sys/src/cmd/ip/snoopy/bootp.c - 664 sys sys 1139667382 3442
-sys/src/cmd/ip/snoopy/dat.h - 664 sys sys 1128179536 1915
+sys/src/cmd/ip/snoopy/dat.h - 664 sys sys 1146318302 1933
 sys/src/cmd/ip/snoopy/dhcp.c - 664 sys sys 1138463389 8958
 sys/src/cmd/ip/snoopy/dns.c - 664 sys sys 1144956777 14815
 sys/src/cmd/ip/snoopy/dump.c - 664 sys sys 1138463389 1078
@@ -12403,7 +12403,7 @@ sys/src/cmd/ip/snoopy/icmp6.c - 664 sys sys 1143759343 7726
 sys/src/cmd/ip/snoopy/il.c - 664 sys sys 1139667365 2260
 sys/src/cmd/ip/snoopy/ip.c - 664 sys sys 1128179538 4300
 sys/src/cmd/ip/snoopy/ip6.c - 664 sys sys 1128179538 5371
-sys/src/cmd/ip/snoopy/main.c - 664 sys sys 1138463390 15607
+sys/src/cmd/ip/snoopy/main.c - 664 sys sys 1146318297 15720
 sys/src/cmd/ip/snoopy/mkfile - 664 sys sys 1144955678 889
 sys/src/cmd/ip/snoopy/ninep.c - 664 sys sys 1138463390 555
 sys/src/cmd/ip/snoopy/ospf.c - 664 sys sys 1138463391 7369
@@ -12528,7 +12528,7 @@ sys/src/cmd/look.c - 664 sys sys 944961619 5994
 sys/src/cmd/lp - 20000000775 sys sys 953344617 0
 sys/src/cmd/lp/LOCK.c - 664 sys sys 1015090023 1066
 sys/src/cmd/lp/ipcopen.c - 664 sys sys 944961017 1607
-sys/src/cmd/lp/lp.rc - 775 sys sys 1139839431 5140
+sys/src/cmd/lp/lp.rc - 775 sys sys 1146317617 5154
 sys/src/cmd/lp/lpdaemon.c - 664 sys sys 1032060412 10000
 sys/src/cmd/lp/lpdsend.c - 664 sys sys 1116770113 9583
 sys/src/cmd/lp/lpsend.c - 664 sys sys 1015090024 6180
@@ -13301,7 +13301,7 @@ sys/src/cmd/ssh/sshnet.c - 664 sys sys 1078840016 17641
 sys/src/cmd/ssh/sshserve.c - 664 sys sys 1135487956 5772
 sys/src/cmd/ssh/util.c - 664 sys sys 1063858753 4478
 sys/src/cmd/stats.c - 664 sys sys 1127974208 28128
-sys/src/cmd/strings.c - 664 sys sys 944961364 1216
+sys/src/cmd/strings.c - 664 sys sys 1146317512 1231
 sys/src/cmd/strip.c - 664 sys sys 1131293244 2502
 sys/src/cmd/sum.c - 664 sys sys 1014926615 5548
 sys/src/cmd/swap.c - 664 sys sys 1014926662 1141

+ 12 - 12
dist/replica/plan9.db

@@ -174,7 +174,7 @@
 386/bin/calendar - 775 sys sys 1144688922 80581
 386/bin/cat - 775 sys sys 1143741965 37482
 386/bin/cb - 775 sys sys 1143777775 77723
-386/bin/cdfs - 775 sys sys 1143777776 167575
+386/bin/cdfs - 775 sys sys 1146338539 167582
 386/bin/cfs - 775 sys sys 1144688922 128366
 386/bin/chgrp - 775 sys sys 1143777776 59617
 386/bin/chmod - 775 sys sys 1143777776 62613
@@ -401,7 +401,7 @@
 386/bin/snap - 775 sys sys 1136346852 313627
 386/bin/snapfs - 775 sys sys 1134389876 388292
 386/bin/sniffer - 775 sys sys 1038443185 99028
-386/bin/snoopy - 775 sys sys 1145033673 183331
+386/bin/snoopy - 775 sys sys 1146338540 183502
 386/bin/sort - 775 sys sys 1143777838 82618
 386/bin/spin - 775 sys sys 1134151359 758520
 386/bin/split - 775 sys sys 1143777838 75981
@@ -411,7 +411,7 @@
 386/bin/ssh - 775 sys sys 1133827764 211090
 386/bin/sshnet - 775 sys sys 1134389877 288327
 386/bin/stats - 775 sys sys 1143777839 190894
-386/bin/strings - 775 sys sys 1143777839 62445
+386/bin/strings - 775 sys sys 1146338540 62457
 386/bin/strip - 775 sys sys 1144264735 80765
 386/bin/sum - 775 sys sys 1143742038 39505
 386/bin/swap - 775 sys sys 1143777840 62468
@@ -5448,7 +5448,7 @@ rc/bin/label - 775 sys sys 945617207 34
 rc/bin/lc - 775 sys sys 945617207 24
 rc/bin/leak - 775 sys sys 1139744263 1052
 rc/bin/lookman - 775 sys sys 1017679344 686
-rc/bin/lp - 775 sys sys 1139839436 5140
+rc/bin/lp - 775 sys sys 1146317617 5154
 rc/bin/mail - 775 sys sys 1045504003 138
 rc/bin/man - 775 sys sys 1138555265 2520
 rc/bin/map - 775 sys sys 945617207 1576
@@ -7740,7 +7740,7 @@ sys/man/8/secstore - 664 sys sys 1105016705 1954
 sys/man/8/securenet - 664 sys sys 954305552 3160
 sys/man/8/send - 664 sys sys 1045501634 2168
 sys/man/8/smtp - 664 sys sys 1133631990 4507
-sys/man/8/snoopy - 664 sys sys 1138463452 4086
+sys/man/8/snoopy - 664 sys sys 1146318297 4288
 sys/man/8/stats - 664 sys sys 1067722908 4291
 sys/man/8/statusbar - 664 sys sys 1141313214 1253
 sys/man/8/stub - 664 sys sys 1044830500 943
@@ -7942,12 +7942,12 @@ sys/src/9/pc/dat.h - 664 sys sys 1142958313 6628
 sys/src/9/pc/devarch.c - 664 sys sys 1143129812 19249
 sys/src/9/pc/devether.c - 664 sys sys 1131290265 10315
 sys/src/9/pc/devfloppy.c - 664 sys sys 1142958305 20139
-sys/src/9/pc/devi82365.c - 664 sys sys 1099761153 20505
+sys/src/9/pc/devi82365.c - 664 sys sys 1146318335 20504
 sys/src/9/pc/devlm78.c - 664 sys sys 1128255048 6291
 sys/src/9/pc/devlml.c - 664 sys sys 1132448361 7502
 sys/src/9/pc/devlml.h - 664 sys sys 1026847636 2948
 sys/src/9/pc/devlpt.c - 664 sys sys 1015014514 4420
-sys/src/9/pc/devpccard.c - 664 sys sys 1141793347 40159
+sys/src/9/pc/devpccard.c - 664 sys sys 1146318335 40443
 sys/src/9/pc/devrtc.c - 664 sys sys 1015014515 7167
 sys/src/9/pc/devtv.c - 664 sys sys 1131290299 45676
 sys/src/9/pc/devusb.c - 664 sys sys 1105193103 18364
@@ -9851,7 +9851,7 @@ sys/src/cmd/cdfs/dat.h - 664 sys sys 1014925665 2334
 sys/src/cmd/cdfs/fns.h - 664 sys sys 969542122 297
 sys/src/cmd/cdfs/main.c - 664 sys sys 1017679316 11040
 sys/src/cmd/cdfs/mkfile - 664 sys sys 959922196 182
-sys/src/cmd/cdfs/mmc.c - 664 sys sys 1143670611 17182
+sys/src/cmd/cdfs/mmc.c - 664 sys sys 1146318348 17198
 sys/src/cmd/cfs - 20000000775 sys sys 1015009266 0
 sys/src/cmd/cfs/bcache.c - 664 sys sys 1014925219 2956
 sys/src/cmd/cfs/bcache.h - 664 sys sys 1014925220 797
@@ -12386,7 +12386,7 @@ sys/src/cmd/ip/rlogind.c - 664 sys sys 1121977161 757
 sys/src/cmd/ip/snoopy - 20000000775 sys sys 1015090062 0
 sys/src/cmd/ip/snoopy/arp.c - 664 sys sys 1128179536 1914
 sys/src/cmd/ip/snoopy/bootp.c - 664 sys sys 1139667382 3442
-sys/src/cmd/ip/snoopy/dat.h - 664 sys sys 1128179536 1915
+sys/src/cmd/ip/snoopy/dat.h - 664 sys sys 1146318302 1933
 sys/src/cmd/ip/snoopy/dhcp.c - 664 sys sys 1138463389 8958
 sys/src/cmd/ip/snoopy/dns.c - 664 sys sys 1144956777 14815
 sys/src/cmd/ip/snoopy/dump.c - 664 sys sys 1138463389 1078
@@ -12403,7 +12403,7 @@ sys/src/cmd/ip/snoopy/icmp6.c - 664 sys sys 1143759343 7726
 sys/src/cmd/ip/snoopy/il.c - 664 sys sys 1139667365 2260
 sys/src/cmd/ip/snoopy/ip.c - 664 sys sys 1128179538 4300
 sys/src/cmd/ip/snoopy/ip6.c - 664 sys sys 1128179538 5371
-sys/src/cmd/ip/snoopy/main.c - 664 sys sys 1138463390 15607
+sys/src/cmd/ip/snoopy/main.c - 664 sys sys 1146318297 15720
 sys/src/cmd/ip/snoopy/mkfile - 664 sys sys 1144955678 889
 sys/src/cmd/ip/snoopy/ninep.c - 664 sys sys 1138463390 555
 sys/src/cmd/ip/snoopy/ospf.c - 664 sys sys 1138463391 7369
@@ -12528,7 +12528,7 @@ sys/src/cmd/look.c - 664 sys sys 944961619 5994
 sys/src/cmd/lp - 20000000775 sys sys 953344617 0
 sys/src/cmd/lp/LOCK.c - 664 sys sys 1015090023 1066
 sys/src/cmd/lp/ipcopen.c - 664 sys sys 944961017 1607
-sys/src/cmd/lp/lp.rc - 775 sys sys 1139839431 5140
+sys/src/cmd/lp/lp.rc - 775 sys sys 1146317617 5154
 sys/src/cmd/lp/lpdaemon.c - 664 sys sys 1032060412 10000
 sys/src/cmd/lp/lpdsend.c - 664 sys sys 1116770113 9583
 sys/src/cmd/lp/lpsend.c - 664 sys sys 1015090024 6180
@@ -13301,7 +13301,7 @@ sys/src/cmd/ssh/sshnet.c - 664 sys sys 1078840016 17641
 sys/src/cmd/ssh/sshserve.c - 664 sys sys 1135487956 5772
 sys/src/cmd/ssh/util.c - 664 sys sys 1063858753 4478
 sys/src/cmd/stats.c - 664 sys sys 1127974208 28128
-sys/src/cmd/strings.c - 664 sys sys 944961364 1216
+sys/src/cmd/strings.c - 664 sys sys 1146317512 1231
 sys/src/cmd/strip.c - 664 sys sys 1131293244 2502
 sys/src/cmd/sum.c - 664 sys sys 1014926615 5548
 sys/src/cmd/swap.c - 664 sys sys 1014926662 1141

+ 12 - 0
dist/replica/plan9.log

@@ -29583,3 +29583,15 @@
 1146157218 7 c 386/lib/ape/libfmt.a - 664 sys sys 1146156980 156706
 1146157218 8 c 386/lib/ape/libutf.a - 664 sys sys 1146156980 88500
 1146175223 0 c sys/doc/ape.ms - 664 sys sys 1146174667 12873
+1146317464 0 c sys/src/cmd/strings.c - 664 sys sys 1146317512 1231
+1146319264 0 c rc/bin/lp - 775 sys sys 1146317617 5154
+1146319264 1 c sys/man/8/snoopy - 664 sys sys 1146318297 4288
+1146319264 2 c sys/src/9/pc/devi82365.c - 664 sys sys 1146318335 20504
+1146319264 3 c sys/src/9/pc/devpccard.c - 664 sys sys 1146318335 40443
+1146319264 4 c sys/src/cmd/cdfs/mmc.c - 664 sys sys 1146318348 17198
+1146319264 5 c sys/src/cmd/ip/snoopy/dat.h - 664 sys sys 1146318302 1933
+1146319264 6 c sys/src/cmd/ip/snoopy/main.c - 664 sys sys 1146318297 15720
+1146319264 7 c sys/src/cmd/lp/lp.rc - 775 sys sys 1146317617 5154
+1146339069 0 c 386/bin/cdfs - 775 sys sys 1146338539 167582
+1146339069 1 c 386/bin/snoopy - 775 sys sys 1146338540 183502
+1146339069 2 c 386/bin/strings - 775 sys sys 1146338540 62457

+ 1 - 1
rc/bin/lp

@@ -91,7 +91,7 @@ XOFF=''
 YOFF=''
 
 # Process options
-flagfmt='D,H,L,Q,R,r,q,c copies,d printer,f font.size,i src,k jobnos,l lines,m magnify,n lpages,o pages,u userid,x offset,y offset'
+flagfmt='D,H,L,Q,R,r,q,M mach,c copies,d printer,f font.size,i src,k jobnos,l lines,m magnify,n lpages,o pages,p proc,u userid,x offset,y offset'
 argv0=lp
 
 if(! ifs=() eval `{aux/getflags $*}) {

+ 11 - 0
sys/man/8/snoopy

@@ -6,6 +6,9 @@ snoopy \- spy on network packets
 [
 .B -CDdpst
 ] [
+.B -M
+.I m
+] [
 .B -N
 .I n
 ] [
@@ -136,6 +139,14 @@ this interface will be seen.
 force one output line per packet.  The
 default is multiline.
 .TP
+.B -M
+discard all but the first
+.I m
+bytes of each packet.  The default is to keep the entire packet.
+This option is most useful when writing packets to a file with the
+.B -d
+option.
+.TP
 .B -N
 dump
 .I n

+ 1 - 1
sys/src/9/pc/devi82365.c

@@ -186,7 +186,7 @@ slotena(PCMslot *pp)
 	wrreg(pp, Rigc, 0);
 	delay(100);
 	wrreg(pp, Rigc, Fnotreset);
-	delay(5000);
+	delay(500);
 
 	/* get configuration */
 	slotinfo(pp);

+ 103 - 75
sys/src/9/pc/devpccard.c

@@ -9,6 +9,8 @@
 #include "../port/error.h"
 #include "io.h"
 
+#define DEBUG	0
+
 #define MAP(x,o)	(Rmap + (x)*0x8 + o)
 
 enum {
@@ -53,7 +55,7 @@ typedef struct Variant Variant;
 struct Variant {
 	ushort	vid;
 	ushort	did;
-	char		*name;
+	char	*name;
 };
 
 static Variant variant[] = {
@@ -199,23 +201,23 @@ enum
 typedef struct Cisdat Cisdat;
 struct Cisdat {
 	uchar		*cisbase;
-	int			cispos;
-	int			cisskip;
-	int			cislen;
+	int		cispos;
+	int		cisskip;
+	int		cislen;
 };
 
 typedef struct Pcminfo Pcminfo;
 struct Pcminfo {
-	char			verstr[512];		/* Version string */
+	char		verstr[512];		/* Version string */
 	PCMmap		mmap[4];		/* maps, last is always for the kernel */
 	ulong		conf_addr;		/* Config address */
-	uchar		conf_present;	/* Config register present */
-	int			nctab;			/* In use configuration tables */
+	uchar		conf_present;		/* Config register present */
+	int		nctab;			/* In use configuration tables */
 	PCMconftab	ctab[8];		/* Configuration tables */
 	PCMconftab	*defctab;		/* Default conftab */
 
-	int			port;			/* Actual port usage */
-	int			irq;			/* Actual IRQ usage */
+	int		port;			/* Actual port usage */
+	int		irq;			/* Actual IRQ usage */
 };
 
 typedef struct Cardbus Cardbus;
@@ -224,18 +226,18 @@ struct Cardbus {
 	Variant		*variant;		/* Which CardBus chipset */
 	Pcidev		*pci;			/* The bridge itself */
 	ulong		*regs;			/* Cardbus registers */
-	int			ltype;			/* Legacy type */
-	int			lindex;		/* Legacy port index address */
-	int			ldata;			/* Legacy port data address */
-	int			lbase;			/* Base register for this socket */
+	int		ltype;			/* Legacy type */
+	int		lindex;			/* Legacy port index address */
+	int		ldata;			/* Legacy port data address */
+	int		lbase;			/* Base register for this socket */
 
-	int			state;			/* Current state of card */
-	int			type;			/* Type of card */
+	int		state;			/* Current state of card */
+	int		type;			/* Type of card */
 	Pcminfo		linfo;			/* PCMCIA slot info */
 
-	int			special;		/* card is allocated to a driver */
+	int		special;		/* card is allocated to a driver */
 
-	int			refs;			/* Number of refs to slot */
+	int		refs;			/* Number of refs to slot */
 	Lock		refslock;		/* inc/dev ref lock */
 };
 
@@ -323,7 +325,7 @@ enum {
 
 static char *states[] = {
 [SlotEmpty]		"SlotEmpty",
-[SlotFull]			"SlotFull",
+[SlotFull]		"SlotFull",
 [SlotPowered]		"SlotPowered",
 [SlotConfigured]	"SlotConfigured",
 };
@@ -331,8 +333,9 @@ static char *states[] = {
 static void
 engine(Cardbus *cb, int message)
 {
-	//print("engine(%d): %s(%s)\n", 
-	//	 (int)(cb - cbslots), states[cb->state], messages[message]);
+	if(DEBUG)
+		print("engine(%ld): %s(%s)\n", cb - cbslots,
+			states[cb->state], messages[message]);
 	switch (cb->state) {
 	case SlotEmpty:
 
@@ -344,8 +347,9 @@ engine(Cardbus *cb, int message)
 		case CardEjected:
 			break;
 		default:
-			//print("#Y%d: Invalid message %s in SlotEmpty state\n",
-			//	(int)(cb - cbslots), messages[message]);
+			if(DEBUG)
+				print("#Y%ld: Invalid message %s in SlotEmpty state\n",
+					cb - cbslots, messages[message]);
 			break;
 		}
 		break;
@@ -362,8 +366,9 @@ engine(Cardbus *cb, int message)
 			powerdown(cb);
 			break;
 		default:
-			//print("#Y%d: Invalid message %s in SlotFull state\n",
-			//	(int)(cb - cbslots), messages[message]);
+			if(DEBUG)
+				print("#Y%ld: Invalid message %s in SlotFull state\n",
+					cb - cbslots, messages[message]);
 			break;
 		}
 		break;
@@ -380,8 +385,8 @@ engine(Cardbus *cb, int message)
 			powerdown(cb);
 			break;
 		default:
-			//print("#Y%d: Invalid message %s in SlotPowered state\n",
-			//	(int)(cb - cbslots), messages[message]);
+			print("#Y%ld: Invalid message %s in SlotPowered state\n",
+				cb - cbslots, messages[message]);
 			break;
 		}
 		break;
@@ -395,8 +400,9 @@ engine(Cardbus *cb, int message)
 			powerdown(cb);
 			break;
 		default:
-			//print("#Y%d: Invalid message %s in SlotConfigured state\n",
-			//	(int)(cb - cbslots), messages[message]);
+			if(DEBUG)
+				print("#Y%ld: Invalid message %s in SlotConfigured state\n",
+					cb - cbslots, messages[message]);
 			break;
 		}
 		break;
@@ -478,12 +484,15 @@ cbinterrupt(Ureg *, void *)
 		Cardbus *cb = &cbslots[i];
 		ulong event, state;
 
-		event= cb->regs[SocketEvent];
+		event = cb->regs[SocketEvent];
+		if(!(event & (SE_POWER|SE_CCD)))
+			continue;
 		state = cb->regs[SocketState];
 		rdreg(cb, Rcsc);	/* Ack the interrupt */
 
-		//print("interrupt: slot %d, event %.8lX, state %.8lX, (%s)\n", 
-		//	(int)(cb - cbslots), event, state, states[cb->state]);
+		if(DEBUG)
+			print("#Y%ld: interrupt: event %.8lX, state %.8lX, (%s)\n", 
+				cb - cbslots, event, state, states[cb->state]);
 
 		if (event & SE_CCD) {
 			cb->regs[SocketEvent] |= SE_CCD;	/* Ack interrupt */
@@ -537,6 +546,8 @@ devpccardlink(void)
 		int slot;
 		uchar pin;
 
+		if(pci->ccrb != 6 || pci->ccru != 7)
+			continue;
 		for (i = 0; i != nelem(variant); i++)
 			if (pci->vid == variant[i].vid && pci->did == variant[i].did)
 				break;
@@ -579,7 +590,7 @@ devpccardlink(void)
 			pcicfgw8(pci, PciINTL, pci->intl);
 
 			if (pci->intl == 0xff || pci->intl == 0)
-				print("#Y%d: No interrupt?\n", (int)(cb - cbslots));
+				print("#Y%ld: No interrupt?\n", cb - cbslots);
 		}
 
 		// Don't you love standards!
@@ -615,6 +626,12 @@ devpccardlink(void)
 			
 			pcicfgw16(cb->pci, PciPMC, pcicfgr16(cb->pci, PciPMC) & ~3);
 		}
+		if (pci->vid == O2_vid) {
+			if(DEBUG)
+				print("writing O2 config\n");
+			pcicfgw8(cb->pci, 0x94, 0xCA);
+			pcicfgw8(cb->pci, 0xD4, 0xCA);
+		}
 
 		if (intl != -1 && intl != pci->intl)
 			intrenable(pci->intl, cbinterrupt, cb, pci->tbdf, "cardbus");
@@ -663,7 +680,7 @@ devpccardlink(void)
 			engine(cb, CardPowered);
 
 		/* Ack and enable interrupts on all events */
-		// cb->regs[SocketEvent] = cb->regs[SocketEvent];
+		//cb->regs[SocketEvent] = cb->regs[SocketEvent];
 		cb->regs[SocketMask] |= 0xF;	
 		wrreg(cb, Rcscic, 0xC);
 	}
@@ -677,8 +694,9 @@ powerup(Cardbus *cb)
 
 	state = cb->regs[SocketState];
 	if (state & SS_PC16) {
-	
-		// print("#Y%ld: Probed a PC16 card, powering up card\n", cb - cbslots);
+		if(DEBUG)
+			print("#Y%ld: Probed a PC16 card, powering up card\n",
+				cb - cbslots);
 		cb->type = PC16;
 		memset(&cb->linfo, 0, sizeof(Pcminfo));
 
@@ -697,7 +715,7 @@ powerup(Cardbus *cb)
 		return 0;
 
 	if (state & SS_NOTCARD) {
-		print("#Y%ld: Not a card inserted\n", cb - cbslots);
+		print("#Y%ld: No card inserted\n", cb - cbslots);
 		return 0;
 	}
 
@@ -708,9 +726,10 @@ powerup(Cardbus *cb)
 		return 0;
 	}
 
-	//print("#Y%ld: card %spowered at %d volt\n", cb - cbslots, 
-	//	(state & SS_POWER)? "": "not ", 
-	//	(state & SS_3V)? 3: (state & SS_5V)? 5: -1);
+	if(DEBUG)
+		print("#Y%ld: card %spowered at %d volt\n", cb - cbslots, 
+			(state & SS_POWER)? "": "not ", 
+			(state & SS_3V)? 3: (state & SS_5V)? 5: -1);
 
 	/* Power up the card
 	 * and make sure the secondary bus is not in reset.
@@ -722,7 +741,8 @@ powerup(Cardbus *cb)
 	pcicfgw16(cb->pci, PciBCR, bcr);
 	delay(100);
 
-	cb->type = (state & SS_PC16)? PC16: PC32;
+	cb->type = PC32;
+
 	return 1;
 }
 
@@ -750,10 +770,13 @@ powerdown(Cardbus *cb)
 static void
 configure(Cardbus *cb)
 {
-	int i;
 	Pcidev *pci;
+	ulong size, bar;
+	int i, ioindex, memindex, r;
 
-	//print("configuring slot %d (%s)\n", (int)(cb - cbslots), states[cb->state]);
+	if(DEBUG)
+		print("configuring slot %ld (%s)\n",
+			cb - cbslots, states[cb->state]);
 	if (cb->state == SlotConfigured)
 		return;
 	engine(cb, CardConfigured);
@@ -769,19 +792,21 @@ configure(Cardbus *cb)
 	pciscan(pcicfgr8(cb->pci, PciSBN), &cb->pci->bridge);
 	pci = cb->pci->bridge;
 	while (pci) {
-		ulong size, bar;
-		int memindex, ioindex;
-
-		pcicfgw16(pci, PciPCR, 
-				pcicfgr16(pci, PciPCR) & ~(PciPCR_IO|PciPCR_MEM));
-
-		/* Treat the found device as an ordinary PCI card.  It seems that the 
-		     CIS is not always present in CardBus cards.  XXX, need to support 
-		     multifunction cards */
+		r = pcicfgr16(pci, PciPCR);
+		r &= ~(PciPCR_IO|PciPCR_MEM);
+		pcicfgw16(pci, PciPCR, r);
+
+		/*
+		 * Treat the found device as an ordinary PCI card.
+		 * It seems that the CIS is not always present in
+		 * CardBus cards.
+		 * XXX, need to support multifunction cards
+		 */
 		memindex = ioindex = 0;
 		for (i = 0; i != Nbars; i++) {
 
-			if (pci->mem[i].size == 0) continue;
+			if (pci->mem[i].size == 0)
+				continue;
 			if (pci->mem[i].bar & 1) {
 
 				// Allocate I/O space
@@ -797,8 +822,9 @@ configure(Cardbus *cb)
 				pcicfgw16(cb->pci, PciCBIBR0 + ioindex * 8, bar);
 				pcicfgw16(cb->pci, PciCBILR0 + ioindex * 8, 
 						 bar + pci->mem[i].size - 1);
-				//print("ioindex[%d] %.8uX (%d)\n", 
-				//	ioindex, bar, pci->mem[i].size);
+				if(DEBUG)
+					print("ioindex[%d] %.8luX (%d)\n", 
+						ioindex, bar, pci->mem[i].size);
 				ioindex++;
 				continue;
 			}
@@ -816,14 +842,16 @@ configure(Cardbus *cb)
 			pcicfgw32(cb->pci, PciCBMLR0 + memindex * 8, 
 					  bar + pci->mem[i].size - 1);
 
-			if (pci->mem[i].bar & 0x80)
+			if (pci->mem[i].bar & 0x80) {
 				/* Enable prefetch */
-				pcicfgw16(cb->pci, PciBCR, 
-						 pcicfgr16(cb->pci, PciBCR) | 
-							          (1 << (8 + memindex)));
+				r = pcicfgr16(cb->pci, PciBCR);
+				r |= 1 << (8 + memindex);
+				pcicfgw16(cb->pci, PciBCR, r);
+			}
 
-			//print("memindex[%d] %.8uX (%d)\n", 
-			//	  memindex, bar, pci->mem[i].size);
+			if(DEBUG)
+				print("memindex[%d] %.8luX (%d)\n", 
+					  memindex, bar, pci->mem[i].size);
 			memindex++;
 		}
 
@@ -845,7 +873,8 @@ configure(Cardbus *cb)
 		}
 
 		/* Set the basic PCI registers for the device */
-		pci->pcr = pcicfgr16(pci, PciPCR) | PciPCR_IO|PciPCR_MEM|PciPCR_Master;
+		pci->pcr = pcicfgr16(pci, PciPCR);
+		pci->pcr |= PciPCR_IO|PciPCR_MEM|PciPCR_Master;
 		pci->cls = 8;
 		pci->ltr = 64;
 		pcicfgw16(pci, PciPCR, pci->pcr);
@@ -869,7 +898,7 @@ static void
 unconfigure(Cardbus *cb)
 {
 	Pcidev *pci;
-	int i, ioindex, memindex;
+	int i, ioindex, memindex, r;
 
 	if (cb->type == PC16) {
 		print("#Y%d: Don't know how to unconfigure a PC16 card\n",
@@ -889,7 +918,8 @@ unconfigure(Cardbus *cb)
 		Pcidev *_pci;
 
 		for (i = 0; i != Nbars; i++) {
-			if (pci->mem[i].size == 0) continue;
+			if (pci->mem[i].size == 0)
+				continue;
 			if (pci->mem[i].bar & 1) {
 				iofree(pci->mem[i].bar & ~1);
 				pcicfgw16(cb->pci, PciCBIBR0 + ioindex * 8, 
@@ -900,19 +930,17 @@ unconfigure(Cardbus *cb)
 			}
 
 			upafree(pci->mem[i].bar & ~0xF, pci->mem[i].size);
-			pcicfgw32(cb->pci, PciCBMBR0 + memindex * 8, 
-				          (ulong)-1);
+			pcicfgw32(cb->pci, PciCBMBR0 + memindex * 8, (ulong)-1);
 			pcicfgw32(cb->pci, PciCBMLR0 + memindex * 8, 0);
-			pcicfgw16(cb->pci, PciBCR, 
-					 pcicfgr16(cb->pci, PciBCR) & 
-							       ~(1 << (8 + memindex)));
+			r = pcicfgr16(cb->pci, PciBCR);
+			r &= ~(1 << (8 + memindex));
+			pcicfgw16(cb->pci, PciBCR, r);
 			memindex++;
 		}
 
 		if (pci->rom.bar && memindex < 2) {
 			upafree(pci->rom.bar & ~0xF, pci->rom.size);
-			pcicfgw32(cb->pci, PciCBMBR0 + memindex * 8, 
-					  (ulong)-1);
+			pcicfgw32(cb->pci, PciCBMBR0 + memindex * 8, (ulong)-1);
 			pcicfgw32(cb->pci, PciCBMLR0 + memindex * 8, 0);
 			memindex++;
 		}
@@ -1000,7 +1028,8 @@ pccard_pcmspecial(char *idstr, ISAConf *isa)
 	}
 
 	if (i == nslots) {
-		// print("#Y: %s not found\n", idstr);
+		//if(DEBUG)
+		//	print("#Y: %s not found\n", idstr);
 		return -1;
 	}
 
@@ -1143,7 +1172,7 @@ pccard_pcmspecial(char *idstr, ISAConf *isa)
 	pi->irq = isa->irq;
 	unlock(cb);
 
-	print("#Y%d: %s irq %d, port %lX\n", (int)(cb - cbslots), pi->verstr, isa->irq, isa->port);
+	print("#Y%ld: %s irq %d, port %lX\n", cb - cbslots, pi->verstr, isa->irq, isa->port);
 	return (int)(cb - cbslots);
 }
 
@@ -1731,10 +1760,10 @@ timing(Cisdat *cis, PCMconftab *ct)
 		ct->maxwait = ttiming(cis, i);		/* max wait */
 	i = (c>>2)&0x7;
 	if(i != 7)
-		ct->readywait = ttiming(cis, i);		/* max ready/busy wait */
+		ct->readywait = ttiming(cis, i);	/* max ready/busy wait */
 	i = (c>>5)&0x7;
 	if(i != 7)
-		ct->otherwait = ttiming(cis, i);		/* reserved wait */
+		ct->otherwait = ttiming(cis, i);	/* reserved wait */
 }
 
 static void
@@ -1945,4 +1974,3 @@ vcode(int volt)
 		return 0;
 	}
 }
-

+ 2 - 1
sys/src/cmd/cdfs/mmc.c

@@ -630,7 +630,8 @@ mmcread(Buf *buf, void *v, long nblock, long off)
 	n = nblock*bs;
 	nn = scsi(drive, cmd, sizeof(cmd), v, n, Sread);
 	if(nn != n) {
-		werrstr("short read %ld/%ld", nn, n);
+		if(nn != -1)
+			werrstr("short read %ld/%ld", nn, n);
 		if(vflag)
 			print("read off %lud nblock %ld bs %d failed\n", off, nblock, bs);
 		return -1;

+ 1 - 0
sys/src/cmd/ip/snoopy/dat.h

@@ -97,6 +97,7 @@ extern void	compile_cmp(char*, Filter*, Field*);
 extern void	demux(Mux*, ulong, ulong, Msg*, Proto*);
 extern int	defaultframer(int, uchar*, int);
 
+extern int Mflag;
 extern int Nflag;
 extern int dflag;
 extern int Cflag;

+ 7 - 0
sys/src/cmd/ip/snoopy/main.c

@@ -11,6 +11,7 @@
 int Cflag;
 int pflag;
 int Nflag;
+int Mflag;
 int sflag;
 int tiflag;
 int toflag;
@@ -88,6 +89,10 @@ main(int argc, char **argv)
 		printhelp(ARGF());
 		exits(0);
 		break;
+	case 'M':
+		p = EARGF(usage());
+		Mflag = atoi(p);
+		break;
 	case 'N':
 		p = EARGF(usage());
 		Nflag = atoi(p);
@@ -310,6 +315,8 @@ tracepkt(uchar *ps, int len)
 {
 	struct pcap_pkthdr *goo;
 
+	if(Mflag && len > Mflag)
+		len = Mflag;
 	if(pcap){
 		goo = (struct pcap_pkthdr*)(ps-16);
 		goo->ts = pkttime;

+ 1 - 1
sys/src/cmd/lp/lp.rc

@@ -91,7 +91,7 @@ XOFF=''
 YOFF=''
 
 # Process options
-flagfmt='D,H,L,Q,R,r,q,c copies,d printer,f font.size,i src,k jobnos,l lines,m magnify,n lpages,o pages,u userid,x offset,y offset'
+flagfmt='D,H,L,Q,R,r,q,M mach,c copies,d printer,f font.size,i src,k jobnos,l lines,m magnify,n lpages,o pages,p proc,u userid,x offset,y offset'
 argv0=lp
 
 if(! ifs=() eval `{aux/getflags $*}) {

+ 3 - 3
sys/src/cmd/strings.c

@@ -81,8 +81,8 @@ stringit(char *str)
 int
 isprint(Rune r)
 {
-	if ((r >= ' ' && r <0x7f) || r > 0xA0)
+	if (r != Runeerror)
+	if ((r >= ' ' && r < 0x7F) || r > 0xA0)
 		return 1;
-	else
-		return 0;
+	return 0;
 }