nusb/usbd: retry opendevtata() a few times on attach (work around mnt-reform trackball)
this is a known and already fixed issue with version the following version
of the mnt-reform trackball firmware:
55ca5bf848
This commit is contained in:
parent
2b1ecbe87d
commit
990ceeef3b
1 changed files with 7 additions and 2 deletions
|
@ -355,6 +355,7 @@ portattach(Hub *h, int p, u32int sts)
|
||||||
char *sp;
|
char *sp;
|
||||||
int mp;
|
int mp;
|
||||||
int nr;
|
int nr;
|
||||||
|
int i;
|
||||||
|
|
||||||
d = h->dev;
|
d = h->dev;
|
||||||
pp = &h->port[p];
|
pp = &h->port[p];
|
||||||
|
@ -421,9 +422,13 @@ portattach(Hub *h, int p, u32int sts)
|
||||||
nd->isusb3 = h->dev->isusb3;
|
nd->isusb3 = h->dev->isusb3;
|
||||||
if(usbdebug > 2)
|
if(usbdebug > 2)
|
||||||
devctl(nd, "debug 1");
|
devctl(nd, "debug 1");
|
||||||
if(opendevdata(nd, ORDWR) < 0){
|
for(i=0;; i++){
|
||||||
|
if(opendevdata(nd, ORDWR) >= 0)
|
||||||
|
break;
|
||||||
fprint(2, "%s: %s: opendevdata: %r\n", argv0, nd->dir);
|
fprint(2, "%s: %s: opendevdata: %r\n", argv0, nd->dir);
|
||||||
|
if(i >= 4)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
sleep(500);
|
||||||
}
|
}
|
||||||
if(usbcmd(nd, Rh2d|Rstd|Rdev, Rsetaddress, nd->id, 0, nil, 0) < 0){
|
if(usbcmd(nd, Rh2d|Rstd|Rdev, Rsetaddress, nd->id, 0, nil, 0) < 0){
|
||||||
dprint(2, "%s: %s: port %d: setaddress: %r\n", argv0, d->dir, p);
|
dprint(2, "%s: %s: port %d: setaddress: %r\n", argv0, d->dir, p);
|
||||||
|
|
Loading…
Reference in a new issue