• Bjørn Mork's avatar
    net: cdc_ncm: fix probing of devices with multiple control interface altsettings · f350ca03
    Bjørn Mork authored
    commit bd329e12 ("net: cdc_ncm: do not bind to NCM compatible MBIM devices")
    added a test for a CDC MBIM altsetting, implementing the cdc_ncm part of
    MBIM backward compatibility support.  This intentionally made the driver
    behave differently for CDC NCM devices with 2 alternate settings for the
    Communication interface, depending on whether or not CONFIG_USB_NET_CDC_MBIM
    was enabled.  This is correct iff alternate setting #1 really *is* a MBIM
    setting.  If not, then NCM probing will use a different altsetting than before,
    possibly causing probing failures depending on CONFIG_USB_NET_CDC_MBIM.
    
    Fix by setting the altsetting back to default after the test, restoring the
    previous behaviour for non MBIM devices.
    
    This bug causes probing of Huawei E3276 devices to fail when the MBIM driver
    is enabled, because these devices have a second alternate setting with no CDC
    functional descriptors.
    
    Cc: Greg Suarez <gsuarez@smithmicro.com>
    Cc: Alexey Orishko <alexey.orishko@stericsson.com>
    Reported-and-tested-by: default avatarJonathan A. <yo.natan@hotmail.com>
    Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f350ca03
cdc_ncm.c 35.5 KB