RM520N-GL Driver building Debian 13 Trixie

Hello All,
While i am waiting for a pcie- M.2 b-key adapter to arrive,am unclear as to wether i need to build the Quectel drivers V1.3.7 for
Purchased the RM520N-GL (LAP) so is strictly pci interface, Didnt know about this.

Linux server3 6.11.4-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.11.4-1 (2024-10-20) x86_64 GNU/Linux

Or will the card initialize ok,with the native mhi_pci built in driver?
Very green at this modem,it goes without saying.
I did try compiling the Quectel-1.3.7 drivers on this kernel and throws many errors about invalid instructions.

TIA

Yes. According the release note, the PCIE_MHI support kernel 6.4.
And for the later version, it haven’t been tested.

wanted to do a follow up.
these are the two errors,I get when i do “make” on the v-1.3.7 of the pcie_mhi driver package.

6.11.4-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.11.4-1 (2024-10-20) x86_64 GNU/Linux

errors

pcie_mhi/core/mhi_init.c:2407:18: error: initialization of ‘int (*)(struct device *, const struct device_driver *)’ from incompatible pointer type ‘int (*)(struct device *, struct device_driver *)’ [-Wincompatible-pointer-types]
 2407 |         .match = mhi_match,


pcie_mhi/core/mhi_init.c:2694:6: warning: no previous prototype for ‘mhi_cntrl_exit’ [-Wmissing-prototypes]
 2694 | void mhi_cntrl_exit(void)

Am showing my stupidity.
Do i need to have the modem installed on the computer i am running the make command on??
I do not have the modem installed yet,still waiying on the pcie adapter to arrive here.

Thanks

For this error. you can


