mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
qemu-usb: disable remote wake up in config descriptors
Some guests don't handle remote wake up correctly causing devices to stop functioning. Therefore, we disable the remote wake up bit (5) in `bmAttributes` of the device configuration descriptor. Thanks to Peter for the initial fix. Fixes #4278
This commit is contained in:
parent
07bb3fc1ec
commit
1072a91592
@ -136,6 +136,16 @@ struct Completion : Usb::Completion
|
||||
switch (packet.type) {
|
||||
case Packet_type::CTRL:
|
||||
actual_size = packet.control.actual_size;
|
||||
|
||||
/*
|
||||
* Disable remote wakeup (bit 5) in 'bmAttributes' (content[7]) in reported
|
||||
* configuration descriptor. On some systems (e.g., Windows) this will
|
||||
* cause devices to stop working.
|
||||
*/
|
||||
if (packet.control.request == USB_REQ_GET_DESCRIPTOR
|
||||
&& actual_size >= 8 && content[1] == USB_DT_CONFIG)
|
||||
content[7] &= ~USB_CFG_ATT_WAKEUP;
|
||||
|
||||
break;
|
||||
case Packet_type::BULK:
|
||||
case Packet_type::IRQ:
|
||||
|
Loading…
x
Reference in New Issue
Block a user