Browse Source

Plan 9 from Bell Labs 2006-09-11

David du Colombier 17 years ago
parent
commit
a4e2ec0999

+ 41 - 38
dist/replica/_plan9.db

@@ -15,7 +15,7 @@
 386/_9pcdisk.gz - 664 sys sys 1039764191 695837
 386/bin - 20000000775 sys sys 1018897690 0
 386/bin/8a - 775 sys sys 1148500566 116698
-386/bin/8c - 775 sys sys 1148500566 365445
+386/bin/8c - 775 sys sys 1157916201 365445
 386/bin/8l - 775 sys sys 1148500567 115711
 386/bin/9660srv - 775 sys sys 1148500567 104375
 386/bin/aan - 775 sys sys 1148500568 131392
@@ -275,7 +275,7 @@
 386/bin/history - 775 sys sys 1148500644 75799
 386/bin/hoc - 775 sys sys 1155491751 100190
 386/bin/html2ms - 775 sys sys 1148500645 66415
-386/bin/htmlfmt - 775 sys sys 1155491752 163435
+386/bin/htmlfmt - 775 sys sys 1157916202 163475
 386/bin/htmlroff - 775 sys sys 1157138536 148544
 386/bin/ico - 775 sys sys 1155491752 162226
 386/bin/iconv - 775 sys sys 1150062738 113723
@@ -284,7 +284,7 @@
 386/bin/iostats - 775 sys sys 1148500650 100476
 386/bin/ip - 20000000775 sys sys 1016920851 0
 386/bin/ip/dhcpclient - 775 sys sys 1148500650 94471
-386/bin/ip/dhcpd - 775 sys sys 1148500651 150757
+386/bin/ip/dhcpd - 775 sys sys 1157916202 150774
 386/bin/ip/dhcpleases - 775 sys sys 1148500652 86543
 386/bin/ip/ftpd - 775 sys sys 1148500653 170760
 386/bin/ip/gizzard - 775 sys sys 1081480408 101521
@@ -301,18 +301,18 @@
 386/bin/ip/httpd/wikipost - 775 sys sys 1148500658 115002
 386/bin/ip/httpfile - 775 sys sys 1148500659 284317
 386/bin/ip/imap4d - 775 sys sys 1156976707 238121
-386/bin/ip/ipconfig - 775 sys sys 1148500661 139400
+386/bin/ip/ipconfig - 775 sys sys 1157916203 139417
 386/bin/ip/ping - 775 sys sys 1148500661 76814
 386/bin/ip/ppp - 775 sys sys 1148500662 220485
 386/bin/ip/pppoe - 775 sys sys 1148500662 77881
 386/bin/ip/pptp - 775 sys sys 1148500663 127269
 386/bin/ip/pptpd - 775 sys sys 1148500663 126202
-386/bin/ip/rarpd - 775 sys sys 1148500663 113122
+386/bin/ip/rarpd - 775 sys sys 1157916204 113139
 386/bin/ip/rexexec - 775 sys sys 1148500664 90309
 386/bin/ip/rip - 775 sys sys 1148500664 91551
 386/bin/ip/rlogind - 775 sys sys 1148500664 67748
 386/bin/ip/telnetd - 775 sys sys 1148500664 123413
-386/bin/ip/tftpd - 775 sys sys 1148500665 132120
+386/bin/ip/tftpd - 775 sys sys 1157916204 132137
 386/bin/ip/traceroute - 775 sys sys 1148500665 74067
 386/bin/ip/udpecho - 775 sys sys 1148500666 43190
 386/bin/join - 775 sys sys 1148500666 114393
@@ -337,13 +337,13 @@
 386/bin/mug - 775 sys sys 1157570246 176473
 386/bin/mv - 775 sys sys 1148500673 65825
 386/bin/ndb - 20000000775 sys sys 985743147 0
-386/bin/ndb/cs - 775 sys sys 1148500674 150956
+386/bin/ndb/cs - 775 sys sys 1157916205 150973
 386/bin/ndb/csquery - 775 sys sys 1148500674 61796
-386/bin/ndb/dns - 775 sys sys 1148500675 247338
-386/bin/ndb/dnsdebug - 775 sys sys 1148500676 221817
+386/bin/ndb/dns - 775 sys sys 1157916207 247355
+386/bin/ndb/dnsdebug - 775 sys sys 1157916208 221834
 386/bin/ndb/dnsquery - 775 sys sys 1148500676 63964
-386/bin/ndb/dnstcp - 775 sys sys 1148500676 220785
-386/bin/ndb/ipquery - 775 sys sys 1148500677 97031
+386/bin/ndb/dnstcp - 775 sys sys 1157916209 220802
+386/bin/ndb/ipquery - 775 sys sys 1157916209 97048
 386/bin/ndb/mkdb - 775 sys sys 1148500677 64305
 386/bin/ndb/mkhash - 775 sys sys 1148500677 84874
 386/bin/ndb/mkhosts - 775 sys sys 1148500677 85917
@@ -556,7 +556,7 @@
 386/lib/libflate.a - 664 sys sys 1143777862 76726
 386/lib/libframe.a - 664 sys sys 1147712341 66398
 386/lib/libgeometry.a - 664 sys sys 1143777862 50470
-386/lib/libhtml.a - 664 sys sys 1155491762 229486
+386/lib/libhtml.a - 664 sys sys 1157916211 229650
 386/lib/libhttpd.a - 664 sys sys 1153069071 99458
 386/lib/libip.a - 664 sys sys 1143777863 35576
 386/lib/libl.a - 664 sys sys 1143777863 5372
@@ -564,7 +564,7 @@
 386/lib/libmemdraw.a - 664 sys sys 1143777866 284092
 386/lib/libmemlayer.a - 664 sys sys 1143777866 47360
 386/lib/libmp.a - 664 sys sys 1144169680 79980
-386/lib/libndb.a - 664 sys sys 1144256044 64436
+386/lib/libndb.a - 664 sys sys 1157916211 64470
 386/lib/libplumb.a - 664 sys sys 1143777866 19408
 386/lib/libregexp.a - 664 sys sys 1143777866 37438
 386/lib/libscribble.a - 664 sys sys 1143777867 107238
@@ -5184,7 +5184,7 @@ lib/kana - 664 sys sys 944943772 1061
 lib/katakana - 664 sys sys 944943772 982
 lib/keyboard - 664 sys sys 1102595267 26057
 lib/mammals - 664 sys sys 944943772 27760
-lib/namespace - 664 sys sys 1060354451 590
+lib/namespace - 664 sys sys 1157899562 593
 lib/namespace.ftp - 664 sys sys 1020313578 373
 lib/namespace.httpd - 664 sys sys 984695868 1209
 lib/ndb - 20000000775 sys sys 959260770 0
@@ -7605,7 +7605,7 @@ sys/man/4/execnet - 664 sys sys 1019866708 1069
 sys/man/4/exportfs - 664 sys sys 1145881912 4655
 sys/man/4/ext2srv - 664 sys sys 1055692986 2409
 sys/man/4/factotum - 664 sys sys 1131294573 14841
-sys/man/4/fossil - 664 sys sys 1112368411 9546
+sys/man/4/fossil - 664 sys sys 1157864806 9575
 sys/man/4/fs - 664 sys sys 1019058716 3387
 sys/man/4/ftpfs - 664 sys sys 1112563349 4410
 sys/man/4/httpfile - 664 sys sys 1128556957 1233
@@ -7621,7 +7621,7 @@ sys/man/4/nntpfs - 664 sys sys 1032632346 2771
 sys/man/4/paqfs - 664 sys sys 1017723482 1541
 sys/man/4/plumber - 664 sys sys 944959699 2748
 sys/man/4/ramfs - 664 sys sys 1127393035 1447
-sys/man/4/ratfs - 664 sys sys 1017423722 3272
+sys/man/4/ratfs - 664 sys sys 1157898800 3276
 sys/man/4/rdbfs - 664 sys sys 944959699 1123
 sys/man/4/rio - 664 sys sys 1023206844 8660
 sys/man/4/sacfs - 664 sys sys 964886843 907
@@ -9845,7 +9845,7 @@ sys/src/cmd/cc/compat.c - 664 sys sys 1132451523 454
 sys/src/cmd/cc/dcl.c - 664 sys sys 1143759352 27003
 sys/src/cmd/cc/dpchk.c - 664 sys sys 1107365037 7152
 sys/src/cmd/cc/funct.c - 664 sys sys 984718510 6167
-sys/src/cmd/cc/lex.c - 664 sys sys 1143759352 24189
+sys/src/cmd/cc/lex.c - 664 sys sys 1157898973 24195
 sys/src/cmd/cc/lexbody - 664 sys sys 1131293457 9188
 sys/src/cmd/cc/mac.c - 664 sys sys 944960808 36
 sys/src/cmd/cc/macbody - 664 sys sys 1144689980 12205
@@ -13138,7 +13138,7 @@ sys/src/cmd/rio/data.c - 664 sys sys 1142015551 6169
 sys/src/cmd/rio/fns.h - 664 sys sys 1039133251 1065
 sys/src/cmd/rio/fsys.c - 664 sys sys 1019678647 13259
 sys/src/cmd/rio/mkfile - 664 sys sys 1111249068 431
-sys/src/cmd/rio/rio.c - 664 sys sys 1142289011 22866
+sys/src/cmd/rio/rio.c - 664 sys sys 1157899815 22866
 sys/src/cmd/rio/scrl.c - 664 sys sys 1014926357 3245
 sys/src/cmd/rio/time.c - 664 sys sys 1014926357 1829
 sys/src/cmd/rio/util.c - 664 sys sys 1014926357 2061
@@ -14075,7 +14075,7 @@ sys/src/cmd/upas/smtp/rfc822.y - 664 sys sys 1064589606 13417
 sys/src/cmd/upas/smtp/rmtdns.c - 664 sys sys 1015013150 1069
 sys/src/cmd/upas/smtp/smtp.c - 664 sys sys 1143759341 20123
 sys/src/cmd/upas/smtp/smtp.h - 664 sys sys 1108827986 1270
-sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1149083996 31606
+sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1157922094 31680
 sys/src/cmd/upas/smtp/smtpd.h - 664 sys sys 1067722781 1111
 sys/src/cmd/upas/smtp/smtpd.y - 664 sys sys 1143670612 6961
 sys/src/cmd/upas/smtp/spam.c - 664 sys sys 1139699502 10238
@@ -14304,7 +14304,7 @@ sys/src/cmd/webfs/http.c - 664 sys sys 1155363881 9305
 sys/src/cmd/webfs/io.c - 664 sys sys 1034736588 1384
 sys/src/cmd/webfs/main.c - 664 sys sys 1128664462 1083
 sys/src/cmd/webfs/mkfile - 664 sys sys 1032665986 340
-sys/src/cmd/webfs/plumb.c - 664 sys sys 1015090008 2761
+sys/src/cmd/webfs/plumb.c - 664 sys sys 1157900012 2811
 sys/src/cmd/webfs/url.c - 664 sys sys 1128664462 24144
 sys/src/cmd/webfs/util.c - 664 sys sys 1015015823 1211
 sys/src/cmd/webfs/webget.c - 664 sys sys 1124711795 1589
@@ -14332,23 +14332,23 @@ sys/src/fs/9netics32.16k - 20000000775 sys sys 1140158691 0
 sys/src/fs/9netics32.16k/9net32.16kfs.c - 664 sys sys 1140167903 3208
 sys/src/fs/9netics32.16k/dat.h - 664 sys sys 1140167904 612
 sys/src/fs/9netics32.16k/fns.h - 664 sys sys 1141028463 2127
-sys/src/fs/9netics32.16k/io.h - 664 sys sys 1097661949 6688
+sys/src/fs/9netics32.16k/io.h - 664 sys sys 1157939328 6720
 sys/src/fs/9netics32.16k/mem.h - 664 sys sys 1140167906 2907
-sys/src/fs/9netics32.16k/mkfile - 664 sys sys 1141020616 1629
+sys/src/fs/9netics32.16k/mkfile - 664 sys sys 1157938805 1644
 sys/src/fs/9netics64.8k - 20000000775 sys sys 1140158692 0
 sys/src/fs/9netics64.8k/9net64.8kfs.c - 664 sys sys 1140167920 3235
 sys/src/fs/9netics64.8k/dat.h - 664 sys sys 1095751680 611
 sys/src/fs/9netics64.8k/fns.h - 664 sys sys 1141028463 2127
-sys/src/fs/9netics64.8k/io.h - 664 sys sys 1097661949 6688
+sys/src/fs/9netics64.8k/io.h - 664 sys sys 1157939328 6720
 sys/src/fs/9netics64.8k/mem.h - 664 sys sys 1140167924 2907
-sys/src/fs/9netics64.8k/mkfile - 664 sys sys 1141020626 1622
+sys/src/fs/9netics64.8k/mkfile - 664 sys sys 1157938855 1637
 sys/src/fs/choline - 20000000775 sys sys 1015110109 0
 sys/src/fs/choline/9cholinefs.c - 664 sys sys 1140168020 2989
 sys/src/fs/choline/dat.h - 664 sys sys 1140168017 612
 sys/src/fs/choline/fns.h - 664 sys sys 1141028463 2127
-sys/src/fs/choline/io.h - 664 sys sys 1140168018 6688
+sys/src/fs/choline/io.h - 664 sys sys 1157939328 6720
 sys/src/fs/choline/mem.h - 664 sys sys 1140168019 2909
-sys/src/fs/choline/mkfile - 664 sys sys 1151739686 1765
+sys/src/fs/choline/mkfile - 664 sys sys 1157938939 1780
 sys/src/fs/dev - 20000000775 sys sys 1015109978 0
 sys/src/fs/dev/apc.c - 664 sys sys 1140167918 14910
 sys/src/fs/dev/cw.c - 664 sys sys 1097712558 43252
@@ -14367,23 +14367,23 @@ sys/src/fs/emelie - 20000000775 sys sys 1015110098 0
 sys/src/fs/emelie/9emeliefs.c - 664 sys sys 1140168026 2989
 sys/src/fs/emelie/dat.h - 664 sys sys 1140168023 612
 sys/src/fs/emelie/fns.h - 664 sys sys 1141028463 2127
