libusb: re-enable timeout setting for control urbs

Fix genodelabs/genode#5259
This commit is contained in:
Stefan Kalkowski 2024-06-26 14:52:30 +02:00 committed by Norman Feske
parent 73b65084e2
commit f1f2d759af
2 changed files with 7 additions and 3 deletions

View File

@ -489,7 +489,8 @@ static int genode_submit_transfer(struct usbi_transfer * itransfer)
Usb_device::Urb(addr, setup->wLength, itransfer,
device()._device, setup->bRequest,
setup->bmRequestType, setup->wValue,
setup->wIndex, setup->wLength);
setup->wIndex, setup->wLength,
transfer->timeout);
device().handle_events();
return LIBUSB_SUCCESS;
}

View File

@ -460,6 +460,7 @@ class Usb::Device
Type::access_t _request_type;
uint16_t _value;
uint16_t _index;
size_t _timeout;
Packet_descriptor _create() const override
{
@ -468,6 +469,7 @@ class Usb::Device
p.request = _request;
p.value = _value;
p.index = _index;
p.timeout = _timeout;
return p;
}
@ -475,14 +477,15 @@ class Usb::Device
Urb(Device &device,
uint8_t request, Type::access_t request_type,
uint16_t value, uint16_t index, size_t size = 0)
uint16_t value, uint16_t index, size_t size = 0,
size_t timeout = 0)
:
Base(device._urb_handler,
Type::D::get(request_type) ? Endpoint::IN
: Endpoint::OUT,
size),
_request(request), _request_type(request_type),
_value(value), _index(index) {}
_value(value), _index(index), _timeout(timeout) {}
};
private: