]> git.karo-electronics.de Git - karo-tx-linux.git/commit
net: cdc_ncm: fix probing of devices with multiple control interface altsettings
authorBjørn Mork <bjorn@mork.no>
Wed, 13 Feb 2013 12:09:52 +0000 (12:09 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Feb 2013 13:38:40 +0000 (05:38 -0800)
commit8d33ee7534d7d8c0ee9f0aa5aad2fa4522463671
tree087595cca5d1edb28e0a283e1adee740fa9b26a7
parente3bee3ddd2fe5af43ad52d837351eb1a12bb39dd
net: cdc_ncm: fix probing of devices with multiple control interface altsettings

[ Upstream commit f350ca03703133c94fe742f6fa6ff0fd8f5a9a09 ]

commit bd329e1 ("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.

Reported-and-tested-by: Jonathan A. <yo.natan@hotmail.com>
Cc: Greg Suarez <gsuarez@smithmicro.com>
Cc: Alexey Orishko <alexey.orishko@stericsson.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/usb/cdc_ncm.c