/* match dev to drv */
static int mhi_match(struct device *dev, const struct device_driver *drv)
{
        struct mhi_device *mhi_dev = to_mhi_device(dev);

Add the const with the struct device_driver*.

static void mhi_netdev_get_drvinfo (struct net_device *ndev, struct ethtool_drvinfo *info)
{
        //struct mhi_netdev *mhi_netdev = ndev_to_mhi(ndev);
#if 0
        strlcpy (info->driver, "pcie_mhi", sizeof info->driver);
        strlcpy (info->version, PCIE_MHI_DRIVER_VERSION, sizeof info->version);
#endif
        strncpy (info->driver, "pcie_mhi", sizeof info->driver);
        strncpy (info->version, PCIE_MHI_DRIVER_VERSION, sizeof info->version);
}

You might also see the log that the strlcpy should be replaced with the strncpy.

@Bean.Wang-Q

Thank You for helping out!

With the changes you provided the pcie_mhi kenel module did compile,without errors ,but had many ‘warnings’ in the build process.
I think something else needs to be modded in the code? I am not nearly smart enough to figure it out.
Will post here the warnings that happened at ‘make’.

/home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_init.c:2704:6: warning: no previous prototype for ‘mhi_cntrl_exit’ [-Wmissing-prototypes]
 2704 | void mhi_cntrl_exit(void)
      |      ^~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_init.c:2667:13: warning: ‘mhi_netdev_get_drvinfo’ defined but not used [-Wunused-function]
 2667 | static void mhi_netdev_get_drvinfo (struct net_device *ndev, struct ethtool_drvinfo *info)
      |             ^~~~~~~~~~~~~~~~~~~~~~
  CC [M]  /home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_main.o
/home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_main.c:294:12: warning: no previous prototype for ‘mhi_to_physical’ [-Wmissing-prototypes]
  294 | dma_addr_t mhi_to_physical(struct mhi_ring *ring, void *addr)
      |            ^~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_main.c:2590:5: warning: no previous prototype for ‘mhi_get_remote_time’ [-Wmissing-prototypes]
 2590 | int mhi_get_remote_time(struct mhi_device *mhi_dev,
      |     ^~~~~~~~~~~~~~~~~~~
  CC [M]  /home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_pm.o
/home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_pm.c:156:6: warning: no previous prototype for ‘mhi_assert_dev_wake’ [-Wmissing-prototypes]
  156 | void mhi_assert_dev_wake(struct mhi_controller *mhi_cntrl, bool force)
      |      ^~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_pm.c:196:6: warning: no previous prototype for ‘mhi_deassert_dev_wake’ [-Wmissing-prototypes]
  196 | void mhi_deassert_dev_wake(struct mhi_controller *mhi_cntrl, bool override)
      |      ^~~~~~~~~~~~~~~~~~~~~
  CC [M]  /home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_boot.o
/home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_boot.c:731:5: warning: no previous prototype for ‘BhiWrite’ [-Wmissing-prototypes]
  731 | int BhiWrite(struct mhi_controller *mhi_cntrl, void __user *ubuf, size_t size)
      |     ^~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_boot.c:821:6: warning: no previous prototype for ‘bhi_get_dev_info’ [-Wmissing-prototypes]
  821 | long bhi_get_dev_info(struct mhi_controller *mhi_cntrl, void __user *ubuf)
      |      ^~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_boot.c:840:6: warning: no previous prototype for ‘bhi_write_image’ [-Wmissing-prototypes]
  840 | long bhi_write_image(struct mhi_controller *mhi_cntrl, void __user *ubuf)
      |      ^~~~~~~~~~~~~~~
  CC [M]  /home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_dtr.o
/home/superuser/Downloads/quectel137driver/pcie_mhi/core/mhi_dtr.c:272:6: warning: no previous prototype for ‘mhi_dtr_exit’ [-Wmissing-prototypes]
  272 | void mhi_dtr_exit(void) {
      |      ^~~~~~~~~~~~
  CC [M]  /home/superuser/Downloads/quectel137driver/pcie_mhi/controllers/mhi_qti.o
/home/superuser/Downloads/quectel137driver/pcie_mhi/controllers/mhi_qti.c:129:5: warning: no previous prototype for ‘mhi_debugfs_trigger_m0’ [-Wmissing-prototypes]
  129 | int mhi_debugfs_trigger_m0(void *data, u64 val)
      |     ^~~~~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/controllers/mhi_qti.c:143:5: warning: no previous prototype for ‘mhi_debugfs_trigger_m3’ [-Wmissing-prototypes]
  143 | int mhi_debugfs_trigger_m3(void *data, u64 val)
      |     ^~~~~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/controllers/mhi_qti.c:449:5: warning: no previous prototype for ‘mhi_system_suspend’ [-Wmissing-prototypes]
  449 | int mhi_system_suspend(struct device *dev)
      |     ^~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/controllers/mhi_qti.c:1093:12: warning: no previous prototype for ‘mhi_controller_qcom_init’ [-Wmissing-prototypes]
 1093 | int __init mhi_controller_qcom_init(void)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/controllers/mhi_qti.c:1098:6: warning: no previous prototype for ‘mhi_controller_qcom_exit’ [-Wmissing-prototypes]
 1098 | void mhi_controller_qcom_exit(void)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/controllers/mhi_qti.c:1209:5: warning: no previous prototype for ‘mhi_arch_platform_init’ [-Wmissing-prototypes]
 1209 | int mhi_arch_platform_init(struct mhi_dev *mhi_dev)
      |     ^~~~~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/controllers/mhi_qti.c:1214:6: warning: no previous prototype for ‘mhi_arch_platform_deinit’ [-Wmissing-prototypes]
 1214 | void mhi_arch_platform_deinit(struct mhi_dev *mhi_dev)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~
  CC [M]  /home/superuser/Downloads/quectel137driver/pcie_mhi/devices/mhi_uci.o
/home/superuser/Downloads/quectel137driver/pcie_mhi/devices/mhi_uci.c:103:12: warning: no previous prototype for ‘user_termios_to_kernel_termios’ [-Wmissing-prototypes]
  103 | __weak int user_termios_to_kernel_termios(struct ktermios *k,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/devices/mhi_uci.c:108:12: warning: no previous prototype for ‘kernel_termios_to_user_termios’ [-Wmissing-prototypes]
  108 | __weak int kernel_termios_to_user_termios(struct termios2 __user *u,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/devices/mhi_uci.c:113:12: warning: no previous prototype for ‘user_termios_to_kernel_termios_1’ [-Wmissing-prototypes]
  113 | __weak int user_termios_to_kernel_termios_1(struct ktermios *k,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/devices/mhi_uci.c:118:12: warning: no previous prototype for ‘kernel_termios_to_user_termios_1’ [-Wmissing-prototypes]
  118 | __weak int kernel_termios_to_user_termios_1(struct termios __user *u,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/devices/mhi_uci.c:945:5: warning: no previous prototype for ‘mhi_device_uci_init’ [-Wmissing-prototypes]
  945 | int mhi_device_uci_init(void)
      |     ^~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/devices/mhi_uci.c:976:6: warning: no previous prototype for ‘mhi_device_uci_exit’ [-Wmissing-prototypes]
  976 | void mhi_device_uci_exit(void)
      |      ^~~~~~~~~~~~~~~~~~~
  CC [M]  /home/superuser/Downloads/quectel137driver/pcie_mhi/devices/mhi_netdev_quectel.o
/home/superuser/Downloads/quectel137driver/pcie_mhi/devices/mhi_netdev_quectel.c:79:5: warning: no previous prototype for ‘mhi_netdev_use_xfer_type_dma’ [-Wmissing-prototypes]
   79 | int mhi_netdev_use_xfer_type_dma(unsigned chan)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/devices/mhi_netdev_quectel.c:211:5: warning: no previous prototype for ‘mhi_netdev_mbin_enabled’ [-Wmissing-prototypes]
  211 | int mhi_netdev_mbin_enabled(void) { return mhi_mbim_enabled; }
      |     ^~~~~~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/devices/mhi_netdev_quectel.c:3373:12: warning: no previous prototype for ‘mhi_device_netdev_init’ [-Wmissing-prototypes]
 3373 | int __init mhi_device_netdev_init(struct dentry *parent)
      |            ^~~~~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/devices/mhi_netdev_quectel.c:3387:6: warning: no previous prototype for ‘mhi_device_netdev_exit’ [-Wmissing-prototypes]
 3387 | void mhi_device_netdev_exit(void)
      |      ^~~~~~~~~~~~~~~~~~~~~~
/home/superuser/Downloads/quectel137driver/pcie_mhi/devices/mhi_netdev_quectel.c:3395:6: warning: no previous prototype for ‘mhi_netdev_quectel_avoid_unused_function’ [-Wmissing-prototypes]
 3395 | void mhi_netdev_quectel_avoid_unused_function(void) {
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  LD [M]  /home/superuser/Downloads/quectel137driver/pcie_mhi/pcie_mhi.o
  MODPOST /home/superuser/Downloads/quectel137driver/pcie_mhi/Module.symvers
  CC [M]  /home/superuser/Downloads/quectel137driver/pcie_mhi/pcie_mhi.mod.o
  LD [M]  /home/superuser/Downloads/quectel137driver/pcie_mhi/pcie_mhi.ko
  BTF [M] /home/superuser/Downloads/quectel137driver/pcie_mhi/pcie_mhi.ko
Skipping BTF generation for /home/superuser/Downloads/quectel137driver/pcie_mhi/pcie_mhi.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-6.11.4-amd64'
#cp pcie_mhi.ko /tftpboot/

TIA

I don’t have the device and maybe you can just try insmod pcie_mhi.ko to see what happen and the dmesg log.