M alphapc/random.c => alphapc/random.c +2 -2
@@ 81,7 81,7 @@ randomclock(void)
wakeup(&rb.consumer);
}
-static void
+void
randominit(void)
{
addclock0link(randomclock);
@@ 93,7 93,7 @@ randominit(void)
/*
* consume random bytes from a circular buffer
*/
-static ulong
+ulong
randomread(void *xp, ulong n)
{
uchar *e, *p;
M alphapc/sd.h => alphapc/sd.h +3 -5
@@ 14,7 14,7 @@ typedef struct SDpart {
char user[NAMELEN];
ulong perm;
int valid;
- int nopen; /* of this partition */
+ ulong vers;
} SDpart;
typedef struct SDunit {
@@ 27,10 27,8 @@ typedef struct SDunit {
QLock ctl;
ulong sectors;
ulong secsize;
- SDpart* part;
- int npart; /* of valid partitions */
- int nopen; /* of partitions on this unit */
- int changed;
+ SDpart* part; /* either nil or points at array of size SDnpart */
+ ulong vers;
Lock rawinuse; /* really just a test-and-set */
int state;
M alphapc/sdscsi.c => alphapc/sdscsi.c +14 -5
@@ 217,6 217,14 @@ scsionline(SDunit* unit)
*/
unit->sectors++;
unit->secsize = (p[4]<<24)|(p[5]<<16)|(p[6]<<8)|p[7];
+
+ /*
+ * Some ATAPI CD readers lie about the block size.
+ * Since we don't read audio via this interface
+ * it's okay to always fudge this.
+ */
+ if((unit->inquiry[0] & 0x1F) == 0x05 && unit->secsize == 2352)
+ unit->secsize = 2048;
ok = 1;
break;
case 1:
@@ 230,7 238,10 @@ scsionline(SDunit* unit)
free(p);
free(r);
- return ok;
+ if(ok)
+ return ok+retries;
+ else
+ return 0;
}
int
@@ 331,15 342,13 @@ again:
case 0x06: /* check condition */
/*
* Check for a removeable media change.
- * If so, mark it and zap the geometry info
+ * If so, mark it by zapping the geometry info
* to force an online request.
*/
if(r->sense[12] != 0x28 || r->sense[13] != 0)
break;
- if(unit->inquiry[1] & 0x80){
- unit->changed = 1;
+ if(unit->inquiry[1] & 0x80)
unit->sectors = 0;
- }
break;
case 0x02: /* not ready */
/*
M carrera/random.c => carrera/random.c +2 -2
@@ 81,7 81,7 @@ randomclock(void)
wakeup(&rb.consumer);
}
-static void
+void
randominit(void)
{
addclock0link(randomclock);
@@ 93,7 93,7 @@ randominit(void)
/*
* consume random bytes from a circular buffer
*/
-static ulong
+ulong
randomread(void *xp, ulong n)
{
uchar *e, *p;