-sys/src/fs/emelie/io.h - 664 sys sys 1140168024 6688
+sys/src/fs/emelie/io.h - 664 sys sys 1157939329 6720
 sys/src/fs/emelie/mem.h - 664 sys sys 1140168025 2909
-sys/src/fs/emelie/mkfile - 664 sys sys 1151739603 1764
+sys/src/fs/emelie/mkfile - 664 sys sys 1157938976 1779
 sys/src/fs/fs - 20000000775 sys sys 1140158693 0
 sys/src/fs/fs/9fsfs.c - 664 sys sys 1140168015 3308
 sys/src/fs/fs/dat.h - 664 sys sys 1140168010 611
 sys/src/fs/fs/fns.h - 664 sys sys 1141028463 2127
-sys/src/fs/fs/io.h - 664 sys sys 1097661949 6688
+sys/src/fs/fs/io.h - 664 sys sys 1157939329 6720
 sys/src/fs/fs/mem.h - 664 sys sys 1140168013 2909
-sys/src/fs/fs/mkfile - 664 sys sys 1141020574 1677
+sys/src/fs/fs/mkfile - 664 sys sys 1157939040 1692
 sys/src/fs/fs64 - 20000000775 sys sys 1140158693 0
 sys/src/fs/fs64/9fsfs64.c - 664 sys sys 1151399221 3612
 sys/src/fs/fs64/dat.h - 664 sys sys 1140168005 611
 sys/src/fs/fs64/fns.h - 664 sys sys 1151312486 2289
-sys/src/fs/fs64/io.h - 664 sys sys 1140168006 6688
+sys/src/fs/fs64/io.h - 664 sys sys 1157939329 6720
 sys/src/fs/fs64/mem.h - 664 sys sys 1151398965 3041
-sys/src/fs/fs64/mkfile - 664 sys sys 1140911236 1617
+sys/src/fs/fs64/mkfile - 664 sys sys 1157938677 1632
 sys/src/fs/ip - 20000000775 sys sys 1015109990 0
 sys/src/fs/ip/arp.c - 664 sys sys 1097578954 8696
 sys/src/fs/ip/icmp.c - 664 sys sys 1015109981 991
@@ -14406,14 +14406,16 @@ sys/src/fs/pc/dosfs.c - 664 sys sys 1146784976 16619
 sys/src/fs/pc/dosfs.h - 664 sys sys 1140167937 2696
 sys/src/fs/pc/ether2114x.c - 664 sys sys 1015110044 31874
 sys/src/fs/pc/ether8139.c - 664 sys sys 1086569718 18552
+sys/src/fs/pc/ether8169.c - 664 sys sys 1157939501 25385
 sys/src/fs/pc/ether82557.c - 664 sys sys 1154067789 30710
 sys/src/fs/pc/ether83815.c - 664 sys sys 1140335463 26764
 sys/src/fs/pc/ether83815.mii.c - 664 sys sys 1049156663 31622
+sys/src/fs/pc/etherdat.h - 664 sys sys 1157938367 72
 sys/src/fs/pc/etherdp83820.c - 664 sys sys 1146355081 32045
 sys/src/fs/pc/etherelnk3.c - 664 sys sys 1015110054 42732
 sys/src/fs/pc/etherga620.c - 664 sys sys 1146785153 24748
 sys/src/fs/pc/etherga620fw.h - 664 sys sys 1032126775 222295
-sys/src/fs/pc/etherif.c - 664 sys sys 1140162742 6375
+sys/src/fs/pc/etherif.c - 664 sys sys 1157938488 6605
 sys/src/fs/pc/etherif.h - 664 sys sys 1015110057 730
 sys/src/fs/pc/etherigbe.c - 664 sys sys 1141208695 46676
 sys/src/fs/pc/ethermii.c - 664 sys sys 1140167954 4689
@@ -14427,7 +14429,7 @@ sys/src/fs/pc/mkfile - 664 sys sys 1140167942 426
 sys/src/fs/pc/mmu.c - 664 sys sys 1015110065 8414
 sys/src/fs/pc/nvr.c - 664 sys sys 1015110066 669
 sys/src/fs/pc/pc.c - 664 sys sys 1151401114 8004
-sys/src/fs/pc/pci.c - 664 sys sys 1151280674 12152
+sys/src/fs/pc/pci.c - 664 sys sys 1157938218 12271
 sys/src/fs/pc/script.i - 664 sys sys 1015110072 27323
 sys/src/fs/pc/scsi.c - 664 sys sys 1151385561 8701
 sys/src/fs/pc/scsibuslogic.c - 664 sys sys 1015110077 28645
@@ -14451,14 +14453,14 @@ sys/src/fs/port/config.c - 664 sys sys 1151037810 20380
 sys/src/fs/port/console.c - 664 sys sys 1101627646 4886
 sys/src/fs/port/data.c - 664 sys sys 1140167986 4510
 sys/src/fs/port/dentry.c - 664 sys sys 1098156404 6345
-sys/src/fs/port/devcons.c - 664 sys sys 1095983755 4451
+sys/src/fs/port/devcons.c - 664 sys sys 1157942528 4896
 sys/src/fs/port/devsd.c - 664 sys sys 1151371646 15110
 sys/src/fs/port/fcmd.c - 664 sys sys 1146785267 1255
 sys/src/fs/port/fs.h - 664 sys sys 1140168001 682
 sys/src/fs/port/iobuf.c - 664 sys sys 1140167988 4956
 sys/src/fs/port/lib.h - 664 sys sys 1146798595 3791
 sys/src/fs/port/lrand.c - 664 sys sys 1091803568 1093
-sys/src/fs/port/main.c - 664 sys sys 1151376423 7827
+sys/src/fs/port/main.c - 664 sys sys 1157943089 7931
 sys/src/fs/port/mkfile - 664 sys sys 1140167991 214
 sys/src/fs/port/portdat.h - 664 sys sys 1151312767 19739
 sys/src/fs/port/portfns.h - 664 sys sys 1140167994 7526
@@ -15183,7 +15185,7 @@ sys/src/libgeometry/tstack.c - 664 sys sys 944961726 4716
 sys/src/libhtml - 20000000775 sys sys 1016902547 0
 sys/src/libhtml/build.c - 664 sys sys 1155362319 94787
 sys/src/libhtml/impl.h - 664 sys sys 1021580002 4627
-sys/src/libhtml/lex.c - 664 sys sys 1143220767 28128
+sys/src/libhtml/lex.c - 664 sys sys 1157899961 28212
 sys/src/libhtml/mkfile - 664 sys sys 1035389778 246
 sys/src/libhtml/strinttab.c - 664 sys sys 1016902547 1285
 sys/src/libhtml/utils.c - 664 sys sys 1021580002 9745
@@ -15402,7 +15404,7 @@ sys/src/libndb/ndbgetipaddr.c - 664 sys sys 1144174489 876
 sys/src/libndb/ndbgetval.c - 664 sys sys 1144174490 1348
 sys/src/libndb/ndbhash.c - 664 sys sys 1144174490 5276
 sys/src/libndb/ndbhf.h - 664 sys sys 1015013485 746
-sys/src/libndb/ndbipinfo.c - 664 sys sys 1144174490 5105
+sys/src/libndb/ndbipinfo.c - 664 sys sys 1157899101 5127
 sys/src/libndb/ndblookval.c - 664 sys sys 1078839929 791
 sys/src/libndb/ndbopen.c - 664 sys sys 1069206441 2716
 sys/src/libndb/ndbparse.c - 664 sys sys 1144174490 1207
@@ -15663,3 +15665,4 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+sys/src/fs/port/config.c - 664 sys sys 1157944410 20574

+ 41 - 39
dist/replica/plan9.db

@@ -15,7 +15,7 @@
 386/_9pcdisk.gz - 664 sys sys 1039764191 695837
 386/bin - 20000000775 sys sys 1018897690 0
 386/bin/8a - 775 sys sys 1148500566 116698
-386/bin/8c - 775 sys sys 1148500566 365445
+386/bin/8c - 775 sys sys 1157916201 365445
 386/bin/8l - 775 sys sys 1148500567 115711
 386/bin/9660srv - 775 sys sys 1148500567 104375
 386/bin/aan - 775 sys sys 1148500568 131392
@@ -275,7 +275,7 @@
 386/bin/history - 775 sys sys 1148500644 75799
 386/bin/hoc - 775 sys sys 1155491751 100190
 386/bin/html2ms - 775 sys sys 1148500645 66415
-386/bin/htmlfmt - 775 sys sys 1155491752 163435
+386/bin/htmlfmt - 775 sys sys 1157916202 163475
 386/bin/htmlroff - 775 sys sys 1157138536 148544
 386/bin/ico - 775 sys sys 1155491752 162226
 386/bin/iconv - 775 sys sys 1150062738 113723
@@ -284,7 +284,7 @@
 386/bin/iostats - 775 sys sys 1148500650 100476
 386/bin/ip - 20000000775 sys sys 1016920851 0
 386/bin/ip/dhcpclient - 775 sys sys 1148500650 94471
-386/bin/ip/dhcpd - 775 sys sys 1148500651 150757
+386/bin/ip/dhcpd - 775 sys sys 1157916202 150774
 386/bin/ip/dhcpleases - 775 sys sys 1148500652 86543
 386/bin/ip/ftpd - 775 sys sys 1148500653 170760
 386/bin/ip/gizzard - 775 sys sys 1081480408 101521
@@ -301,18 +301,18 @@
 386/bin/ip/httpd/wikipost - 775 sys sys 1148500658 115002
 386/bin/ip/httpfile - 775 sys sys 1148500659 284317
 386/bin/ip/imap4d - 775 sys sys 1156976707 238121
-386/bin/ip/ipconfig - 775 sys sys 1148500661 139400
+386/bin/ip/ipconfig - 775 sys sys 1157916203 139417
 386/bin/ip/ping - 775 sys sys 1148500661 76814
 386/bin/ip/ppp - 775 sys sys 1148500662 220485
 386/bin/ip/pppoe - 775 sys sys 1148500662 77881
 386/bin/ip/pptp - 775 sys sys 1148500663 127269
 386/bin/ip/pptpd - 775 sys sys 1148500663 126202
-386/bin/ip/rarpd - 775 sys sys 1148500663 113122
+386/bin/ip/rarpd - 775 sys sys 1157916204 113139
 386/bin/ip/rexexec - 775 sys sys 1148500664 90309
 386/bin/ip/rip - 775 sys sys 1148500664 91551
 386/bin/ip/rlogind - 775 sys sys 1148500664 67748
 386/bin/ip/telnetd - 775 sys sys 1148500664 123413
-386/bin/ip/tftpd - 775 sys sys 1148500665 132120
+386/bin/ip/tftpd - 775 sys sys 1157916204 132137
 386/bin/ip/traceroute - 775 sys sys 1148500665 74067
 386/bin/ip/udpecho - 775 sys sys 1148500666 43190
 386/bin/join - 775 sys sys 1148500666 114393
@@ -337,13 +337,13 @@
 386/bin/mug - 775 sys sys 1157570246 176473
 386/bin/mv - 775 sys sys 1148500673 65825
 386/bin/ndb - 20000000775 sys sys 985743147 0
-386/bin/ndb/cs - 775 sys sys 1148500674 150956
+386/bin/ndb/cs - 775 sys sys 1157916205 150973
 386/bin/ndb/csquery - 775 sys sys 1148500674 61796
-386/bin/ndb/dns - 775 sys sys 1148500675 247338
-386/bin/ndb/dnsdebug - 775 sys sys 1148500676 221817
+386/bin/ndb/dns - 775 sys sys 1157916207 247355
+386/bin/ndb/dnsdebug - 775 sys sys 1157916208 221834
 386/bin/ndb/dnsquery - 775 sys sys 1148500676 63964
-386/bin/ndb/dnstcp - 775 sys sys 1148500676 220785
-386/bin/ndb/ipquery - 775 sys sys 1148500677 97031
+386/bin/ndb/dnstcp - 775 sys sys 1157916209 220802
+386/bin/ndb/ipquery - 775 sys sys 1157916209 97048
 386/bin/ndb/mkdb - 775 sys sys 1148500677 64305
 386/bin/ndb/mkhash - 775 sys sys 1148500677 84874
 386/bin/ndb/mkhosts - 775 sys sys 1148500677 85917
@@ -556,7 +556,7 @@
 386/lib/libflate.a - 664 sys sys 1143777862 76726
 386/lib/libframe.a - 664 sys sys 1147712341 66398
 386/lib/libgeometry.a - 664 sys sys 1143777862 50470
-386/lib/libhtml.a - 664 sys sys 1155491762 229486
+386/lib/libhtml.a - 664 sys sys 1157916211 229650
 386/lib/libhttpd.a - 664 sys sys 1153069071 99458
 386/lib/libip.a - 664 sys sys 1143777863 35576
 386/lib/libl.a - 664 sys sys 1143777863 5372
@@ -564,7 +564,7 @@
 386/lib/libmemdraw.a - 664 sys sys 1143777866 284092
 386/lib/libmemlayer.a - 664 sys sys 1143777866 47360
 386/lib/libmp.a - 664 sys sys 1144169680 79980
-386/lib/libndb.a - 664 sys sys 1144256044 64436
+386/lib/libndb.a - 664 sys sys 1157916211 64470
 386/lib/libplumb.a - 664 sys sys 1143777866 19408
 386/lib/libregexp.a - 664 sys sys 1143777866 37438
 386/lib/libscribble.a - 664 sys sys 1143777867 107238
@@ -5184,7 +5184,7 @@ lib/kana - 664 sys sys 944943772 1061
 lib/katakana - 664 sys sys 944943772 982
 lib/keyboard - 664 sys sys 1102595267 26057
 lib/mammals - 664 sys sys 944943772 27760
-lib/namespace - 664 sys sys 1060354451 590
+lib/namespace - 664 sys sys 1157899562 593
 lib/namespace.ftp - 664 sys sys 1020313578 373
 lib/namespace.httpd - 664 sys sys 984695868 1209
 lib/ndb - 20000000775 sys sys 959260770 0
@@ -7605,7 +7605,7 @@ sys/man/4/execnet - 664 sys sys 1019866708 1069
 sys/man/4/exportfs - 664 sys sys 1145881912 4655
 sys/man/4/ext2srv - 664 sys sys 1055692986 2409
 sys/man/4/factotum - 664 sys sys 1131294573 14841
