Driver installation issues

I installed the QMI_WWAN driver module on a system with Ubuntu 20.04.4, and it prompted the following error:
root@yanxiubao-virtual-machine:/usr/local/src# ls
Quectel_Linux_Android_QMI_WWAN_Driver_V1.2.7.zip r500q
root@yanxiubao-virtual-machine:/usr/local/src# cd r500q/
root@yanxiubao-virtual-machine:/usr/local/src/r500q# ls
License.txt log Makefile qmi_wwan_q.c ReleaseNote.txt rmnet_nss.c
root@yanxiubao-virtual-machine:/usr/local/src/r500q# make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.13.0-30-generic/build M=/usr/local/src/r500q modules
make[1]: Entering directory ‘/usr/src/linux-headers-5.13.0-30-generic’
CC [M] /usr/local/src/r500q/qmi_wwan_q.o
/usr/local/src/r500q/qmi_wwan_q.c: In function ‘qmi_wwan_register_subdriver’:
/usr/local/src/r500q/qmi_wwan_q.c:2073:13: error: ‘WWAN_PORT_QMI’ undeclared (first use in this function)
2073 | 4096, WWAN_PORT_QMI, &qmi_wwan_cdc_wdm_manage_power);
| ^~~~~~~~~~~~~
/usr/local/src/r500q/qmi_wwan_q.c:2073:13: note: each undeclared identifier is reported only once for each function it appears in
/usr/local/src/r500q/qmi_wwan_q.c:2072:14: error: too many arguments to function ‘usb_cdc_wdm_register’
2072 | subdriver = usb_cdc_wdm_register(info->control, &dev->status->desc,
| ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/src/r500q/qmi_wwan_q.c:37:
./include/linux/usb/cdc-wdm.h:17:27: note: declared here
17 | extern struct usb_driver *usb_cdc_wdm_register(struct usb_interface *intf,
| ^~~~~~~~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:281: /usr/local/src/r500q/qmi_wwan_q.o] Error 1
make[1]: *** [Makefile:1879: /usr/local/src/r500q] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-5.13.0-30-generic’
make: *** [Makefile:28: default] Error 2

The module I use is RM500Q-GL

it Is because the qmi_wwan is based on the cdc-wdm.
You should compile the cdc-wdm first.

drivers/usb/class/cdc-wdm.c
CONFIG_USB_WDM=y

Hello, I am following the steps in the manual and using it on a Linux PC, so do I also need to edit the source code files?

Please check it on the device

ls /sys/bus/usb/drivers/

root@yanxiubao-virtual-machine:/sys/bus/usb/drivers# cd usb
root@yanxiubao-virtual-machine:/sys/bus/usb/drivers/usb# ls
3-1 bind uevent unbind usb1 usb2 usb3 usb4

Based on your suggestion, I have checked, what should I do next?

You should be able to see something like this.

ls /sys/bus/usb/drivers
ath3k  btusb  cdc_acm  cdc_ether  cdc_wdm  hub  option  qmi_wwan  rndis_host  rtsx_usb  snd-usb-audio  usb  usbfs  usbserial_generic  uvcvideo

You must be in the wrong folder.

You should also check the dmesg log to see it it support the USB driver.
dmesg | grep -i usb

There are many dependency.
For example it should support USB net.

Well, after finding the corresponding file, I can follow what you said above and continue with the make operation, right?

I need to know whether your OS support usbnet.
If you can recompile the Linux kernel it would be much beter.

Normally we needn’t to recompile the Linux kernel.
We just to need compile the driver we expect.
If we need the usbnet and cdc-wdm we just need to compile the usbnet.ko and cdc-wdm.ko.