mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 18:56:29 +00:00
qemu-usb: handle Interface_not_found exceptions
Fix genodelabs/genode#4572
This commit is contained in:
parent
560747c22e
commit
48eacb6f79
@ -270,6 +270,7 @@ struct Usb_host_device : List<Usb_host_device>::Element
|
||||
for (unsigned i = 0; i < cdescr.num_interfaces; i++) {
|
||||
try { usb_raw.release_interface(i); }
|
||||
catch (Usb::Session::Device_not_found) { return; }
|
||||
catch (Usb::Session::Interface_not_found) { return; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -287,7 +288,7 @@ struct Usb_host_device : List<Usb_host_device>::Element
|
||||
usb_raw.claim_interface(i);
|
||||
} catch (Usb::Session::Interface_already_claimed) {
|
||||
result = false;
|
||||
}
|
||||
} catch (Usb::Session::Interface_not_found) { }
|
||||
}
|
||||
|
||||
if (!result) error("device already claimed");
|
||||
@ -675,6 +676,7 @@ struct Usb_host_device : List<Usb_host_device>::Element
|
||||
catch (Usb::Session::Device_not_found) { return; }
|
||||
|
||||
for (unsigned i = 0; i < cdescr.num_interfaces; i++) {
|
||||
try {
|
||||
Usb::Interface_descriptor iface;
|
||||
uint8_t const altsetting = udev->altsetting[i];
|
||||
usb_raw.interface_descriptor(i, altsetting, &iface);
|
||||
@ -691,6 +693,7 @@ struct Usb_host_device : List<Usb_host_device>::Element
|
||||
usb_ep_set_ifnum(udev, pid, ep, i);
|
||||
usb_ep_set_halted(udev, pid, ep, 0);
|
||||
}
|
||||
} catch (Usb::Session::Interface_not_found) { }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user