On 06/12/2015 03:42 PM, Oliver Neukum wrote:
On Fri, 2015-06-12 at 15:22 +0200, Krzysztof Opasiak wrote:
On 06/12/2015 03:10 PM, Oliver Neukum wrote:
Some drivers (BT, CDC ACM, ...) require multiple interfaces
The authorization must be given atomically or probing will
fail.
Please correct me if I'm wrong but this:
echo 1 > $(DATA_INTF)/authorized
echo 1 > $(CONTROL_INTF)/authorized
should also work fine even if driver needs more than one interface. The
only issue is that you should authorize interface for which driver is
probing as last one.
Exactly. And that information may depend on the driver version.
It would be a bad idea to expose this.
But I see that this could be easily fixed in a quite similar way it is
done in usb_device_set_mask() introduced by 4th patch in this series.
Each interface should notify ubs_device if its authorized status has
changed from 0 to 1 and device should go through all interfaces (in
current config) that are authorized but not claimed and try to find a
driver for it.
Maybe it is not the best solution (all others are very welcome if you
have any) because we will be probing all free (and authorized)
interfaces each time some interface has been authorized, but single
attribute in interface directory to which we can simply write 1 or 0 is
way more user friendly. Let's say that we have 3 interfaces, two of them
are authorized now, to authorize third one we have to do:
MASK=`cat authorized_mask`
NEW_MASK=$((MASK|4))
echo $NEW_MASK > authorized_mask
on the other hand if we have authorized attribute in interface directory
we simply do
echo 1 > intf_dir/authorized
In my humble opinion second approach looks way more obvious and easy for
a user, also writing an udev rules which I think will be a common use
case will be way simpler.
Best regards,
--
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html