mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-20 08:03:56 +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:
committed by
Norman Feske
parent
07bb3fc1ec
commit
1072a91592
@ -136,6 +136,16 @@ struct Completion : Usb::Completion
|
|||||||
switch (packet.type) {
|
switch (packet.type) {
|
||||||
case Packet_type::CTRL:
|
case Packet_type::CTRL:
|
||||||
actual_size = packet.control.actual_size;
|
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;
|
break;
|
||||||
case Packet_type::BULK:
|
case Packet_type::BULK:
|
||||||
case Packet_type::IRQ:
|
case Packet_type::IRQ:
|
||||||
|
Reference in New Issue
Block a user