Browse Source

Plan 9 from Bell Labs 2006-02-04

David du Colombier 15 years ago
parent
commit
dcaad2a1f3

+ 7 - 7
dist/replica/_plan9.db

@@ -173,7 +173,7 @@
 386/bin/calendar - 775 sys sys 1135570797 80216
 386/bin/cat - 775 sys sys 1130384267 37465
 386/bin/cb - 775 sys sys 1135570797 77379
-386/bin/cdfs - 775 sys sys 1135570797 167135
+386/bin/cdfs - 775 sys sys 1138982896 167246
 386/bin/cfs - 775 sys sys 1135570797 128025
 386/bin/chgrp - 775 sys sys 1135570798 59279
 386/bin/chmod - 775 sys sys 1135570798 62275
@@ -547,7 +547,7 @@
 386/lib/libc.a - 664 sys sys 1138500920 502724
 386/lib/libcomplete.a - 664 sys sys 1138500945 6372
 386/lib/libcontrol.a - 664 sys sys 1138500950 274924
-386/lib/libdisk.a - 664 sys sys 1138500973 42236
+386/lib/libdisk.a - 664 sys sys 1138982896 42414
 386/lib/libdraw.a - 664 sys sys 1138500978 374124
 386/lib/libflate.a - 664 sys sys 1138500991 76832
 386/lib/libframe.a - 664 sys sys 1138500996 66116
@@ -5993,7 +5993,7 @@ sys/include/complete.h - 664 sys sys 1076276516 562
 sys/include/control.h - 664 sys sys 1084467622 4844
 sys/include/ctype.h - 664 sys sys 1014929062 951
 sys/include/cursor.h - 664 sys sys 1014929062 102
-sys/include/disk.h - 664 sys sys 1014929063 1096
+sys/include/disk.h - 664 sys sys 1138975314 1120
 sys/include/draw.h - 664 sys sys 1108655526 16144
 sys/include/event.h - 664 sys sys 1014929063 1426
 sys/include/fcall.h - 664 sys sys 1137461445 3063
@@ -14041,7 +14041,7 @@ sys/src/cmd/usb/lib/dump.c - 664 sys sys 1135896862 12915
 sys/src/cmd/usb/lib/fmt.c - 664 sys sys 1091204978 291
 sys/src/cmd/usb/lib/mkfile - 664 sys sys 1091204979 204
 sys/src/cmd/usb/lib/setup.c - 664 sys sys 1091204978 1953
-sys/src/cmd/usb/lib/usb.h - 664 sys sys 1103381265 7036
+sys/src/cmd/usb/lib/usb.h - 664 sys sys 1138975309 7049
 sys/src/cmd/usb/lib/util.c - 664 sys sys 1091204978 523
 sys/src/cmd/usb/misc - 20000000775 sys sys 1091205037 0
 sys/src/cmd/usb/misc/mkfile - 664 sys sys 1091205037 274
@@ -14053,9 +14053,9 @@ sys/src/cmd/usb/printer - 20000000775 sys sys 1073007760 0
 sys/src/cmd/usb/usbd - 20000000775 sys sys 1017802021 0
 sys/src/cmd/usb/usbd/dat.h - 664 sys sys 1091204979 675
 sys/src/cmd/usb/usbd/fns.h - 664 sys sys 1091204979 495
-sys/src/cmd/usb/usbd/hub.c - 664 sys sys 1104849419 4296
+sys/src/cmd/usb/usbd/hub.c - 664 sys sys 1138975310 4292
 sys/src/cmd/usb/usbd/mkfile - 664 sys sys 1091204979 304
-sys/src/cmd/usb/usbd/setup.c - 664 sys sys 1091204979 1192
+sys/src/cmd/usb/usbd/setup.c - 664 sys sys 1138975309 1210
 sys/src/cmd/usb/usbd/usbd.c - 664 sys sys 1091204979 5188
 sys/src/cmd/va - 20000000775 sys sys 954038374 0
 sys/src/cmd/va/a.h - 664 sys sys 1089299166 2915
@@ -15000,7 +15000,7 @@ sys/src/libdisk - 20000000775 sys sys 969512501 0
 sys/src/libdisk/disk.c - 664 sys sys 1126278243 6665
 sys/src/libdisk/mkfile - 664 sys sys 1035389777 269
 sys/src/libdisk/proto.c - 664 sys sys 1020313839 8808
