Browse Source

Plan 9 from Bell Labs 2011-05-10

David du Colombier 13 years ago
parent
commit
427df12646

+ 0 - 2
sys/man/1/vac

@@ -169,8 +169,6 @@ to standard error.
 If listing files, print metadata in addition to the names.
 .SH SOURCE
 .B /sys/src/cmd/vac
-.br
-.B /sys/src/cmd/unvac
 .SH "SEE ALSO"
 .IR vacfs (4),
 .IR venti (8)

+ 0 - 4
sys/man/2/venti-cache

@@ -2,7 +2,6 @@
 .SH NAME
 VtBlock, VtCache, 
 vtblockcopy,
-vtblockdirty,
 vtblockduplock,
 vtblockput,
 vtblockwrite,
@@ -77,9 +76,6 @@ void	vtcachesetwrite(VtCache *c,
 .PP
 .B
 VtBlock*	vtblockcopy(VtBlock *b);
-.PP
-.B
-int	vtblockdirty(VtBlock *b);
 .SH DESCRIPTION
 These functions provide access to a simple in-memory
 cache of blocks already stored on a Venti server

+ 1 - 0
sys/src/9/pc/pci.c

@@ -653,6 +653,7 @@ static Bridge southbridges[] = {
 	{ 0x8086, 0x2641, pIIxget, pIIxset },	/* Intel 82801FBM */
 	{ 0x8086, 0x27b8, pIIxget, pIIxset },	/* Intel 82801GB */
 	{ 0x8086, 0x27b9, pIIxget, pIIxset },	/* Intel 82801GBM */
+	{ 0x8086, 0x27bd, pIIxget, pIIxset },	/* Intel 82801GB/GR */
 	{ 0x8086, 0x3a16, pIIxget, pIIxset },	/* Intel 82801JIR */
 	{ 0x8086, 0x3a40, pIIxget, pIIxset },	/* Intel 82801JI */
 	{ 0x8086, 0x3a42, pIIxget, pIIxset },	/* Intel 82801JI */

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

@@ -202,7 +202,7 @@ install:V:
 		mk $MKFLAGS $i.install
 
 %.install:V:	$BIN/%
-	for (fs in lookout boundary piestand bovril)
+	for (fs in )
 		9fs $fs && cp $prereq /n/$fs/$prereq
 
 $BIN/%:	%

+ 6 - 0
sys/src/boot/pc/pci.c

@@ -345,6 +345,7 @@ static bridge_t southbridges[] = {
 	{ 0x8086, 0x2420, pIIx_link, pIIx_init },	// Intel 82801AB
 	{ 0x8086, 0x2440, pIIx_link, pIIx_init },	// Intel 82801BA
 	{ 0x8086, 0x244c, pIIx_link, pIIx_init },	// Intel 82801BAM
+	{ 0x8086, 0x244e, pIIx_link, pIIx_init },	// Intel 82801
 	{ 0x8086, 0x2480, pIIx_link, pIIx_init },	// Intel 82801CA
 	{ 0x8086, 0x248c, pIIx_link, pIIx_init },	// Intel 82801CAM
 	{ 0x8086, 0x24c0, pIIx_link, pIIx_init },	// Intel 82801DBL
@@ -355,6 +356,11 @@ static bridge_t southbridges[] = {
 	{ 0x8086, 0x2641, pIIx_link, pIIx_init },	// Intel 82801FBM
 	{ 0x8086, 0x27b8, pIIx_link, pIIx_init },	// Intel 82801GB
 	{ 0x8086, 0x27b9, pIIx_link, pIIx_init },	// Intel 82801GBM
+	{ 0x8086, 0x27bd, pIIx_link, pIIx_init },	// Intel 82801GB/GR
+	{ 0x8086, 0x3a16, pIIx_link, pIIx_init },	// Intel 82801JIR
+	{ 0x8086, 0x3a40, pIIx_link, pIIx_init },	// Intel 82801JI
+	{ 0x8086, 0x3a42, pIIx_link, pIIx_init },	// Intel 82801JI
+	{ 0x8086, 0x3a48, pIIx_link, pIIx_init },	// Intel 82801JI
 	{ 0x1106, 0x0586, via_link, via_init },		// Viatech 82C586
 	{ 0x1106, 0x0596, via_link, via_init },		// Viatech 82C596
 	{ 0x1106, 0x0686, via_link, via_init },		// Viatech 82C686

+ 8 - 5
sys/src/cmd/usb/disk/disk.c

@@ -454,7 +454,10 @@ setup(Umsc *lun, char *data, int count, vlong offset)
 /*
  * Upon SRread/SRwrite errors we assume the medium may have changed,
  * and ask again for the capacity of the media.
- * BUG: How to proceed to avoid confussing dossrv??
+ * BUG: How to proceed to avoid confusing dossrv??
+ *
+ * ctl reads must match the format documented in sd(3) exactly
+ * to interoperate with the rest of the system.
  */
 static long
 dread(Usbfs *fs, Fid *fid, void *data, long count, vlong offset)
@@ -478,14 +481,14 @@ dread(Usbfs *fs, Fid *fid, void *data, long count, vlong offset)
 		count = usbdirread(fs, q, data, count, offset, dirgen, nil);
 		break;
 	case Qctl:
+		s = buf;
 		e = buf + sizeof(buf);
-		s = seprint(buf, e, "%s lun %ld: ", fs->dev->dir, lun - &ums->lun[0]);
 		if(lun->flags & Finqok)
-			s = seprint(s, e, "inquiry %s ", lun->inq);
+			s = seprint(s, e, "inquiry %s lun %ld: %s\n",
+				fs->dev->dir, lun - &ums->lun[0], lun->inq);
 		if(lun->blocks > 0)
-			s = seprint(s, e, "geometry %llud %ld",
+			s = seprint(s, e, "geometry %llud %ld\n",
 				lun->blocks, lun->lbsize);
-		s = seprint(s, e, "\n");
 		count = usbreadbuf(data, count, offset, buf, s - buf);
 		break;
 	case Qraw:

+ 17 - 5
sys/src/libdisk/scsi.c

@@ -166,17 +166,20 @@ scsicmd(Scsi *s, uchar *cmd, int ccount, void *data, int dcount, int io)
 static int
 _scsiready(Scsi *s, int dolock)
 {
+	char err[ERRMAX];
 	uchar cmd[6], resp[16];
 	int status, i;
 
 	if(dolock)
 		qlock(s);
+	werrstr("");
 	for(i=0; i<3; i++) {
 		memset(cmd, 0, sizeof(cmd));
 		cmd[0] = 0x00;	/* unit ready */
 		if(write(s->rawfd, cmd, sizeof(cmd)) != sizeof(cmd)) {
 			if(scsiverbose)
 				fprint(2, "ur cmd write: %r\n");
+			werrstr("short unit-ready raw write");
 			goto bad;
 		}
 		write(s->rawfd, resp, 0);
@@ -196,6 +199,9 @@ _scsiready(Scsi *s, int dolock)
 			fprint(2, "target: bad status: %x\n", status);
 	bad:;
 	}
+	rerrstr(err, sizeof err);
+	if(err[0] == '\0')
+		werrstr("unit did not become ready");
 	if(dolock)
 		qunlock(s);
 	return -1;
@@ -272,7 +278,7 @@ scsi(Scsi *s, uchar *cmd, int ccount, void *v, int dcount, int io)
 		fprint(2, "scsi cmd #%.2ux: %.2ux %.2ux %.2ux: %s\n",
 			cmd[0], key, code, sense[13], p);
 
-//	if(key == 0)
+//	if(key == 0)			/* no sense? */
 //		return dcount;
 	return -1;
 }
@@ -297,21 +303,27 @@ openscsi(char *dev)
 
 	snprint(name, l, "%s/ctl", dev);
 	if((ctlfd = open(name, ORDWR)) < 0) {
-		free(name);
 	Error:
+		free(name);
 		close(rawfd);
 		return nil;
 	}
-	free(name);
 
 	n = readn(ctlfd, buf, sizeof buf);
 	close(ctlfd);
-	if(n <= 0)
+	if(n <= 0) {
+		if(n == 0)
+			werrstr("eof on %s", name);
 		goto Error;
+	}
 
-	if(strncmp(buf, "inquiry ", 8) != 0 || (p = strchr(buf, '\n')) == nil)
+	if(strncmp(buf, "inquiry ", 8) != 0 || (p = strchr(buf, '\n')) == nil) {
+		werrstr("inquiry mal-formatted in %s", name);
 		goto Error;
+	}
 	*p = '\0';
+	free(name);
+	name = nil;
 
 	if((p = strdup(buf+8)) == nil)
 		goto Error;