| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2012 Bjørn Mork <bjorn@mork.no> |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * The probing code is heavily inspired by cdc_ether, which is: |
|---|
| 5 | 6 | * Copyright (C) 2003-2005 by David Brownell |
|---|
| 6 | 7 | * 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. |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | |
|---|
| 13 | 10 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 129 | 126 | struct rtnl_link_stats64 *stats) |
|---|
| 130 | 127 | { |
|---|
| 131 | 128 | struct qmimux_priv *priv = netdev_priv(net); |
|---|
| 132 | | - unsigned int start; |
|---|
| 133 | | - int cpu; |
|---|
| 134 | 129 | |
|---|
| 135 | 130 | 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); |
|---|
| 157 | 132 | } |
|---|
| 158 | 133 | |
|---|
| 159 | 134 | static const struct net_device_ops qmimux_netdev_ops = { |
|---|
| .. | .. |
|---|
| 708 | 683 | |
|---|
| 709 | 684 | static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf) |
|---|
| 710 | 685 | { |
|---|
| 711 | | - int status = -1; |
|---|
| 686 | + int status; |
|---|
| 712 | 687 | u8 *buf = intf->cur_altsetting->extra; |
|---|
| 713 | 688 | int len = intf->cur_altsetting->extralen; |
|---|
| 714 | 689 | struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc; |
|---|
| .. | .. |
|---|
| 1049 | 1024 | {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */ |
|---|
| 1050 | 1025 | {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */ |
|---|
| 1051 | 1026 | {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */ |
|---|
| 1027 | + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0801)}, /* Quectel RM520N */ |
|---|
| 1052 | 1028 | |
|---|
| 1053 | 1029 | /* 3. Combined interface devices matching on interface number */ |
|---|
| 1054 | 1030 | {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */ |
|---|
| .. | .. |
|---|
| 1316 | 1292 | {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ |
|---|
| 1317 | 1293 | {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ |
|---|
| 1318 | 1294 | {QMI_QUIRK_SET_DTR(0x1bc7, 0x1031, 3)}, /* Telit LE910C1-EUX */ |
|---|
| 1295 | + {QMI_QUIRK_SET_DTR(0x1bc7, 0x103a, 0)}, /* Telit LE910C4-WWX */ |
|---|
| 1319 | 1296 | {QMI_QUIRK_SET_DTR(0x1bc7, 0x1040, 2)}, /* Telit LE922A */ |
|---|
| 1320 | 1297 | {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 */ |
|---|
| 1321 | 1300 | {QMI_FIXED_INTF(0x1bc7, 0x1100, 3)}, /* Telit ME910 */ |
|---|
| 1322 | 1301 | {QMI_FIXED_INTF(0x1bc7, 0x1101, 3)}, /* Telit ME910 dual modem */ |
|---|
| 1323 | 1302 | {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ |
|---|
| .. | .. |
|---|
| 1354 | 1333 | {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ |
|---|
| 1355 | 1334 | {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */ |
|---|
| 1356 | 1335 | {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */ |
|---|
| 1336 | + {QMI_FIXED_INTF(0x413c, 0x81c2, 8)}, /* Dell Wireless 5811e */ |
|---|
| 1357 | 1337 | {QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */ |
|---|
| 1358 | 1338 | {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */ |
|---|
| 1359 | 1339 | {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */ |
|---|
| .. | .. |
|---|
| 1372 | 1352 | {QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */ |
|---|
| 1373 | 1353 | {QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/ |
|---|
| 1374 | 1354 | {QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */ |
|---|
| 1355 | + {QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */ |
|---|
| 1375 | 1356 | |
|---|
| 1376 | 1357 | /* 4. Gobi 1000 devices */ |
|---|
| 1377 | 1358 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
|---|