移远官网

RM520GL驱动编译报错

1.系统promox ve,内核版本6.5.11-8 。找不到u64_stats_fetch_begin_irq()和u64_stats_fetch_retry_irq()

root@zy-pve:~/Quectel_Linux_Android_QMI_WWAN_Driver_V1.2.6# make install
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/6.5.11-8-pve/build M=/root/Quectel_Linux_Android_QMI_WWAN_Driver_V1.2.6 modules
make[1]: Entering directory '/usr/src/linux-headers-6.5.11-8-pve'
  CC [M]  /root/Quectel_Linux_Android_QMI_WWAN_Driver_V1.2.6/qmi_wwan_q.o
/root/Quectel_Linux_Android_QMI_WWAN_Driver_V1.2.6/qmi_wwan_q.c: In function ‘_rmnet_vnd_get_stats64’:
/root/Quectel_Linux_Android_QMI_WWAN_Driver_V1.2.6/qmi_wwan_q.c:850:33: error: implicit declaration of function ‘u64_stats_fetch_begin_irq’; did you mean ‘u64_stats_fetch_begin’? [-Werror=implicit-function-declaration]
  850 |                         start = u64_stats_fetch_begin_irq(&stats64->syncp);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 u64_stats_fetch_begin
/root/Quectel_Linux_Android_QMI_WWAN_Driver_V1.2.6/qmi_wwan_q.c:855:26: error: implicit declaration of function ‘u64_stats_fetch_retry_irq’; did you mean ‘u64_stats_fetch_retry’? [-Werror=implicit-function-declaration]
  855 |                 } while (u64_stats_fetch_retry_irq(&stats64->syncp, start));
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                          u64_stats_fetch_retry
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:251: /root/Quectel_Linux_Android_QMI_WWAN_Driver_V1.2.6/qmi_wwan_q.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.5.11-8-pve/Makefile:2039: /root/Quectel_Linux_Android_QMI_WWAN_Driver_V1.2.6] Error 2
make[1]: *** [Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.5.11-8-pve'
make: *** [Makefile:28: default] Error 2

有什么替换函数吗?

这个qmi_wwan_q 的编译晚点可以试。6.5 内核太新了。
这个函数提示已经过时。如果数据结构没有变化,可以考虑自己实现下。

譬如
在驱动开头添加定义

/* Obsolete interfaces */
static inline unsigned int u64_stats_fetch_begin_irq(const struct u64_stats_sync *syncp)
{
	return u64_stats_fetch_begin(syncp);
}

static inline bool u64_stats_fetch_retry_irq(const struct u64_stats_sync *syncp,
					     unsigned int start)
{
	return u64_stats_fetch_retry(syncp, start);
}