]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
USB: serial: option: reimplement interface masking
authorJohan Hovold <johan@kernel.org>
Wed, 7 Mar 2018 16:40:48 +0000 (17:40 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:25:19 +0000 (12:25 +0200)
commit342ab95dcf42ce0749e7f3eb40284c0fe968ec21
tree46e051f93cce7a30fa87bb268f5facf2d01fb7a2
parentfaf3a75ca0151c2bbf17f7ae8377f285799995dc
USB: serial: option: reimplement interface masking

BugLink: http://bugs.launchpad.net/bugs/1778759
commit c3a65808f04a8426481b63a4fbd9392f009f6330 upstream.

Reimplement interface masking using device flags stored directly in the
device-id table. This will make it easier to add and maintain device-id
entries by using a more compact and readable notation compared to the
current implementation (which manages pairs of masks in separate
blacklist structs).

Two convenience macros are used to flag an interface as either reserved
or as not supporting modem-control requests:

{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
  .driver_info = NCTRL(0) | RSVD(3) },

For now, we limit the highest maskable interface number to seven, which
allows for (up to 16) additional device flags to be added later should
need arise.

Note that this will likely need to be backported to stable in order to
make future device-id backports more manageable.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/serial/option.c