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:
parent
1ac9d6ab0e
commit
742fe500b5
5 changed files with 6 additions and 18 deletions
|
@ -1107,7 +1107,6 @@ episoread(Ep *ep, Isoio *iso, void *a, int count)
|
||||||
error(iso->err ? iso->err : Eio);
|
error(iso->err ? iso->err : Eio);
|
||||||
}
|
}
|
||||||
iso->state = Qdone;
|
iso->state = Qdone;
|
||||||
assert(iso->tdu != iso->tdi);
|
|
||||||
|
|
||||||
for(tot = 0; iso->tdi != iso->tdu && tot < count; tot += nr){
|
for(tot = 0; iso->tdi != iso->tdu && tot < count; tot += nr){
|
||||||
tdu = iso->tdu;
|
tdu = iso->tdu;
|
||||||
|
|
|
@ -358,17 +358,17 @@ threadmain(int argc, char **argv)
|
||||||
if(setrec){
|
if(setrec){
|
||||||
value[0] = i;
|
value[0] = i;
|
||||||
if(setcontrol(Record, "channels", value) == Undef)
|
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;
|
value[0] = 16;
|
||||||
if(setcontrol(Record, "resolution", value) == Undef)
|
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 */
|
getcontrols(); /* Get the initial value of all controls */
|
||||||
value[0] = defaultspeed[Play];
|
value[0] = defaultspeed[Play];
|
||||||
if(endpt[Play] >= 0 && setcontrol(Play, "speed", value) < 0)
|
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];
|
value[0] = defaultspeed[Record];
|
||||||
if(endpt[Record] >= 0 && setcontrol(Record, "speed", value) < 0)
|
if(endpt[Record] >= 0 && setcontrol(Record, "speed", value) < 0)
|
||||||
fprint(2, "%s: can't set record speed\n", argv0);
|
fprint(2, "%s: can't set record speed\n", argv0);
|
||||||
|
|
|
@ -131,7 +131,7 @@ findalt(int rec, int nchan, int res, int speed)
|
||||||
int
|
int
|
||||||
setspeed(int rec, int speed)
|
setspeed(int rec, int speed)
|
||||||
{
|
{
|
||||||
int ps, n, no, dist, i;
|
int n, no, dist, i;
|
||||||
Audioalt *a;
|
Audioalt *a;
|
||||||
Altc *da;
|
Altc *da;
|
||||||
Ep *ep;
|
Ep *ep;
|
||||||
|
@ -215,15 +215,6 @@ setspeed(int rec, int speed)
|
||||||
}
|
}
|
||||||
dprint(2, " speed now %d Hz;", 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",
|
dprint(2, "Configuring %s endpoint for %d Hz\n",
|
||||||
rec?"record":"playback", speed);
|
rec?"record":"playback", speed);
|
||||||
epdev[rec] = openep(ad, endpt[rec]);
|
epdev[rec] = openep(ad, endpt[rec]);
|
||||||
|
|
|
@ -66,8 +66,6 @@ usbfsadd(Usbfs *dfs)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
print("%s: %s\n", argv0, dfs->name);
|
|
||||||
|
|
||||||
dprint(2, "%s: fsadd %s\n", argv0, dfs->name);
|
dprint(2, "%s: fsadd %s\n", argv0, dfs->name);
|
||||||
qlock(&fslck);
|
qlock(&fslck);
|
||||||
for(i = 1; i < nfs; i++)
|
for(i = 1; i < nfs; i++)
|
||||||
|
|
|
@ -13,13 +13,13 @@ typedef struct Usbdev Usbdev;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
/* fundamental constants */
|
/* fundamental constants */
|
||||||
Nep = 16, /* max. endpoints per usb device & per interface */
|
Nep = 256, /* max. endpoints per usb device & per interface */
|
||||||
|
|
||||||
/* tunable parameters */
|
/* tunable parameters */
|
||||||
Nconf = 16, /* max. configurations per usb device */
|
Nconf = 16, /* max. configurations per usb device */
|
||||||
Nddesc = 8*Nep, /* max. device-specific descriptors per usb device */
|
Nddesc = 8*Nep, /* max. device-specific descriptors per usb device */
|
||||||
Niface = 16, /* max. interfaces per configuration */
|
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 */
|
Uctries = 4, /* no. of tries for usbcmd */
|
||||||
Ucdelay = 50, /* delay before retrying */
|
Ucdelay = 50, /* delay before retrying */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue