usb_host: reflect ENOSPC as STALL

Issue #4035
This commit is contained in:
Norman Feske 2021-03-02 14:49:46 +01:00
parent 80522fadf6
commit 2e4ccc1459

View File

@ -432,6 +432,18 @@ class Usb::Worker : public Genode::Weak_object<Usb::Worker>
p.error = Packet_descriptor::INTERFACE_OR_ENDPOINT_ERROR;
else if ((ret == -ENODEV) || (ret == -ESHUTDOWN))
p.error = Packet_descriptor::NO_DEVICE_ERROR;
else if (ret == -ENOSPC) {
/*
* ENOSPC (no bandwidth) is handled by the USB HID driver
* as return value of submitting an interrupt URB. But
* since the USB session delivers the error asynchronously,
* the error shows up at the HID driver as late as when
* handling the interrupt where this error is not
* anticipated.
*/
Genode::warning(__func__, ": reflect ENOSPC as STALL_ERROR");
p.error = Packet_descriptor::STALL_ERROR;
}
else {
Genode::error(__func__, ": unhandled error: ", ret);
p.error = Packet_descriptor::UNKNOWN_ERROR;