-sys/man/4/fossil - 664 sys sys 1112368411 9546
+sys/man/4/fossil - 664 sys sys 1157864806 9575
 sys/man/4/fs - 664 sys sys 1019058716 3387
 sys/man/4/ftpfs - 664 sys sys 1112563349 4410
 sys/man/4/httpfile - 664 sys sys 1128556957 1233
@@ -7621,7 +7621,7 @@ sys/man/4/nntpfs - 664 sys sys 1032632346 2771
 sys/man/4/paqfs - 664 sys sys 1017723482 1541
 sys/man/4/plumber - 664 sys sys 944959699 2748
 sys/man/4/ramfs - 664 sys sys 1127393035 1447
-sys/man/4/ratfs - 664 sys sys 1017423722 3272
+sys/man/4/ratfs - 664 sys sys 1157898800 3276
 sys/man/4/rdbfs - 664 sys sys 944959699 1123
 sys/man/4/rio - 664 sys sys 1023206844 8660
 sys/man/4/sacfs - 664 sys sys 964886843 907
@@ -9845,7 +9845,7 @@ sys/src/cmd/cc/compat.c - 664 sys sys 1132451523 454
 sys/src/cmd/cc/dcl.c - 664 sys sys 1143759352 27003
 sys/src/cmd/cc/dpchk.c - 664 sys sys 1107365037 7152
 sys/src/cmd/cc/funct.c - 664 sys sys 984718510 6167
-sys/src/cmd/cc/lex.c - 664 sys sys 1143759352 24189
+sys/src/cmd/cc/lex.c - 664 sys sys 1157898973 24195
 sys/src/cmd/cc/lexbody - 664 sys sys 1131293457 9188
 sys/src/cmd/cc/mac.c - 664 sys sys 944960808 36
 sys/src/cmd/cc/macbody - 664 sys sys 1144689980 12205
@@ -13138,7 +13138,7 @@ sys/src/cmd/rio/data.c - 664 sys sys 1142015551 6169
 sys/src/cmd/rio/fns.h - 664 sys sys 1039133251 1065
 sys/src/cmd/rio/fsys.c - 664 sys sys 1019678647 13259
 sys/src/cmd/rio/mkfile - 664 sys sys 1111249068 431
-sys/src/cmd/rio/rio.c - 664 sys sys 1142289011 22866
+sys/src/cmd/rio/rio.c - 664 sys sys 1157899815 22866
 sys/src/cmd/rio/scrl.c - 664 sys sys 1014926357 3245
 sys/src/cmd/rio/time.c - 664 sys sys 1014926357 1829
 sys/src/cmd/rio/util.c - 664 sys sys 1014926357 2061
@@ -14075,7 +14075,7 @@ sys/src/cmd/upas/smtp/rfc822.y - 664 sys sys 1064589606 13417
 sys/src/cmd/upas/smtp/rmtdns.c - 664 sys sys 1015013150 1069
 sys/src/cmd/upas/smtp/smtp.c - 664 sys sys 1143759341 20123
 sys/src/cmd/upas/smtp/smtp.h - 664 sys sys 1108827986 1270
-sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1149083996 31606
+sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1157922094 31680
 sys/src/cmd/upas/smtp/smtpd.h - 664 sys sys 1067722781 1111
 sys/src/cmd/upas/smtp/smtpd.y - 664 sys sys 1143670612 6961
 sys/src/cmd/upas/smtp/spam.c - 664 sys sys 1139699502 10238
@@ -14304,7 +14304,7 @@ sys/src/cmd/webfs/http.c - 664 sys sys 1155363881 9305
 sys/src/cmd/webfs/io.c - 664 sys sys 1034736588 1384
 sys/src/cmd/webfs/main.c - 664 sys sys 1128664462 1083
 sys/src/cmd/webfs/mkfile - 664 sys sys 1032665986 340
-sys/src/cmd/webfs/plumb.c - 664 sys sys 1015090008 2761
+sys/src/cmd/webfs/plumb.c - 664 sys sys 1157900012 2811
 sys/src/cmd/webfs/url.c - 664 sys sys 1128664462 24144
 sys/src/cmd/webfs/util.c - 664 sys sys 1015015823 1211
 sys/src/cmd/webfs/webget.c - 664 sys sys 1124711795 1589
@@ -14332,23 +14332,23 @@ sys/src/fs/9netics32.16k - 20000000775 sys sys 1140158691 0
 sys/src/fs/9netics32.16k/9net32.16kfs.c - 664 sys sys 1140167903 3208
 sys/src/fs/9netics32.16k/dat.h - 664 sys sys 1140167904 612
 sys/src/fs/9netics32.16k/fns.h - 664 sys sys 1141028463 2127
-sys/src/fs/9netics32.16k/io.h - 664 sys sys 1097661949 6688
+sys/src/fs/9netics32.16k/io.h - 664 sys sys 1157939328 6720
 sys/src/fs/9netics32.16k/mem.h - 664 sys sys 1140167906 2907
-sys/src/fs/9netics32.16k/mkfile - 664 sys sys 1141020616 1629
+sys/src/fs/9netics32.16k/mkfile - 664 sys sys 1157938805 1644
 sys/src/fs/9netics64.8k - 20000000775 sys sys 1140158692 0
 sys/src/fs/9netics64.8k/9net64.8kfs.c - 664 sys sys 1140167920 3235
 sys/src/fs/9netics64.8k/dat.h - 664 sys sys 1095751680 611
 sys/src/fs/9netics64.8k/fns.h - 664 sys sys 1141028463 2127
-sys/src/fs/9netics64.8k/io.h - 664 sys sys 1097661949 6688
+sys/src/fs/9netics64.8k/io.h - 664 sys sys 1157939328 6720
 sys/src/fs/9netics64.8k/mem.h - 664 sys sys 1140167924 2907
-sys/src/fs/9netics64.8k/mkfile - 664 sys sys 1141020626 1622
+sys/src/fs/9netics64.8k/mkfile - 664 sys sys 1157938855 1637
 sys/src/fs/choline - 20000000775 sys sys 1015110109 0
 sys/src/fs/choline/9cholinefs.c - 664 sys sys 1140168020 2989
 sys/src/fs/choline/dat.h - 664 sys sys 1140168017 612
 sys/src/fs/choline/fns.h - 664 sys sys 1141028463 2127
-sys/src/fs/choline/io.h - 664 sys sys 1140168018 6688
+sys/src/fs/choline/io.h - 664 sys sys 1157939328 6720
 sys/src/fs/choline/mem.h - 664 sys sys 1140168019 2909
-sys/src/fs/choline/mkfile - 664 sys sys 1151739686 1765
+sys/src/fs/choline/mkfile - 664 sys sys 1157938939 1780
 sys/src/fs/dev - 20000000775 sys sys 1015109978 0
 sys/src/fs/dev/apc.c - 664 sys sys 1140167918 14910
 sys/src/fs/dev/cw.c - 664 sys sys 1097712558 43252
@@ -14367,23 +14367,23 @@ sys/src/fs/emelie - 20000000775 sys sys 1015110098 0
 sys/src/fs/emelie/9emeliefs.c - 664 sys sys 1140168026 2989
 sys/src/fs/emelie/dat.h - 664 sys sys 1140168023 612
 sys/src/fs/emelie/fns.h - 664 sys sys 1141028463 2127
-sys/src/fs/emelie/io.h - 664 sys sys 1140168024 6688
+sys/src/fs/emelie/io.h - 664 sys sys 1157939329 6720
 sys/src/fs/emelie/mem.h - 664 sys sys 1140168025 2909
-sys/src/fs/emelie/mkfile - 664 sys sys 1151739603 1764
+sys/src/fs/emelie/mkfile - 664 sys sys 1157938976 1779
 sys/src/fs/fs - 20000000775 sys sys 1140158693 0
 sys/src/fs/fs/9fsfs.c - 664 sys sys 1140168015 3308
 sys/src/fs/fs/dat.h - 664 sys sys 1140168010 611
 sys/src/fs/fs/fns.h - 664 sys sys 1141028463 2127
-sys/src/fs/fs/io.h - 664 sys sys 1097661949 6688
+sys/src/fs/fs/io.h - 664 sys sys 1157939329 6720
 sys/src/fs/fs/mem.h - 664 sys sys 1140168013 2909
-sys/src/fs/fs/mkfile - 664 sys sys 1141020574 1677
+sys/src/fs/fs/mkfile - 664 sys sys 1157939040 1692
 sys/src/fs/fs64 - 20000000775 sys sys 1140158693 0
 sys/src/fs/fs64/9fsfs64.c - 664 sys sys 1151399221 3612
 sys/src/fs/fs64/dat.h - 664 sys sys 1140168005 611
 sys/src/fs/fs64/fns.h - 664 sys sys 1151312486 2289
-sys/src/fs/fs64/io.h - 664 sys sys 1140168006 6688
+sys/src/fs/fs64/io.h - 664 sys sys 1157939329 6720
 sys/src/fs/fs64/mem.h - 664 sys sys 1151398965 3041
-sys/src/fs/fs64/mkfile - 664 sys sys 1140911236 1617
+sys/src/fs/fs64/mkfile - 664 sys sys 1157938677 1632
 sys/src/fs/ip - 20000000775 sys sys 1015109990 0
 sys/src/fs/ip/arp.c - 664 sys sys 1097578954 8696
 sys/src/fs/ip/icmp.c - 664 sys sys 1015109981 991
@@ -14406,14 +14406,16 @@ sys/src/fs/pc/dosfs.c - 664 sys sys 1146784976 16619
 sys/src/fs/pc/dosfs.h - 664 sys sys 1140167937 2696
 sys/src/fs/pc/ether2114x.c - 664 sys sys 1015110044 31874
 sys/src/fs/pc/ether8139.c - 664 sys sys 1086569718 18552
+sys/src/fs/pc/ether8169.c - 664 sys sys 1157939501 25385
 sys/src/fs/pc/ether82557.c - 664 sys sys 1154067789 30710
 sys/src/fs/pc/ether83815.c - 664 sys sys 1140335463 26764
 sys/src/fs/pc/ether83815.mii.c - 664 sys sys 1049156663 31622
+sys/src/fs/pc/etherdat.h - 664 sys sys 1157938367 72
 sys/src/fs/pc/etherdp83820.c - 664 sys sys 1146355081 32045
 sys/src/fs/pc/etherelnk3.c - 664 sys sys 1015110054 42732
 sys/src/fs/pc/etherga620.c - 664 sys sys 1146785153 24748
 sys/src/fs/pc/etherga620fw.h - 664 sys sys 1032126775 222295
-sys/src/fs/pc/etherif.c - 664 sys sys 1140162742 6375
+sys/src/fs/pc/etherif.c - 664 sys sys 1157938488 6605
 sys/src/fs/pc/etherif.h - 664 sys sys 1015110057 730
 sys/src/fs/pc/etherigbe.c - 664 sys sys 1141208695 46676
 sys/src/fs/pc/ethermii.c - 664 sys sys 1140167954 4689
@@ -14427,7 +14429,7 @@ sys/src/fs/pc/mkfile - 664 sys sys 1140167942 426
 sys/src/fs/pc/mmu.c - 664 sys sys 1015110065 8414
 sys/src/fs/pc/nvr.c - 664 sys sys 1015110066 669
 sys/src/fs/pc/pc.c - 664 sys sys 1151401114 8004
-sys/src/fs/pc/pci.c - 664 sys sys 1151280674 12152
+sys/src/fs/pc/pci.c - 664 sys sys 1157938218 12271
 sys/src/fs/pc/script.i - 664 sys sys 1015110072 27323
 sys/src/fs/pc/scsi.c - 664 sys sys 1151385561 8701
 sys/src/fs/pc/scsibuslogic.c - 664 sys sys 1015110077 28645
@@ -14447,18 +14449,18 @@ sys/src/fs/port/auth.c - 664 sys sys 1146785221 7606
 sys/src/fs/port/chk.c - 664 sys sys 1097832483 15683
 sys/src/fs/port/clock.c - 664 sys sys 1097580538 4033
 sys/src/fs/port/con.c - 664 sys sys 1146785256 16304
-sys/src/fs/port/config.c - 664 sys sys 1151037810 20380
+sys/src/fs/port/config.c - 664 sys sys 1157944410 20574
 sys/src/fs/port/console.c - 664 sys sys 1101627646 4886
 sys/src/fs/port/data.c - 664 sys sys 1140167986 4510
 sys/src/fs/port/dentry.c - 664 sys sys 1098156404 6345
-sys/src/fs/port/devcons.c - 664 sys sys 1095983755 4451
+sys/src/fs/port/devcons.c - 664 sys sys 1157942528 4896
 sys/src/fs/port/devsd.c - 664 sys sys 1151371646 15110
 sys/src/fs/port/fcmd.c - 664 sys sys 1146785267 1255
 sys/src/fs/port/fs.h - 664 sys sys 1140168001 682
 sys/src/fs/port/iobuf.c - 664 sys sys 1140167988 4956
 sys/src/fs/port/lib.h - 664 sys sys 1146798595 3791
 sys/src/fs/port/lrand.c - 664 sys sys 1091803568 1093
-sys/src/fs/port/main.c - 664 sys sys 1151376423 7827
+sys/src/fs/port/main.c - 664 sys sys 1157943089 7931
 sys/src/fs/port/mkfile - 664 sys sys 1140167991 214
 sys/src/fs/port/portdat.h - 664 sys sys 1151312767 19739
 sys/src/fs/port/portfns.h - 664 sys sys 1140167994 7526
@@ -15183,7 +15185,7 @@ sys/src/libgeometry/tstack.c - 664 sys sys 944961726 4716
 sys/src/libhtml - 20000000775 sys sys 1016902547 0
 sys/src/libhtml/build.c - 664 sys sys 1155362319 94787
 sys/src/libhtml/impl.h - 664 sys sys 1021580002 4627
-sys/src/libhtml/lex.c - 664 sys sys 1143220767 28128
+sys/src/libhtml/lex.c - 664 sys sys 1157899961 28212
 sys/src/libhtml/mkfile - 664 sys sys 1035389778 246
 sys/src/libhtml/strinttab.c - 664 sys sys 1016902547 1285
 sys/src/libhtml/utils.c - 664 sys sys 1021580002 9745
