Sierra Wireless Gobi drivers for 19.07.2

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 forums 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 and the ROOTer forum is useless. All build settings (compiler,c library, etc) were the default and the only kernel option I changed 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 any other router/modules, I just know it worked with my system. Other info that may be pertinent is I am compiling on a Lenovo Thinkcenter M720q (Core i3-8100T, 16 gb ram) with Mint 20.1 Cinnamon installed (kernel 5.4.0-70-generic).

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.

Gobi drivers for openWRT