fix panic in usbuhci driver, increase max number of endpoints and alt configurations, make usb/audio continue besides some errors

This commit is contained in:
cinap_lenrek 2011-05-21 18:39:13 +00:00
parent 1ac9d6ab0e
commit 742fe500b5
5 changed files with 6 additions and 18 deletions

View file

@ -1107,7 +1107,6 @@ episoread(Ep *ep, Isoio *iso, void *a, int count)
error(iso->err ? iso->err : Eio);
}
iso->state = Qdone;
assert(iso->tdu != iso->tdi);
for(tot = 0; iso->tdi != iso->tdu && tot < count; tot += nr){
tdu = iso->tdu;

View file

@ -358,17 +358,17 @@ threadmain(int argc, char **argv)
if(setrec){
value[0] = i;
if(setcontrol(Record, "channels", value) == Undef)
sysfatal("Can't set record channels");
fprint(2, "%s: can't set record channels\n", argv0);
value[0] = 16;
if(setcontrol(Record, "resolution", value) == Undef)
sysfatal("Can't set record resolution");
fprint(2, "%s: can't set record resolution\n", argv0);
}
}
getcontrols(); /* Get the initial value of all controls */
value[0] = defaultspeed[Play];
if(endpt[Play] >= 0 && setcontrol(Play, "speed", value) < 0)
sysfatal("can't set play speed");
fprint(2, "%s: can't set play speed\n", argv0);
value[0] = defaultspeed[Record];
if(endpt[Record] >= 0 && setcontrol(Record, "speed", value) < 0)
fprint(2, "%s: can't set record speed\n", argv0);

View file

@ -131,7 +131,7 @@ findalt(int rec, int nchan, int res, int speed)
int
setspeed(int rec, int speed)
{
int ps, n, no, dist, i;
int n, no, dist, i;
Audioalt *a;
Altc *da;
Ep *ep;
@ -215,15 +215,6 @@ setspeed(int rec, int speed)
}
dprint(2, " speed now %d Hz;", speed);
}
ps = ((speed * da->interval + 999) / 1000)
* controls[rec][Channel_control].value[0]
* controls[rec][Resolution_control].value[0]/8;
if(ps > ep->maxpkt){
fprint(2, "%s: setspeed(rec %d, speed %d): packet size %d > "
"maximum packet size %d\n",
argv0, rec, speed, ps, ep->maxpkt);
return Undef;
}
dprint(2, "Configuring %s endpoint for %d Hz\n",
rec?"record":"playback", speed);
epdev[rec] = openep(ad, endpt[rec]);

View file

@ -66,8 +66,6 @@ usbfsadd(Usbfs *dfs)
{
int i, j;
print("%s: %s\n", argv0, dfs->name);
dprint(2, "%s: fsadd %s\n", argv0, dfs->name);
qlock(&fslck);
for(i = 1; i < nfs; i++)

View file

@ -13,13 +13,13 @@ typedef struct Usbdev Usbdev;
enum {
/* fundamental constants */
Nep = 16, /* max. endpoints per usb device & per interface */
Nep = 256, /* max. endpoints per usb device & per interface */
/* tunable parameters */
Nconf = 16, /* max. configurations per usb device */
Nddesc = 8*Nep, /* max. device-specific descriptors per usb device */
Niface = 16, /* max. interfaces per configuration */
Naltc = 16, /* max. alt configurations per interface */
Naltc = 256, /* max. alt configurations per interface */
Uctries = 4, /* no. of tries for usbcmd */
Ucdelay = 50, /* delay before retrying */