nusb/lib: do not retry port status requests

We want the hub to detect a failed hub as soon as possible,
to not delay device detaches.
This commit is contained in:
cinap_lenrek 2024-11-03 12:13:22 +00:00
parent ebf3e9067d
commit bada582e18

View file

@ -449,6 +449,13 @@ usbcmd(Dev *d, int type, int req, int value, int index, uchar *data, int count)
if(r == 0)
werrstr("no data from device");
}
/* don't retry GET_STATUS requests */
if(type == (Rd2h|Rclass|Rother)
&& req == Rgetstatus
&& value == 0)
break;
nerr++;
if(*err == 0)
rerrstr(err, sizeof(err));