forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/net/usb/huawei_cdc_ncm.c
....@@ -1,7 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* huawei_cdc_ncm.c - handles Huawei devices using the CDC NCM protocol as
23 * transport layer.
34 * Copyright (C) 2013 Enrico Mioso <mrkiko.rs@gmail.com>
4
- *
55 *
66 * ABSTRACT:
77 * This driver handles devices resembling the CDC NCM standard, but
....@@ -11,10 +11,6 @@
1111 * This code has been heavily inspired by the cdc_mbim.c driver, which is
1212 * Copyright (c) 2012 Smith Micro Software, Inc.
1313 * Copyright (c) 2012 Bjørn Mork <bjorn@mork.no>
14
- *
15
- * This program is free software; you can redistribute it and/or
16
- * modify it under the terms of the GNU General Public License
17
- * version 2 as published by the Free Software Foundation.
1814 */
1915
2016 #include <linux/module.h>
....@@ -71,7 +67,7 @@
7167 {
7268 struct cdc_ncm_ctx *ctx;
7369 struct usb_driver *subdriver = ERR_PTR(-ENODEV);
74
- int ret = -ENODEV;
70
+ int ret;
7571 struct huawei_cdc_ncm_state *drvstate = (void *)&usbnet_dev->data;
7672 int drvflags = 0;
7773
....@@ -81,11 +77,11 @@
8177 */
8278 drvflags |= CDC_NCM_FLAG_NDP_TO_END;
8379
84
- /* Additionally, it has been reported that some Huawei E3372H devices, with
85
- * firmware version 21.318.01.00.541, come out of reset in NTB32 format mode, hence
86
- * needing to be set to the NTB16 one again.
80
+ /* For many Huawei devices the NTB32 mode is the default and the best mode
81
+ * they work with. Huawei E5785 and E5885 devices refuse to work in NTB16 mode at all.
8782 */
88
- drvflags |= CDC_NCM_FLAG_RESET_NTB16;
83
+ drvflags |= CDC_NCM_FLAG_PREFER_NTB32;
84
+
8985 ret = cdc_ncm_bind_common(usbnet_dev, intf, 1, drvflags);
9086 if (ret)
9187 goto err;