quectel-qmi-wwan: fix build with kernel 6.6

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen
2024-04-08 14:20:46 +08:00
parent 6ee3f23f06
commit 77f930e11e
3 changed files with 25 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=quectel-qmi-wwan
PKG_VERSION:=1.2.6
PKG_RELEASE:=1
PKG_RELEASE:=2
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk

View File

@@ -0,0 +1,23 @@
--- a/qmi_wwan_q.c
+++ b/qmi_wwan_q.c
@@ -846,12 +846,20 @@ static struct rtnl_link_stats64 *_rmnet_
stats64 = per_cpu_ptr(dev->stats64, cpu);
do {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION( 6,6,0 ))
start = u64_stats_fetch_begin_irq(&stats64->syncp);
+#else
+ start = u64_stats_fetch_begin(&stats64->syncp);
+#endif
rx_packets = stats64->rx_packets;
rx_bytes = stats64->rx_bytes;
tx_packets = stats64->tx_packets;
tx_bytes = stats64->tx_bytes;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION( 6,6,0 ))
} while (u64_stats_fetch_retry_irq(&stats64->syncp, start));
+#else
+ } while (u64_stats_fetch_retry(&stats64->syncp, start));
+#endif
stats->rx_packets += u64_stats_read(&rx_packets);
stats->rx_bytes += u64_stats_read(&rx_bytes);

View File

@@ -1,6 +1,6 @@
--- a/qmi_wwan_q.c
+++ b/qmi_wwan_q.c
@@ -2526,6 +2526,13 @@ static const struct usb_device_id produc
@@ -2533,6 +2533,13 @@ static const struct usb_device_id produc
{ QMI_FIXED_RAWIP_INTF(0x2C7C, 0x0800, 4, sdx55) }, /* Quectel RG500 */
{ QMI_FIXED_RAWIP_INTF(0x2C7C, 0x0801, 4, sdx55) }, /* Quectel RG520 */
{ QMI_FIXED_RAWIP_INTF(0x2C7C, 0x0122, 4, sdx55) }, /* Quectel RG650 */