nusb: handle sub hubs

This commit is contained in:
cinap_lenrek 1970-01-01 01:34:55 +01:00
parent e321b1b9d2
commit 9d49fcdb37
2 changed files with 12 additions and 0 deletions

View file

@ -1,2 +1,3 @@
int startdev(Port*);
void work(void);
Hub* newhub(char *, Dev *);

View file

@ -311,6 +311,17 @@ startdev(Port *p)
fprint(2, "okay what?\n");
return -1;
}
if(d->usb->class == Clhub){
/*
* Hubs are handled directly by this process avoiding
* concurrent operation so that at most one device
* has the config address in use.
* We cancel kernel debug for these eps. too chatty.
*/
if((p->hub = newhub(d->dir, d)) == nil)
return -1;
return 0;
}
close(d->dfd);
d->dfd = -1;
pushevent(formatdev(d));