Browse Source

Plan 9 from Bell Labs 2008-05-24

David du Colombier 12 years ago
parent
commit
4e66bd6fb2

+ 4 - 4
dist/replica/_plan9.db

@@ -8186,7 +8186,7 @@ sys/src/9/pc/realmode.c - 664 sys sys 1139667044 2678
 sys/src/9/pc/rebootcode.s - 664 sys sys 1015014522 988
 sys/src/9/pc/screen.c - 664 sys sys 1184522395 13973
 sys/src/9/pc/screen.h - 664 sys sys 1147023549 4256
-sys/src/9/pc/sd53c8xx.c - 664 sys sys 1170456695 55276
+sys/src/9/pc/sd53c8xx.c - 664 sys sys 1211521147 55313
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
 sys/src/9/pc/sdata.c - 664 sys sys 1205986828 53185
 sys/src/9/pc/sdiahci.c - 664 sys sys 1200348596 38496
@@ -10033,9 +10033,9 @@ sys/src/cmd/cc/sub.c - 664 sys sys 1143759345 34268
 sys/src/cmd/cc/y.tab.h - 664 sys sys 1098501521 1680
 sys/src/cmd/cdfs - 20000000775 sys sys 1039727558 0
 sys/src/cmd/cdfs/buf.c - 664 sys sys 1205271166 1923
-sys/src/cmd/cdfs/dat.h - 664 sys sys 1208632592 4636
+sys/src/cmd/cdfs/dat.h - 664 sys sys 1211521283 5591
 sys/src/cmd/cdfs/fns.h - 664 sys sys 969542122 297
-sys/src/cmd/cdfs/main.c - 664 sys sys 1210357437 12478
+sys/src/cmd/cdfs/main.c - 664 sys sys 1211521244 12479
 sys/src/cmd/cdfs/mkfile - 664 sys sys 1204937991 153
 sys/src/cmd/cdfs/mmc.c - 664 sys sys 1210046871 31599
 sys/src/cmd/cec - 20000000775 sys sys 1193683647 0
@@ -13408,7 +13408,7 @@ sys/src/cmd/scuzz/changer.c - 664 sys sys 944961084 1137
 sys/src/cmd/scuzz/mkfile - 664 sys sys 1032060571 231
 sys/src/cmd/scuzz/mo.words - 664 sys sys 1177702138 1262
 sys/src/cmd/scuzz/scsireq.c - 664 sys sys 1181436637 13594
-sys/src/cmd/scuzz/scsireq.h - 664 sys sys 1204949623 6861
+sys/src/cmd/scuzz/scsireq.h - 664 sys sys 1211559652 6902
 sys/src/cmd/scuzz/scuzz.c - 664 sys sys 1181436627 38286
 sys/src/cmd/scuzz/sense.c - 664 sys sys 1177702138 5680
 sys/src/cmd/sed.c - 664 sys sys 1182465504 26844

+ 4 - 4
dist/replica/plan9.db

@@ -8186,7 +8186,7 @@ sys/src/9/pc/realmode.c - 664 sys sys 1139667044 2678
 sys/src/9/pc/rebootcode.s - 664 sys sys 1015014522 988
 sys/src/9/pc/screen.c - 664 sys sys 1184522395 13973
 sys/src/9/pc/screen.h - 664 sys sys 1147023549 4256
-sys/src/9/pc/sd53c8xx.c - 664 sys sys 1170456695 55276
+sys/src/9/pc/sd53c8xx.c - 664 sys sys 1211521147 55313
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
 sys/src/9/pc/sdata.c - 664 sys sys 1205986828 53185
 sys/src/9/pc/sdiahci.c - 664 sys sys 1200348596 38496
@@ -10033,9 +10033,9 @@ sys/src/cmd/cc/sub.c - 664 sys sys 1143759345 34268
 sys/src/cmd/cc/y.tab.h - 664 sys sys 1098501521 1680
 sys/src/cmd/cdfs - 20000000775 sys sys 1039727558 0
 sys/src/cmd/cdfs/buf.c - 664 sys sys 1205271166 1923
-sys/src/cmd/cdfs/dat.h - 664 sys sys 1208632592 4636
+sys/src/cmd/cdfs/dat.h - 664 sys sys 1211521283 5591
 sys/src/cmd/cdfs/fns.h - 664 sys sys 969542122 297
