Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8e260f8 authored by Tomasz Michalec's avatar Tomasz Michalec
Browse files

fastboot: Check USB configuration

Problem: Only one configuration from the device's USB descriptor is an
active one. We currently only look at the first configuration which
doesn't need to be the active one. This leads to selecting interfaces
that belongs to not actice configuration. These interfaces cannot be
used to communicate with the device.

Solution: Check which confguration is active and look only on interfaces
that belong to that configuration.

Description:
USB device in it's descriptor may have multiple configurations. While it
is possible to change active configuration, Linux documentation advises
to avoid using USBDEVFS_SETCONFIGURATION for it. (source:
www.kernel.org/doc/html/latest/driver-api/usb/usb.html#synchronous-i-o-support)
Because of that, interfaces that we can freely use are those from
configuration that is currently active.

There is no known fastboot capable device that uses multiple USB
configurations, but to be on the safe side, application should check if
interface that will be used for fastboot comes from active USB
configuration.

This is not required on osx and windows, as these backends only offer
interfaces that are available (i.e. are part of the active USB
configuration).

Bug: 370465224
Change-Id: I2a5135bc54bbfb61e617068151ac43d43ba2d44c
parent c8c77199
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment