Qmi_wwan_q driver for OpenWrt

Hello, I am trying to compile the qmi_wwan_q driver for OpenWrt since I am experiencing issues with the generic qmi_wwan driver on a private 5G network. The module I am using is the RG500Q-EA.

Since the Makefile provided with the source files is not adequate for OpenWrt I have created a new one with the following content:

include $(TOPDIR)/rules.mk

PKG_NAME:=qmi_wwan_q
PKG_VERSION:=1.2.2
PKG_RELEASE:=1

# Custom variable
SOURCE_DIR:=/home/crave/Documents/mypackages/qmi_wwan_q

PKG_MAINTAINER:=Quectel

include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk

define KernelPackage/qmi_wwan_q
    SUBMENU:=Network
    TITLE:=Quectel qmi_wwan driver
    DEPENDS:= \
        +kmod-mii \
        +kmod-usb-core \
        +kmod-usb-net-cdc-ether \
        +kmod-usb-net \
        +kmod-usb-net-qmi-wwan \
    FILES:=$(PKG_BUILD_DIR)/qmi_wwan_q.ko
	#AUTOLOAD:=$(call AutoLoad,50,qmi_wwan_q)
endef

define KernelPackage/qmi_wwan_q/description
	qmi_wwan driver by Quectel
endef

EXTRA_CFLAGS:= \
    $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \
    $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
    
MAKE_OPTS:= \
	ARCH="$(LINUX_KARCH)" \
	CROSS_COMPILE="$(TARGET_CROSS)" \
	SUBDIRS="$(PKG_BUILD_DIR)" \
	EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
	$(EXTRA_KCONFIG)

define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) $(SOURCE_DIR)/* $(PKG_BUILD_DIR)/
	$(Build/Patch)
endef


define Build/Compile
	$(MAKE) -C "$(LINUX_DIR)" \
	$(MAKE_OPTS) \
	modules
endef

$(eval $(call KernelPackage,qmi_wwan_q))

When I try to build it using the OpenWrt SDK I get the following error

make[4]: Entering directory '/home/crave/Documents/openWrt/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/linux-5.10.146'
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/sorttable
scripts/sorttable.c:34:10: fatal error: tools/be_byteshift.h: No such file or directory
   34 | #include <tools/be_byteshift.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[5]: *** [scripts/Makefile.host:95: scripts/sorttable] Error 1
make[4]: *** [Makefile:1209: scripts] Error 2
make[4]: Leaving directory '/home/crave/Documents/openWrt/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/linux-5.10.146'
make[3]: *** [Makefile:53: /home/crave/Documents/openWrt/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/qmi_wwan_q-1.2.2/.built] Error 2
make[3]: Leaving directory '/home/crave/Documents/openWrt/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/package/qmi_wwan_q'
time: package/qmi_wwan_q/compile#2.43#0.35#2.78
    ERROR: package/qmi_wwan_q failed to build.

What could be the issue in this case and how could I correct it?

Thank you in advance

Dear @CarlosR_5COMM
Sorry for the late, did you resolve your question now?

Yes, it was solved. Thank you