-sys/src/cmd/cdfs/main.c - 664 sys sys 1210357437 12478
+sys/src/cmd/cdfs/main.c - 664 sys sys 1211521244 12479
 sys/src/cmd/cdfs/mkfile - 664 sys sys 1204937991 153
 sys/src/cmd/cdfs/mmc.c - 664 sys sys 1210046871 31599
 sys/src/cmd/cec - 20000000775 sys sys 1193683647 0
@@ -13408,7 +13408,7 @@ sys/src/cmd/scuzz/changer.c - 664 sys sys 944961084 1137
 sys/src/cmd/scuzz/mkfile - 664 sys sys 1032060571 231
 sys/src/cmd/scuzz/mo.words - 664 sys sys 1177702138 1262
 sys/src/cmd/scuzz/scsireq.c - 664 sys sys 1181436637 13594
-sys/src/cmd/scuzz/scsireq.h - 664 sys sys 1204949623 6861
+sys/src/cmd/scuzz/scsireq.h - 664 sys sys 1211559652 6902
 sys/src/cmd/scuzz/scuzz.c - 664 sys sys 1181436627 38286
 sys/src/cmd/scuzz/sense.c - 664 sys sys 1177702138 5680
 sys/src/cmd/sed.c - 664 sys sys 1182465504 26844

+ 4 - 0
dist/replica/plan9.log

@@ -19679,3 +19679,7 @@
 1211256004 13 c 386/bin/venti/wrarena - 775 sys sys 1211255752 284303
 1211409030 0 c sys/src/cmd/uniq.c - 664 sys sys 1211408347 2173
 1211428804 0 c 386/bin/uniq - 775 sys sys 1211428445 62434
+1211522406 0 c sys/src/9/pc/sd53c8xx.c - 664 sys sys 1211521147 55313
+1211522406 1 c sys/src/cmd/cdfs/dat.h - 664 sys sys 1211521283 5591
+1211522406 2 c sys/src/cmd/cdfs/main.c - 664 sys sys 1211521244 12479
+1211560204 0 c sys/src/cmd/scuzz/scsireq.h - 664 sys sys 1211559652 6902

+ 9 - 8
sys/src/9/pc/sd53c8xx.c

@@ -202,7 +202,8 @@ typedef enum State {
 	Allocated, Queued, Active, Done
 } State;
 