-sys/src/libdisk/scsi.c - 664 sys sys 1126278243 6023
+sys/src/libdisk/scsi.c - 664 sys sys 1138975317 6099
 sys/src/libdisk/test.c - 664 sys sys 960347152 275
 sys/src/libdraw - 20000000775 sys sys 1014927873 0
 sys/src/libdraw/alloc.c - 664 sys sys 1131637702 4160

+ 7 - 7
dist/replica/plan9.db

@@ -173,7 +173,7 @@
 386/bin/calendar - 775 sys sys 1135570797 80216
 386/bin/cat - 775 sys sys 1130384267 37465
 386/bin/cb - 775 sys sys 1135570797 77379
-386/bin/cdfs - 775 sys sys 1135570797 167135
+386/bin/cdfs - 775 sys sys 1138982896 167246
 386/bin/cfs - 775 sys sys 1135570797 128025
 386/bin/chgrp - 775 sys sys 1135570798 59279
 386/bin/chmod - 775 sys sys 1135570798 62275
@@ -547,7 +547,7 @@
 386/lib/libc.a - 664 sys sys 1138500920 502724
 386/lib/libcomplete.a - 664 sys sys 1138500945 6372
 386/lib/libcontrol.a - 664 sys sys 1138500950 274924
-386/lib/libdisk.a - 664 sys sys 1138500973 42236
+386/lib/libdisk.a - 664 sys sys 1138982896 42414
 386/lib/libdraw.a - 664 sys sys 1138500978 374124
 386/lib/libflate.a - 664 sys sys 1138500991 76832
 386/lib/libframe.a - 664 sys sys 1138500996 66116
@@ -5993,7 +5993,7 @@ sys/include/complete.h - 664 sys sys 1076276516 562
 sys/include/control.h - 664 sys sys 1084467622 4844
 sys/include/ctype.h - 664 sys sys 1014929062 951
 sys/include/cursor.h - 664 sys sys 1014929062 102
-sys/include/disk.h - 664 sys sys 1014929063 1096
+sys/include/disk.h - 664 sys sys 1138975314 1120
 sys/include/draw.h - 664 sys sys 1108655526 16144
 sys/include/event.h - 664 sys sys 1014929063 1426
 sys/include/fcall.h - 664 sys sys 1137461445 3063
@@ -14041,7 +14041,7 @@ sys/src/cmd/usb/lib/dump.c - 664 sys sys 1135896862 12915
 sys/src/cmd/usb/lib/fmt.c - 664 sys sys 1091204978 291
 sys/src/cmd/usb/lib/mkfile - 664 sys sys 1091204979 204
 sys/src/cmd/usb/lib/setup.c - 664 sys sys 1091204978 1953
-sys/src/cmd/usb/lib/usb.h - 664 sys sys 1103381265 7036
+sys/src/cmd/usb/lib/usb.h - 664 sys sys 1138975309 7049
 sys/src/cmd/usb/lib/util.c - 664 sys sys 1091204978 523
 sys/src/cmd/usb/misc - 20000000775 sys sys 1091205037 0
 sys/src/cmd/usb/misc/mkfile - 664 sys sys 1091205037 274
@@ -14053,9 +14053,9 @@ sys/src/cmd/usb/printer - 20000000775 sys sys 1073007760 0
 sys/src/cmd/usb/usbd - 20000000775 sys sys 1017802021 0
 sys/src/cmd/usb/usbd/dat.h - 664 sys sys 1091204979 675
 sys/src/cmd/usb/usbd/fns.h - 664 sys sys 1091204979 495
-sys/src/cmd/usb/usbd/hub.c - 664 sys sys 1104849419 4296
+sys/src/cmd/usb/usbd/hub.c - 664 sys sys 1138975310 4292
 sys/src/cmd/usb/usbd/mkfile - 664 sys sys 1091204979 304
-sys/src/cmd/usb/usbd/setup.c - 664 sys sys 1091204979 1192
+sys/src/cmd/usb/usbd/setup.c - 664 sys sys 1138975309 1210
 sys/src/cmd/usb/usbd/usbd.c - 664 sys sys 1091204979 5188
 sys/src/cmd/va - 20000000775 sys sys 954038374 0
 sys/src/cmd/va/a.h - 664 sys sys 1089299166 2915
@@ -15000,7 +15000,7 @@ sys/src/libdisk - 20000000775 sys sys 969512501 0
 sys/src/libdisk/disk.c - 664 sys sys 1126278243 6665
 sys/src/libdisk/mkfile - 664 sys sys 1035389777 269
 sys/src/libdisk/proto.c - 664 sys sys 1020313839 8808
-sys/src/libdisk/scsi.c - 664 sys sys 1126278243 6023
+sys/src/libdisk/scsi.c - 664 sys sys 1138975317 6099
 sys/src/libdisk/test.c - 664 sys sys 960347152 275
 sys/src/libdraw - 20000000775 sys sys 1014927873 0
 sys/src/libdraw/alloc.c - 664 sys sys 1131637702 4160

+ 7 - 0
dist/replica/plan9.log

@@ -27518,3 +27518,10 @@
 1138750261 0 c sys/src/9/port/proc.c - 664 sys sys 1138749368 28702
 1138750261 1 c sys/src/9/port/segment.c - 664 sys sys 1138749368 13939
 1138843891 0 c sys/man/1/replica - 664 sys sys 1138843328 7210
+1138975208 0 c sys/src/libdisk/scsi.c - 664 sys sys 1138975317 6099
+1138977017 0 c sys/include/disk.h - 664 sys sys 1138975314 1120
+1138977017 1 c sys/src/cmd/usb/lib/usb.h - 664 sys sys 1138975309 7049
+1138977017 2 c sys/src/cmd/usb/usbd/hub.c - 664 sys sys 1138975310 4292
+1138977017 3 c sys/src/cmd/usb/usbd/setup.c - 664 sys sys 1138975309 1210
+1138984207 0 c 386/bin/cdfs - 775 sys sys 1138982896 167246
+1138984207 1 c 386/lib/libdisk.a - 664 sys sys 1138982896 42414

+ 1 - 0
sys/include/disk.h

@@ -21,6 +21,7 @@ char*	scsierror(int, int);
 int		scsicmd(Scsi*, uchar*, int, void*, int, int);
 int		scsi(Scsi*, uchar*, int, void*, int, int);
 Scsi*		openscsi(char*);
+void		closescsi(Scsi*);
 int		scsiready(Scsi*);
 
 extern int		scsiverbose;

+ 1 - 0
sys/src/cmd/usb/lib/usb.h

@@ -109,6 +109,7 @@ enum
 	HID = 0x21,
 	REPORT = 0x22,
 	PHYSICAL = 0x23,
+	HUB	= 0x29,
 
 	/* feature selectors */
 	DEVICE_REMOTE_WAKEUP = 1,

+ 3 - 4
sys/src/cmd/usb/usbd/hub.c

@@ -45,7 +45,7 @@ newhub(Hub *parent, Device *d)
 	h->ctlrno = parent->ctlrno;
 	h->dev0 = parent->dev0;
 
-	if (setupreq(d->ep[0], RD2H|Rclass|Rdevice, GET_DESCRIPTOR, (0<<8)|0, 0, sizeof(buf)) < 0 ||
+	if (setupreq(d->ep[0], RD2H|Rclass|Rdevice, GET_DESCRIPTOR, (HUB<<8)|0, 0, DHUBLEN) < 0 ||
 	   (nr = setupreply(d->ep[0], buf, sizeof(buf))) < DHUBLEN) {
 		fprint(2, "usbd: error reading hub descriptor\n");
 		free(h);
@@ -117,11 +117,10 @@ hubfeature(Hub *h, int port, int feature, int on)
 {
 	int cmd;
 
+	cmd = CLEAR_FEATURE;
 	if(on)
 		cmd = SET_FEATURE;
-	else
-		cmd = CLEAR_FEATURE;
-	setup0(h->d, Rclass|Rother, cmd, feature, port, 0);
+	setup0(h->d, RH2D|Rclass|Rother, cmd, feature, port, 0);
 }
 
 void

+ 1 - 1
sys/src/cmd/usb/usbd/setup.c

@@ -25,7 +25,7 @@ setup0(Device *d, int type, int req, int value, int index, int count)
 void
 setconfig(Device *d, int n)
 {
-	setup0(d, RH2D, SET_CONFIGURATION, n, 0, 0);
+	setup0(d, RH2D|Rstandard|Rdevice, SET_CONFIGURATION, n, 0, 0);
 	d->state = Configured;
 }
 

+ 8 - 0
sys/src/libdisk/scsi.c

@@ -324,3 +324,11 @@ openscsi(char *dev)
 
 	return s;
 }
+
+void
+closescsi(Scsi *s)
+{
+	close(s->rawfd);
+	free(s->inquire);
+	free(s);
+}