usb: gadget: f_acm: make bInterfaceProtocol configurable
authorMichael Walle <mwalle@kernel.org>
Sun, 25 Aug 2024 18:04:46 +0000 (20:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Sep 2024 07:54:16 +0000 (09:54 +0200)
commita17f04d4f26db70a42e52ebf0f04d84da79ebf1e
treeb1d180681b2cbdf9f1bf801d2e1b20c4fba592bf
parentc146ede472717f352b7283a525bd9a1a2b15e2cf
usb: gadget: f_acm: make bInterfaceProtocol configurable

The bInterfaceProtocol is hardcoded to USB_CDC_ACM_PROTO_AT_V25TER. This
will lead to problems with ModemManger which will gladly try to probe
that port as a modem if the gadget also has a network function.
ModemManager will try to send AT commands to the ACM port. Make the
bInterfaceProtocol configurable. For this, track the number of instances
and only allow write to the property if there are no intances (yet).

This will also set bFunctionProtocol to the same value, see commit
5c8db070b448 ("USB: Change acm_iad_descriptor bFunctionProtocol to
USB_CDC_ACM_PROTO_AT_V25TER") for more details.

Signed-off-by: Michael Walle <mwalle@kernel.org>
Link: https://lore.kernel.org/r/20240825180446.3757073-1-mwalle@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/ABI/testing/configfs-usb-gadget-acm
drivers/usb/gadget/function/f_acm.c
drivers/usb/gadget/function/u_serial.h