Build drivers for linux, specifically Rooter (OpenWRT base 19.07.2)

If I am to understand correctly, Sierra Wireless has switched from building your own linux drivers to the pre-compilled MBLP drivers and the older QMI drivers are EOL. In the past I have built my own Rooter firmware for my router without issues. However I am now trying to build a version for my new router (Netgear R7800) and I am having nothing but trouble with the latest Rooter build kit (OpenWRT 19.07.2) and cannot seem to get the latest QMI driver (S2.42,N2.64) to compile. I noticed they have a build for ARM64 but I am unsure how to incorporate those pre-built drivers into my firmware or if they would even work without modification. Can anyone point me to a current guide or point me in the right direction. The Rooter forum is useless and I have exhaustively searched the OpenWRT guides without finding a resolution. Thank you in advance.

Hi @penguinslovebananas ,
Which module are you using for your deployment? QMI still works fine on EM/MC 7X. EM9X supports both QMI for USB 3.1 and MBLP for PCIe.

I apologize I listed everything except the most important detail. I am using an EM7565 in a M.2 to usb3 box connected to my router via USB port.

Hi @penguinslovebananas,
Currently, MBPL has been published for EM9, not EM7. It is planed in the further. Please try using QMI SDK at the link below if you would like to install device drivers and full API system
https://source.sierrawireless.com/resources/airprime/software/linux-qmi-sdk-software-04,-d-,00,-d-,15/#sthash.wpp5GRTl.qGXgecVV.dpbs
Also, refer to the document for step by step guideline
Linux QMI SDK Application Developers Guide Rev1.26_1.pdf (1.4 MB)
Please share if you have any concerns. Help us tick “Solution” if it is useful. It might be beneficial to someone getting the same problem
Thanks

Even when I go to the device page for the em7565 it shows a link for MBPL and not the QMI drivers. I was also wondering if future versions of the QMI driver will be made since they are listed as EOL. I appreciate the links as they are difficult to find on source, but if the em7565 is not supported by MBPL it should not be listed with the device page. Also I was hoping someone could give me some input into compiling the qmi drivers into OPENwrt as I have not been able to do so. I will paste specific error logs this afternoon.

Ok i have had a chance now to sit down and play with the code a little bit and I finally figured it out. This information came from my trial and error, but also several other formums on the internet including openWRT and Techship. I thought I would post it here since there doesn’t seem to be an up to date guide on this information. All build settings (compiler,c library, etc) were the default and the only kernel option I change was to enable SATA port multiplier support. As I cannot seem to get the whitespace formatting to copy over correctly wherever you see a plus indicates a tab. As a heads up I used a Netgear R7800 as the build target and the ROOTer 19.07.2 build kit to achieve this and my module is an EM7565 and I am using QMI version S2.42 N.2.64. I have done ZERO testing with anyother router/modules, I just know it worked with my system.

The gobiserial files are as follows
gobiserial directory (package/kernel/gobiserial)

src dir
Makefile

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=gobiserial
PKG_RELEASE:=1

include $(INCLUDE_DIR)/package.mk

define KernelPackage/gobiserial
SUBMENU:=Other modules
TITLE:=Gobiserial for EM7565
DEPENDS:=+kmod-usb-core kmod-usb-net
FILES:=$(PKG_BUILD_DIR)/gobiserial.ko
AUTOLOAD:=$(call AutoLoad,30,button-hotplug,1)
KCONFIG:=
endef

define KernelPackage/gobiserial/description
Kernel module serial port driver for Sierra Wireless EM7565
endef

EXTRA_KCONFIG:= \
+CONFIG_GOBISERIAL=m

EXTRA_CFLAGS:=
+$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \
+$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG))))

MAKE_OPTS:= \
+$(KERNEL_MAKE_FLAGS) \
+SUBDIRS="$(PKG_BUILD_DIR)" \
+EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
+$(EXTRA_KCONFIG)

define Build/Compile
+$(MAKE) -C “$(LINUX_DIR)” \
++$(MAKE_OPTS) \
++modules
endef

$(eval $(call KernelPackage,gobiserial))

In the source directory I placed

GobiSerial.C
Kconfig

config SIERRA_NET
+tristate “net for sierra USB”

Makefile

obj-${CONFIG_GOBISERIAL}+= GobiSerial.o

For the gobinet drivers

gobinet directory (package/kernel/gobinet)

src dir
Makefile

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=gobinet
PKG_RELEASE:=1

include $(INCLUDE_DIR)/package.mk

define KernelPackage/gobinet
SUBMENU:=Other modules
TITLE:=Gobinet for EM7565
DEPENDS:=+kmod-usb-core kmod-usb-net
FILES:=$(PKG_BUILD_DIR)/gobinet.ko
AUTOLOAD:=$(call AutoLoad,50,gobinet)
KCONFIG:=
endef

define KernelPackage/gobinet/description
Kernel module driver for Sierra Wireless EM7565
endef

EXTRA_KCONFIG:= \
+CONFIG_GOBINET=m

EXTRA_CFLAGS:=
+$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \
+$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \

MAKE_OPTS:= \
+$(KERNEL_MAKE_FLAGS) \
+SUBDIRS="$(PKG_BUILD_DIR)" \
+EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
+$(EXTRA_KCONFIG)

define Build/Compile
+$(MAKE) -C “$(LINUX_DIR)” \
++$(MAKE_OPTS) \
++modules
endef

$(eval $(call KernelPackage,gobinet))

src directory

gobi_usbnet.h
gobiUSBnet.c
QMI.c
QMI.h
QMIDevice.c
QMIDevice.h
Structs.h
Makefile

obj-${CONFIG_GOBINET}+= gobinet.o
gobinet-objs:= GobiUSBNet.o QMIDevice.o QMI.o

Kconfig - same as gobiserial

Hope this helps as I know I have fought for a couple weeks now trying to figure this out.

I am also going to share my files on my google drive. You can find both an archive with everything included and the individual files if you just need one thing.

Sierra QMI drivers for openWRT 190.07.2