From 66fef58a649a6bf75873f8d7200323d6b4c0fd57 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 8 Aug 1995 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1995-08-08 --- pc/scsi.c | 14 ++++++++------ pc/vgaark2000pv.c | 8 ++++++-- port/devkprof.c | 2 +- port/netif.c | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 9 deletions(-) diff --git a/pc/scsi.c b/pc/scsi.c index 867e1b5c97d639fee3b66f472928ad556d454800..a86d1506332ae3370ae767bcf70565381a4cd874 100644 --- a/pc/scsi.c +++ b/pc/scsi.c @@ -371,9 +371,10 @@ scsireqsense(Target *t, char lun, void *data, int *nbytes, int quiet) } /* - * Unit is becoming ready + * Unit is becoming ready, rather than not ready */ - if(sense[12] != 0x04 || sense[13] != 0x01) + if((sense[2] & 0x0F) != 0x02 && + (sense[12] != 0x04 || sense[13] != 0x01)) break; delay(5000); @@ -389,16 +390,17 @@ scsireqsense(Target *t, char lun, void *data, int *nbytes, int quiet) } int -scsidiskinfo(Target *t, char lun, uchar *data) +scsidiskinfo(Target *t, char lun, int track, uchar *data) { int s, nbytes; uchar cmd[10], *d; - nbytes = 4; + nbytes = 12; memset(cmd, 0, sizeof(cmd)); cmd[0] = 0x43; cmd[1] = lun<<5; + cmd[6] = track; hnputs(cmd+7, nbytes); d = scsialloc(nbytes); @@ -407,7 +409,7 @@ scsidiskinfo(Target *t, char lun, uchar *data) memset(d, 0, nbytes); s = scsiexec(t, SCSIread, cmd, sizeof(cmd), d, &nbytes); - memmove(data, d, 4); + memmove(data, d, 12); scsifree(d); return s; } @@ -466,7 +468,7 @@ scsibufsize(Target *t, char lun, int size) } int -scsireadcdda(Target *t, char lun, int dir, void *b, long n, long bsize, long bno) +scsireadcdda(Target *t, char lun, int, void *b, long n, long bsize, long bno) { uchar cmd[10]; int s, nbytes; diff --git a/pc/vgaark2000pv.c b/pc/vgaark2000pv.c index 0c98e9dc63fc85689238b36e1de9ef8f3af68024..be4e139799098dea717bedfc439e64f22450e81c 100644 --- a/pc/vgaark2000pv.c +++ b/pc/vgaark2000pv.c @@ -89,7 +89,9 @@ load(Cursor *c) } memmove(&curcursor, c, sizeof(Cursor)); +#ifdef notdef vgaxo(Seqx, 0x20, seq20 & ~0x08); +#endif /* * Is linear addressing turned on? This will determine * how we access the cursor storage. @@ -120,8 +122,8 @@ load(Cursor *c) *p++ = c->set[2*y + x]; } else { - *p++ = 0xAA; - *p++ = 0x55; + *p++ = 0x00; + *p++ = 0x00; } } } @@ -130,7 +132,9 @@ load(Cursor *c) * Set the cursor hotpoint and enable the cursor. */ hotpoint = c->offset; +#ifdef notdef vgaxo(Seqx, 0x20, seq20|0x08); +#endif unlock(&ark2000pvlock); } diff --git a/port/devkprof.c b/port/devkprof.c index f2ec3759b2bbfff79ab96721e391b5c9d89be629..644d846abe14ca2f6ed0bda2bf62a31088041caf 100644 --- a/port/devkprof.c +++ b/port/devkprof.c @@ -113,7 +113,7 @@ kprofwstat(Chan*, char*) } void -kprofclose(Chan *c) +kprofclose(Chan*) { } diff --git a/port/netif.c b/port/netif.c index c520f6823e57c054352e2f5cb2cd4cb345c4b0db..be7941a22e52cb0c796b9586701575cd1f2ab014 100644 --- a/port/netif.c +++ b/port/netif.c @@ -395,3 +395,41 @@ matchtoken(char *p, char *token) p++; return p; } + +void +hnputl(void *p, ulong v) +{ + uchar *a; + + a = p; + a[0] = v>>24; + a[1] = v>>16; + a[2] = v>>8; + a[3] = v; +} + +void +hnputs(void *p, ushort v) +{ + uchar *a; + + a = p; + a[0] = v>>8; + a[1] = v; +} + +ulong +nhgetl(void *p) +{ + uchar *a; + a = p; + return (a[0]<<24)|(a[1]<<16)|(a[2]<<8)|(a[3]<<0); +} + +ushort +nhgets(void *p) +{ + uchar *a; + a = p; + return (a[0]<<8)|(a[1]<<0); +}