On 19.04.2018 21:02, Jerry Zhang wrote:
[...]

As main usecase for this code is FunctionFS I think that we should
consider adding some flag to FunctionFS to mark instance as only for
such purpouse. I mean sth like FFS_CONTROL_ONLY which would make
FunctionFS igore the descs (or allow to provide 0 of them) and make this
function usable only for this purpouse (disallow linking to real config
and allow only for linking to this fake one).
I'm not sure what you mean the purpose of the flag to be. Would it be
required for it to handle requests (so both ALL_CTRL and CONTROL_ONLY must
be enabled)? Since userspace already has to link the functions, this seems
more like an "are you sure?" switch as opposed to providing concrete
functionality.
Unless you mean that it wouldn't be required, but allowed in order for user
to write no descriptors. Ffs allows for pretty bare bones descriptors
already (1 speed, 1 interface, with no endpoints). If we want to allow 0
speeds to be provided we might as well allow that generally. It wouldn't be
useful in most cases, but that is similar to providing no endpoints anyway.

The purpose would be:
1) Allow writing no descriptors (maybe also skip the strings) when this flag is set
2) Disallow linking such an instance to real configuration
3) Disallow linking real function implementation to our "magic config"

Obviously you are right that it's not required but this improves usability. Even now our ConfigFS interface is pretty complicated and gives user many chances for "silent misconfiguration". It would be nice to protect user against stupid and very hard to debug mistakes rather than giving this child even more weapon;)

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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to