Browse Source

Plan 9 from Bell Labs 2004-11-16

David du Colombier 19 years ago
parent
commit
4bac93824c

+ 20 - 16
dist/replica/_plan9.db

@@ -3007,7 +3007,7 @@ rc/bin/dosmnt - 775 sys sys 958526437 285
 rc/bin/eject - 775 sys sys 945617207 123
 rc/bin/fax - 775 sys sys 1015701359 2390
 rc/bin/fedex - 775 sys sys 1060187356 1244
-rc/bin/fshalt - 775 sys sys 1076458748 1315
+rc/bin/fshalt - 775 sys sys 1100524288 1335
 rc/bin/homespool - 775 sys sys 945617207 339
 rc/bin/ipconf - 20000000775 sys sys 1058791152 0
 rc/bin/ipconf/inside - 775 sys sys 1058790955 427
@@ -3015,7 +3015,7 @@ rc/bin/ipconf/lra - 775 sys sys 1058791152 1558
 rc/bin/ipconf/outside - 775 sys sys 1058790951 550
 rc/bin/ipconf/theworld - 775 sys sys 1058790940 1212
 rc/bin/ipso - 775 sys sys 1079377794 2838
-rc/bin/iwhois - 775 sys sys 1068053163 584
+rc/bin/iwhois - 775 sys sys 1100534870 1372
 rc/bin/kill - 775 sys sys 1018387014 132
 rc/bin/label - 775 sys sys 945617207 34
 rc/bin/lc - 775 sys sys 945617207 24
@@ -4645,7 +4645,7 @@ sys/man/1/0intro - 664 sys sys 958249499 9623
 sys/man/1/2a - 664 sys sys 1089299164 1188
 sys/man/1/2c - 664 sys sys 1089299164 7193
 sys/man/1/2l - 664 sys sys 1089903786 3992
-sys/man/1/INDEX - 664 sys sys 1089339723 3026
+sys/man/1/INDEX - 664 sys sys 1100525423 3010
 sys/man/1/INDEX.html - 664 sys sys 1089320990 16634
 sys/man/1/acid - 664 sys sys 1082404958 9725
 sys/man/1/acme - 664 sys sys 1019828741 17587
@@ -4687,8 +4687,7 @@ sys/man/1/ed - 664 sys sys 961259286 13916
 sys/man/1/emacs - 664 sys sys 944959673 199
 sys/man/1/eqn - 664 sys sys 944959675 5655
 sys/man/1/expect - 664 sys sys 1058791094 3023
-sys/man/1/face - 664 sys sys 1062505426 2278
-sys/man/1/faces - 664 sys sys 1072972212 2093
+sys/man/1/faces - 664 sys sys 1100525422 2317
 sys/man/1/factor - 664 sys sys 957920005 1019
 sys/man/1/file - 664 sys sys 1015024739 1578
 sys/man/1/filter - 664 sys sys 1041108741 4403
@@ -4989,7 +4988,7 @@ sys/man/4/cfs - 664 sys sys 1015024813 1758
 sys/man/4/consolefs - 664 sys sys 1069179473 3920
 sys/man/4/dossrv - 664 sys sys 1015024813 4176
 sys/man/4/execnet - 664 sys sys 1019866708 1069
-sys/man/4/exportfs - 664 sys sys 1081200463 4652
+sys/man/4/exportfs - 664 sys sys 1100524176 4540
 sys/man/4/ext2srv - 664 sys sys 1055692986 2409
 sys/man/4/factotum - 664 sys sys 1053127875 14460
 sys/man/4/fossil - 664 sys sys 1087005581 9423
@@ -5084,7 +5083,7 @@ sys/man/8/INDEX.html - 664 sys sys 1089321186 7944
 sys/man/8/aan - 664 sys sys 1045501064 1670
 sys/man/8/aliasmail - 664 sys sys 1055701148 1353
 sys/man/8/apm - 664 sys sys 1017679308 1811
-sys/man/8/auth - 664 sys sys 1079529504 4225
+sys/man/8/auth - 664 sys sys 1100575042 4226
 sys/man/8/boot - 664 sys sys 1063858248 8362
 sys/man/8/booting - 664 sys sys 1015024984 4136
 sys/man/8/checkarenas - 664 sys sys 1019866709 669
@@ -6805,7 +6804,7 @@ sys/src/cmd/acme/rows.c - 664 sys sys 1084542482 14664
 sys/src/cmd/acme/scrl.c - 664 sys sys 1014926095 3072
 sys/src/cmd/acme/text.c - 664 sys sys 1099500744 27642
 sys/src/cmd/acme/time.c - 664 sys sys 1014926095 1783
-sys/src/cmd/acme/util.c - 664 sys sys 1079102916 7412
+sys/src/cmd/acme/util.c - 664 sys sys 1100535510 7208
 sys/src/cmd/acme/wind.c - 664 sys sys 1096388102 11187
 sys/src/cmd/acme/xfid.c - 664 sys sys 1079044030 19175
 sys/src/cmd/ar.c - 664 sys sys 1046643027 23717
@@ -9770,7 +9769,7 @@ sys/src/cmd/netstat.c - 664 sys sys 1078839959 3846
 sys/src/cmd/news.c - 664 sys sys 1014926614 3778
 sys/src/cmd/nfs.c - 664 sys sys 1050068720 31096
 sys/src/cmd/nm.c - 664 sys sys 1073313392 4912
-sys/src/cmd/nntpfs.c - 664 sys sys 1094156765 18904
+sys/src/cmd/nntpfs.c - 664 sys sys 1100524486 18920
 sys/src/cmd/ns.c - 664 sys sys 984717934 3558
 sys/src/cmd/p.c - 664 sys sys 1043516305 1497
 sys/src/cmd/page - 20000000775 sys sys 956344628 0
@@ -10379,7 +10378,7 @@ sys/src/cmd/spin/vars.c - 664 sys sys 953242990 8412
 sys/src/cmd/spin/version.h - 664 sys sys 956275780 54
 sys/src/cmd/split.c - 664 sys sys 1038183077 3219
 sys/src/cmd/srv.c - 664 sys sys 1074452607 3885
-sys/src/cmd/srvfs.c - 664 sys sys 1084470046 1655
+sys/src/cmd/srvfs.c - 664 sys sys 1100524152 1672
 sys/src/cmd/srvold9p - 20000000775 sys sys 1016921011 0
 sys/src/cmd/srvold9p/9p1.h - 664 sys sys 1016921010 2413
 sys/src/cmd/srvold9p/9p1lib.c - 664 sys sys 1016921010 11446
@@ -10929,13 +10928,13 @@ sys/src/cmd/upas/vf/mkfile - 664 sys sys 1064393881 241
 sys/src/cmd/upas/vf/vf.c - 664 sys sys 1087829630 17442
 sys/src/cmd/usb - 20000000775 sys sys 1017802022 0
 sys/src/cmd/usb/audio - 20000000775 sys sys 1017802021 0
-sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1099760452 18231
-sys/src/cmd/usb/audio/audiosub.c - 664 sys sys 1099760453 13512
+sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1100568596 18166
+sys/src/cmd/usb/audio/audiosub.c - 664 sys sys 1100568596 6967
 sys/src/cmd/usb/audio/mkfile - 664 sys sys 1091204980 349
-sys/src/cmd/usb/audio/usbaudio.c - 664 sys sys 1099760452 15571
-sys/src/cmd/usb/audio/usbaudio.h - 664 sys sys 1099760452 1911
-sys/src/cmd/usb/audio/usbaudioctl.c - 664 sys sys 1099760452 42236
-sys/src/cmd/usb/audio/usbaudioctl.h - 664 sys sys 1099760453 2120
+sys/src/cmd/usb/audio/usbaudio.c - 664 sys sys 1100568596 9817
+sys/src/cmd/usb/audio/usbaudio.h - 664 sys sys 1100568597 1861
+sys/src/cmd/usb/audio/usbaudioctl.c - 664 sys sys 1100568597 17264
+sys/src/cmd/usb/audio/usbaudioctl.h - 664 sys sys 1100568597 600
 sys/src/cmd/usb/lib - 20000000775 sys sys 1018369393 0
 sys/src/cmd/usb/lib/device.c - 664 sys sys 1099760882 2968
 sys/src/cmd/usb/lib/dump.c - 664 sys sys 1099760882 12704
@@ -12392,3 +12391,8 @@ usr/glenda/lib/profile - 664 glenda glenda 1021580005 847
 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
+386/bin/acme - 775 sys sys 1100579339 425046
+386/bin/nntpfs - 775 sys sys 1100579339 158859
+386/bin/usb/usbaudio - 775 sys sys 1100579340 183269
+386/bin/srvfs - 775 sys sys 1100579339 39567
+sys/man/1/INDEX - 664 sys sys 1100579340 3010

+ 19 - 20
dist/replica/plan9.db

@@ -20,7 +20,7 @@
 386/bin/9660srv - 775 sys sys 1085076971 101995
 386/bin/aan - 775 sys sys 1085076971 128820
 386/bin/acid - 775 sys sys 1091936087 353717
-386/bin/acme - 775 sys sys 1099545477 425223
+386/bin/acme - 775 sys sys 1100579339 425046
 386/bin/ape - 20000000775 sys sys 1016944144 0
 386/bin/ape/basename - 775 sys sys 1087442501 132681
 386/bin/ape/cc - 775 sys sys 1085076973 68304
@@ -334,7 +334,7 @@
 386/bin/news - 775 sys sys 1085077084 69654
 386/bin/nfs - 775 sys sys 1089397314 313346
 386/bin/nm - 775 sys sys 1091936093 113471
-386/bin/nntpfs - 775 sys sys 1094218814 158833
+386/bin/nntpfs - 775 sys sys 1100579339 158859
 386/bin/ns - 775 sys sys 1085077086 63226
 386/bin/p - 775 sys sys 1085077086 62948
 386/bin/page - 775 sys sys 1098158510 229681
@@ -390,7 +390,7 @@
 386/bin/spin - 775 sys sys 1094040113 655153
 386/bin/split - 775 sys sys 1085077099 73388
 386/bin/srv - 775 sys sys 1085077099 80398
-386/bin/srvfs - 775 sys sys 1085077099 39578
+386/bin/srvfs - 775 sys sys 1100579339 39567
 386/bin/srvold9p - 775 sys sys 1085077100 128139
 386/bin/ssh - 775 sys sys 1092539158 208978
 386/bin/sshnet - 775 sys sys 1092539158 280678
@@ -458,7 +458,7 @@
 386/bin/upas/unspam - 775 sys sys 1064598367 38
 386/bin/upas/vf - 775 sys sys 1087873352 90619
 386/bin/usb - 20000000775 sys sys 1019538890 0
-386/bin/usb/usbaudio - 775 sys sys 1099800617 206890
+386/bin/usb/usbaudio - 775 sys sys 1100579340 183269
 386/bin/usb/usbd - 775 sys sys 1099800617 127661
 386/bin/usb/usbmouse - 775 sys sys 1099800618 138206
 386/bin/usb/usbprinter - 775 sys sys 1089408719 222
@@ -3007,7 +3007,7 @@ rc/bin/dosmnt - 775 sys sys 958526437 285
 rc/bin/eject - 775 sys sys 945617207 123
 rc/bin/fax - 775 sys sys 1015701359 2390
 rc/bin/fedex - 775 sys sys 1060187356 1244
-rc/bin/fshalt - 775 sys sys 1076458748 1315
+rc/bin/fshalt - 775 sys sys 1100524288 1335
 rc/bin/homespool - 775 sys sys 945617207 339
 rc/bin/ipconf - 20000000775 sys sys 1058791152 0
 rc/bin/ipconf/inside - 775 sys sys 1058790955 427
@@ -3015,7 +3015,7 @@ rc/bin/ipconf/lra - 775 sys sys 1058791152 1558
 rc/bin/ipconf/outside - 775 sys sys 1058790951 550
 rc/bin/ipconf/theworld - 775 sys sys 1058790940 1212
 rc/bin/ipso - 775 sys sys 1079377794 2838
-rc/bin/iwhois - 775 sys sys 1068053163 584
+rc/bin/iwhois - 775 sys sys 1100534870 1372
 rc/bin/kill - 775 sys sys 1018387014 132
 rc/bin/label - 775 sys sys 945617207 34
 rc/bin/lc - 775 sys sys 945617207 24
@@ -4645,7 +4645,7 @@ sys/man/1/0intro - 664 sys sys 958249499 9623
 sys/man/1/2a - 664 sys sys 1089299164 1188
 sys/man/1/2c - 664 sys sys 1089299164 7193
 sys/man/1/2l - 664 sys sys 1089903786 3992
-sys/man/1/INDEX - 664 sys sys 1089339723 3026
+sys/man/1/INDEX - 664 sys sys 1100579340 3010
 sys/man/1/INDEX.html - 664 sys sys 1089320990 16634
 sys/man/1/acid - 664 sys sys 1082404958 9725
 sys/man/1/acme - 664 sys sys 1019828741 17587
@@ -4687,8 +4687,7 @@ sys/man/1/ed - 664 sys sys 961259286 13916
 sys/man/1/emacs - 664 sys sys 944959673 199
 sys/man/1/eqn - 664 sys sys 944959675 5655
 sys/man/1/expect - 664 sys sys 1058791094 3023
-sys/man/1/face - 664 sys sys 1062505426 2278
-sys/man/1/faces - 664 sys sys 1072972212 2093
+sys/man/1/faces - 664 sys sys 1100525422 2317
 sys/man/1/factor - 664 sys sys 957920005 1019
 sys/man/1/file - 664 sys sys 1015024739 1578
 sys/man/1/filter - 664 sys sys 1041108741 4403
@@ -4989,7 +4988,7 @@ sys/man/4/cfs - 664 sys sys 1015024813 1758
 sys/man/4/consolefs - 664 sys sys 1069179473 3920
 sys/man/4/dossrv - 664 sys sys 1015024813 4176
 sys/man/4/execnet - 664 sys sys 1019866708 1069
-sys/man/4/exportfs - 664 sys sys 1081200463 4652
+sys/man/4/exportfs - 664 sys sys 1100524176 4540
 sys/man/4/ext2srv - 664 sys sys 1055692986 2409
 sys/man/4/factotum - 664 sys sys 1053127875 14460
 sys/man/4/fossil - 664 sys sys 1087005581 9423
@@ -5084,7 +5083,7 @@ sys/man/8/INDEX.html - 664 sys sys 1089321186 7944
 sys/man/8/aan - 664 sys sys 1045501064 1670
 sys/man/8/aliasmail - 664 sys sys 1055701148 1353
 sys/man/8/apm - 664 sys sys 1017679308 1811
-sys/man/8/auth - 664 sys sys 1079529504 4225
+sys/man/8/auth - 664 sys sys 1100575042 4226
 sys/man/8/boot - 664 sys sys 1063858248 8362
 sys/man/8/booting - 664 sys sys 1015024984 4136
 sys/man/8/checkarenas - 664 sys sys 1019866709 669
@@ -6805,7 +6804,7 @@ sys/src/cmd/acme/rows.c - 664 sys sys 1084542482 14664
 sys/src/cmd/acme/scrl.c - 664 sys sys 1014926095 3072
 sys/src/cmd/acme/text.c - 664 sys sys 1099500744 27642
 sys/src/cmd/acme/time.c - 664 sys sys 1014926095 1783
-sys/src/cmd/acme/util.c - 664 sys sys 1079102916 7412
+sys/src/cmd/acme/util.c - 664 sys sys 1100535510 7208
 sys/src/cmd/acme/wind.c - 664 sys sys 1096388102 11187
 sys/src/cmd/acme/xfid.c - 664 sys sys 1079044030 19175
 sys/src/cmd/ar.c - 664 sys sys 1046643027 23717
@@ -9770,7 +9769,7 @@ sys/src/cmd/netstat.c - 664 sys sys 1078839959 3846
 sys/src/cmd/news.c - 664 sys sys 1014926614 3778
 sys/src/cmd/nfs.c - 664 sys sys 1050068720 31096
 sys/src/cmd/nm.c - 664 sys sys 1073313392 4912
-sys/src/cmd/nntpfs.c - 664 sys sys 1094156765 18904
+sys/src/cmd/nntpfs.c - 664 sys sys 1100524486 18920
 sys/src/cmd/ns.c - 664 sys sys 984717934 3558
 sys/src/cmd/p.c - 664 sys sys 1043516305 1497
 sys/src/cmd/page - 20000000775 sys sys 956344628 0
@@ -10379,7 +10378,7 @@ sys/src/cmd/spin/vars.c - 664 sys sys 953242990 8412
 sys/src/cmd/spin/version.h - 664 sys sys 956275780 54
 sys/src/cmd/split.c - 664 sys sys 1038183077 3219
 sys/src/cmd/srv.c - 664 sys sys 1074452607 3885
-sys/src/cmd/srvfs.c - 664 sys sys 1084470046 1655
+sys/src/cmd/srvfs.c - 664 sys sys 1100524152 1672
 sys/src/cmd/srvold9p - 20000000775 sys sys 1016921011 0
 sys/src/cmd/srvold9p/9p1.h - 664 sys sys 1016921010 2413
 sys/src/cmd/srvold9p/9p1lib.c - 664 sys sys 1016921010 11446
@@ -10929,13 +10928,13 @@ sys/src/cmd/upas/vf/mkfile - 664 sys sys 1064393881 241
 sys/src/cmd/upas/vf/vf.c - 664 sys sys 1087829630 17442
 sys/src/cmd/usb - 20000000775 sys sys 1017802022 0
 sys/src/cmd/usb/audio - 20000000775 sys sys 1017802021 0
-sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1099760452 18231
-sys/src/cmd/usb/audio/audiosub.c - 664 sys sys 1099760453 13512
+sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1100568596 18166
+sys/src/cmd/usb/audio/audiosub.c - 664 sys sys 1100568596 6967
 sys/src/cmd/usb/audio/mkfile - 664 sys sys 1091204980 349