@@ -15402,7 +15404,7 @@ sys/src/libndb/ndbgetipaddr.c - 664 sys sys 1144174489 876
 sys/src/libndb/ndbgetval.c - 664 sys sys 1144174490 1348
 sys/src/libndb/ndbhash.c - 664 sys sys 1144174490 5276
 sys/src/libndb/ndbhf.h - 664 sys sys 1015013485 746
-sys/src/libndb/ndbipinfo.c - 664 sys sys 1144174490 5105
+sys/src/libndb/ndbipinfo.c - 664 sys sys 1157899101 5127
 sys/src/libndb/ndblookval.c - 664 sys sys 1078839929 791
 sys/src/libndb/ndbopen.c - 664 sys sys 1069206441 2716
 sys/src/libndb/ndbparse.c - 664 sys sys 1144174490 1207

+ 42 - 0
dist/replica/plan9.log

@@ -30380,3 +30380,45 @@
 1157684407 0 c 386/bin/grep - 775 sys sys 1157684160 79663
 1157684407 1 a 386/bin/compress - 775 sys sys 1157684160 166929
 1157851805 0 c 386/9loaddebug - 775 sys sys 1157851789 315943
+1157866206 0 c sys/man/4/fossil - 664 sys sys 1157864806 9575
+1157900406 0 c lib/namespace - 664 sys sys 1157899562 593
+1157900406 1 c sys/man/4/ratfs - 664 sys sys 1157898800 3276
+1157900406 2 c sys/src/cmd/cc/lex.c - 664 sys sys 1157898973 24195
+1157900406 3 c sys/src/cmd/webfs/plumb.c - 664 sys sys 1157900012 2811
+1157900406 4 c sys/src/cmd/rio/rio.c - 664 sys sys 1157899815 22866
+1157900406 5 c sys/src/libhtml/lex.c - 664 sys sys 1157899961 28212
+1157900406 6 c sys/src/libndb/ndbipinfo.c - 664 sys sys 1157899101 5127
+1157916607 0 c 386/bin/8c - 775 sys sys 1157916201 365445
+1157916607 1 c 386/bin/htmlfmt - 775 sys sys 1157916202 163475
+1157916607 2 c 386/bin/ip/dhcpd - 775 sys sys 1157916202 150774
+1157916607 3 c 386/bin/ip/ipconfig - 775 sys sys 1157916203 139417
+1157916607 4 c 386/bin/ip/rarpd - 775 sys sys 1157916204 113139
+1157916607 5 c 386/bin/ip/tftpd - 775 sys sys 1157916204 132137
+1157916607 6 c 386/bin/ndb/cs - 775 sys sys 1157916205 150973
+1157916607 7 c 386/bin/ndb/dns - 775 sys sys 1157916207 247355
+1157916607 8 c 386/bin/ndb/dnsdebug - 775 sys sys 1157916208 221834
+1157916607 9 c 386/bin/ndb/dnstcp - 775 sys sys 1157916209 220802
+1157916607 10 c 386/bin/ndb/ipquery - 775 sys sys 1157916209 97048
+1157916607 11 c 386/lib/libhtml.a - 664 sys sys 1157916211 229650
+1157916607 12 c 386/lib/libndb.a - 664 sys sys 1157916211 64470
+1157922006 0 c sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1157922094 31680
+1157938206 0 c sys/src/fs/pc/pci.c - 664 sys sys 1157938218 12271
+1157938206 1 c sys/src/fs/port/devcons.c - 664 sys sys 1157937432 4845
+1157940006 0 c sys/src/fs/9netics32.16k/io.h - 664 sys sys 1157939328 6720
+1157940006 1 c sys/src/fs/9netics32.16k/mkfile - 664 sys sys 1157938805 1644
+1157940006 2 c sys/src/fs/9netics64.8k/io.h - 664 sys sys 1157939328 6720
+1157940006 3 c sys/src/fs/9netics64.8k/mkfile - 664 sys sys 1157938855 1637
+1157940006 4 c sys/src/fs/choline/io.h - 664 sys sys 1157939328 6720
+1157940006 5 c sys/src/fs/choline/mkfile - 664 sys sys 1157938939 1780
+1157940006 6 c sys/src/fs/emelie/io.h - 664 sys sys 1157939329 6720
+1157940006 7 c sys/src/fs/emelie/mkfile - 664 sys sys 1157938976 1779
+1157940006 8 c sys/src/fs/fs/io.h - 664 sys sys 1157939329 6720
+1157940006 9 c sys/src/fs/fs/mkfile - 664 sys sys 1157939040 1692
+1157940006 10 c sys/src/fs/fs64/io.h - 664 sys sys 1157939329 6720
+1157940006 11 c sys/src/fs/fs64/mkfile - 664 sys sys 1157938677 1632
+1157940006 12 a sys/src/fs/pc/ether8169.c - 664 sys sys 1157939501 25385
+1157940006 13 a sys/src/fs/pc/etherdat.h - 664 sys sys 1157938367 72
+1157940006 14 c sys/src/fs/pc/etherif.c - 664 sys sys 1157938488 6605
+1157943605 0 c sys/src/fs/port/devcons.c - 664 sys sys 1157942528 4896
+1157943605 1 c sys/src/fs/port/main.c - 664 sys sys 1157943089 7931
+1157945406 0 c sys/src/fs/port/config.c - 664 sys sys 1157944410 20574

+ 1 - 1
lib/namespace

@@ -13,7 +13,7 @@ bind -a #¤ /dev
 bind -a #S /dev
 
 # mount points
-mount /srv/slashn /n
+mount -a /srv/slashn /n
 
 # authentication
 mount -a /srv/factotum /mnt

+ 13 - 8
sys/man/4/fossil

@@ -63,22 +63,24 @@ fossil \- archival file server
 .B fossil/last
 .I file
 .SH DESCRIPTION
-Fossil
+.I Fossil
 will become the main file system for Plan 9.
 Unlike the Plan 9 file servers of old,
-fossil
+.I fossil
 is a collection of user-space programs that run on a standard Plan 9 kernel.
 The name of the main fossil file server at Murray Hill is
-.BR ehime .
+.BR edith .
 The Plan 9 distribution file server,
 .BR sources ,
 is also a fossil server.
 .PP
-Fossil
+.I Fossil
 is structured as a magnetic disk write buffer
-backed by a Venti server for archival storage.
+optionally backed by a Venti server for archival storage.
 It serves the Plan 9 protocol via TCP.
-A fossil file server conventionally presents
+A
+.I fossil
+file server conventionally presents
 three trees in the root directory of each file system:
 .BR active ,
 .BR archive ,
@@ -152,7 +154,8 @@ in the format
 An empty attach name selects
 .BR main/active .
 .PP
-Fossil normally requires all users except
+.I Fossil
+normally requires all users except
 .L none
 to provide authentication tickets on each
 .IR attach (5).
@@ -250,7 +253,9 @@ is deprecated in favor of the console
 command (see
 .IR fossilcons (8)).
 .I Flchk
-prints fossil console commands that may be
+prints
+.I fossil
+console commands that may be
 executed to take care of
 bad pointers
 .RB ( clrp ),

+ 1 - 1
sys/man/4/ratfs

@@ -113,7 +113,7 @@ and
 represent the contents of the
 .I classification 
 (default
-.BR /mail/lib/smtpd.conf ).
+.BR /mail/lib/smtpd.conf.ext ).
 Each contains two directories;
 .B ip
 and

+ 3 - 2
sys/src/cmd/cc/lex.c

@@ -157,6 +157,7 @@ compile(char *file, char **defs, int ndef)
 			include[0] = strdup(ofile);
 	} else
 		p = ofile;
+
 	if(outfile == 0) {
 		outfile = p;
 		if(outfile) {
@@ -186,6 +187,7 @@ compile(char *file, char **defs, int ndef)
 			setinclude("/sys/include");
 		}
 	}
+	Binit(&diagbuf, 1, OWRITE);
 	if((debug['a'] || debug['Z']) && !debug['n']) {
 		outfile = 0;
 		Binit(&outbuf, dup(1, -1), OWRITE);
@@ -193,13 +195,12 @@ compile(char *file, char **defs, int ndef)
 	} else {
 		c = mycreat(outfile, 0664);
 		if(c < 0) {
-			diag(Z, "cannot open %s", outfile);
+			diag(Z, "cannot open %s - %r", outfile);
 			outfile = 0;
 			errorexit();
 		}
 		Binit(&outbuf, c, OWRITE);
 	}
-	Binit(&diagbuf, 1, OWRITE);
 	newio();
 
 	/* Use an ANSI preprocessor */

+ 2 - 2
sys/src/cmd/rio/rio.c

@@ -960,7 +960,7 @@ bandsize(Window *w)
 	int which, but;
 
 	p = mouse->xy;
-	
+	but = mouse->buttons;
 	which = whichcorner(w, p);
 	p = cornerpt(w->screenr, p, which);
 	wmovemouse(w, p);
@@ -969,7 +969,7 @@ bandsize(Window *w)
 	drawborder(r, 1);
 	or = r;
 	startp = p;
