reorder tests so usb/disk does not suicide on some sd cards I have, sadly it doesn't work with them either (device with short descriptor) -Steve Reference: /n/sources/patch/usb.disk-suicide Date: Thu Feb 5 12:29:32 CET 2015 Signed-off-by: steve@quintile.net --- /sys/src/cmd/usb/disk/disk.c Thu Feb 5 12:17:06 2015 +++ /sys/src/cmd/usb/disk/disk.c Thu Feb 5 12:17:01 2015 @@ -661,20 +661,22 @@ for(i = 0; i < nelem(ud->ep); i++){ if((ep = ud->ep[i]) == nil) continue; + if(ep->type != Ebulk) + continue; + csp = ep->iface->csp; sc = Subclass(csp); if(!(Class(csp) == Clstorage && (Proto(csp) == Protobulk))) continue; if(sc != Subatapi && sc != Sub8070 && sc != Subscsi) fprint(2, "disk: subclass %#ulx not supported. trying anyway\n", sc); - if(ep->type == Ebulk){ - if(ep->dir == Eboth || ep->dir == Ein) - if(epin == -1) - epin = ep->id; - if(ep->dir == Eboth || ep->dir == Eout) - if(epout == -1) - epout = ep->id; - } + + if(ep->dir == Eboth || ep->dir == Ein) + if(epin == -1) + epin = ep->id; + if(ep->dir == Eboth || ep->dir == Eout) + if(epout == -1) + epout = ep->id; } dprint(2, "disk: ep ids: in %d out %d\n", epin, epout); if(epin == -1 || epout == -1)