This fixes the issue, that usbd was unable to get the desc- riptor of the HUB and some cleanups in the OR creation of some requests. Reference: /n/sources/patch/applied/usbd-hub-fix Date: Wed Feb 1 15:53:48 CET 2006 --- /sys/src/cmd/usb/usbd/setup.c Wed Feb 1 15:52:42 2006 +++ /sys/src/cmd/usb/usbd/setup.c Wed Feb 1 15:52:38 2006 @@ -25,7 +25,7 @@ void setconfig(Device *d, int n) { - setup0(d, RH2D, SET_CONFIGURATION, n, 0, 0); + setup0(d, RH2D|Rstandard|Rdevice, SET_CONFIGURATION, n, 0, 0); d->state = Configured; } --- /sys/src/cmd/usb/lib/usb.h Wed Feb 1 15:53:01 2006 +++ /sys/src/cmd/usb/lib/usb.h Wed Feb 1 15:52:57 2006 @@ -109,6 +109,7 @@ HID = 0x21, REPORT = 0x22, PHYSICAL = 0x23, + HUB = 0x29, /* feature selectors */ DEVICE_REMOTE_WAKEUP = 1, --- /sys/src/cmd/usb/usbd/hub.c Wed Feb 1 15:53:26 2006 +++ /sys/src/cmd/usb/usbd/hub.c Wed Feb 1 15:53:23 2006 @@ -45,7 +45,7 @@ h->ctlrno = parent->ctlrno; h->dev0 = parent->dev0; - if (setupreq(d->ep[0], RD2H|Rclass|Rdevice, GET_DESCRIPTOR, (0<<8)|0, 0, sizeof(buf)) < 0 || + if ((setupreq(d->ep[0], RD2H|Rclass|Rdevice, GET_DESCRIPTOR, (HUB<<8)|0, 0, DHUBLEN) < 0) || (nr = setupreply(d->ep[0], buf, sizeof(buf))) < DHUBLEN) { fprint(2, "usbd: error reading hub descriptor\n"); free(h); @@ -117,11 +117,10 @@ { int cmd; + cmd = CLEAR_FEATURE; if(on) cmd = SET_FEATURE; - else - cmd = CLEAR_FEATURE; - setup0(h->d, Rclass|Rother, cmd, feature, port, 0); + setup0(h->d, RH2D|Rclass|Rother, cmd, feature, port, 0); } void