-typedef struct Dsa {
+typedef struct Dsa Dsa;
+struct Dsa {
 	uchar stateb;
 	uchar result;
 	uchar dmablks;
@@ -224,7 +225,7 @@ typedef struct Dsa {
 	uchar pad2[2];
 
 	uchar next[4];			/* chaining for SCRIPT (NCR byte order) */
-	struct Dsa *freechain;		/* chaining for freelist */
+	Dsa	*freechain;		/* chaining for freelist */
 	Rendez;
 	uchar scsi_id_buf[4];
 	Movedata msg_out_buf;
@@ -235,7 +236,7 @@ typedef struct Dsa {
 	uchar status;
 	int p9status;
 	uchar parityerror;
-} Dsa;
+};
 
 typedef enum Feature {
 	BigFifo = 1,			/* 536 byte fifo */
@@ -1182,9 +1183,8 @@ write_mismatch_recover(Controller *c, Ncr *n, Dsa *dsa)
 static void
 sd53c8xxinterrupt(Ureg *ur, void *a)
 {
-	uchar istat;
+	uchar istat, dstat;
 	ushort sist;
-	uchar dstat;
 	int wakeme = 0;
 	int cont = -1;
 	Dsa *dsa;
@@ -1406,8 +1406,8 @@ sd53c8xxinterrupt(Ureg *ur, void *a)
 			dsa->parityerror = 1;
 		}
 		if (sist & 0x4) {
-			IPRINT(PRINTPREFIX "%d/%d: unexpected disconnect\n",
-			    dsa->target, dsa->lun);
+			IPRINT(PRINTPREFIX "%s%d lun %d: unexpected disconnect\n",
+				c->sdev->name, dsa->target, dsa->lun);
 			dumpncrregs(c, 1);
 			//wakeme = 1;
 			dsa->p9status = SDeio;
@@ -1948,7 +1948,8 @@ cribbios(Controller *c)
 {
 	c->bios.scntl3 = c->n->scntl3;
 	c->bios.stest2 = c->n->stest2;
-	print(PRINTPREFIX "bios scntl3(%.2x) stest2(%.2x)\n", c->bios.scntl3, c->bios.stest2);
+	print(PRINTPREFIX "%s: bios scntl3(%.2x) stest2(%.2x)\n",
+		c->sdev->name, c->bios.scntl3, c->bios.stest2);
 }
 
 static int

+ 32 - 3
sys/src/cmd/cdfs/dat.h

@@ -45,8 +45,21 @@ enum {
 	Capcdda		= 1<<0,		/* Capmisc bits */
 	Caprw		= 1<<2,
 
+	/* Pagwrparams mode page offsets */
+	Wpwrtype	= 2,		/* write type */
+	Wptrkmode,			/* track mode */
+	Wpdatblktype,
+	Wpsessfmt	= 8,
+	Wppktsz		= 10,		/* BE ulong: # user data blks/fixed pkt */
+
 	/* Pagwrparams bits */
-	Bufe	= 1<<6,		/* buffer under-run free recording enable */
+	Bufe	= 1<<6,	/* Wpwrtype: buffer under-run free recording enable */
+	/* Wptrkmode */
+	Msbits	= 3<<6,		/* multisession field */
+	Msnonext= 0<<6,		/* no next border nor session */
+	Mscdnonext= 1<<6,	/* cd special: no next session */
+	Msnext	= 3<<6,		/* next session or border allowed */
+	Fp	= 1<<5,		/* pay attention to Wppktsz */
 
 	/* close track session cdb bits */
 	Closetrack	= 1,
@@ -69,12 +82,28 @@ enum {
 	Msfbit	= 1<<1,
 
 	/* write types, MMC-6 §7.5.4.9 */
-	Wtpkt	= 0,
+	Wtpkt	= 0,		/* a.k.a. incremental */
 	Wttrackonce,
-	Wtsessonce,
+	Wtsessonce,		/* a.k.a. disc-at-once */
 	Wtraw,
 	Wtlayerjump,
 
+	/* track modes (TODO: also track types?) */
+	Tmcdda	= 0,		/* audio cdda */
+	Tm2audio,		/* 2 audio channels */
+	Tmunintr = 4,		/* data, recorded uninterrupted */
+	Tmintr,			/* data, recorded interrupted (dvd default) */
+
+	/* data block types */
+	Dbraw = 0,		/* 2352 bytes */
+	Db2kdata = 8,		/* mode 1: 2K of user data */
+	Db2336,			/* mode 2: 2336 bytes of user data */
+
+	/* session formats */
+	Sfdata	= 0,
+	Sfcdi	= 0x10,
+	Sfcdxa	= 0x20,
+
 	/* Cache control bits in mode page 8 byte 2 */
 	Ccrcd	= 1<<0,		/* read cache disabled */
 	Ccmf	= 1<<1,		/* multiplication factor */

+ 1 - 1
sys/src/cmd/cdfs/main.c

@@ -193,7 +193,7 @@ fsremove(Req *r)
 	case Qwd:
 		if(drive->fixate(drive) < 0)
 			respond(r, geterrstr());
-// let's see if it can figure this out		drive->writeok = 0;	
+// let us see if it can figure this out:	drive->writeok = 0;	
 		else
 			respond(r, nil);
 		checktoc(drive);

+ 2 - 1
sys/src/cmd/scuzz/scsireq.h

@@ -94,7 +94,8 @@ enum {					/* SCSI command codes */
 	ScmdRTOC	= 0x43,		/* read TOC data */
 	ScmdRdiscinfo	= 0x51,		/* read disc information */
 	ScmdRtrackinfo	= 0x52,		/* read track information */
-	ScmdBlank	= 0xA1,		/* blank CD-RW media */
+	ScmdReserve	= 0x53,		/* reserve track */
+	ScmdBlank	= 0xA1,		/* blank *-RW media */
 
 	ScmdCDpause	= 0x4B,		/* pause/resume */
 	ScmdCDstop	= 0x4E,		/* stop play/scan */