diff --git a/arch/arm64/configs/seco_px30_d23-linux_defconfig b/arch/arm64/configs/seco_px30_d23-linux_defconfig index 1762a29412acb5c16d0ba76a31d2bce6d3956c4b..19e70f19160c6f2f70106714e09235be1d0605df 100644 --- a/arch/arm64/configs/seco_px30_d23-linux_defconfig +++ b/arch/arm64/configs/seco_px30_d23-linux_defconfig @@ -215,6 +215,7 @@ CONFIG_MICREL_PHY=y CONFIG_MICROCHIP_PHY=y CONFIG_FIXED_PHY=y CONFIG_USB_USBNET=y +CONFIG_DUMMY_STATS_TO_AVOID_CRASH=y CONFIG_USB_NET_QMI_WWAN=y CONFIG_BRCMFMAC=m # CONFIG_RTL_CARDS is not set diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index 3a7286256db090c56396b6dd7b6d8b1b4c2091ef..1159c1640179689315db1afb53cc777d3f6a3f59 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig @@ -152,6 +152,14 @@ config USB_USBNET To compile this driver as a module, choose M here: the module will be called usbnet. +config DUMMY_STATS_TO_AVOID_CRASH + tristate "Use dummy stats to avpoid crash with buggy LTE modems" + depends on USB_USBNET + default n + help + This option enable dummy stats insthad of native one to avoid + crash when the function get_stats is called + config USB_NET_AX8817X tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters" depends on USB_USBNET diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 99edd0f098403d0cf165f5328d368f41a3c645a3..64c2dfc19d33e3f480a2616e065c5aaa5c3de09a 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -979,7 +979,7 @@ EXPORT_SYMBOL_GPL(usbnet_set_settings); struct rtnl_link_stats64 * usbnet_get_stats64(struct net_device *net, struct rtnl_link_stats64 *stats) { -#ifdef DUMMY_STATS_TO_AVOID_CRASH +#ifdef CONFIG_DUMMY_STATS_TO_AVOID_CRASH stats->rx_packets = 0; stats->rx_bytes = 0; stats->tx_packets = 0; @@ -1011,7 +1011,7 @@ usbnet_get_stats64(struct net_device *net, struct rtnl_link_stats64 *stats) stats->tx_packets += tx_packets; stats->tx_bytes += tx_bytes; } -#endif /* DUMMY_STATS_TO_AVOID_CRASH */ +#endif /* CONFIG_DUMMY_STATS_TO_AVOID_CRASH */ return stats; } EXPORT_SYMBOL_GPL(usbnet_get_stats64);