forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/net/usb/qmi_wwan.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2012 Bjørn Mork <bjorn@mork.no>
34 *
45 * The probing code is heavily inspired by cdc_ether, which is:
56 * Copyright (C) 2003-2005 by David Brownell
67 * Copyright (C) 2006 by Ole Andre Vadla Ravnas (ActiveSync)
7
- *
8
- * This program is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU General Public License
10
- * version 2 as published by the Free Software Foundation.
118 */
129
1310 #include <linux/module.h>
....@@ -129,31 +126,9 @@
129126 struct rtnl_link_stats64 *stats)
130127 {
131128 struct qmimux_priv *priv = netdev_priv(net);
132
- unsigned int start;
133
- int cpu;
134129
135130 netdev_stats_to_stats64(stats, &net->stats);
136
-
137
- for_each_possible_cpu(cpu) {
138
- struct pcpu_sw_netstats *stats64;
139
- u64 rx_packets, rx_bytes;
140
- u64 tx_packets, tx_bytes;
141
-
142
- stats64 = per_cpu_ptr(priv->stats64, cpu);
143
-
144
- do {
145
- start = u64_stats_fetch_begin_irq(&stats64->syncp);
146
- rx_packets = stats64->rx_packets;
147
- rx_bytes = stats64->rx_bytes;
148
- tx_packets = stats64->tx_packets;
149
- tx_bytes = stats64->tx_bytes;
150
- } while (u64_stats_fetch_retry_irq(&stats64->syncp, start));
151
-
152
- stats->rx_packets += rx_packets;
153
- stats->rx_bytes += rx_bytes;
154
- stats->tx_packets += tx_packets;
155
- stats->tx_bytes += tx_bytes;
156
- }
131
+ dev_fetch_sw_netstats(stats, priv->stats64);
157132 }
158133
159134 static const struct net_device_ops qmimux_netdev_ops = {
....@@ -708,7 +683,7 @@
708683
709684 static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
710685 {
711
- int status = -1;
686
+ int status;
712687 u8 *buf = intf->cur_altsetting->extra;
713688 int len = intf->cur_altsetting->extralen;
714689 struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc;
....@@ -1049,6 +1024,7 @@
10491024 {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */
10501025 {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */
10511026 {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */
1027
+ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0801)}, /* Quectel RM520N */
10521028
10531029 /* 3. Combined interface devices matching on interface number */
10541030 {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */
....@@ -1316,8 +1292,11 @@
13161292 {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */
13171293 {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */
13181294 {QMI_QUIRK_SET_DTR(0x1bc7, 0x1031, 3)}, /* Telit LE910C1-EUX */
1295
+ {QMI_QUIRK_SET_DTR(0x1bc7, 0x103a, 0)}, /* Telit LE910C4-WWX */
13191296 {QMI_QUIRK_SET_DTR(0x1bc7, 0x1040, 2)}, /* Telit LE922A */
13201297 {QMI_QUIRK_SET_DTR(0x1bc7, 0x1050, 2)}, /* Telit FN980 */
1298
+ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1060, 2)}, /* Telit LN920 */
1299
+ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1070, 2)}, /* Telit FN990 */
13211300 {QMI_FIXED_INTF(0x1bc7, 0x1100, 3)}, /* Telit ME910 */
13221301 {QMI_FIXED_INTF(0x1bc7, 0x1101, 3)}, /* Telit ME910 dual modem */
13231302 {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */
....@@ -1354,6 +1333,7 @@
13541333 {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
13551334 {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */
13561335 {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */
1336
+ {QMI_FIXED_INTF(0x413c, 0x81c2, 8)}, /* Dell Wireless 5811e */
13571337 {QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */
13581338 {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */
13591339 {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */
....@@ -1372,6 +1352,7 @@
13721352 {QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */
13731353 {QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/
13741354 {QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
1355
+ {QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */
13751356
13761357 /* 4. Gobi 1000 devices */
13771358 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */