Commit c1a2e954 authored by Bjørn Mork's avatar Bjørn Mork Committed by David S. Miller

net: cdc_mbim: change the default to send ZLPs

A number of devices in the wild have turned out to require ZLPs.
Even if this is a spec violation, our priority is to make any
device work as good as possible. Devices needing ZLPs will fail
to receive any full sized frame we send. On the other hand,
devices which do not need the ZLP will still work if we send
them.

This gives us no other option than sending ZLPs by default.

This will prevent devices conforming to the spec from making the
optimizations which are possible without ZLPs.  Adding known
such devices to a whitelist, to avoid the possible negative
impact of the new spec violating default.

Cc: Greg Suarez <gsuarez@smithmicro.com>
Cc: Alexey Orishko <alexey.orishko@gmail.com>
Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5b8f15f7
...@@ -429,9 +429,18 @@ static const struct driver_info cdc_mbim_info = { ...@@ -429,9 +429,18 @@ static const struct driver_info cdc_mbim_info = {
}; };
/* MBIM and NCM devices should not need a ZLP after NTBs with /* MBIM and NCM devices should not need a ZLP after NTBs with
* dwNtbOutMaxSize length. This driver_info is for the exceptional * dwNtbOutMaxSize length. Nevertheless, a number of devices from
* devices requiring it anyway, allowing them to be supported without * different vendor IDs will fail unless we send ZLPs, forcing us
* forcing the performance penalty on all the sane devices. * to make this the default.
*
* This default may cause a performance penalty for spec conforming
* devices wanting to take advantage of optimizations possible without
* ZLPs. A whitelist is added in an attempt to avoid this for devices
* known to conform to the MBIM specification.
*
* All known devices supporting NCM compatibility mode are also
* conforming to the NCM and MBIM specifications. For this reason, the
* NCM subclass entry is also in the ZLP whitelist.
*/ */
static const struct driver_info cdc_mbim_info_zlp = { static const struct driver_info cdc_mbim_info_zlp = {
.description = "CDC MBIM", .description = "CDC MBIM",
...@@ -454,16 +463,13 @@ static const struct usb_device_id mbim_devs[] = { ...@@ -454,16 +463,13 @@ static const struct usb_device_id mbim_devs[] = {
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE), { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long)&cdc_mbim_info, .driver_info = (unsigned long)&cdc_mbim_info,
}, },
/* Sierra Wireless MC7710 need ZLPs */ /* ZLP conformance whitelist: All Ericsson MBIM devices */
{ USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x68a2, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), { USB_VENDOR_AND_INTERFACE_INFO(0x0bdb, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long)&cdc_mbim_info_zlp, .driver_info = (unsigned long)&cdc_mbim_info,
},
/* HP hs2434 Mobile Broadband Module needs ZLPs */
{ USB_DEVICE_AND_INTERFACE_INFO(0x3f0, 0x4b1d, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long)&cdc_mbim_info_zlp,
}, },
/* default entry */
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long)&cdc_mbim_info, .driver_info = (unsigned long)&cdc_mbim_info_zlp,
}, },
{ {
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment