aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/usb/huawei_cdc_ncm.c
diff options
context:
space:
mode:
authorEnrico Mioso <mrkiko.rs@gmail.com>2017-07-11 17:21:52 +0200
committerDavid S. Miller <davem@davemloft.net>2017-07-14 08:15:05 -0700
commit2b02c20ce0c28974b44e69a2e2f5ddc6a470ad6f (patch)
treeba2f9e3295e42338f3a83f5bb95952580eab4b91 /drivers/net/usb/huawei_cdc_ncm.c
parentmdio: mux: fix parsing mux registers outside of the PHY address range (diff)
downloadwireguard-linux-2b02c20ce0c28974b44e69a2e2f5ddc6a470ad6f.tar.xz
wireguard-linux-2b02c20ce0c28974b44e69a2e2f5ddc6a470ad6f.zip
cdc_ncm: Set NTB format again after altsetting switch for Huawei devices
Some firmwares in Huawei E3372H devices have been observed to switch back to NTB 32-bit format after altsetting switch. This patch implements a driver flag to check for the device settings and set NTB format to 16-bit again if needed. The flag has been activated for devices controlled by the huawei_cdc_ncm.c driver. V1->V2: - fixed broken error checks - some corrections to the commit message V2->V3: - variable name changes, to clarify what's happening - check (and possibly set) the NTB format later in the common bind code path Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com> Reported-and-tested-by: Christian Panton <christian@panton.org> Reviewed-by: Bjørn Mork <bjorn@mork.no> CC: Bjørn Mork <bjorn@mork.no> CC: Christian Panton <christian@panton.org> CC: linux-usb@vger.kernel.org CC: netdev@vger.kernel.org CC: Oliver Neukum <oliver@neukum.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/huawei_cdc_ncm.c')
-rw-r--r--drivers/net/usb/huawei_cdc_ncm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/usb/huawei_cdc_ncm.c b/drivers/net/usb/huawei_cdc_ncm.c
index 2680a65cd5e4..63f28908afda 100644
--- a/drivers/net/usb/huawei_cdc_ncm.c
+++ b/drivers/net/usb/huawei_cdc_ncm.c
@@ -80,6 +80,12 @@ static int huawei_cdc_ncm_bind(struct usbnet *usbnet_dev,
* be at the end of the frame.
*/
drvflags |= CDC_NCM_FLAG_NDP_TO_END;
+
+ /* Additionally, it has been reported that some Huawei E3372H devices, with
+ * firmware version 21.318.01.00.541, come out of reset in NTB32 format mode, hence
+ * needing to be set to the NTB16 one again.
+ */
+ drvflags |= CDC_NCM_FLAG_RESET_NTB16;
ret = cdc_ncm_bind_common(usbnet_dev, intf, 1, drvflags);
if (ret)
goto err;