linux-uconsole/drivers/net/usb
Bjørn Mork a20c8e4ae4 cdc_ether: fix rndis support for Mediatek based smartphones
[ Upstream commit 4d7ffcf3bf ]

A Mediatek based smartphone owner reports problems with USB
tethering in Linux.  The verbose USB listing shows a rndis_host
interface pair (e0/01/03 + 10/00/00), but the driver fails to
bind with

[  355.960428] usb 1-4: bad CDC descriptors

The problem is a failsafe test intended to filter out ACM serial
functions using the same 02/02/ff class/subclass/protocol as RNDIS.
The serial functions are recognized by their non-zero bmCapabilities.

No RNDIS function with non-zero bmCapabilities were known at the time
this failsafe was added. But it turns out that some Wireless class
RNDIS functions are using the bmCapabilities field. These functions
are uniquely identified as RNDIS by their class/subclass/protocol, so
the failing test can safely be disabled.  The same applies to the two
types of Misc class RNDIS functions.

Applying the failsafe to Communication class functions only retains
the original functionality, and fixes the problem for the Mediatek based
smartphone.

Tow examples of CDC functional descriptors with non-zero bmCapabilities
from Wireless class RNDIS functions are:

0e8d:000a  Mediatek Crosscall Spider X5 3G Phone

      CDC Header:
        bcdCDC               1.10
      CDC ACM:
        bmCapabilities       0x0f
          connection notifications
          sends break
          line coding and serial state
          get/set/clear comm features
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      CDC Call Management:
        bmCapabilities       0x03
          call management
          use DataInterface
        bDataInterface          1

and

19d2:1023  ZTE K4201-z

      CDC Header:
        bcdCDC               1.10
      CDC ACM:
        bmCapabilities       0x02
          line coding and serial state
      CDC Call Management:
        bmCapabilities       0x03
          call management
          use DataInterface
        bDataInterface          1
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1

The Mediatek example is believed to apply to most smartphones with
Mediatek firmware.  The ZTE example is most likely also part of a larger
family of devices/firmwares.

Suggested-by: Lars Melin <larsm17@gmail.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>
2019-09-19 09:09:28 +02:00
..
asix.h
asix_common.c asix: Check for supported Wake-on-LAN modes 2018-09-29 11:31:29 -07:00
asix_devices.c net: usb: asix: init MAC address buffers 2019-07-26 09:14:15 +02:00
ax88172a.c
ax88179_178a.c ax88179_178a: Check for supported Wake-on-LAN modes 2018-09-29 11:31:29 -07:00
catc.c
cdc-phonet.c
cdc_eem.c
cdc_ether.c cdc_ether: fix rndis support for Mediatek based smartphones 2019-09-19 09:09:28 +02:00
cdc_mbim.c
cdc_ncm.c
cdc_subset.c
ch9200.c
cx82310_eth.c cx82310_eth: fix a memory leak bug 2019-09-10 10:33:47 +01:00
dm9601.c
gl620a.c
hso.c USB: hso: Fix OOB memory access in hso_probe/hso_get_config_data 2018-12-29 13:37:54 +01:00
huawei_cdc_ncm.c
int51x1.c
ipheth.c usbnet: ipheth: fix racing condition 2019-06-19 08:18:04 +02:00
kalmia.c net: kalmia: fix memory leaks 2019-09-10 10:33:48 +01:00
kaweth.c
Kconfig
lan78xx.c lan78xx: Fix memory leaks 2019-09-10 10:33:47 +01:00
lan78xx.h
lg-vl600.c
Makefile
mcs7830.c
net1080.c
pegasus.c net: usb: pegasus: fix improper read if get_registers() fail 2019-08-25 10:47:50 +02:00
pegasus.h
plusb.c
qmi_wwan.c net: usb: qmi_wwan: Add the BroadMobi BM818 card 2019-08-29 08:28:32 +02:00
r8152.c r8152: Check for supported Wake-on-LAN Modes 2018-09-29 11:31:29 -07:00
rndis_host.c
rtl8150.c Merge ra.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux 2018-07-20 21:17:12 -07:00
sierra_net.c
smsc75xx.c net/usb: cancel pending work when unbinding smsc75xx 2018-10-04 13:51:30 -07:00
smsc75xx.h
smsc95xx.c usbnet: smsc95xx: fix rx packet alignment 2019-02-12 19:47:00 +01:00
smsc95xx.h
sr9700.c net: usb: sr9700: Replace mdelay() with msleep() in sr9700_bind() 2018-07-27 13:45:15 -07:00
sr9700.h
sr9800.c sr9800: Check for supported Wake-on-LAN modes 2018-09-29 11:31:29 -07:00
sr9800.h
usbnet.c usbnet: fix kernel crash after disconnect 2019-06-04 08:02:32 +02:00
zaurus.c