| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* huawei_cdc_ncm.c - handles Huawei devices using the CDC NCM protocol as |
|---|
| 2 | 3 | * transport layer. |
|---|
| 3 | 4 | * Copyright (C) 2013 Enrico Mioso <mrkiko.rs@gmail.com> |
|---|
| 4 | | - * |
|---|
| 5 | 5 | * |
|---|
| 6 | 6 | * ABSTRACT: |
|---|
| 7 | 7 | * This driver handles devices resembling the CDC NCM standard, but |
|---|
| .. | .. |
|---|
| 11 | 11 | * This code has been heavily inspired by the cdc_mbim.c driver, which is |
|---|
| 12 | 12 | * Copyright (c) 2012 Smith Micro Software, Inc. |
|---|
| 13 | 13 | * 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. |
|---|
| 18 | 14 | */ |
|---|
| 19 | 15 | |
|---|
| 20 | 16 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 71 | 67 | { |
|---|
| 72 | 68 | struct cdc_ncm_ctx *ctx; |
|---|
| 73 | 69 | struct usb_driver *subdriver = ERR_PTR(-ENODEV); |
|---|
| 74 | | - int ret = -ENODEV; |
|---|
| 70 | + int ret; |
|---|
| 75 | 71 | struct huawei_cdc_ncm_state *drvstate = (void *)&usbnet_dev->data; |
|---|
| 76 | 72 | int drvflags = 0; |
|---|
| 77 | 73 | |
|---|
| .. | .. |
|---|
| 81 | 77 | */ |
|---|
| 82 | 78 | drvflags |= CDC_NCM_FLAG_NDP_TO_END; |
|---|
| 83 | 79 | |
|---|
| 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. |
|---|
| 87 | 82 | */ |
|---|
| 88 | | - drvflags |= CDC_NCM_FLAG_RESET_NTB16; |
|---|
| 83 | + drvflags |= CDC_NCM_FLAG_PREFER_NTB32; |
|---|
| 84 | + |
|---|
| 89 | 85 | ret = cdc_ncm_bind_common(usbnet_dev, intf, 1, drvflags); |
|---|
| 90 | 86 | if (ret) |
|---|
| 91 | 87 | goto err; |
|---|