-sys/src/cmd/usb/audio/usbaudio.c - 664 sys sys 1099760452 15571
-sys/src/cmd/usb/audio/usbaudio.h - 664 sys sys 1099760452 1911
-sys/src/cmd/usb/audio/usbaudioctl.c - 664 sys sys 1099760452 42236
-sys/src/cmd/usb/audio/usbaudioctl.h - 664 sys sys 1099760453 2120
+sys/src/cmd/usb/audio/usbaudio.c - 664 sys sys 1100568596 9817
+sys/src/cmd/usb/audio/usbaudio.h - 664 sys sys 1100568597 1861
+sys/src/cmd/usb/audio/usbaudioctl.c - 664 sys sys 1100568597 17264
+sys/src/cmd/usb/audio/usbaudioctl.h - 664 sys sys 1100568597 600
 sys/src/cmd/usb/lib - 20000000775 sys sys 1018369393 0
 sys/src/cmd/usb/lib/device.c - 664 sys sys 1099760882 2968
 sys/src/cmd/usb/lib/dump.c - 664 sys sys 1099760882 12704

+ 21 - 0
dist/replica/plan9.log

@@ -17032,3 +17032,24 @@
 1100406655 2 c 386/9pcdisk - 775 sys sys 1100406384 2024663
 1100406655 3 c 386/9pcf - 775 sys sys 1100406389 2356306
 1100448064 0 c sys/games/lib/fortunes - 664 sys sys 1100446483 250944
+1100525478 0 c rc/bin/fshalt - 775 sys sys 1100524288 1335
+1100525478 1 c sys/man/1/INDEX - 664 sys sys 1100525423 3010
+1100525478 2 c sys/man/1/faces - 664 sys sys 1100525422 2317
+1100525478 3 c sys/man/4/exportfs - 664 sys sys 1100524176 4540
+1100525478 4 c sys/src/cmd/nntpfs.c - 664 sys sys 1100524486 18920
+1100525478 5 c sys/src/cmd/srvfs.c - 664 sys sys 1100524152 1672
+1100525478 6 d sys/man/1/face - 664 sys sys 1062505426 0
+1100536279 0 c rc/bin/iwhois - 775 sys sys 1100534870 1372
+1100536279 1 c sys/src/cmd/acme/util.c - 664 sys sys 1100535510 7208
+1100568685 0 c sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1100568596 18166
+1100568685 1 c sys/src/cmd/usb/audio/audiosub.c - 664 sys sys 1100568596 6967
+1100568685 2 c sys/src/cmd/usb/audio/usbaudio.c - 664 sys sys 1100568596 9817
+1100568685 3 c sys/src/cmd/usb/audio/usbaudio.h - 664 sys sys 1100568597 1861
+1100568685 4 c sys/src/cmd/usb/audio/usbaudioctl.c - 664 sys sys 1100568597 17264
+1100568685 5 c sys/src/cmd/usb/audio/usbaudioctl.h - 664 sys sys 1100568597 600
+1100575887 0 c sys/man/8/auth - 664 sys sys 1100575042 4226
+1100579488 0 c 386/bin/acme - 775 sys sys 1100579339 425046
+1100579488 1 c 386/bin/nntpfs - 775 sys sys 1100579339 158859
+1100579488 2 c 386/bin/usb/usbaudio - 775 sys sys 1100579340 183269
+1100579488 3 c 386/bin/srvfs - 775 sys sys 1100579339 39567
+1100579488 4 c sys/man/1/INDEX - 664 sys sys 1100579340 3010

+ 2 - 0
rc/bin/fshalt

@@ -11,6 +11,8 @@ echo -n syncing...
 for(i in $f){
 	echo -n $i...
 	{
+		echo
+		dial/drain
 		echo fsys all sync
 		if(! dial/expect -t 120 ': ')
 			echo -n 'not synced...' > /dev/cons

+ 42 - 10
rc/bin/iwhois

@@ -1,26 +1,58 @@
 #!/bin/rc
+# iwhois domain - print registration data for domain
+rfork e
+person=`{echo $1|sed s/@.*//}
+fn boilerplate { sed -n '/^[	 ]*[A-Za-z][A-Za-z]*:$/,$p' $* }
+
 switch($1){
 case *@*
-	person=`{echo $1|sed s/@.*//}
 	machine=`{echo $1|sed s/.*@//}
-	fn boilerplate { sed '1,/^$/d' $* }
-case *.co.uk
-	person=`{echo $1|sed s/@.*//}
+case *.ca
+	machine=whois.cira.ca
+	fn boilerplate { grep -v ':[	 ]*$' $* }
+case *.us
+	machine=whois.nic.us
+	fn boilerplate { sed '/^>* Whois database was last updated on/,$d' $* }
+case *.co.uk *.net.uk *.org.uk
 	machine=whois.nic.uk
 	fn boilerplate { sed '/^ +WHOIS database last updated at/,$d' $* }
+case *.ac.uk
+	machine=whois.ja.net
+case *.au
+	machine=whois.aunic.net
+	fn boilerplate { grep -v ':[	 ]*$' $* }
+case *.fr
+	machine=whois.nic.fr
+	fn boilerplate { grep -v '^%%' $* }
+case *.de
+	machine=whois.denic.de
+	fn boilerplate { cat $* }
+case *.dk
+	machine=whois.dk-hostmaster.dk
+	fn boilerplate { grep -v '^#' $* }
+case *.se
+	machine=whois.nic-se.se
+	fn boilerplate { grep -v '^#' $* | uniq }
+case *.es
+	echo no known whois server for .es
+	exit
 case *
-	person=$1
-	machine=rs.internic.net
-	fn boilerplate { sed '1,/^$/d' $* }
+	machine=whois.internic.net	# alternate: whois.networksolutions.com
 }
 file=/tmp/iwhois$pid
-echo ''$person'' | telnet -n tcp!$machine!whois > $file
+fn sigexit {
+	rm -f $file
+}
+echo $person | telnet -nr tcp!$machine!whois > $file
 x=`{ sed -n 's/.*Whois Server: (.*)/\1/p' $file }
 switch($x){
 case ''
-	;
+	;			# e.g., for .ca
+case *' '*
+	echo $0: buggery: $x >[1=2]
+	exit botch
 case *
-	echo ''$person'' | telnet -n tcp!$x!whois > $file
+	echo $person | telnet -nr tcp!$x!whois > $file
 }
 boilerplate $file
 rm $file

+ 4 - 7
sys/man/1/INDEX

@@ -92,10 +92,6 @@ at expect
 drain expect
 expect expect
 pass expect
-face face
-faces face
-seemail face
-vwhois face
 faces faces
 seemail faces
 vwhois faces
@@ -111,6 +107,9 @@ fmt fmt
 htmlfmt fmt
 fortune fortune
 freq freq
+games games
+mahjongg games
+sokoban games
 grap grap
 graph graph
 grep grep
@@ -180,9 +179,6 @@ tpic pic
 pipefile pipefile
 plot plot
 plumb plumb
-pq pq
-pqgen pq
-pqsrv pq
 pr pr
 kprof prof
 prof prof
@@ -256,6 +252,7 @@ tarfs tapefs
 tpfs tapefs
 v10fs tapefs
 v6fs tapefs
+zipfs tapefs
 tar tar
 tbl tbl
 tcs tcs

+ 0 - 116
sys/man/1/face

@@ -1,116 +0,0 @@
-.TH FACES 1
-.SH NAME
-faces, seemail, vwhois \-  mailbox interface
-.SH SYNOPSIS
-.B faces
-[
-.B -ih
-] [
-.B -m
-.I maildir
-]
-.br
-.B seemail
-.br
-.B vwhois
-.I person
-\&...
-.SH DESCRIPTION
-The
-.I faces
-command monitors incoming mail and
-displays in its window a representation of the user's mail box
-using a small image for each message.
-The image is typically a portrait of the sender. Which image to 
-display is determined by two directories /usr/$user/lib/face 
-and /lib/face. Entries in /usr/$user/lib/face take priority over 
-those in /lib/face. See 
-.IR face(6),
-.I
-for how these directories are organised.
-.PP
-If the user is running
-.IR plumber (4),
-.I faces
-reacts to plumb messages to the
-.B seemail
-port,
-typically from
-.BR upas/fs ,
-and is thus notified of message additions and deletions.
-.PP
-Right-clicking on a message icon causes that message to be `plumbed' to
-.BR showmail .
-A typical plumb action will be to display the message, such as by
-the rule
-.EX
-    plumb start window mail -s $0
-.EE
-The
-.IR acme (1)
-mail reader listens to the
-.B showmail
-port automatically.
-.PP
-If the user is not running
-.IR plumber ,
-.I faces
-reads the log file
-.F /sys/log/mail
-and right-clicking has no effect.
-.PP
-If arrows are visible, clicking on them will scroll the display.
-Middle-clicking on the arrows scrolls to the end.
-.PP
-Starting
-.B faces
-with the
-.B -i
-flag causes
-.B faces
-to read the messages in
-.B /mail/fs/mbox
-upon startup.
-.PP
-The
-.B -m
-option directs
-.I faces
-to watch for messages arriving in
-.I maildir
-as well as in
-.BR /mail/fs/mbox .
-However, only
-.BR /mail/fs/mbox
-is used to load the initial set of faces.
-.PP
-The
-.B -h
-flag causes a different, venerable behavior in which
-the window displays the history of messages received
-rather than the current state of the mail box.
-In particular, faces are not removed from the screen when messages are deleted.
-Also, in this mode clicking button 1 in the display will clear the window.
-.PP
-.I Seemail
-is an
-.IR rc (1)
-script that invokes
-.B faces
-.BR -h .
-.PP
-.I Vwhois
-tells
-.I faces
-to display the icons of the named
-.IR persons ,
-without sending a message.
-.SH FILES
-.BR /mail/fs/mbox   "   mail directory.
-.SH "SEE ALSO"
-.IR mail (1),
-.IR marshal (1),
-.IR nedmail (1),
-.IR plumber (4),
-.IR face (6),
-.IR plumb (6)

+ 6 - 1
sys/man/1/faces

@@ -21,7 +21,12 @@ The
 command monitors incoming mail and
 displays in its window a representation of the user's mail box
 using a small image for each message.
-The image is typically a portrait of the sender.
+The image is typically a portrait of the sender. Which image to 
+display is determined by two directories /usr/$user/lib/face 
+and /lib/face. Entries in /usr/$user/lib/face take priority over 
+those in /lib/face. See 
+.IR face (6),
+for how these directories are organised.
 .PP
 If the user is running
 .IR plumber (4),

+ 0 - 7
sys/man/4/exportfs

@@ -188,13 +188,6 @@ which is created with mode
 (default 0600).
 By default, the name space is the directory tree rooted at 
 .IR path .
-If the 
-.B -S
-option is given, the name space is obtained by
-mounting
-.B path
-(typically a file in 
-.BR /srv ).
 If the
 .BR -d ,
 .BR -R ,

+ 2 - 2
sys/man/8/auth

@@ -12,7 +12,7 @@ changeuser, wrkey, convkeys, convkeys2, printnetkey, status, authsrv, guard.srv,
 .RB [ -p ]
 .I keyfile
 .PP
-.B auth/convkeys
+.B auth/convkeys2
 .RB [ -p ]
 .I keyfile
 .PP
@@ -190,7 +190,7 @@ an easy way to run a command as none.
 .TP
 .B /lib/ndb/auth
 Speaksfor relationships and mappings for
-rasius server id's.
+RADIUS server id's.
 .TP
 .B /adm/keys.who
 List of users in the Plan 9 database.

+ 0 - 8
sys/src/cmd/acme/util.c

@@ -151,14 +151,6 @@ flushwarnings(void)
 	int owner, nr, q0, n;
 	Rune *r;
 
-	if(row.ncol == 0){	/* really early error */
-		rowinit(&row, screen->clipr);
-		rowadd(&row, nil, -1);
-		rowadd(&row, nil, -1);
-		if(row.ncol == 0)
-			error("initializing columns in flushwarnings()");
-	}
-
 	for(warn=warnings; warn; warn=next) {
 		w = errorwin(warn->md, 'E');
 		t = &w->body;

+ 2 - 1
sys/src/cmd/nntpfs.c

@@ -541,7 +541,8 @@ nntprefreshall(Netbuf *n)
 	while(p = Nrdline(n)){
 		if(strcmp(p, ".")==0)
 			break;
-		nf = tokenize(p, f, nelem(f));
+
+		nf = getfields(p, f, nelem(f), 1, "\t\r\n ");
 		if(nf != 4){
 			int i;
 			for(i=0; i<nf; i++)

+ 1 - 1
sys/src/cmd/srvfs.c

@@ -4,7 +4,7 @@
 static void
 usage(void)
 {
-	fprint(2, "usage: %s [-dS] [-e exportfs] [-p perm] srvname path\n", argv0);
+	fprint(2, "usage: %s [-dR] [-p perm] [-P patternfile] [-e exportfs] srvname path\n", argv0);
 	exits("usage");
 }
 

+ 4 - 4
sys/src/cmd/usb/audio/audiofs.c

@@ -22,7 +22,7 @@ typedef struct Worker Worker;
 struct Audioctldata
 {
 	long		offoff;			// offset of the offset for audioctl
-	long		values[2][Ncontrol][9];	// last values transmitted, K.Okamoto
+	long		values[2][Ncontrol][8];	// last values transmitted
 	char	*	s;
 	int		ns;
 };
@@ -373,7 +373,7 @@ allocaudioctldata(void)
 	a = emallocz(sizeof(Audioctldata), 1);
 	for (i = 0; i < 2; i++)
 		for(j=0; j < Ncontrol; j++)
-			for(k=0; k < 9; k++)		/* K.Okamoto */
+			for(k=0; k < 8; k++)
 			a->values[i][j][k] = Undef;
 	return a;
 }
@@ -450,8 +450,8 @@ makeaudioctldata(Fid *f)
 			c = &controls[rec][ctl];
 			different = 0;
 			if (c->chans){
-				for (i = 1; i < 9; i++)		/* K.Okamoto */
-					if ((c->chans & 1<<(i-1)) && c->value[i] != a->values[rec][ctl][i])	/* K.Okamoto */
+				for (i = 1; i < 8; i++)
+					if ((c->chans & 1<<i) && c->value[i] != a->values[rec][ctl][i])
 						different = 1;
 			}else
 				if (c->value[0] != a->values[rec][ctl][0])

+ 37 - 175
sys/src/cmd/usb/audio/audiosub.c

@@ -8,46 +8,21 @@
 Namelist terminal_types[] = {
 	{	0x100, "USB Terminal, undefined type"},
 	{	0x101, "USB Streaming"},
-	{	0x201, "Microphone"},
 	{	0x301, "Speaker"},
-	{	0x302, "Headphones"},
-	{	0x401, "Handset"},			/* bi-directional */
-	{	0x501, "Phone Line"},			/* analog telephone line jack */
-	{	0x601, "Analog connector"},
-	{	0x602, "Digital audio interface"},
-	{	0x603, "Line connector"},		/* 3.5mm jack */
-	{	0x604, "Legacy audio connector"},	/* input, connected to audio OUT */
-	{	0x605, "S/PDIF"},
-	{	0x606, "1394 DA stream"},
-	{	0x607, "1394 DV stream soundtrack"},
-	{	0x703, "CD player"},
-	{	0x704, "DAT"},
-	{	0x706, "Minidisk"},
-	{	0x70b, "DVD Audio"},
-	{	0x713, "Synthesizer"},
+	{	0x603, "Line connector"},
 	{	0, nil }
 };
 
-/* units[8][16] stores rec and play and other unit's id,  K.Okamoto
-	8: one of Play, Record, masterRecAGC, masterRecMute, LRRecVol, 
-		LRPlayVol, masterPlayMute, masterPlayVol
-	8: unit's ID
-	1: unit attribute of readable, settable, chans, value[9] and min, max, step
-*/
-FeatureAttr units[8][16];
-int nunits[8];		/* number in use for individual Unit's type K.Okamoto */
-int nf;		/* current total number of featurelist K.Okamoto */
+units[2][8];	/* rec and play units */
+nunits[2];		/* number in use */
 
 static int
 findunit(int nr)
 {
 	int rec, i;
-
-	if (nr == 12)		/* bSourceID == Mixer */
-		return Play;	/* K.Okamoto */
 	for (rec = 0; rec < 2; rec++)
 		for (i = 0; i < nunits[rec]; i++)
-			if (units[rec][i].id == nr)
+			if (units[rec][i] == nr)
 				return rec;
 	return -1;
 }
@@ -55,7 +30,7 @@ findunit(int nr)
 void
 audio_interface(Device *d, int n, ulong csp, void *bb, int nb) {
 	byte *b = bb;
-	int ctl, ch, u, x, nbchan, bmc;
+	int ctl, ch, u, x;
 	byte *p;
 	int class, subclass, ifc, dalt;
 	Audioalt *aa;
@@ -69,90 +44,66 @@ audio_interface(Device *d, int n, ulong csp, void *bb, int nb) {
 	switch (subclass) {
 	case 1:	// control
 		switch (b[2]) {
-		case 0x01:	/* class-specific AC interface header */
+		case 0x01:
 			if (debug & Dbginfo){
 				fprint(2, "Class-Specific AC Interface Header Descriptor\n");
-				fprint(2, "\tAudioDeviceClass release (bcd)%c%c%c%c, TotalLength %d, InCollection %d aInterfaceNr %d %d",
+				fprint(2, "\tAudioDeviceClass release (bcd)%c%c%c%c, TotalLength %d, InCollection %d aInterfaceNr %d\n",
 					'0'+((b[4]>>4)&0xf), '0'+(b[4]&0xf),
 					'0'+((b[3]>>4)&0xf), '0'+(b[3]&0xf),
-					b[5]|(b[6]<<8), b[7], 1, b[8]);
-				if(b[7]-1)		/* K.Okamoto */
-					for(ctl=1;ctl<b[7];ctl++) 
-						fprint(2,", aInterfaceNr%d %d", ctl+1, b[8+ctl]);
-				fprint(2, "\n");
+					b[5]|(b[6]<<8), b[7], b[8]);
 			}
 			break;
 		case 0x02:	// input
 			if (debug & Dbginfo){
 				fprint(2, "Audio Input Terminal Descriptor\n");
-				fprint(2, "\tbTerminalId %d, wTerminalType 0x%x (%s), bAssocTerminal %d bNrChannels %d, wChannelConfig 0x%x, iChannelNames %d iTerminal %d\n",
+				fprint(2, "\tbTerminalId %d, wTerminalType 0x%x (%s), bAssocTerminal %d bNrChannels %d, wChannelConfig %d, iChannelNames %d iTerminal %d\n",
 					b[3], b[4]|(b[5]<<8),
 					namefor(terminal_types, b[4]|(b[5]<<8)),
 					b[6], b[7], b[8]|(b[9]<<8), b[10], b[11]);
 			}
-			if ((b[4]|b[5]<<8) == 0x101){	/* b[4]|b[5]<<8 = wTerminalType */
+			if ((b[4]|b[5]<<8) == 0x101){
 				if (verbose)
 					fprint(2, "Audio output unit %d\n", b[3]);
 				/* USB streaming input: play interface */
-				units[Play][nunits[Play]++].id = b[3];	/* b[3] = bTerminalId */
+				units[Play][nunits[Play]++] = b[3];
 			}else{
 				if (verbose)
 					fprint(2, "Device can record from %s\n",
 						namefor(terminal_types, b[4]|(b[5]<<8)));
 				/* Non-USB input: record interface */
-				units[Record][nunits[Record]++].id = b[3];
+				units[Record][nunits[Record]++] = b[3];
 			}
 			break;
 		case 0x03:	// output
-			if(debug & Dbginfo){
+			if (debug & Dbginfo){
 				fprint(2, "Audio Output Terminal Descriptor\n");
 				fprint(2, "\tbTerminalId %d, wTerminalType 0x%x (%s), bAssocTerminal %d bSourceId %d, iTerminal %d\n",
 					b[3], b[4]|(b[5]<<8),
 					namefor(terminal_types, b[4]|(b[5]<<8)),
 					b[6], b[7], b[8]);
 			}
-			if((b[4]|b[5]<<8) == 0x101){
+			if ((b[4]|b[5]<<8) == 0x101){
 				if (verbose)
 					fprint(2, "Audio input unit %d\n", b[3]);
 				/* USB streaming output: record interface */
-				units[Record][nunits[Record]++].id = b[3];
-			}else{
+				units[Record][nunits[Record]++] = b[3];
 				if (verbose)
 					fprint(2, "Device can play to %s\n",
 						namefor(terminal_types, b[4]|(b[5]<<8)));
 				/* Non-USB output: play interface */
-				units[Play][nunits[Play]++].id = b[3];
+				units[Play][nunits[Play]++] = b[3];
 			}
 			break;
-		case 0x04:	/* mixer */
-			if (debug & Dbginfo){			/* K.Okamoto */
-				fprint(2, "Audio Mixer Unit %d\n", b[3]);
-				fprint(2, "\tbNrInPins %d, ", b[4]);
-				for(ctl = 1;ctl <= b[4]; ctl++)
-					fprint(2, "Input Pin %d's UnitID %d, ", ctl, b[4+ctl]);
-				ctl--;
-				nbchan = b[5+ctl];
-				fprint(2, "bNrChannels %d, ", nbchan);
-				fprint(2, "wChannelConfig 0x%x, ", b[6+ctl]|b[7+ctl]<<8);
-				fprint(2, "iChannelNames %d, ", b[8+ctl]);
-				bmc = 9 + ctl;
-				fprint(2, "bmControls 0x%x", b[bmc++]);
-				nbchan = b[0]-bmc-1;
-				if(nbchan > 1)
-					while(nbchan--) fprint(2, "%x", b[bmc++]);
-				fprint(2, ", iMixer %d\n", b[bmc]);
-			}
+		case 0x04:
 			if (verbose)
 				fprint(2, "Audio Mixer Unit %d\n", b[3]);
-			mixerid = b[3];
 			break;
-		case 0x05:	/* selector */
-			if(verbose)
+		case 0x05:
+			if (verbose)
 				fprint(2, "Audio Selector Unit %d\n", b[3]);
-			if(debug & Dbginfo)
+			if (debug & Dbginfo)
 				fprint(2, "\tbUnitId %d, bNrInPins %d", b[3], b[4]);
-			selector = b[3];		/* K.Okamoto */
-			if(b[4]){	/* number of Pins >=1, K.Okamoto */
+			if (b[4]){
 				if (debug & Dbginfo) fprint(2, ", baSourceIDs: [%d", b[5]);
 				u = findunit(b[5]);
 				for (ctl = 1; ctl < b[4]; ctl++){
@@ -164,17 +115,14 @@ audio_interface(Device *d, int n, ulong csp, void *bb, int nb) {
 				}
 				if (debug & Dbginfo) fprint(2, "]\n");
 				if (u >= 0){
+					units[u][nunits[u]++] = b[3];
 					if (selectorid[u] >= 0)
 						fprint(2, "Second selector (%d, %d) on %s\n", selectorid[u], b[3], u?"record":"playback");
 					selectorid[u] = b[3];
 				}
 			}
 			break;
-		case 0x06:
-			/* feature, b[6]: master channel, b[7]: logical channel 1, 2, 3, .. -->
-			 * b[5]: byte size of individual element data size
-			 * b[3] id number, b[4]: source ID, 
-			 */
+		case 0x06:	// feature
 			if (verbose) fprint(2, "Audio Feature Unit %d", b[3]);
 			if (debug & Dbginfo)
 				fprint(2, "\tbUnitId %d, bSourceId %d, bControlSize %d\n",
@@ -182,125 +130,39 @@ audio_interface(Device *d, int n, ulong csp, void *bb, int nb) {
 			u = findunit(b[4]);
 			if (u >= 0){
 				if (verbose) fprint(2, " for %s\n", u?"Record":"Playback");
-//				units[u][nunits[u]++].id = b[3];
+				units[u][nunits[u]++] = b[3];
 				if (featureid[u] >= 0)
 					if (verbose) fprint(2, "Second feature unit (%d, %d) on %s\n", featureid[u], b[3], u?"record":"playback");
 				featureid[u] = b[3];
 			}else
 				if (verbose) fprint(2, ", not known what for\n");
-			p = b + 6;	/* p: each logical channel data */
-			/* check first for master channel */
-			for(ctl = 1; ctl < 0x0b; ctl++){
-				if((1<<(ctl-1)) & (b[6] | ((b[5]>1)?(b[7]<<8):0))){
-					/* b[6]: master channel control,
-					 * D0: Mute, D1: Volume, D2: Bass, D3: Mid, 
-					 * D4: Treble, D5: Equalizer, D6: Agc, D7: Delay,
-					 * D8: Bass Boost, D9: Loudness ...
-					 */
-					if (ctl == 1 && u == Record){
-						units[masterRecMute][nunits[masterRecMute]].id = b[3];
-						units[masterRecMute][nunits[masterRecMute]].readable =1;
-						units[masterRecMute][nunits[masterRecMute]].settable = 1;
-						units[masterRecMute][nunits[masterRecMute]++].chans = 0;
-						controls[u][ctl].readable = 1;
-						controls[u][ctl].settable = 1;
-						controls[u][ctl].chans = 0;
-					} else if (ctl == 1 && u == Play) {
-						units[masterPlayMute][nunits[masterPlayMute]].id = b[3];
-						units[masterPlayMute][nunits[masterPlayMute]].readable = 1;
-						units[masterPlayMute][nunits[masterPlayMute]].settable = 1;
-						units[masterPlayMute][nunits[masterPlayMute]++].chans = 0;
-						controls[u][ctl].readable = 1;
-						controls[u][ctl].settable = 1;
-						controls[u][ctl].chans = 0;
-					} else if (ctl == 2 && u == Play) {
-						units[masterPlayVol][nunits[masterPlayVol]].id = b[3];
-						units[masterPlayVol][nunits[masterPlayVol]].readable = 1;
-						units[masterPlayVol][nunits[masterPlayVol]].settable = 1;
-						units[masterPlayVol][nunits[masterPlayVol]++].chans = 0;
-						controls[u][ctl].readable = 1;
-						controls[u][ctl].settable = 1;
-						controls[u][ctl].chans = 0;
-					} else if (ctl == 7 && u == Record){ 	/* K.Okamoto for CM106/F */
-						units[masterRecAGC][nunits[masterRecAGC]].id = b[3];
-						units[masterRecAGC][nunits[masterRecAGC]].readable = 1;
-						units[masterRecAGC][nunits[masterRecAGC]].settable = 1;
-						units[masterRecAGC][nunits[masterRecAGC]++].chans = 0;
+			p = b + 6;
+			for (ctl = 1; ctl < 0x0b; ctl++)
+				if ((1<<(ctl-1)) & (b[6] | ((b[5]>1)?(b[7]<<8):0))) {
+					if (verbose)
+						fprint(2, "\t%s control on master channel\n",
+							controls[0][ctl].name);
+					if (u >= 0){
 						controls[u][ctl].readable = 1;
 						controls[u][ctl].settable = 1;
 						controls[u][ctl].chans = 0;
 					}
-					if (verbose)
-						fprint(2, "\t%s control on master channel\n",
-							controls[0][ctl].name);
 				}
-			}
-			/* Now going to check each logical channel */
 			p += (b[5]>1)?2:1;
 			for (ch = 0; ch < (nb - 8)/b[5]; ch++) {
-				for (ctl = 1; ctl < 0x0b; ctl++) {
-					/* p[0]: each channel control,
-					 * D0: Mute, D1: Volume, D2: Bass, D3: Mid, 
-					 * D4: Treble, D5: Equalizer, D6: Agc, D7: Delay,
-					 * D8: Bass Boost, D9: Loudness ...
-					 */
+				for (ctl = 1; ctl < 0x0b; ctl++)
 					if ((1<<(ctl-1)) & (p[0] | ((b[5]>1)?(p[1]<<8):0))) {
-						if (ctl == 2 && u == Play ) {
-							if (!ch) {
-								units[LRPlayVol][nunits[LRPlayVol]].id = b[3];
-								units[LRPlayVol][nunits[LRPlayVol]].readable = 1;
-								units[LRPlayVol][nunits[LRPlayVol]].settable = 1;
-							}
-							units[LRPlayVol][nunits[LRPlayVol]].chans |= 1<<ch;
-						}
-						else if (ctl == 2 && u == Record) {
-							if (!ch) {
-								units[LRRecVol][nunits[LRRecVol]].id = b[3];
-								units[LRRecVol][nunits[LRRecVol]].readable = 1;
-								units[LRRecVol][nunits[LRRecVol]].settable = 1;
-							}
-							units[LRRecVol][nunits[LRRecVol]].chans |= 1<<ch;
-						}
-
-/* Why we have to set these flags? K.Okamoto */
-						controls[u][ctl].readable = 1;
-						controls[u][ctl].settable = 1;
-						controls[u][ctl].chans |= 1<<ch;
-/**/
 						if (verbose)
 							fprint(2, "\t%s control on channel %d\n",
 								controls[0][ctl].name, ch+1);
+						if (u >= 0){
+							controls[u][ctl].readable = 1;
+							controls[u][ctl].settable = 1;
+							controls[u][ctl].chans |= 1 <<(ch+1);
+						}
 					}
-				}
 				p += (b[5]>1)?2:1;
 			}
-			if (units[LRRecVol][nunits[LRRecVol]].id) nunits[LRRecVol]++;
-			if (units[LRPlayVol][nunits[LRPlayVol]].id) nunits[LRPlayVol]++;
-			if (debug & Dbginfo) {	/* K.Okamoto */
-				fprint(2, "Number of Play Units = %d, and consists of ", nunits[Play]);
-				for(x=0; x<nunits[Play]; x++) fprint(2, "%d, ", units[Play][x].id);
-				fprint(2, "\nNumber of Record Units = %d, and consists of ", nunits[Record]);
-				for(x=0; x<nunits[Record]; x++) fprint(2, "%d, ", units[Record][x].id);
-				fprint(2, "\nNumber of masterRecAGC Units = %d, and consists of ", nunits[masterRecAGC]);
-				for(x=0; x<nunits[masterRecAGC]; x++) 
-					if (units[masterRecAGC][x].id) fprint(2, "%d, ", units[masterRecAGC][x].id);
-				fprint(2, "\nNumber of masterRecMute Units = %d, and consists of ", nunits[masterRecMute]);
-				for(x=0; x<nunits[masterRecMute]; x++) 
-					if (units[masterRecMute][x].id) fprint(2, "%d, ", units[masterRecMute][x].id);
-				fprint(2, "\nNumber of LRRecVol Units = %d, and consists of ", nunits[LRRecVol]);
-				for(x=0; x<nunits[LRRecVol]; x++) 
-					if (units[LRRecVol][x].id) fprint(2, "%d, ", units[LRRecVol][x].id);
-				fprint(2, "\nNumber of masterPlayMute Units = %d, and consists of ", nunits[masterPlayMute]);
-				for(x=0; x<nunits[masterPlayMute]; x++) 
-					if (units[masterPlayMute][x].id) fprint(2, "%d, ", units[masterPlayMute][x].id);
-				fprint(2, "\nNumber of masterPlayVol Units = %d, and consists of ", nunits[masterPlayVol]);
-				for(x=0; x<nunits[masterPlayVol]; x++)
-					if (units[masterPlayVol][x].id) fprint(2, "%d, ", units[masterPlayVol][x].id);
-				fprint(2, "\nNumber of LRPlayVol Units = %d, and consists of ", nunits[LRPlayVol]);
-				for(x=0; x<nunits[LRPlayVol]; x++) 
-					if (units[LRPlayVol][x].id) fprint(2, "%d, ", units[LRPlayVol][x].id);
-				fprint(2, "\n");
-			}
 			break;
 		default:
 			pcs_raw("audio control unknown", bb, nb);

+ 63 - 183
sys/src/cmd/usb/audio/usbaudio.c

@@ -13,20 +13,13 @@
 
 extern char* srvpost;
 char * mntpt;
-extern MasterVol masterplayvol;	/* K.Okamoto */
-extern int mixerid;			/* K.Okamoto */
-extern int selector;		/* K.Okamoto */
-int vendor;		/* K.Okamoto */
-int product;		/* K.Okamoto */
+
 Channel *controlchan;
 
 char audstr[]		= "Enabled 0x000101\n";	/* audio.control.0 */
 
 int defaultspeed[2] = {44100, 44100};
 
-extern FeatureAttr units[8][16];		/* K.Okamoto */
-extern int nunits[8];
-
 static void
 audio_endpoint(Device *d, int c, ulong csp, void *bb, int n)
 {
@@ -106,7 +99,7 @@ controlproc(void *)
 	int i, nf;
 	char *req, *args[8];
 	Audiocontrol *c;
-	long value[9];
+	long value[8];
 	Channel *replchan;
 
 	while(req = recvp(controlchan)){
@@ -133,7 +126,6 @@ controlproc(void *)
 			if (strcmp(args[1], c->name) == 0)
 				break;
 		}
-
 		if (i == Ncontrol){
 			if (debug) fprint(2, "Illegal control name: %s", args[1]);
 			if (replchan) chanprint(replchan, "Illegal control name: %s", args[1]);
@@ -154,34 +146,13 @@ controlproc(void *)
 			if (debug & Dbginfo)
 				fprint(2, "controlproc: setcontrol %s %s %s\n",
 					rec?"in":"out", args[1], args[3]);
-			if (rec == Play) {		/* most messy part, K.Okamoto */
-				if (vendor == 0xd8c && product== 0x6) {	/* for C-Media CM-106/F chip */
-					if (setcontrol(rec, args[1], value, 0) < 0){	/* units[masterPlayVol][0]: #13 Unit */
-						if (replchan)
-							chanprint(replchan, "setting %s %s failed", args[1], args[2]);
-					}else{
-						if (replchan) chanprint(replchan, "ok");
-					}
-				} else {
-					if (setcontrol(rec, args[1], value, 0) < 0){	/* replace the '0' to another */
-						if (replchan)
-							chanprint(replchan, "setting %s %s failed", args[1], args[2]);
-					}else{
-						if (replchan) chanprint(replchan, "ok");
-					}
-				}
-			} else
-			if (rec == Record && !strcmp(args[1], "volume")) {
-				if (vendor == 0xd8c && product== 0x6) {	/* for C-Media CM-106/F chip */
-					if (setcontrol(rec, args[1], value, 2) < 0){	/* units[LRRecVol][2]: #2 Unit */
-						if (replchan)
-							chanprint(replchan, "setting %s %s failed", args[1], args[2]);
-					}else{
-						if (replchan) chanprint(replchan, "ok");
-					}
-				}
-				ctlevent();
+			if (setcontrol(rec, args[1], value) < 0){
+				if (replchan)
+					chanprint(replchan, "setting %s %s failed", args[1], args[2]);
+			}else{
+				if (replchan) chanprint(replchan, "ok");
 			}
+			ctlevent();
 		}
 		free(req);
 	}
@@ -192,7 +163,7 @@ buttonproc(void *) {
 	int	i, fd, b;
 	char fname[64], err[32];
 	byte buf[1];
-	Audiocontrol *c, *cm;
+	Audiocontrol *c;
 
 	sprint(fname, "/dev/usb%d/%d/ep%ddata", ad->ctlrno, ad->id, buttonendpt);
 	if (debug & Dbginfo) fprint(2, "buttonproc opening %s\n", fname);
@@ -200,9 +171,6 @@ buttonproc(void *) {
 		sysfatal("Can't open %s: %r", fname);
 
 	c = &controls[Play][Volume_control];
-	cm = &controls[Play][Mute_control];
-	if (vendor == 0xd8c && product== 0x6)		/* for C-Media CM-106/F chip */
-		cm->value[0] = units[masterPlayMute][0].value[0];	/* K.Okamoto, messy! */
 	for (;;) {
 		if ((b = read(fd, buf, 1)) < 0){
 			rerrstr(err, sizeof err);
@@ -214,24 +182,22 @@ buttonproc(void *) {
 		}
 		if (b == 0 || buf[0] == 0){
 			continue;
-		}else if (buf[0] == 1){		/* increase volume */
-			c->chans = 0;
-			c->value[0] += c->step;
-			chanprint(controlchan, "0 volume playback %A", c);
-		}else if (buf[0] == 2){		/* decrease volume */
-			c->chans = 0;
-			c->value[0] -= c->step;
+		}else if (buf[0] == 1){
+			if (c->chans == 0)
+				c->value[0] += c->step;
+			else
+				for (i = 1; i < 8; i++)
+					if (c->chans & 1 << i)
+						c->value[i] += c->step;
 			chanprint(controlchan, "0 volume playback %A", c);
-		}else if (buf[0] == 4){		/* Play mute On/Off control K.Okamoto */
-			cm->chans = 0;
-			if (cm->value[0] == 0)
-				cm->value[0] = 1;
+		}else if (buf[0] == 2){
+			if (c->chans == 0)
+				c->value[0] -= c->step;
 			else
-				cm->value[0] = 0;
-			chanprint(controlchan, "0 mute playback %A", cm);
-		}else if (buf[0] == 0x70){		/* Onkyo SE-U55X IrDA */
-			// not implemented yet
-			continue;
+				for (i = 1; i < 8; i++)
+					if (c->chans & 1 << i)
+						c->value[i] -= c->step;
+			chanprint(controlchan, "0 volume playback %A", c);
 		}else if (debug & Dbginfo){
 			fprint(2, "button");
 			for (i = 0; i < b; i++)
@@ -274,29 +240,27 @@ findendpoints(void)
 void
 usage(void)
 {
-	fprint(2, "usage: usbaudio [-V] [-v volume[%%]] [-m mountpoint] [-r recording device] [-s srvname] [ctrlno id]\n");
+	fprint(2, "usage: usbaudio [-V] [-v volume[%%]] [-m mountpoint] [-s srvname] [ctrlno id]\n");
 	threadexitsall("usage");
 }
 
 void
 threadmain(int argc, char **argv)
 {
-	int ctlrno, id, i, j, sfd, select;
-	long value[9];
-	long volume[9];
-	long mastervol;		/* K.Okamoto */
+	int ctlrno, id, i, sfd;
+	long value[8];
+	long volume[8];
+	Audiocontrol *c;
 	char buf[32], *p, line[256];
 
 	ctlrno = -1;
 	id = -1;
-	volume[0] = 50;		/* default volume is 50% */
-	select = 4;				/* Mixer input default, must be checked for other devices K.Okamoto */
-	for (i = 0; i<9; i++)		/* K.Okamoto */
+	volume[0] = Undef;
+	for (i = 0; i<8; i++)
 		value[i] = 0;
 	fmtinstall('A', Aconv);
 	quotefmtinstall();
 
-	mastervol = 0;		/* K.Okamoto */
 	ARGBEGIN{
 	case 'V':
 		verbose++;
@@ -307,16 +271,13 @@ threadmain(int argc, char **argv)
 		verbose++;
 		break;
 	case 'v':
-		mastervol = strtol(ARGF(), &p, 0);;		/* K.Okamoto */
-		for(i = 0; i < 9; i++)
-			volume[i] = mastervol;			/* K.Okamoto */
+		volume[0] = strtol(ARGF(), &p, 0);
+		for(i = 1; i < 8; i++)
+			volume[i] = volume[0];
 		break;
 	case 'm':
 		mntpt = ARGF();
 		break;
-	case 'r':
-		select = atoi(ARGF());
-		break;
 	case 's':
 		srvpost = ARGF();
 		break;
@@ -357,9 +318,6 @@ threadmain(int argc, char **argv)
 	if (describedevice(ad) < 0)
 		sysfatal("describedevice");
 
-	vendor = ad->vid;
-	product = ad->did;
-
 	for(i=0; i<ad->nconf; i++) {
 		if (ad->config[i] == nil)
 			ad->config[i] = mallocz(sizeof(*ad->config[i]),1);
@@ -371,32 +329,18 @@ threadmain(int argc, char **argv)
 	findendpoints();
 
 	if (endpt[Play] >= 0){
-		if (vendor == 0xd8c && product == 0x6) {		/* C-Media CM-106F chip K.Okamoto */
-			if(findalt(Play, 8, 16, defaultspeed[Play]) < 0){
-				if(findalt(Play, 8, 16, 48000) < 0)
-					sysfatal("Can't configure playout for %d or %d Hz", defaultspeed[Play], 48000);
-				fprint(2, "Warning, can't configure playout for %d Hz, configuring for %d Hz instead\n",
-					defaultspeed[Play], 48000);
-				defaultspeed[Play] = 48000;
-			}
-		} else {
-			if(findalt(Play, 2, 16, defaultspeed[Play]) < 0){
-				if(findalt(Play, 2, 16, 48000) < 0)
-					sysfatal("Can't configure playout for %d or %d Hz", defaultspeed[Play], 48000);
-				fprint(2, "Warning, can't configure playout for %d Hz, configuring for %d Hz instead\n",
-					defaultspeed[Play], 48000);
-				defaultspeed[Play] = 48000;
-			}
+		if(findalt(Play, 2, 16, defaultspeed[Play]) < 0){
+			if(findalt(Play, 2, 16, 48000) < 0)
+				sysfatal("Can't configure playout for %d or %d Hz", defaultspeed[Play], 48000);
+			fprint(2, "Warning, can't configure playout for %d Hz, configuring for %d Hz instead\n",
+				defaultspeed[Play], 48000);
+			defaultspeed[Play] = 48000;
 		}
-		/* K.Okamoto choose feature 4 (connected from Mixer) for Output to USB Stream */
-		if (selector >0)
-			if( setselector(select) == Undef)
-				sysfatal("Failed to set selector\n");
-		value[0] = 8;			/* K.Okamoto */
-		if (setcontrol(Play, "channels", value, featureid[Play]) == Undef)
+		value[0] = 2;
+		if (setcontrol(Play, "channels", value) == Undef)
 			sysfatal("Can't set play channels\n");
 		value[0] = 16;
-		if (setcontrol(Play, "resolution", value, featureid[Play]) == Undef)
+		if (setcontrol(Play, "resolution", value) == Undef)
 			sysfatal("Can't set play resolution\n");
 	}
 
@@ -408,103 +352,39 @@ threadmain(int argc, char **argv)
 				defaultspeed[Record], 48000);
 			defaultspeed[Record] = 48000;
 		}
-		/* K.Okamoto choose all the controls for Mixer inputs */
-		if (mixerid >0)
-			if (initmixer() == Undef)		/* K.Okamoto, set all the channels alive on the mixer */
-				sysfatal("Failed to set MIXER all live\n");
 		value[0] = 2;
-		if (setcontrol(Record, "channels", value, featureid[Record]) == Undef)
+		if (setcontrol(Record, "channels", value) == Undef)
 			sysfatal("Can't set record channels\n");
 		value[0] = 16;
-		if (setcontrol(Record, "resolution", value, featureid[Record]) == Undef)
+		if (setcontrol(Record, "resolution", value) == Undef)
 			sysfatal("Can't set record resolution\n");
 	}
 
-	if(debugdebug) fprint(2, "\n=======Start of listing default values of feature units=======\n");	/*.K.Okamoto */
-	getcontrols();
-	if(debugdebug) fprint(2, "\n=======Start of setting values of feature units=======\n");	/*.K.Okamoto */
+	getcontrols();	/* Get the initial value of all controls */
 	value[0] = defaultspeed[Play];
-	if (endpt[Play] >= 0 && setcontrol(Play, "speed", value, featureid[Play]) < 0)
+	if (endpt[Play] >= 0 && setcontrol(Play, "speed", value) < 0)
 		sysfatal("Can't set play speed\n");
 	value[0] = defaultspeed[Record];
-	if (endpt[Record] >= 0 && setcontrol(Record, "speed", value, featureid[Record]) < 0)
+	if (endpt[Record] >= 0 && setcontrol(Record, "speed", value) < 0)
 		sysfatal("Can't set record speed\n");
-	/* here, 'i' is the n-th turn of multiple Units for this purpose, 
-		'i' does not equals to Unit number itself */
-	if (nunits[masterRecMute])
-		for(i=0; i<nunits[masterRecMute]; i++) {
-			value[0] = 0;			/* set master Record Mute OFF K.Okamoto */
-			setcontrol(Record, "mute", value, i);
-		}
-	if (nunits[masterPlayMute])
-		for (i=0; i<nunits[masterPlayMute]; i++) {
-			value[0] = 0;			/* set master Play Mute OFF K.Okamoto */
-			setcontrol(Play, "mute", value, i);
-		}
-	if (nunits[masterRecAGC])
-		for (i=0; i<nunits[masterRecAGC]; i++) {
-			value[0]=1;						/* set AGC ON, K.Okamoto */
-			setcontrol(Record, "agc", value, i);		/* K.Okamoto */
-		}
-	if (nunits[LRRecVol])
-		for (i=0; i<nunits[LRRecVol]; i++) {
-			if (argc >=1 && *p == '%') {
-				for (j = 0; j < 9; j++) {
-					volume[j] = mastervol*(units[LRRecVol][i].max - units[LRRecVol][i].min)/100	+ units[LRRecVol][i].min;
-					if (debug &  Dbgcontrol) fprint(2, "Unit#%d's ,  c->max, c->min= 0x%lx, 0x%lx\n", 
-						units[LRRecVol][i].id, units[LRRecVol][i].max, units[LRRecVol][i].min);
-					if (debug & Dbgcontrol) fprint(2, "volume[%d] = 0x%lx\n", j, volume[j]);
-				}
-			} else {
-				for (j = 0; j < 9; j++) {
-					volume[j] = 50*(units[LRRecVol][i].max - units[LRRecVol][i].min)/100	+ 
-						units[LRRecVol][i].min;
-					if (debug & Dbgcontrol) fprint(2, "Unit#%d's ,  c->max, c->min= 0x%lx, 0x%lx\n", 
-						units[LRRecVol][i].id, units[LRRecVol][i].max, units[LRRecVol][i].min);
-					if (debug & Dbgcontrol) fprint(2, "volume[%d] = 0x%lx\n", j, volume[j]);
-				}
-			}
-			if (units[LRRecVol][i].settable)
-				setcontrol(Record, "volume", volume, i);
-		}
-	if (nunits[LRPlayVol])
-		for (i=0; i<nunits[LRPlayVol]; i++) {
-			if (argc >=1 && *p == '%') {
-				for (j = 0; j < 9; j++) {
-					volume[j] = mastervol*(units[LRPlayVol][i].max - units[LRPlayVol][i].min)/100	+ 
-						units[LRPlayVol][i].min;
-					if (debug & Dbgcontrol) fprint(2, "Unit#%d's ,  c->max, c->min= 0x%lx, 0x%lx\n", 
-						units[LRPlayVol][i].id, units[LRPlayVol][i].max, units[LRPlayVol][i].min);
-					if (debug & Dbgcontrol) fprint(2, "volume[%d] = 0x%lx\n", j, volume[j]);
-				}
-			} else {
-				for (j = 0; j < 9; j++) {
-					volume[j] = 50*(units[LRPlayVol][i].max - units[LRPlayVol][i].min)/100	+ 
-						units[LRPlayVol][i].min;
-					if (debug & Dbgcontrol) fprint(2, "Unit#%d's ,  c->max, c->min= 0x%lx, 0x%lx\n", 
-						units[LRPlayVol][i].id, units[LRPlayVol][i].max, units[LRPlayVol][i].min);
-					if (debug & Dbgcontrol) fprint(2, "volume[%d] = 0x%lx\n", j, volume[j]);
-				}
-			}
-			if (units[LRPlayVol][i].settable)
-				setcontrol(Play, "volume", volume, i);
-		}
-	if (nunits[masterPlayVol])
-		for (i=0; i<nunits[masterPlayVol]; i++) {
-			if (argc >=1)
-				volume[0] = mastervol*(masterplayvol.max - masterplayvol.min)/100+ masterplayvol.min;
-			else
-				volume[0] = 50*(masterplayvol.max - masterplayvol.min)/100+ masterplayvol.min;
-			volume[1] = 0;
-			if (debug & Dbgcontrol) fprint(2, "masterplayvol.max = %ld\n", masterplayvol.max);
-			if (debug & Dbgcontrol) fprint(2, "masterplayvol.min = %ld\n", masterplayvol.min);
-			if (debug & Dbgcontrol) fprint(2, "master Play volume[0] = %ld\n", volume[0]);
-			if (units[masterPlayVol][i].settable)
-				setcontrol(Play, "volume", volume, i);
-		}
+	value[0] = 0;
+	setcontrol(Play, "mute", value);
+
+	if (volume[0] != Undef){
+		c = &controls[Play][Volume_control];
+		if (*p == '%' && c->min != Undef)
+			for (i = 0; i < 8; i++)
+				volume[i] = (volume[i]*c->max + (100-volume[i])*c->min)/100;
+		if (c->settable)
+			setcontrol(Play, "volume", volume);
+		c = &controls[Record][Volume_control];
+		if (c->settable)
+			setcontrol(Record, "volume", volume);
+	}
+
 	if (buttonendpt > 0){
 		sprint(buf, "ep %d bulk r 1 1", buttonendpt);
-		if (debug) fprint(2, "sending `%s' to /dev/usb%d/%d/ctl\n", buf, ad->ctlrno, id);
+		if (debug) fprint(2, "sending `%s' to /dev/usb/%d/ctl\n", buf, id);
 		if (write(ad->ctl, buf, strlen(buf)) > 0)
 			proccreate(buttonproc, nil, STACKSIZE);
 		else

+ 3 - 4
sys/src/cmd/usb/audio/usbaudio.h

@@ -2,7 +2,7 @@
 enum {
 	master_chan		= 0x00,
 	Speed_control		= 0x00,
-	/* Items below are  defined for feature controls by USB standard: */
+	/* Items below are  defined by USB standard: */
 	Mute_control		= 0x01,
 	Volume_control		= 0x02,
 	Bass_control		= 0x03,
@@ -18,8 +18,6 @@ enum {
 	Resolution_control	= 0x0c,
 	Ncontrol,
 	sampling_freq_control	= 0x01,
-	/* Sreaming terminal control by USB standard K.Okamoto */
-	pitch_control	=	0x02,
 };
 
 
@@ -64,7 +62,8 @@ void	audio_interface(Device *d, int n, ulong csp, void *bb, int nb);
 void	setalt(Device *d, int endpt, int value);
 int	getalt(Device *d, int endpt);
 int	setspeed(int rec, int speed);
-int	setcontrol(int rec, char *name, long *value, int unit);
+int	setcontrol(int rec, char *name, long *value);
+int	getspecialcontrol(int rec, int ctl, int req, long *value);
 int	getcontrol(int rec, char *name, long *value);
 int	findalt(int rec, int nchan, int res, int speed);
 void	getcontrols(void);

File diff suppressed because it is too large
+ 137 - 647
sys/src/cmd/usb/audio/usbaudioctl.c


+ 6 - 41
sys/src/cmd/usb/audio/usbaudioctl.h

@@ -1,64 +1,29 @@
 enum{
 	Undef = 0x80000000,
-	Play = 0,	/* for USB Streaming Terminal K.Okamoto */
-	Record = 1,	/* for USB Streaming Terminal K.Okamoto */
-	masterRecAGC,	/* feature ID for master record AGC function K.Okamoto */
-	masterRecMute,	/* feature IDs for master record mute function K.Okamoto */
-	LRRecVol,	/* feature ID for master record L/R volume for Mic, LineIN */
-	LRPlayVol,	/* Left/Right volume for speaker, no master volume */
-	masterPlayMute,	/* feature ID for master play mute for Speaker, K.Okamoto */
-	masterPlayVol,	/* feature ID for master play volume control function */
+	Play = 0,
+	Record = 1,
 };
 
 typedef struct Audiocontrol Audiocontrol;
 
 struct Audiocontrol {
-	char	*name;
+	char		*name;
 	uchar	readable;
 	uchar	settable;
 	uchar	chans;		/* 0 is master, non-zero is bitmap */
-	long	value[9];	/* 0 is master; value[0] == Undef -> all values Undef */
-	long	min, max, step;
+	long		value[8];		/* 0 is master; value[0] == Undef -> all values Undef */
+	long		min, max, step;
 };
 
-typedef struct FeatureAttr FeatureAttr;	/* K.Okamoto */
-
-struct FeatureAttr {
-	int		id;
-	uchar	readable;
-	uchar	settable;
-	uchar	chans;
-	long value[9];
-	long	min, max, step;
-};
-
-typedef struct MasterVol MasterVol;	/* K.Okamoto */
-
-struct MasterVol {			/* K.Okamoto */
-	long	min;
-	long max;
-	long step;
-	long value;		
-};
 
 extern Audiocontrol controls[2][Ncontrol];
 extern int endpt[2];
 extern int interface[2];
-extern int featureid[2];		/* current Play/Record Feature ID */
+extern int featureid[2];
 extern int selectorid[2];
-extern int selector;			/* K.Okamoto */
-extern int mixerid;			/* K.Okamoto */
 extern int buttonendpt;
 
 int	ctlparse(char *s, Audiocontrol *c, long *v);
 void	ctlevent(void);
-int	getspecialcontrol(Audiocontrol *c, int rec, int ctl, int req, long *value);
-int	setselector(int);		/* added by K.Okamoto */
-int	initmixer(void);	/* added by K.Okamoto */
-int	getmasterValue(int, int, int, int, int, long*);	/* added by K.Okamoto */
-int	getchannelVol(int, int, int, int, int, uchar, long*);	/* added by K.okamoto */
-int	setmasterValue(Audiocontrol*, int, int, int, int, int, long*);	/* K.Okamoto */
-int	setchannelVol(Audiocontrol*, int, int, int, int, int, long*);	/* K.Okamoto */
-int	printValue(Audiocontrol*, int req, long*);			/* K.Okamoto */
 
 #pragma	varargck	type	"A"	Audiocontrol*

Some files were not shown because too many files changed in this diff