-	but = mouse->buttons;
+	
 	while(mouse->buttons == but){
 		p = onscreen(mouse->xy);
 		r = whichrect(w->screenr, p, which);

+ 4 - 0
sys/src/cmd/upas/smtp/smtpd.c

@@ -1341,6 +1341,10 @@ starttls(void)
 	int certlen, fd;
 	TLSconn *conn;
 
+	if (tlscert == nil) {
+		reply("454 TLS not available\r\n");
+		return;
+	}
 	conn = mallocz(sizeof *conn, 1);
 	cert = readcert(tlscert, &certlen);
 	if (conn == nil || cert == nil) {

+ 2 - 0
sys/src/cmd/webfs/plumb.c

@@ -101,6 +101,8 @@ ctypes[] =
 	{ "application/rtf", "rtf" },
 	{ "image/gif", "gif" },
 	{ "image/jpeg", "jpg" },
+	{ "image/png", "png" },
+	{ "image/ppm", "ppm" },
 	{ "image/tiff", "tiff" },
 	{ "text/html", "html" },
 	{ "text/plain", "txt" },

+ 1 - 0
sys/src/fs/9netics32.16k/io.h

@@ -179,6 +179,7 @@ extern int pcicfgr32(Pcidev*, int);
 extern void pcicfgw8(Pcidev*, int, int);
 extern void pcicfgw16(Pcidev*, int, int);
 extern void pcicfgw32(Pcidev*, int, int);
+extern void pciclrmwi(Pcidev*);
 extern void pcihinv(Pcidev*, ulong);
 extern Pcidev* pcimatch(Pcidev*, int, int);
 extern Pcidev* pcimatchtbdf(int);

+ 1 - 0
sys/src/fs/9netics32.16k/mkfile

@@ -72,6 +72,7 @@ ETHER=\
 	compat.$O\
 	ether2114x.$O\
 	ether8139.$O\
+	ether8169.$O\
 	ether82557.$O\
 	ether83815.$O\
 	etherdp83820.$O\

+ 1 - 0
sys/src/fs/9netics64.8k/io.h

@@ -179,6 +179,7 @@ extern int pcicfgr32(Pcidev*, int);
 extern void pcicfgw8(Pcidev*, int, int);
 extern void pcicfgw16(Pcidev*, int, int);
 extern void pcicfgw32(Pcidev*, int, int);
+extern void pciclrmwi(Pcidev*);
 extern void pcihinv(Pcidev*, ulong);
 extern Pcidev* pcimatch(Pcidev*, int, int);
 extern Pcidev* pcimatchtbdf(int);

+ 1 - 0
sys/src/fs/9netics64.8k/mkfile

@@ -72,6 +72,7 @@ ETHER=\
 	compat.$O\
 	ether2114x.$O\
 	ether8139.$O\
+	ether8169.$O\
 	ether82557.$O\
 	ether83815.$O\
 	etherdp83820.$O\

+ 1 - 0
sys/src/fs/choline/io.h

@@ -179,6 +179,7 @@ extern int pcicfgr32(Pcidev*, int);
 extern void pcicfgw8(Pcidev*, int, int);
 extern void pcicfgw16(Pcidev*, int, int);
 extern void pcicfgw32(Pcidev*, int, int);
+extern void pciclrmwi(Pcidev*);
 extern void pcihinv(Pcidev*, ulong);
 extern Pcidev* pcimatch(Pcidev*, int, int);
 extern Pcidev* pcimatchtbdf(int);

+ 1 - 0
sys/src/fs/choline/mkfile

@@ -72,6 +72,7 @@ ETHER=\
 	compat.$O\
 	ether2114x.$O\
 	ether8139.$O\
+	ether8169.$O\
 	ether82557.$O\
 	ether83815.$O\
 	etherdp83820.$O\

+ 1 - 0
sys/src/fs/emelie/io.h

@@ -179,6 +179,7 @@ extern int pcicfgr32(Pcidev*, int);
 extern void pcicfgw8(Pcidev*, int, int);
 extern void pcicfgw16(Pcidev*, int, int);
 extern void pcicfgw32(Pcidev*, int, int);
+extern void pciclrmwi(Pcidev*);
 extern void pcihinv(Pcidev*, ulong);
 extern Pcidev* pcimatch(Pcidev*, int, int);
 extern Pcidev* pcimatchtbdf(int);

+ 1 - 0
sys/src/fs/emelie/mkfile

@@ -72,6 +72,7 @@ ETHER=\
 	compat.$O\
 	ether2114x.$O\
 	ether8139.$O\
+	ether8169.$O\
 	ether82557.$O\
 	ether83815.$O\
 	etherdp83820.$O\

+ 1 - 0
sys/src/fs/fs/io.h

@@ -179,6 +179,7 @@ extern int pcicfgr32(Pcidev*, int);
 extern void pcicfgw8(Pcidev*, int, int);
 extern void pcicfgw16(Pcidev*, int, int);
 extern void pcicfgw32(Pcidev*, int, int);
+extern void pciclrmwi(Pcidev*);
 extern void pcihinv(Pcidev*, ulong);
 extern Pcidev* pcimatch(Pcidev*, int, int);
 extern Pcidev* pcimatchtbdf(int);

+ 1 - 0
sys/src/fs/fs/mkfile

@@ -72,6 +72,7 @@ ETHER=\
 	compat.$O\
 	ether2114x.$O\
 	ether8139.$O\
+	ether8169.$O\
 	ether82557.$O\
 	ether83815.$O\
 	etherdp83820.$O\

+ 1 - 0
sys/src/fs/fs64/io.h

@@ -179,6 +179,7 @@ extern int pcicfgr32(Pcidev*, int);
 extern void pcicfgw8(Pcidev*, int, int);
 extern void pcicfgw16(Pcidev*, int, int);
 extern void pcicfgw32(Pcidev*, int, int);
+extern void pciclrmwi(Pcidev*);
 extern void pcihinv(Pcidev*, ulong);
 extern Pcidev* pcimatch(Pcidev*, int, int);
 extern Pcidev* pcimatchtbdf(int);

+ 1 - 0
sys/src/fs/fs64/mkfile

@@ -72,6 +72,7 @@ ETHER=\
 	compat.$O\
 	ether2114x.$O\
 	ether8139.$O\
+	ether8169.$O\
 	ether82557.$O\
 	ether83815.$O\
 	etherdp83820.$O\

+ 1133 - 0
sys/src/fs/pc/ether8169.c

@@ -0,0 +1,1133 @@
+/*
+ * Realtek RTL8110S/8169S.
+ * Mostly there. There are some magic register values used
+ * which are not described in any datasheet or driver but seem
+ * to be necessary.
+ * No tuning has been done. Only tested on an RTL8110S, there
+ * are slight differences between the chips in the series so some
+ * tweaks may be needed.
+ */
+#include "etherdat.h"
+#include "etherif.h"
+#include "ethermii.h"
+#include "compat.h"
+
+#define dprint(...)	print("ether 8169: " __VA_ARGS__);
+
+enum {					/* registers */
+	Idr0		= 0x00,		/* MAC address */
+	Mar0		= 0x08,		/* Multicast address */
+	Dtccr		= 0x10,		/* Dump Tally Counter Command */
+	Tnpds		= 0x20,		/* Transmit Normal Priority Descriptors */
+	Thpds		= 0x28,		/* Transmit High Priority Descriptors */
+	Flash		= 0x30,		/* Flash Memory Read/Write */
+	Erbcr		= 0x34,		/* Early Receive Byte Count */
+	Ersr		= 0x36,		/* Early Receive Status */
+	Cr		= 0x37,		/* Command Register */
+	Tppoll		= 0x38,		/* Transmit Priority Polling */
+	Imr		= 0x3C,		/* Interrupt Mask */
+	Isr		= 0x3E,		/* Interrupt Status */
+	Tcr		= 0x40,		/* Transmit Configuration */
+	Rcr		= 0x44,		/* Receive Configuration */
+	Tctr		= 0x48,		/* Timer Count */
+	Mpc		= 0x4C,		/* Missed Packet Counter */
+	Cr9346		= 0x50,		/* 9346 Command Register */
+	Config0		= 0x51,		/* Configuration Register 0 */
+	Config1		= 0x52,		/* Configuration Register 1 */
+	Config2		= 0x53,		/* Configuration Register 2 */
+	Config3		= 0x54,		/* Configuration Register 3 */
+	Config4		= 0x55,		/* Configuration Register 4 */
+	Config5		= 0x56,		/* Configuration Register 5 */
+	Timerint		= 0x58,		/* Timer Interrupt */
+	Mulint		= 0x5C,		/* Multiple Interrupt Select */
+	Phyar		= 0x60,		/* PHY Access */
+	Tbicsr0		= 0x64,		/* TBI Control and Status */
+	Tbianar		= 0x68,		/* TBI Auto-Negotiation Advertisment */
+	Tbilpar		= 0x6A,		/* TBI Auto-Negotiation Link Partner */
+	Phystatus	= 0x6C,		/* PHY Status */
+
+	Rms		= 0xDA,		/* Receive Packet Maximum Size */
+	Cplusc		= 0xE0,		/* C+ Command */
+	Rdsar		= 0xE4,		/* Receive Descriptor Start Address */
+	Mtps		= 0xEC,		/* Max. Transmit Packet Size */
+};
+
+enum {					/* Dtccr */
+	Cmd		= 0x00000008,	/* Command */
+};
+
+enum {					/* Cr */
+	Te		= 0x04,		/* Transmitter Enable */
+	Re		= 0x08,		/* Receiver Enable */
+	Rst		= 0x10,		/* Software Reset */
+};
+
+enum {					/* Tppoll */
+	Fswint		= 0x01,		/* Forced Software Interrupt */
+	Npq		= 0x40,		/* Normal Priority Queue polling */
+	Hpq		= 0x80,		/* High Priority Queue polling */
+};
+
+enum {					/* Imr/Isr */
+	Rok		= 0x0001,	/* Receive OK */
+	Rer		= 0x0002,	/* Receive Error */
+	Tok		= 0x0004,	/* Transmit OK */
+	Ter		= 0x0008,	/* Transmit Error */
+	Rdu		= 0x0010,	/* Receive Descriptor Unavailable */
+	Punlc		= 0x0020,	/* Packet Underrun or Link Change */
+	Fovw		= 0x0040,	/* Receive FIFO Overflow */
+	Tdu		= 0x0080,	/* Transmit Descriptor Unavailable */
+	Swint		= 0x0100,	/* Software Interrupt */
+	Timeout		= 0x4000,	/* Timer */
+	Serr		= 0x8000,	/* System Error */
+};
+
+enum {					/* Tcr */
+	MtxdmaSHIFT	= 8,		/* Max. DMA Burst Size */
+	MtxdmaMASK	= 0x00000700,
+	Mtxdmaunlimited	= 0x00000700,
+	Acrc		= 0x00010000,	/* Append CRC (not) */
+	Lbk0		= 0x00020000,	/* Loopback Test 0 */
+	Lbk1		= 0x00040000,	/* Loopback Test 1 */
+	Ifg2		= 0x00080000,	/* Interframe Gap 2 */
+	HwveridSHIFT	= 23,		/* Hardware Version ID */
+	HwveridMASK	= 0x7C800000,
+	Macv01		= 0x00000000,	/* RTL8169 */
+	Macv02		= 0x00800000,	/* RTL8169S/8110S */
+	Macv03		= 0x04000000,	/* RTL8169S/8110S */
+	Macv04		= 0x10000000,	/* RTL8169SB/8110SB */
+	Macv05		= 0x18000000,	/* RTL8169SC/8110SC */
+	Macv11		= 0x30000000,	/* RTL8168B/8111B */
+	Macv12		= 0x38000000,	/* RTL8169B/8111B */
+	Macv13		= 0x34000000,	/* RTL8101E */
+	Macv14		= 0x30800000,	/* RTL8100E */
+	Macv15		= 0x38800000,	/* RTL8100E */
+	Ifg0		= 0x01000000,	/* Interframe Gap 0 */
+	Ifg1		= 0x02000000,	/* Interframe Gap 1 */
+};
+
+enum {					/* Rcr */
+	Aap		= 0x00000001,	/* Accept All Packets */
+	Apm		= 0x00000002,	/* Accept Physical Match */
+	Am		= 0x00000004,	/* Accept Multicast */
+	Ab		= 0x00000008,	/* Accept Broadcast */
+	Ar		= 0x00000010,	/* Accept Runt */
+	Aer		= 0x00000020,	/* Accept Error */
+	Sel9356		= 0x00000040,	/* 9356 EEPROM used */
+	MrxdmaSHIFT	= 8,		/* Max. DMA Burst Size */
+	MrxdmaMASK	= 0x00000700,
+	Mrxdmaunlimited	= 0x00000700,
+	RxfthSHIFT	= 13,		/* Receive Buffer Length */
+	RxfthMASK	= 0x0000E000,
+	Rxfth256	= 0x00008000,
+	Rxfthnone	= 0x0000E000,
+	Rer8		= 0x00010000,	/* Accept Error Packets > 8 bytes */
+	MulERINT	= 0x01000000,	/* Multiple Early Interrupt Select */
+};
+
+enum {					/* Cr9346 */
+	Eedo		= 0x01,		/* */
+	Eedi		= 0x02,		/* */
+	Eesk		= 0x04,		/* */
+	Eecs		= 0x08,		/* */
+	Eem0		= 0x40,		/* Operating Mode */
+	Eem1		= 0x80,
+};
+
+enum {					/* Phyar */
+	DataMASK	= 0x0000FFFF,	/* 16-bit GMII/MII Register Data */
+	DataSHIFT	= 0,
+	RegaddrMASK	= 0x001F0000,	/* 5-bit GMII/MII Register Address */
+	RegaddrSHIFT	= 16,
+	PhyFlag		= 0x80000000,	/* */
+};
+
+enum {					/* Phystatus */
+	Fd		= 0x01,		/* Full Duplex */
+	Linksts		= 0x02,		/* Link Status */
+	Speed10		= 0x04,		/* */
+	Speed100	= 0x08,		/* */
+	Speed1000	= 0x10,		/* */
+	Rxflow		= 0x20,		/* */
+	Txflow		= 0x40,		/* */
+	Entbi		= 0x80,		/* */
+};
+
+enum {					/* Cplusc */
+	Mulrw		= 0x0008,	/* PCI Multiple R/W Enable */
+	Dac		= 0x0010,	/* PCI Dual Address Cycle Enable */
+	Rxchksum	= 0x0020,	/* Receive Checksum Offload Enable */
+	Rxvlan		= 0x0040,	/* Receive VLAN De-tagging Enable */
+	Endian		= 0x0200,	/* Endian Mode */
+};
+
+typedef struct D D;			/* Transmit/Receive Descriptor */
+struct D {
+	u32int	control;
+	u32int	vlan;
+	u32int	addrlo;
+	u32int	addrhi;
+};
+
+enum {					/* Transmit Descriptor control */
+	TxflMASK	= 0x0000FFFF,	/* Transmit Frame Length */
+	TxflSHIFT	= 0,
+	Tcps		= 0x00010000,	/* TCP Checksum Offload */
+	Udpcs		= 0x00020000,	/* UDP Checksum Offload */
+	Ipcs		= 0x00040000,	/* IP Checksum Offload */
+	Lgsen		= 0x08000000,	/* Large Send */
+};
+
+enum {					/* Receive Descriptor control */
+	RxflMASK	= 0x00003FFF,	/* Receive Frame Length */
+	RxflSHIFT	= 0,
+	Tcpf		= 0x00004000,	/* TCP Checksum Failure */
+	Udpf		= 0x00008000,	/* UDP Checksum Failure */
+	Ipf		= 0x00010000,	/* IP Checksum Failure */
+	Pid0		= 0x00020000,	/* Protocol ID0 */
+	Pid1		= 0x00040000,	/* Protocol ID1 */
+	Crce		= 0x00080000,	/* CRC Error */
+	Runt		= 0x00100000,	/* Runt Packet */
+	Res		= 0x00200000,	/* Receive Error Summary */
+	Rwt		= 0x00400000,	/* Receive Watchdog Timer Expired */
+	Fovf		= 0x00800000,	/* FIFO Overflow */
+	Bovf		= 0x01000000,	/* Buffer Overflow */
+	Bar		= 0x02000000,	/* Broadcast Address Received */
+	Pam		= 0x04000000,	/* Physical Address Matched */
+	Mar		= 0x08000000,	/* Multicast Address Received */
+};
+
+enum {					/* General Descriptor control */
+	Ls		= 0x10000000,	/* Last Segment Descriptor */
+	Fs		= 0x20000000,	/* First Segment Descriptor */
+	Eor		= 0x40000000,	/* End of Descriptor Ring */
+	Own		= 0x80000000,	/* Ownership */
+};
+
+/*
+ */
+enum {					/* Ring sizes  (<= 1024) */
+	Ntd		= 32,		/* Transmit Ring */
+	Nrd		= 128,		/* Receive Ring */
+
+	Mps		= ROUNDUP(ETHERMAXTU+4, 128),
+};
+
+typedef struct Dtcc Dtcc;
+struct Dtcc {
+	u64int	txok;
+	u64int	rxok;
+	u64int	txer;
+	u32int	rxer;
+	u16int	misspkt;
+	u16int	fae;
+	u32int	tx1col;
+	u32int	txmcol;
+	u64int	rxokph;
+	u64int	rxokbrd;
+	u32int	rxokmu;
+	u16int	txabt;
+	u16int	txundrn;
+};
+
+enum {						/* Variants */
+	Rtl8100e 	= (0x8136<<16)|0x10EC,	/* RTL810[01]E ? */
+	Rtl8169c		= (0x0116<<16)|0x16EC,	/* RTL8169C+ (USR997902) */
+	Rtl8169sc	= (0x8167<<16)|0x10EC,	/* RTL8169SC */
+	Rtl8168b 	= (0x8168<<16)|0x10EC,	/* RTL8168B */
+	Rtl8169		= (0x8169<<16)|0x10EC,	/* RTL8169 */
+};
+
+typedef struct Ctlr Ctlr;
+typedef struct Ctlr {
+	int	port;
+	Pcidev*	pcidev;
+	Ctlr*	next;
+	int	active;
+
+	QLock	alock;			/* attach */
+	Lock	ilock;			/* init */
+	int	init;			/*  */
+
+	int	pciv;			/*  */
+	int	macv;			/* MAC version */
+	int	phyv;			/* PHY version */
+
+	Mii*	mii;
+
+	Lock	tlock;			/* transmit */
+	D*	td;			/* descriptor ring */
+	Block**	tb;			/* transmit buffers */
+	int	ntd;
+
+	int	tdh;			/* head - producer index (host) */
+	int	tdt;			/* tail - consumer index (NIC) */
+	int	ntdfree;
+	int	ntq;
+
+	int	mtps;			/* Max. Transmit Packet Size */
+
+	Lock	rlock;			/* receive */
+	D*	rd;			/* descriptor ring */
+	Block**	rb;			/* receive buffers */
+	int	nrd;
+
+	int	rdh;			/* head - producer index (NIC) */
+	int	rdt;			/* tail - consumer index (host) */
+	int	nrdfree;
+
+	int	tcr;			/* transmit configuration register */
+	int	rcr;			/* receive configuration register */
+	int	imr;
+
+	QLock	slock;			/* statistics */
+	Dtcc*	dtcc;
+	uint	txdu;
+	uint	tcpf;
+	uint	udpf;
+	uint	ipf;
+	uint	fovf;
+	uint	ierrs;
+	uint	rer;
+	uint	rdu;
+	uint	punlc;
+	uint	fovw;
+} Ctlr;
+
+static Ctlr* rtl8169ctlrhead;
+static Ctlr* rtl8169ctlrtail;
+
+#define csr8r(c, r)	(inb((c)->port+(r)))
+#define csr16r(c, r)	(ins((c)->port+(r)))
+#define csr32r(c, r)	(inl((c)->port+(r)))
+#define csr8w(c, r, b)	(outb((c)->port+(r), (u8int)(b)))
+#define csr16w(c, r, w)	(outs((c)->port+(r), (u16int)(w)))
+#define csr32w(c, r, l)	(outl((c)->port+(r), (u32int)(l)))
+
+static int
+rtl8169miimir(Mii* mii, int pa, int ra)
+{
+	uint r;
+	int timeo;
+	Ctlr *ctlr;
+
+	if(pa != 1)
+		return -1;
+	ctlr = mii->ctlr;
+
+	r = (ra<<16) & RegaddrMASK;
+	csr32w(ctlr, Phyar, r);
+	delay(1);
+	for(timeo = 0; timeo < 2000; timeo++){
+		if((r = csr32r(ctlr, Phyar)) & PhyFlag)
+			break;
+		microdelay(100);
+	}
+	if(!(r & PhyFlag))
+		return -1;
+
+	return (r & DataMASK)>>DataSHIFT;
+}
+
+static int
+rtl8169miimiw(Mii* mii, int pa, int ra, int data)
+{
+	uint r;
+	int timeo;
+	Ctlr *ctlr;
+
+	if(pa != 1)
+		return -1;
+	ctlr = mii->ctlr;
+
+	r = PhyFlag|((ra<<16) & RegaddrMASK)|((data<<DataSHIFT) & DataMASK);
+	csr32w(ctlr, Phyar, r);
+	delay(1);
+	for(timeo = 0; timeo < 2000; timeo++){
+		if(!((r = csr32r(ctlr, Phyar)) & PhyFlag))
+			break;
+		microdelay(100);
+	}
+	if(r & PhyFlag)
+		return -1;
+
+	return 0;
+}
+
+static int
+rtl8169mii(Ctlr* ctlr)
+{
+	MiiPhy *phy;
+
+	/*
+	 * Link management.
+	 */
+	if((ctlr->mii = malloc(sizeof(Mii))) == nil)
+		return -1;
+	ctlr->mii->mir = rtl8169miimir;
+	ctlr->mii->miw = rtl8169miimiw;
+	ctlr->mii->ctlr = ctlr;
+
+	/*
+	 * Get rev number out of Phyidr2 so can config properly.
+	 * There's probably more special stuff for Macv0[234] needed here.
+	 */
+	ctlr->phyv = rtl8169miimir(ctlr->mii, 1, Phyidr2) & 0x0F;
+	if(ctlr->macv == Macv02){
+		csr8w(ctlr, 0x82, 1);				/* magic */
+		rtl8169miimiw(ctlr->mii, 1, 0x0B, 0x0000);	/* magic */
+	}
+
+	if(mii(ctlr->mii, (1<<1)) == 0 || (phy = ctlr->mii->curphy) == nil){
+		free(ctlr->mii);
+		ctlr->mii = nil;
+		return -1;
+	}
+	print("oui %#ux phyno %d, macv = %#8.8ux phyv = %#4.4ux\n",
+		phy->oui, phy->phyno, ctlr->macv, ctlr->phyv);
+
+	miiane(ctlr->mii, ~0, ~0, ~0);
+
+	return 0;
+}
+
+void
+rtl8169promiscuous(void* arg, int on)
+{
+	Ether *edev;
+	Ctlr * ctlr;
+
+	edev = arg;
+	ctlr = edev->ctlr;
+	ilock(&ctlr->ilock);
+
+	if(on)
+		ctlr->rcr |= Aap;
+	else
+		ctlr->rcr &= ~Aap;
+	csr32w(ctlr, Rcr, ctlr->rcr);
+	iunlock(&ctlr->ilock);
+}
+
+#ifndef FS
+static long
+rtl8169ifstat(Ether* edev, void* a, long n, ulong offset)
+{
+	char *p;
+	Ctlr *ctlr;
+	Dtcc *dtcc;
+	int i, l, r, timeo;
+
+	ctlr = edev->ctlr;
+	qlock(&ctlr->slock);
+
+	p = nil;
+	if(waserror()){
+		qunlock(&ctlr->slock);
+		free(p);
+		nexterror();
+	}
+
+	csr32w(ctlr, Dtccr+4, 0);
+	csr32w(ctlr, Dtccr, PCIWADDR(ctlr->dtcc)|Cmd);
+	for(timeo = 0; timeo < 1000; timeo++){
+		if(!(csr32r(ctlr, Dtccr) & Cmd))
+			break;
+		delay(1);
+	}
+	if(csr32r(ctlr, Dtccr) & Cmd)
+		error(Eio);
+	dtcc = ctlr->dtcc;
+
+	edev->oerrs = dtcc->txer;
+	edev->crcs = dtcc->rxer;
+	edev->frames = dtcc->fae;
+	edev->buffs = dtcc->misspkt;
+	edev->overflows = ctlr->txdu+ctlr->rdu;
+
+	if(n == 0){
+		qunlock(&ctlr->slock);
+		poperror();
+		return 0;
+	}
+
+	if((p = malloc(READSTR)) == nil)
+		error(Enomem);
+
+	l = snprint(p, READSTR, "TxOk: %llud\n", dtcc->txok);
+	l += snprint(p+l, READSTR-l, "RxOk: %llud\n", dtcc->rxok);
+	l += snprint(p+l, READSTR-l, "TxEr: %llud\n", dtcc->txer);
+	l += snprint(p+l, READSTR-l, "RxEr: %ud\n", dtcc->rxer);
+	l += snprint(p+l, READSTR-l, "MissPkt: %ud\n", dtcc->misspkt);
+	l += snprint(p+l, READSTR-l, "FAE: %ud\n", dtcc->fae);
+	l += snprint(p+l, READSTR-l, "Tx1Col: %ud\n", dtcc->tx1col);
+	l += snprint(p+l, READSTR-l, "TxMCol: %ud\n", dtcc->txmcol);
+	l += snprint(p+l, READSTR-l, "RxOkPh: %llud\n", dtcc->rxokph);
+	l += snprint(p+l, READSTR-l, "RxOkBrd: %llud\n", dtcc->rxokbrd);
+	l += snprint(p+l, READSTR-l, "RxOkMu: %ud\n", dtcc->rxokmu);
+	l += snprint(p+l, READSTR-l, "TxAbt: %ud\n", dtcc->txabt);
+	l += snprint(p+l, READSTR-l, "TxUndrn: %ud\n", dtcc->txundrn);
+
+	l += snprint(p+l, READSTR-l, "txdu: %ud\n", ctlr->txdu);
+	l += snprint(p+l, READSTR-l, "tcpf: %ud\n", ctlr->tcpf);
+	l += snprint(p+l, READSTR-l, "udpf: %ud\n", ctlr->udpf);
+	l += snprint(p+l, READSTR-l, "ipf: %ud\n", ctlr->ipf);
+	l += snprint(p+l, READSTR-l, "fovf: %ud\n", ctlr->fovf);
+	l += snprint(p+l, READSTR-l, "ierrs: %ud\n", ctlr->ierrs);
+	l += snprint(p+l, READSTR-l, "rer: %ud\n", ctlr->rer);
+	l += snprint(p+l, READSTR-l, "rdu: %ud\n", ctlr->rdu);
+	l += snprint(p+l, READSTR-l, "punlc: %ud\n", ctlr->punlc);
+	l += snprint(p+l, READSTR-l, "fovw: %ud\n", ctlr->fovw);
+
+	l += snprint(p+l, READSTR-l, "tcr: %#8.8ux\n", ctlr->tcr);
+	l += snprint(p+l, READSTR-l, "rcr: %#8.8ux\n", ctlr->rcr);
+
+	if(ctlr->mii != nil && ctlr->mii->curphy != nil){
+		l += snprint(p+l, READSTR, "phy:   ");
+		for(i = 0; i < NMiiPhyr; i++){
+			if(i && ((i & 0x07) == 0))
+				l += snprint(p+l, READSTR-l, "\n       ");
+			r = miimir(ctlr->mii, i);
+			l += snprint(p+l, READSTR-l, " %4.4ux", r);
+		}
+		snprint(p+l, READSTR-l, "\n");
+	}
+
+	n = readstr(offset, a, n, p);
+
+	qunlock(&ctlr->slock);
+	poperror();
+	free(p);
+
+	return n;
+}
+#endif
+
+static void
+rtl8169halt(Ctlr* ctlr)
+{
+	csr8w(ctlr, Cr, 0);
+	csr16w(ctlr, Imr, 0);
+	csr16w(ctlr, Isr, ~0);
+}
+
+static int
+rtl8169reset(Ctlr* ctlr)
+{
+	u32int r;
+	int timeo;
+
+	/*
+	 * Soft reset the controller.
+	 */
+	csr8w(ctlr, Cr, Rst);
+	for(r = timeo = 0; timeo < 1000; timeo++){
+		r = csr8r(ctlr, Cr);
+		if(!(r & Rst))
+			break;
+		delay(1);
+	}
+	rtl8169halt(ctlr);
+
+	if(r & Rst)
+		return -1;
+	return 0;
+}
+
+static void
+rtl8169replenish(Ctlr* ctlr)
+{
+	D *d;
+	int rdt;
+	Block *bp;
+
+	rdt = ctlr->rdt;
+	while(NEXT(rdt, ctlr->nrd) != ctlr->rdh){
+		d = &ctlr->rd[rdt];
+		if(ctlr->rb[rdt] == nil){
+			/*
+			 * Simple allocation for now.
+			 * This better be aligned on 8.
+			 */
+			bp = iallocb(Mps);
+			if(bp == nil){
+				iprint("no available buffers\n");
+				break;
+			}
+			ctlr->rb[rdt] = bp;
+			d->addrlo = PCIWADDR(bp->rp);
+			d->addrhi = 0;
+		}
+		coherence();
+		d->control |= Own|Mps;
+		rdt = NEXT(rdt, ctlr->nrd);
+		ctlr->nrdfree++;
+	}
+	ctlr->rdt = rdt;
+}
+
+static int
+rtl8169init(Ether* edev)
+{
+	int i;
+	u32int r;
+	Block *bp;
+	Ctlr *ctlr;
+	u8int cplusc;
+
+	ctlr = edev->ctlr;
+	ilock(&ctlr->ilock);
+
+	rtl8169halt(ctlr);
+
+	/*
+	 * MAC Address.
+	 * Must put chip into config register write enable mode.
+	 */
+	csr8w(ctlr, Cr9346, Eem1|Eem0);
+	r = (edev->ea[3]<<24)|(edev->ea[2]<<16)|(edev->ea[1]<<8)|edev->ea[0];
+	csr32w(ctlr, Idr0, r);
+	r = (edev->ea[5]<<8)|edev->ea[4];
+	csr32w(ctlr, Idr0+4, r);
+
+	/*
+	 * Transmitter.
+	 */
+	memset(ctlr->td, 0, sizeof(D)*ctlr->ntd);
+	ctlr->tdh = ctlr->tdt = 0;
+	ctlr->td[ctlr->ntd-1].control = Eor;
+
+	/*
+	 * Receiver.
+	 * Need to do something here about the multicast filter.
+	 */
+	memset(ctlr->rd, 0, sizeof(D)*ctlr->nrd);
+	ctlr->nrdfree = ctlr->rdh = ctlr->rdt = 0;
+	ctlr->rd[ctlr->nrd-1].control = Eor;
+
+	for(i = 0; i < ctlr->nrd; i++){
+		if((bp = ctlr->rb[i]) != nil){
+			ctlr->rb[i] = nil;
+			freeb(bp);
+		}
+	}
+	rtl8169replenish(ctlr);
+	ctlr->rcr = Rxfthnone|Mrxdmaunlimited|Ab|Apm;
+
+	/*
+	 * Mtps is in units of 128 except for the RTL8169
+	 * where is is 32. If using jumbo frames should be
+	 * set to 0x3F.
+	 * Setting Mulrw in Cplusc disables the Tx/Rx DMA burst
+	 * settings in Tcr/Rcr; the (1<<14) is magic.
+	 */
+	ctlr->mtps = HOWMANY(Mps, 128);
+	cplusc = csr16r(ctlr, Cplusc) & ~(1<<14);
+	cplusc |= /*Rxchksum|*/Mulrw;
+	dprint("mac = %.2ux\n", ctlr->macv);
+	switch(ctlr->macv){
+	default:
+		print("bad mac %.2ux\n", ctlr->macv);
+		return -1;
+	case Macv01:
+		ctlr->mtps = HOWMANY(Mps, 32);
+		break;
+	case Macv02:
+	case Macv03:
+		cplusc |= (1<<14);			/* magic */
+		break;
+	case Macv05:
+		/*
+		 * This is interpreted from clearly bogus code
+		 * in the manufacturer-supplied driver, it could
+		 * be wrong. Untested.
+		 */
+		r = csr8r(ctlr, Config2) & 0x07;
+		if(r == 0x01)				/* 66MHz PCI */
+			csr32w(ctlr, 0x7C, 0x0007FFFF);	/* magic */
+		else
+			csr32w(ctlr, 0x7C, 0x0007FF00);	/* magic */
+		pciclrmwi(ctlr->pcidev);
+		break;
+	case Macv13:
+		/*
+		 * This is interpreted from clearly bogus code
+		 * in the manufacturer-supplied driver, it could
+		 * be wrong. Untested.
+		 */
+		pcicfgw8(ctlr->pcidev, 0x68, 0x00);	/* magic */
+		pcicfgw8(ctlr->pcidev, 0x69, 0x08);	/* magic */
+		break;
+	case Macv04:
+	case Macv11:
+	case Macv12:
+	case Macv14:
+	case Macv15:
+		break;
+	}
+
+	/*
+	 * Enable receiver/transmitter.
+	 * Need to do this first or some of the settings below
+	 * won't take.
+	 */
+	switch(ctlr->pciv){
+	default:
+		csr8w(ctlr, Cr, Te|Re);
+		csr32w(ctlr, Tcr, Ifg1|Ifg0|Mtxdmaunlimited);
+		csr32w(ctlr, Rcr, ctlr->rcr);
+	case Rtl8169sc:
+	case Rtl8168b:
+		break;
+	}
+
+	/*
+	 * Interrupts.
+	 * Disable Tdu|Tok for now, the transmit routine will tidy.
+	 * Tdu means the NIC ran out of descriptors to send, so it
+	 * doesn't really need to ever be on.
+	 */
+	csr32w(ctlr, Timerint, 0);
+	ctlr->imr = Serr|Timeout|Fovw|Punlc|Rdu|Ter|Rer|Rok;
+	csr16w(ctlr, Imr, ctlr->imr);
+
+	/*
+	 * Clear missed-packet counter;
+	 * initial early transmit threshold value;
+	 * set the descriptor ring base addresses;
+	 * set the maximum receive packet size;
+	 * no early-receive interrupts.
+	 */
+	csr32w(ctlr, Mpc, 0);
+	csr8w(ctlr, Mtps, ctlr->mtps);
+	csr32w(ctlr, Tnpds+4, 0);
+	csr32w(ctlr, Tnpds, PCIWADDR(ctlr->td));
+	csr32w(ctlr, Rdsar+4, 0);
+	csr32w(ctlr, Rdsar, PCIWADDR(ctlr->rd));
+	csr16w(ctlr, Rms, Mps);
+	r = csr16r(ctlr, Mulint) & 0xF000;
+	csr16w(ctlr, Mulint, r);
+	csr16w(ctlr, Cplusc, cplusc);
+
+	/*
+	 * Set configuration.
+	 */
+	switch(ctlr->pciv){
+	default:
+		break;
+	case Rtl8169sc:
+		csr16w(ctlr, 0xE2, 0);			/* magic */
+		csr8w(ctlr, Cr, Te|Re);
+		csr32w(ctlr, Tcr, Ifg1|Ifg0|Mtxdmaunlimited);
+		csr32w(ctlr, Rcr, ctlr->rcr);
+		break;
+	case Rtl8168b:
+	case Rtl8169c:
+		csr16w(ctlr, 0xE2, 0);			/* magic */
+		csr16w(ctlr, Cplusc, 0x2000);		/* magic */
+		csr8w(ctlr, Cr, Te|Re);
+		csr32w(ctlr, Tcr, Ifg1|Ifg0|Mtxdmaunlimited);
+		csr32w(ctlr, Rcr, ctlr->rcr);
+		csr16w(ctlr, Rms, 0x0800);
+		csr8w(ctlr, Mtps, 0x3F);
+		break;
+	}
+	ctlr->tcr = csr32r(ctlr, Tcr);
+	csr8w(ctlr, Cr9346, 0);
+
+	iunlock(&ctlr->ilock);
+
+//	rtl8169mii(ctlr);
+
+	return 0;
+}
+
+static void
+rtl8169attach(Ether* edev)
+{
+	int timeo;
+	Ctlr *ctlr;
+
+	ctlr = edev->ctlr;
+	qlock(&ctlr->alock);
+	if(ctlr->init == 0){
+		/*
+		 * Handle allocation/init errors here.
+		 */
+		ctlr->td = mallocalign(sizeof(D)*Ntd, 256, 0, 0);
+		ctlr->tb = malloc(Ntd*sizeof(Block*));
+		ctlr->ntd = Ntd;
+		ctlr->rd = mallocalign(sizeof(D)*Nrd, 256, 0, 0);
+		ctlr->rb = malloc(Nrd*sizeof(Block*));
+		ctlr->nrd = Nrd;
+		ctlr->dtcc = mallocalign(sizeof(Dtcc), 64, 0, 0);
+		rtl8169init(edev);
+		ctlr->init = 1;
+	}
+	qunlock(&ctlr->alock);
+
+	/*
+	 * Wait for link to be ready.
+	 */
+	for(timeo = 0; timeo < 3500; timeo++){
+		if(miistatus(ctlr->mii) == 0)
+			break;
+		delay(10);
+	}
+}
+
+static void
+rtl8169link(Ether* edev)
+{
+	uint r;
+	Ctlr *ctlr;
+
+	ctlr = edev->ctlr;
+
+	/*
+	 * Maybe the link changed - do we care very much?
+	 * Could stall transmits if no link, maybe?
+	 */
+	if(!((r = csr8r(ctlr, Phystatus)) & Linksts))
+		return;
+
+	if(r & Speed10)
+		edev->mbps = 10;
+	else if(r & Speed100)
+		edev->mbps = 100;
+	else if(r & Speed1000)
+		edev->mbps = 1000;
+}
+
+static void
+rtl8169transmit(Ether* edev)
+{
+	D *d;
+	Block *bp;
+	Ctlr *ctlr;
+	int control, x;
+
+	ctlr = edev->ctlr;
+
+	ilock(&ctlr->tlock);
+	for(x = ctlr->tdh; ctlr->ntq > 0; x = NEXT(x, ctlr->ntd)){
+		d = &ctlr->td[x];
+		if((control = d->control) & Own)
+			break;
+
+		/*
+		 * Check errors and log here.
+		 */
+		USED(control);
+
+		/*
+		 * Free it up.
+		 * Need to clean the descriptor here? Not really.
+		 * Simple freeb for now (no chain and freeblist).
+		 * Use ntq count for now.
+		 */
+		freeb(ctlr->tb[x]);
+		ctlr->tb[x] = nil;
+		d->control &= Eor;
+
+		ctlr->ntq--;
+	}
+	ctlr->tdh = x;
+
+	x = ctlr->tdt;
+	while(ctlr->ntq < (ctlr->ntd-1)){
+		if((bp = etheroq(edev)) == nil)
+			break;
+
+		d = &ctlr->td[x];
+		d->addrlo = PCIWADDR(bp->rp);
+		d->addrhi = 0;
+		ctlr->tb[x] = bp;
+		coherence();
+		d->control |= Own|Fs|Ls|((BLEN(bp)<<TxflSHIFT) & TxflMASK);
+
+		x = NEXT(x, ctlr->ntd);
+		ctlr->ntq++;
+	}
+	if(x != ctlr->tdt){
+		ctlr->tdt = x;
+		csr8w(ctlr, Tppoll, Npq);
+	}
+	else if(ctlr->ntq >= (ctlr->ntd-1))
+		ctlr->txdu++;
+
+	iunlock(&ctlr->tlock);
+}
+
+static void
+rtl8169receive(Ether* edev)
+{
+	D *d;
+	int rdh;
+	Block *bp;
+	Ctlr *ctlr;
+	u32int control;
+
+	ctlr = edev->ctlr;
+
+	rdh = ctlr->rdh;
+	for(;;){
+		d = &ctlr->rd[rdh];
+	
+		if(d->control & Own)
+			break;
+
+		control = d->control;
+		if((control & (Fs|Ls|Res)) == (Fs|Ls)){
+			bp = ctlr->rb[rdh];
+			ctlr->rb[rdh] = nil;
+			SETWPCNT(bp, ((control & RxflMASK)>>RxflSHIFT)-4);
+			bp->next = nil;
+
+#ifndef FS
+			if(control & Fovf)
+				ctlr->fovf++;
+#endif
+
+			switch(control & (Pid1|Pid0)){
+			default:
+				break;
+			case Pid0:
+				if(control & Tcpf){
+					ctlr->tcpf++;
+					break;
+				}
+#ifndef FS
+				bp->flag |= Btcpck;
+#endif
+				break;
+			case Pid1:
+				if(control & Udpf){
+					ctlr->udpf++;
+					break;
+				}
+#ifndef FS
+				bp->flag |= Budpck;
+#endif
+				break;
+			case Pid1|Pid0:
+				if(control & Ipf){
+					ctlr->ipf++;
+					break;
+				}
+#ifndef FS
+				bp->flag |= Bipck;
+#endif
+				break;
+			}
+			ETHERIQ(edev, bp, 1);
+		}
+		else{
+			/*
+			 * Error stuff here.
+			print("control %#8.8ux\n", control);
+			 */
+		}
+		d->control &= Eor;
+		ctlr->nrdfree--;
+		rdh = NEXT(rdh, ctlr->nrd);
+
+		if(ctlr->nrdfree < ctlr->nrd/2)
+			rtl8169replenish(ctlr);
+	}
+	ctlr->rdh = rdh;
+}
+
+static void
+rtl8169interrupt(Ureg*, void* arg)
+{
+	Ctlr *ctlr;
+	Ether *edev;
+	u32int isr;
+
+	edev = arg;
+	ctlr = edev->ctlr;
+
+	while((isr = csr16r(ctlr, Isr)) != 0 && isr != 0xFFFF){
+		csr16w(ctlr, Isr, isr);
+		if((isr & ctlr->imr) == 0)
+			break;
+		if(isr & (Fovw|Punlc|Rdu|Rer|Rok)){
+			rtl8169receive(edev);
+			if(!(isr & (Punlc|Rok)))
+				ctlr->ierrs++;
+			if(isr & Rer)
+				ctlr->rer++;
+			if(isr & Rdu)
+				ctlr->rdu++;
+			if(isr & Punlc)
+				ctlr->punlc++;
+			if(isr & Fovw)
+				ctlr->fovw++;
+			isr &= ~(Fovw|Rdu|Rer|Rok);
+		}
+
+		if(isr & (Tdu|Ter|Tok)){
+			rtl8169transmit(edev);
+			isr &= ~(Tdu|Ter|Tok);
+		}
+
+		if(isr & Punlc){
+			rtl8169link(edev);
+			isr &= ~Punlc;
+		}
+
+		/*
+		 * Some of the reserved bits get set sometimes...
+		 */
+		if(isr & (Serr|Timeout|Tdu|Fovw|Punlc|Rdu|Ter|Tok|Rer|Rok))
+			panic("rtl8169interrupt: imr %#4.4ux isr %#4.4ux\n",
+				csr16r(ctlr, Imr), isr);
+	}
+}
+
+static void
+rtl8169pci(void)
+{
+	Pcidev *p;
+	Ctlr *ctlr;
+	int i, port;
+
+	p = nil;
+	while(p = pcimatch(p, 0, 0)){
+#ifdef FS
+		if(p->ccru != ((0x02<<8)|0x00))
+#else
+		if(p->ccrb != 0x02 || p->ccru != 0)
+#endif
+			continue;
+
+		dprint("  pci: found  vid %ux did %ux\n", p->vid, p->did);
+		switch(i = ((p->did<<16)|p->vid)){
+		default:
+			continue;
+		case Rtl8100e:			/* RTL810[01]E ? */
+		case Rtl8169c:			/* RTL8169C */
+		case Rtl8169sc:			/* RTL8169SC */
+		case Rtl8168b:			/* RTL8168B */
+		case Rtl8169:			/* RTL8169 */
+			break;
+		case (0xC107<<16)|0x1259:	/* Corega CG-LAPCIGT */
+			i = Rtl8169;
+			break;
+		}
+
+		port = p->mem[0].bar & ~0x01;
+		if(ioalloc(port, p->mem[0].size, 0, "rtl8169") < 0){
+			print("rtl8169: port %#ux in use\n", port);
+			continue;
+		}
+
+		ctlr = malloc(sizeof(Ctlr));
+		ctlr->port = port;
+		ctlr->pcidev = p;
+		ctlr->pciv = i;
+
+#ifndef FS
+		if(pcigetpms(p) > 0){
+			pcisetpms(p, 0);
+	
+			for(i = 0; i < 6; i++)
+				pcicfgw32(p, PciBAR0+i*4, p->mem[i].bar);
+			pcicfgw8(p, PciINTL, p->intl);
+			pcicfgw8(p, PciLTR, p->ltr);
+			pcicfgw8(p, PciCLS, p->cls);
+			pcicfgw16(p, PciPCR, p->pcr);
+		}
+#endif
+
+		if(rtl8169reset(ctlr)){
+			iofree(port);
+			free(ctlr);
+			continue;
+		}
+
+		/*
+		 * Extract the chip hardware version,
+		 * needed to configure each properly.
+		 */
+		ctlr->macv = csr32r(ctlr, Tcr) & HwveridMASK;
+
+		rtl8169mii(ctlr);
+
+		pcisetbme(p);
+
+		if(rtl8169ctlrhead != nil)
+			rtl8169ctlrtail->next = ctlr;
+		else
+			rtl8169ctlrhead = ctlr;
+		rtl8169ctlrtail = ctlr;
+	}
+}
+
+int
+rtl8169pnp(Ether* edev)
+{
+	u32int r;
+	Ctlr *ctlr;
+	uchar ea[Eaddrlen];
+
+	if(rtl8169ctlrhead == nil)
+		rtl8169pci();
+
+	/*
+	 * Any adapter matches if no edev->port is supplied,
+	 * otherwise the ports must match.
+	 */
+	for(ctlr = rtl8169ctlrhead; ctlr != nil; ctlr = ctlr->next){
+		if(ctlr->active)
+			continue;
+		if(edev->port == 0 || edev->port == ctlr->port){
+			ctlr->active = 1;
+			break;
+		}
+	}
+	if(ctlr == nil)
+		return -1;
+
+	edev->ctlr = ctlr;
+	edev->port = ctlr->port;
+	edev->irq = ctlr->pcidev->intl;
+	edev->tbdf = ctlr->pcidev->tbdf;
+	edev->mbps = 100;
+
+	/*
+	 * Check if the adapter's station address is to be overridden.
+	 * If not, read it from the device and set in edev->ea.
+	 */
+	memset(ea, 0, Eaddrlen);
+	if(memcmp(ea, edev->ea, Eaddrlen) == 0){
+		r = csr32r(ctlr, Idr0);
+		edev->ea[0] = r;
+		edev->ea[1] = r>>8;
+		edev->ea[2] = r>>16;
+		edev->ea[3] = r>>24;
+		r = csr32r(ctlr, Idr0+4);
+		edev->ea[4] = r;
+		edev->ea[5] = r>>8;
+	}
+
+	edev->attach = rtl8169attach;
+	edev->transmit = rtl8169transmit;
+	edev->interrupt = rtl8169interrupt;
+#ifndef FS
+	edev->ifstat = rtl8169ifstat;
+
+	edev->arg = edev;
+	edev->promiscuous = rtl8169promiscuous;
+#endif
+	rtl8169link(edev);
+
+	return 0;
+}
+
+void
+ether8169link(void)
+{
+	addethercard("rtl8169", rtl8169pnp);
+}

+ 4 - 0
sys/src/fs/pc/etherdat.h

@@ -0,0 +1,4 @@
+#include "all.h"
+#include "io.h"
+#include "mem.h"
+#include "../ip/ip.h"

+ 11 - 3
sys/src/fs/pc/etherif.c

@@ -5,6 +5,8 @@
 #include "../ip/ip.h"
 #include "etherif.h"
 
+#define dprint(...)	/* print(__VA_ARGS__) */
+
 extern int etherga620reset(Ether*);
 extern int ether21140reset(Ether*);
 extern int etherelnk3reset(Ether*);
@@ -13,6 +15,7 @@ extern int igbepnp(Ether *);
 extern int dp83815reset(Ether*);
 extern int dp83820pnp(Ether*);
 extern int rtl8139pnp(Ether*);
+extern int rtl8169pnp(Ether*);
 
 static struct
 {
@@ -30,6 +33,7 @@ static struct
 	{ "i82557",	etheri82557reset, },
 	{ "igbe",	igbepnp, },
 	{ "rtl8139",	rtl8139pnp, },
+	{ "rtl8169",	rtl8169pnp, },
 	{ 0, },
 };
 
@@ -295,6 +299,7 @@ etherinit(void)
 		for(n = 0; etherctlr[n].type; n++){
 			if(cistrcmp(etherctlr[n].type, ether->type))
 				continue;
+			dprint("FOUND ether %s\n", etherctlr[n].type);
 			ether->ctlrno = ctlrno;
 			ether->tbdf = BUSUNKNOWN;
 			for(i = 0; i < ether->nopt; i++){
@@ -302,10 +307,13 @@ etherinit(void)
 					continue;
 				if(parseether(ether->ea, &ether->opt[i][3]) == -1)
 					memset(ether->ea, 0, Easize);
-			}	
-			if((*etherctlr[n].reset)(ether))
+			}
+			dprint("  reset ... ");
+			if((*etherctlr[n].reset)(ether)){
+				dprint("fail\n");
 				break;
-
+			}
+			dprint("okay\n");
 			if(ether->irq == 2)
 				ether->irq = 9;
 			setvec(Int0vec + ether->irq, ether->interrupt, ether);

+ 10 - 0
sys/src/fs/pc/pci.c

@@ -428,6 +428,14 @@ pcicfgw32(Pcidev* pcidev, int rno, int data)
 	pcicfgrw32(pcidev->tbdf, rno, data, 0);
 }
 
+void
+pciclrmwi(Pcidev* p)
+{
+	p->pcr &= ~MemWrInv;
+	pcicfgw16(p, PciPCR, p->pcr);
+}
+
+
 Pcidev*
 pcimatch(Pcidev* prev, int vid, int did)
 {
@@ -547,6 +555,8 @@ vid2name(int vid)
 		return "netgear";
 	case 0x15ad:
 		return "vmware";
+	case 0x16ec:
+		return "usrobot";
 	case 0x5333:			/* "S" "3".  har, har. */
 		return "s3";
 	case 0x8086:

+ 5 - 0
sys/src/fs/port/config.c

@@ -713,6 +713,11 @@ dowormcopy(void)
 		panic("main file system missing");
 	fdev = f1->dev;
 	from = wormof(fdev);			/* fake worm special */
+	if (from->type != Devfworm && from->type != Devcw) {
+		print("main file system is not a worm; copyworm may not do what you want!\n");
+		print("waiting for 20 seconds...\n");
+		delay(20000);
+	}
 
 	f2 = fsstr("output");
 	if(f2 == nil) {

+ 19 - 4
sys/src/fs/port/devcons.c

@@ -132,6 +132,8 @@ conschar(void)
 	return c;
 }
 
+#define ctl(c)	((c) & 037)
+
 /*
  * dispose of input character at interrupt time
  * always called splhi from proc 0
@@ -142,14 +144,15 @@ kbdchar(int c)
 	int s;
 	uchar *p;
 	uchar ch;
+	char uparrow[2];
 
-	if(c == ('T' - '@'))			/* ^t */
+	if(c == ctl('t'))
 		dotrace(0);
 	s = splhi();
 	lock(&readq);
 	if(readq.reading)
 		goto out;
-	if(c == ('U' - '@')) {
+	if(c == ctl('u')) {
 		if(echo)
 			putstrn("^U\n", 3);	/* echo */
 		readq.in = readq.out;
@@ -159,13 +162,24 @@ kbdchar(int c)
 		c = '\n';
 	ch = c;
 	if(echo)
-		putstrn((char*)&ch, 1);		/* echo */
+		/*
+		 * cga mode (for example) does a poor job of showing control
+		 * chars, so echo them as ^X.  this will mess up subsequent
+		 * backspace erasures, alas.  it also doesn't cope with utf.
+		 */
+		if (ch >= ' ' || ch == '\n' || ch == '\t' || ch == '\b')
+			putstrn((char*)&ch, 1);		/* echo */
+		else {
+			uparrow[0] = '^';
+			uparrow[1] = ch + '@';	/* ctrl -> upper case */
+			putstrn(uparrow, 2);
+		}
 	p = readq.in;
 	*p++ = c;
 	if(p >= readq.buf+sizeof(readq.buf))
 		p = readq.buf;
 	readq.in = p;
-	if(c == '\n' || c == ('D' - '@')) {
+	if(c == '\n' || c == ctl('d')) {
 		readq.reading = 1;
 		wakeup(&readq);
 	}
@@ -188,6 +202,7 @@ rawchar(int seconds)
 		if(c) {
 			if(c == '\r')
 				c = '\n';
+			/* ugh!  yet another place that does echoing */
 			if(c == '\n') {
 				(*consputc)('\r');
 				delay(10);

+ 9 - 4
sys/src/fs/port/main.c

@@ -305,6 +305,8 @@ enum {
 void
 exit(void)
 {
+	long timeleft;
+
 	u = 0;
 	lock(&active);
 	active.machs &= ~(1<<m->machno);
@@ -316,13 +318,16 @@ exit(void)
 	while(active.machs)
 		delay(1);
 
-	print("halted at %T.\npress a key to reboot sooner than %d mins.\n",
-		time(), Keydelay/60);
+	print("halted at %T.\n", time());
+	print("press the Enter key to reboot sooner than %d mins.\n",
+		Keydelay/60);
 	delay(500);		/* time to drain print q */
 
 	splhi();
-	/* reboot after delay (for debugging) or at key press */
-	rawchar(Keydelay);
+	/* reboot after delay (for debugging) or at newline */
+	for (timeleft = Keydelay; timeleft > 0; timeleft--)
+		if (rawchar(1) == '\n')
+			break;
 
 	spllo();
 	delay(500);		/* time to drain echo q */

+ 33 - 38
sys/src/libhtml/lex.c

@@ -127,7 +127,7 @@ Rune* tagnames[] = {
 };
 
 // HTML 4.0 attribute names.
-// Keep sorted, and in correspondence with enum in i.h.
+// Keep sorted, and in correspondence with enum in impl.h.
 Rune* attrnames[] = {
 	L"abbr",
 	L"accept-charset",
@@ -540,7 +540,7 @@ static StringInt*	attrtable;		// initialized from attrnames
 static void		lexinit();
 static int		getplaindata(TokenSource* ts, Token* a, int* pai);
 static int		getdata(TokenSource* ts, int firstc, int starti, Token* a, int* pai);
-static int		getscriptdata(TokenSource* ts, int firstc, int starti, Token* a, int* pai);
+static int		getscriptdata(TokenSource* ts, int firstc, int starti, Token* a, int* pai, int findtag);
 static int		gettag(TokenSource* ts, int starti, Token* a, int* pai);
 static Rune*	buftostr(Rune* s, Rune* buf, int j);
 static int		comment(TokenSource* ts);
@@ -620,11 +620,11 @@ _gettoks(uchar* data, int datalen, int chset, int mtype, int* plen)
 				break;
 			if(c == '<') {
 				tag = gettag(ts, starti, a, &ai);
-				if(tag == Tscript) {
+				if(tag == Tscript || tag == Tstyle) {
 					// special rules for getting Data after....
 					starti = ts->i;
 					c = getchar(ts);
-					tag = getscriptdata(ts, c, starti, a, &ai);
+					tag = getscriptdata(ts, c, starti, a, &ai, tag);
 				}
 			}
 			else
@@ -649,6 +649,7 @@ _gettoks(uchar* data, int datalen, int chset, int mtype, int* plen)
 				fprint(2, "lex: got token %T\n", &a[ai]);
 		}
 	}
+	free(ts);
 	if(dbglex)
 		fprint(2, "lex: returning %d tokens\n", ai);
 	*plen = ai;
@@ -793,9 +794,9 @@ getdata(TokenSource* ts, int firstc, int starti, Token* a, int* pai)
 }
 
 // The rules for lexing scripts are different (ugh).
-// Gather up everything until see a </SCRIPT>.
+// Gather up everything until see an "</" tagnames[tok] ">"
 static int
-getscriptdata(TokenSource* ts, int firstc, int starti, Token* a, int* pai)
+getscriptdata(TokenSource* ts, int firstc, int starti, Token* a, int* pai, int findtag)
 {
 	Rune*	s;
 	int	j;
@@ -818,8 +819,10 @@ getscriptdata(TokenSource* ts, int firstc, int starti, Token* a, int* pai)
 			savei = ts->i;
 			c = getchar(ts);
 			if(c == '!') {
-				while(c >= 0 && c != '\n' && c != '\r')
-					c = getchar(ts);
+//				while(c >= 0 && c != '\n' && c != '\r')
+//					c = getchar(ts);
+				if(comment(ts) == -1)
+					break;
 				if(c == '\r')
 					c = getchar(ts);
 				if(c == '\n')
@@ -833,11 +836,11 @@ getscriptdata(TokenSource* ts, int firstc, int starti, Token* a, int* pai)
 				if(tag != Comment)
 					(*pai)--;
 				backup(ts, tstarti);
-				if(tag == Tscript + RBRA) {
+				if(tag == findtag + RBRA) {
 					done = 1;
 					break;
 				}
-				// here tag was not </SCRIPT>, so take as regular data
+				// here tag was not the one we were looking for, so take as regular data
 				c = getchar(ts);
 			}
 		}
@@ -1196,8 +1199,7 @@ mainloop_done:
 // We've just read an '&'; look for an entity reference
 // name, and if found, return translated char.
 // if there is a complete entity name but it isn't known,
-// try prefixes (gets around some buggy HTML out there),
-// and if that fails, back up to just past the '&' and return '&'.
+// back up to just past the '&' and return '&'.
 // If the entity can't be completed in the current buffer, back up
 // to the '&' and return -1.
 static int
@@ -1208,7 +1210,6 @@ ampersand(TokenSource* ts)
 	int	fnd;
 	int	ans;
 	int	v;
-	int	i;
 	int	k;
 	Rune	buf[SMALLBUFSIZE];
 
@@ -1219,12 +1220,23 @@ ampersand(TokenSource* ts)
 	if(c == '#') {
 		c = getchar(ts);
 		v = 0;
-		while(c >= 0) {
-			if(!(c < 256 && isdigit(c)))
-				break;
-			v = v*10 + c - 48;
-			c = getchar(ts);
-		}
+		if(c == 'X' || c == 'x')
+			for(c = getchar(ts); c < 256; c = getchar(ts))
+				if(c >= '0' && c <= '9')
+					v = v*16+c-'0';
+				else if(c >= 'A' && c<= 'F')
+					v = v*16+c-'A'+10;
+				else if(c >= 'a' && c <= 'f')
+					v = v*16+c-'a'+10;
+				else
+					break;
+		else
+			while(c >= 0) {
+				if(!(c < 256 && isdigit(c)))
+					break;
+				v = v*10 + c - 48;
+				c = getchar(ts);
+			}
 		if(c >= 0) {
 			if(!(c == ';' || c == '\n' || c == '\r'))
 				ungetchar(ts, c);
@@ -1245,7 +1257,7 @@ ampersand(TokenSource* ts)
 			c = getchar(ts);
 			if(c < 0)
 				break;
-			if(ISNAMCHAR(c)) {
+			if(c < 256 && (isalpha(c) || isdigit(c))) {
 				if(k < SMALLBUFSIZE-1)
 					buf[k++] = c;
 			}
@@ -1255,25 +1267,8 @@ ampersand(TokenSource* ts)
 				break;
 			}
 		}
-		if(c >= 0) {
+		if(c >= 256 || c != '=' && !(isalpha(c) || isdigit(c)))
 			fnd = _lookup(chartab, NCHARTAB, buf, k, &ans);
-			if(!fnd) {
-				// Try prefixes of s
-				if(c == ';' || c == '\n' || c == '\r')
-					ungetchar(ts, c);
-				i = k;
-				while(--k > 0) {
-					fnd = _lookup(chartab, NCHARTAB, buf, k, &ans);
-					if(fnd) {
-						while(i > k) {
-							i--;
-							ungetchar(ts, buf[i]);
-						}
-						break;
-					}
-				}
-			}
-		}
 	}
 	if(!fnd) {
 		backup(ts, savei);

+ 4 - 2
sys/src/libndb/ndbipinfo.c

@@ -181,8 +181,10 @@ ndbipinfo(Ndb *db, char *attr, char *val, char **alist, int n)
 	ipstr = ndbgetvalue(db, &s, attr, val, "ip", &nt);
 	if(ipstr == nil){
 		/* none found, make one up */
-		if(strcmp(attr, "ip") != 0)
-			return nil;
+		if(strcmp(attr, "ip") != 0) {
+			ndbfree(f);
+			return nil;	
+		}
 		t = ndbnew("ip", val);
 		t->line = t;
 		t->entry = nil;