usb_block_drv: don't select alternate interface setting

Selecting an alternate interface setting, even if it is the same as the
current one, apparently makes the INQUIRY command fail with USB devices
like 'SanDisk Ultra Fit' (0781:5583) and 'Corsair Flash Voyager'
(1b1c:1a03) when the USB block driver is restarted.

Fixes #2860
This commit is contained in:
Christian Prochaska 2018-06-11 15:09:29 +02:00 committed by Christian Helmuth
parent 347d82bdc6
commit d1524ba0b8

View File

@ -381,9 +381,8 @@ struct Usb::Block_driver : Usb::Completion,
ISUBCLASS_SCSI = 6,
IPROTO_BULK_ONLY = 80
};
try {
Alternate_interface &alt_iface = iface.alternate_interface(0);
iface.set_alternate_interface(alt_iface);
Alternate_interface &alt_iface = iface.current();
if (alt_iface.iclass != ICLASS_MASS_STORAGE
|| alt_iface.isubclass != ISUBCLASS_SCSI
@ -394,7 +393,7 @@ struct Usb::Block_driver : Usb::Completion,
for (int i = 0; i < alt_iface.num_endpoints; i++) {
Endpoint ep = alt_iface.endpoint(i);
if (!ep.is_bulk())
if (!ep.bulk())
continue;
if (ep.address & Usb::ENDPOINT_IN)
ep_in = i;
@ -402,11 +401,6 @@ struct Usb::Block_driver : Usb::Completion,
ep_out = i;
}
} catch (Usb::Session::Interface_not_found) {
Genode::error("Interface not found");
return false;
}
try {
/*