M pc/devusb.c => pc/devusb.c +14 -7
@@ 832,10 832,6 @@ schedendpt(Endpt *e)
e->etd = nil;
e->remain = 0;
e->nbytes = 0;
- e->foffset = 0;
- e->toffset = 0;
- e->poffset = 0;
- e->buffered = 0;
td = e->td0;
for(i = e->sched; i < NFRAME; i += e->pollms){
bp = e->bp0 + e->maxpkt*i/e->pollms;
@@ 1595,6 1591,10 @@ usbopen(Chan *c, int omode)
else
error("can't schedule USB endpoint");
}
+ e->foffset = 0;
+ e->toffset = 0;
+ e->poffset = 0;
+ e->buffered = 0;
eptactivate(e);
}
incref(d);
@@ 1687,6 1687,7 @@ isoio(Endpt *e, void *a, long n, ulong offset, int w)
p = a;
ub = &ubus;
if (offset != 0 && offset != e->foffset){
+ iprint("offset %lud, foffset %lud\n", offset, e->foffset);
/* Seek to a specific position */
frnum = (IN(Frnum) + 8) & 0x3ff;
td = e->td0 +frnum;
@@ 1857,9 1858,15 @@ epstatus(char *s, int n, Endpt *e, int i)
l = 0;
l += snprint(s+l, n-l, "%2d %#6.6lux %10lud bytes %10lud blocks\n",
i, e->csp, e->nbytes, e->nblocks);
- if (e->iso && e->toffset){
- l += snprint(s+l, n-l, "bufsize %6d buffered %6d offset %10lud time %19lld\n",
- e->maxpkt, e->buffered, e->toffset, e->time);
+ if (e->iso){
+ l += snprint(s+l, n-l, "bufsize %6d buffered %6d",
+ e->maxpkt, e->buffered);
+ if(e->toffset)
+ l += snprint(s+l, n-l, " offset %10lud time %19lld\n",
+ e->toffset, e->time);
+ if (n-l > 0)
+ s[l++] = '\n';
+ s[l] = '\0';
}
return l;
}
M pc/ether82557.c => pc/ether82557.c +2 -1
@@ 902,9 902,10 @@ i82557pci(void)
switch(p->did){
default:
continue;
+ case 0x1209: /* INtel 82559ER */
case 0x1229: /* Intel 8255[789] */
case 0x1031: /* Intel 82562EM */
- case 0x2449: /* Intel ????? */
+ case 0x2449: /* Intel 82562ET */
break;
}
M port/devaudio.c => port/devaudio.c +3 -3
@@ 409,7 409,6 @@ sb16startdma(void)
sbcmd(count>>8);
audio.active = 1;
- audio.tottime = todget(nil);
contindma();
iunlock(&blaster);
}
@@ 501,7 500,6 @@ ess1688startdma(void)
ess1688w(0xB8, x|0x05);
audio.active = 1;
- audio.tottime = todget(nil);
contindma();
iunlock(&blaster);
}
@@ 896,6 894,8 @@ audioopen(Chan *c, int omode)
}
audio.amode = amode;
setempty();
+ if (amode == Aread)
+ audio.totcount -= Bufsize;
audio.curcount = 0;
qunlock(&audio);
mxvolume();
@@ 1017,7 1017,7 @@ audioread(Chan *c, void *v, long n, vlong off)
case Qstatus:
buf[0] = 0;
snprint(buf, sizeof(buf), "bufsize %6d buffered %6d offset %10lud time %19lld\n",
- Bufsize, audio.buffered, audio.totcount, audio.tottime);
+ Bufsize, audio.buffered, audio.totcount<0?0:audio.totcount, audio.tottime);
return readstr(offset, a, n, buf);
case Qvolume:
M port/devpipe.c => port/devpipe.c +1 -0
@@ 98,6 98,7 @@ pipegen(Chan *c, char*, Dirtab *tab, int ntab, int i, Dir *dp)
devdir(c, c->qid, "#|", 0, eve, DMDIR|0555, dp);
return 1;
}
+ i++; /* skip . */
if(tab==0 || i>=ntab)
return -1;
M port/devproc.c => port/devproc.c +8 -2
@@ 85,6 85,7 @@ procgen(Chan *c, char *name, Dirtab *tab, int, int s, Dir *dp)
{
Qid qid;
Proc *p;
+ char *ename;
Segment *q;
ulong pid, path, perm, len;
@@ 97,8 98,8 @@ procgen(Chan *c, char *name, Dirtab *tab, int, int s, Dir *dp)
if(c->qid.path == Qdir){
if(name != nil){
/* ignore s and use name to find pid */
- pid = strtol(name, &name, 0);
- if(pid==0 || name[0]!='\0')
+ pid = strtol(name, &ename, 10);
+ if(pid==0 || ename[0]!='\0')
return -1;
s = procindex(pid);
if(s < 0)
@@ 111,6 112,11 @@ procgen(Chan *c, char *name, Dirtab *tab, int, int s, Dir *dp)
if(pid == 0)
return 0;
sprint(up->genbuf, "%lud", pid);
+ /*
+ * String comparison is done in devwalk so name must match its formatted pid
+ */
+ if(name != nil && strcmp(name, up->genbuf) != 0)
+ return -1;
mkqid(&qid, (s+1)<<QSHIFT, pid, QTDIR);
devdir(c, qid, up->genbuf, 0, p->user, DMDIR|0555, dp);
return 1;