Quectel FGH100M Wi-Fi HaLow (fgh100m) – ieee80211_alloc_hw failed (-12) Error (Kernel 6.12.80 / MT7628)

Hello everyone,

I am trying to integrate the Quectel FGH100M Wi-Fi HaLow module into an OpenWrt-based system (HLK-7628N / MT7628). The module is connected via the SPI interface. I have successfully compiled the manufacturer-provided drivers (fgh100m v1.16.4), but I am facing a serious incompatibility issue during the driver probe stage.

System Summary:

  • Hardware: HLK-7628N (MIPS 24kc)

  • Kernel: 6.12.80

  • Driver: Morse Micro fgh100m (based on Backport v6.18.7)

  • Interface: SPI (on spi0.1)

Problem:
The modules load without errors, but during the probe stage, the driver fails at the ieee80211_alloc_hw call with error -12 (ENOMEM) and aborts. This happens even though the system has around 77MB of free RAM.

From my own debugging, I observed that the size of struct ieee80211_hw is calculated as 160 bytes on the driver side. However, on a modern kernel like 6.12, this structure should be significantly larger. This suggests a mismatch between the driver’s internal backport headers and the running kernel’s headers.

Tests and Outputs:

1. Interface and Device Status:
The iw dev command returns nothing, and wlan1 does not appear in ip link. SPI devices are present, but driver binding fails:

root@OpenWrt:~# iw dev
root@OpenWrt:~# ls -l /sys/bus/spi/devices/
spi0.0 -> ../../../devices/platform/10000000.palmbus/10000b00.spi/spi_master/spi0/spi0.0
spi0.1 -> ../../../devices/platform/10000000.palmbus/10000b00.spi/spi_master/spi0/spi0.1

root@OpenWrt:~# ls -l /sys/bus/spi/drivers/morse_spi/
ls: /sys/bus/spi/drivers/morse_spi/: No such file or directory

2. Memory Status (proves it’s not a RAM issue):

root@OpenWrt:~# free -m
             total       used       free     shared  buff/cache   available
Mem:        123560      19360      77564        252       26636       66180

root@OpenWrt:~# cat /proc/meminfo | grep -i slab
Slab:                 8764 kB

3. Module Version Info:

root@OpenWrt:~# modinfo mac80211 | grep -E "filename|vermagic"
filename:       /lib/modules/6.12.80/mac80211.ko
vermagic:       6.12.80 mod_unload MIPS32_R2 32BIT  

root@OpenWrt:~# modinfo morse | grep -E "filename|vermagic"
filename:       /lib/modules/6.12.80/morse.ko
vermagic:       6.12.80 mod_unload MIPS32_R2 32BIT  

4. Dmesg Logs:

[   36.636094] Loading modules backported from Linux version v6.18.7-0-g5dfbc5357
[   36.650529] Backport generated by backports.git c8a37ce
[   37.911156] morse micro driver registration. Version 0-rel_1_16_4_2025_Sep_18
# Earlier logs: morse_spi spi0.1: ieee80211_alloc_hw failed with error -12

Summary:

The driver’s backport layer assumes it is running on kernel v6.18, while the actual kernel is v6.12. It appears that the ops structure or the total hardware size passed to ieee80211_alloc_hw is being rejected by the kernel.

My Question:

How can I force the driver to use the kernel’s native mac80211.h instead of its own backport headers? Or could there be another cause for this issue specific to the MIPS architecture?

I would greatly appreciate any insights or suggestions.

Thanks in advance!

root@OpenWrt:~# ls /sys/bus/spi/drivers/ 
morse_spi  spi-nor    spidev 
root@OpenWrt:~# ls -l /sys/bus/spi/devices/spi0.1/driver 
ls: /sys/bus/spi/devices/spi0.1/driver: No such file or directory 
root@OpenWrt:~# dmesg | grep -iE "morse|spi0.1" 
[   37.494334] Morse Micro Dot11ah driver registration. Version 0-rel_1_16_4_2025_Sep_18 
[   37.711407] morse micro driver registration. Version 0-rel_1_16_4_2025_Sep_18 
[   37.756541] Modules linked in: morse(O+) mac80211(O) dot11ah(O) cfg80211(O) spidev slhc nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6
 nf_defrag_ipv4 crc32c_generic libcrc32c crc_ccitt compat(O) seqiv sha3_generic jitterentropy_rng drbg hmac geniv rng cmac leds_gpio gpio_button_hotplug(O) 
[   38.049739] [<82a8adb8>] 0x82a8adb8 [morse@d57e4d8d+0x3b000] 
[   38.067872] [<82ab42f0>] 0x82ab42f0 [morse@d57e4d8d+0x3b000] 
[   38.175940] [<828cf000>] 0x828cf000 [morse@d57e4d8d+0x3b000] 
[   38.187160] [<828cf0e8>] 0x828cf0e8 [morse@d57e4d8d+0x3b000] 
[   38.198396] [<828cf000>] 0x828cf000 [morse@d57e4d8d+0x3b000] 
[   38.209616] [<828cf044>] 0x828cf044 [morse@d57e4d8d+0x3b000] 
[   38.220850] [<828cf000>] 0x828cf000 [morse@d57e4d8d+0x3b000] 
[   38.278899] morse_spi spi0.1: ieee80211_alloc_hw failed 
[   38.289455] morse_spi spi0.1: morse_mac_create failed 
[   38.299489] morse_spi spi0.1: probe with driver morse_spi failed with error -12 
root@OpenWrt:~# cat /sys/bus/spi/devices/spi0.1/modalias 
spi:mm610x-spi 
root@OpenWrt:~# free -h 
              total        used        free      shared  buff/cache   available 
Mem:         123560       18944       78012         256       26604       66612 
Swap:             0           0           0 
root@OpenWrt:~#

Hi @ugur.altnsy!

The most likely cause of your failure for compiling the driver against 6.12 is an incomplete chanctx callback set. Forum users have experienced this issue and fixed the it based on steps described here: Mm6108 Linux 6.12 support - #7 by ianholland

If that does not fix it, could you please provide the full dmesg command output from around the probe stage, without any filtering in a file if possible. This would be useful for finding kernel warnings or stack traces right before the alloc failure.

It would also be helpful to get the output of this command if it is not captured in the first log: dmesg | grep -i backport. This will help us determine whether you are running backports mac80211/cfg80211 vs in-kernel. This would also help: lsmod | grep -E “^(compat|cfg80211|mac80211|morse|dot11ah)\b”.

Furthermore could you also provide your morse device tree node so we can double check for the correct compatibility string and other properties? If you could also identify the SPI clock speed setting there that would be good.

Cheers!

I looked at what you posted, did what was mentioned there, and it still came out the same way

&spi0 {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;

flash@0 {
    compatible = "jedec,spi-nor";
    reg = <0>;
    spi-max-frequency = <10000000>;
    broken-flash-reset;

    partitions {
        compatible = "fixed-partitions";
        #address-cells = <1>;
        #size-cells = <1>;

        partition@0 {
            label = "u-boot";
            reg = <0x0 0x30000>;
            read-only;
        };

        partition@30000 {
            label = "u-boot-env";
            reg = <0x30000 0x10000>;
            read-only;
        };

        partition@40000 {
            label = "factory";
            reg = <0x40000 0x10000>;
            read-only;

            nvmem-layout {
                compatible = "fixed-layout";
                #address-cells = <1>;
                #size-cells = <1>;

                eeprom_factory_0: eeprom@0 {
                    reg = <0x0 0x400>;
                };

                macaddr_factory_28: macaddr@28 {
                    reg = <0x28 0x6>;
                };
            };
        };

        partition@50000 {
            compatible = "denx,uimage";
            label = "firmware";
            reg = <0x50000 0x1fb0000>;
        };
    };
};

/* --- FGH100M HaLow (CS1) --- */
halow@1 {
    compatible = "morse,mm610x-spi";
    reg = <1>;
    spi-max-frequency = <20000000>;
    interrupt-parent = <&gpio>;
    interrupts = <0 IRQ_TYPE_EDGE_RISING>;
    spi-irq-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
    reset-gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
    status = "okay";
};
};

static struct ieee80211_ops mors_ops = {

#ifdef CONFIG_MORSE_RC
.sta_statistics = morse_sta_tx_rate_stats,
.get_expected_throughput = morse_get_expected_throughput,
#endif
.add_chanctx = ieee80211_emulate_add_chanctx,
.remove_chanctx = ieee80211_emulate_remove_chanctx,
.change_chanctx = ieee80211_emulate_change_chanctx,
.switch_vif_chanctx = ieee80211_emulate_switch_vif_chanctx,
};

root@OpenWrt:~# dmesg | grep -iE “morse|spi0.1”
[ 37.858771] Morse Micro Dot11ah driver registration. Version 0-rel_1_16_4_2025_Sep_18
[ 38.073770] morse micro driver registration. Version 0-rel_1_16_4_2025_Sep_18
[ 38.118893] Modules linked in: morse(O+) mac80211(O) dot11ah(O) cfg80211(O) spidev slhc nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 crc32c_generic libcrc32c crc_ccitt compat(O) ntfs3 ledtrig_activity nls_utf8 nls_iso8859_1 nls_cp437 seqiv sha3_generic jitterentropy_rng drbg hmac geniv rng cmac usb_storage leds_gpio ohci_platform ohci_hcd fsl_mph_dr_of ehci_platform ehci_fsl sd_mod scsi_mod scsi_common ehci_hcd gpio_button_hotplug(O) vfat fat ext4 mbcache jbd2 usbcore nls_base usb_common crc16
[ 38.451208] [<8294adb8>] 0x8294adb8 [morse@97d3146a+0x3b000]
[ 38.469333] [<829742f0>] 0x829742f0 [morse@97d3146a+0x3b000]
[ 38.577462] [<8290f000>] 0x8290f000 [morse@97d3146a+0x3b000]
[ 38.588682] [<8290f0e8>] 0x8290f0e8 [morse@97d3146a+0x3b000]
[ 38.599924] [<8290f000>] 0x8290f000 [morse@97d3146a+0x3b000]
[ 38.611142] [<8290f044>] 0x8290f044 [morse@97d3146a+0x3b000]
[ 38.622385] [<8290f000>] 0x8290f000 [morse@97d3146a+0x3b000]
[ 38.680458] morse_spi spi0.1: ieee80211_alloc_hw failed
[ 38.690997] morse_spi spi0.1: morse_mac_create failed
[ 38.701020] morse_spi spi0.1: probe with driver morse_spi failed with error -12
root@OpenWrt:~#

Are you constrained to using this particular OpenWrt? It would be much easier to use our OpenWrt fork for now, I expect:

I keep getting errors at every step; as soon as I fix one, another one pops up. I’m fixing them one by one—is this normal?

ugur@fedora:~/Desktop/GIT/morse-openwrt$ make toolchain/install -j$(nproc)
make[2]: Entering directory '/home/ugur/Desktop/GIT/morse-openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/ugur/Desktop/GIT/morse-openwrt/scripts/config'
make[1] toolchain/install
make[2] tools/compile
make[3] -C tools/flock compile
make[3] -C tools/xz compile
make[3] -C tools/sed compile
make[3] -C tools/libdeflate compile
make[3] -C tools/tar compile
make[3] -C tools/patch compile
make[3] -C tools/ninja compile
make[3] -C tools/m4 compile
make[3] -C tools/autoconf-archive compile
make[3] -C tools/gnulib compile
make[3] -C tools/zlib compile
make[3] -C tools/expat compile
make[3] -C tools/cpio compile
make[3] -C tools/lzma compile
make[3] -C tools/mtools compile
make[3] -C tools/patch-image compile
make[3] -C tools/zip compile
make[3] -C tools/sstrip compile
make[3] -C tools/meson compile
make[3] -C tools/autoconf compile
make[3] -C tools/make-ext4fs compile
make[3] -C tools/squashfs4 compile
make[3] -C tools/elfutils compile
make[3] -C tools/pkgconf compile
make[3] -C tools/zstd compile
make[3] -C tools/missing-macros compile
make[3] -C tools/automake compile
make[3] -C tools/libressl compile
make[3] -C tools/dosfstools compile
make[3] -C tools/libtool compile
make[3] -C tools/cmake compile
make[3] -C tools/flex compile
make[3] -C tools/e2fsprogs compile
make[3] -C tools/fakeroot compile
make[3] -C tools/gengetopt compile
make[3] -C tools/mklibs compile
make[3] -C tools/patchelf compile
make[3] -C tools/gmp compile
make[3] -C tools/bison compile
make[3] -C tools/mtd-utils compile
make[3] -C tools/mpfr compile
make[3] -C tools/firmware-utils compile
make[3] -C tools/bc compile
make[3] -C tools/findutils compile
make[3] -C tools/mkimage compile
make[3] -C tools/mpc compile
make[3] -C tools/padjffs2 compile
make[3] -C tools/quilt compile
make[2] -C toolchain/fortify-headers compile
make[2] -C toolchain/gdb compile
make[2] -C toolchain/binutils compile
ERROR: toolchain/gdb failed to build.
ERROR: toolchain/binutils failed to build.
make -r toolchain/install: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's
going on
make: *** [/home/ugur/Desktop/GIT/morse-openwrt/include/toplevel.mk:233: toolchain/install] Error 1
ugur@fedora:~/Desktop/GIT/morse-openwrt$

Without knowing what the errors are, it’s hard for me to say.

If you’re building on a recent Ubuntu or similar, you’re more likely to run into minor toolchain/build issues (from memory, there are around 4 or 5 of these, all of which can be fixed by pulling the appropriate patch from OpenWrt master). We have these fixed in our private tree, but unfortunately waiting on the next release. 22.04 LTS and 24.04 LTS should work fine; you can use a docker image for this.

I would suggest that either using a docker image or fixing any toolchain issues here is going to be the easiest path.

I’m using Fedora; could you please provide the steps for the 24.04 LTS version without using Docker?

I’m a bit confused. Are you saying give you steps for running Ubuntu 24.04LTS using qemu? How to install Ubuntu? The internet or your preferred LLM should be able to help with this :slight_smile:

I set up my SPI connection in this way. After consulting with Quectel, I configured SPI in the DTS. I was able to complete the build successfully on Fedora using an Ubuntu environment via Podman. It turned out that the initial issue was related to Fedora. However, I still cannot wake the device over SPI. Where could I be making a mistake? My module is FGM100M.

mt7628an_hilink_hlk-7628n.dts

&gpio {gpio-line-names =“MM_IRQ”, “”, “”, “”, “”, “”, “”, “”,“”, “”, “”, “”, “”, “”, “MM_RESET”, “”,/* … rest of the pins … */;};

&spi0 {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;

mmwlan@1 {
    compatible = "morse,mm610x-spi";
    reg = <1>;
    spi-max-frequency = <40000000>;
    interrupt-parent = <&gpio>;
    interrupts = <0 IRQ_TYPE_EDGE_RISING>;
    reset-gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
    status = "okay";
};

};

Morse OpenWRT

__ __ __ __ _
| \/ | ___ _ __ ___ ___ | \/ (_) ___ _ __ ___
| |\/| |/ _ \| '__/ __|/ _ \ | |\/| | |/ __| '__/ _ \
| | | | (_) | | \__ \ __/ | | | | | (__| | | (_) |
|_| |_|\___/|_| |___/\___| |_| |_|_|\___|_| \___/

---------------------------------------------------------
OpenWrt 23.05.5, r24106-10cc5fcd00
---------------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@hlk-7628n-bdd4:~# iw dev
phy#0
Interface phy0-ap0
ifindex 8
wdev 0x2
addr 40:d6:3c:d7:bd:d4
ssid hlk-7628n-bdd4
type AP
channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz
txpower 20.00 dBm
multicast TXQ:
qsz-byt qsz-pkt flows drops marks overlmt hashcol tx-bytes tx-packets
0 0 0 0 0 0 0 0 0
root@hlk-7628n-bdd4:~# dmesg | grep -iE "morse|spi|mm61"
[ 0.620405] spi-mt7621 10000b00.spi: sys_freq: 193333333
[ 0.654679] spi-nor spi0.0: w25q256 (32768 Kbytes)
[ 0.664322] 4 fixed-partitions partitions found on MTD device spi0.0
[ 0.676953] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[ 0.691484] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[ 0.706475] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[ 0.721040] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[ 0.735802] Creating 4 MTD partitions on "spi0.0":
[ 12.516932] morsechipreset: unable to find sdio device/driver to unbind; proceeding anyway
[ 15.599597] Morse Micro Dot11ah driver registration. Version 0-rel_1_16_4_2025_Sep_18
[ 15.844425] morse micro driver registration. Version 0-rel_1_16_4_2025_Sep_18
[ 15.858940] usbcore: registered new interface driver morse_usb
[ 1818.462896] usbcore: deregistering interface driver morse_usb
[ 1822.487142] morse micro driver registration. Version 0-rel_1_16_4_2025_Sep_18
[ 1822.501759] morse_spi spi0.1: setup: unsupported mode bits 4
[ 1822.513055] morse_spi spi0.1: can't change chip-select polarity
[ 1822.524808] morse_spi spi0.1: morse_spi_probe: failed to init SPI with CMD63 (ret:-22)
[ 1822.540536] morse_spi_probe failed. The driver has not been loaded!
[ 1822.552957] morse_spi: probe of spi0.1 failed with error -22
[ 1822.564440] usbcore: registered new interface driver morse_usb
[ 1941.113374] usbcore: deregistering interface driver morse_usb
[ 1945.414063] morse micro driver registration. Version 0-rel_1_16_4_2025_Sep_18
[ 1945.428616] morse_spi spi0.1: setup: unsupported mode bits 4
[ 1945.439911] morse_spi spi0.1: can't change chip-select polarity
[ 1945.451753] morse_spi spi0.1: morse_spi_probe: failed to init SPI with CMD63 (ret:-22)
[ 1945.467505] morse_spi_probe failed. The driver has not been loaded!
[ 1945.479928] morse_spi: probe of spi0.1 failed with error -22
[ 1945.491403] usbcore: registered new interface driver morse_usb
root@hlk-7628n-bdd4:~# lsmod | grep morse
cfg80211 296792 5 morse,dot11ah,mt7603e,mt76,mac80211
crc7 843 1 morse
dot11ah 64742 1 morse
mac80211 599469 3 morse,mt7603e,mt76
morse 362676 0
root@hlk-7628n-bdd4:~# ls -l /sys/bus/spi/devices/
lrwxrwxrwx 1 root root 0 Jan 1 1970 spi0.0->../../../devices/platform/10000000.palmbus/10000b00.spi/
spi_master/spi0/spi0.0
lrwxrwxrwx 1 root root 0 Jan 1 1970 spi0.1->../../../devices/platform/10000000.palmbus/10000b00.spi/
spi_master/spi0/spi0.1
root@hlk-7628n-bdd4:~# ls -l /lib/firmware/morse/
-rw-r--r-- 1 root root 1673 Oct 11 02:47 bcf_aw_hm593.bin
-rw-r--r-- 1 root root 1708 Oct 11 02:47 bcf_aw_hm593_4v3.bin
-rw-r--r-- 1 root root 2081 Oct 11 02:47 bcf_aw_hm677.bin
-rw-r--r-- 1 root root 1753 Oct 11 02:47 bcf_boardtype_0801.bin
-rw-r--r-- 1 root root 990 Oct 11 02:47 bcf_boardtype_0802.bin
-rw-r--r-- 1 root root 2081 Oct 11 02:47 bcf_boardtype_0804.bin
-rw-r--r-- 1 root root 2081 Oct 11 02:47 bcf_boardtype_0807.bin
-rw-r--r-- 1 root root 1673 Oct 11 02:47 bcf_boardtype_0a01.bin
-rw-r--r-- 1 root root 2081 Oct 11 02:47 bcf_boardtype_0a02.bin
lrwxrwxrwx 1 root root 36 Oct 11 02:47 bcf_default.bin-> /lib/firmware/morse/bcf_failsafe.bin
-rw-r--r-- 1 root root 1298 Oct 11 02:47 bcf_failsafe.bin
-rw-r--r-- 1 root root 650 Oct 11 02:47 bcf_fgh100maamd.bin
-rw-r--r-- 1 root root 1776 Oct 11 02:47 bcf_fgh100mabmd.bin
-rw-r--r-- 1 root root 1251 Oct 11 02:47 bcf_fgh100mhaamd.bin
-rw-r--r-- 1 root root 858 Oct 11 02:47 bcf_fgh100mjaamd.bin
-rw-r--r-- 1 root root 1435 Oct 11 02:47 bcf_mf08651_4v3_us.bin
-rw-r--r-- 1 root root 990 Oct 11 02:47 bcf_mf08651_jp.bin
-rw-r--r-- 1 root root 1753 Oct 11 02:47 bcf_mf08651_us.bin
-rw-r--r-- 1 root root 2081 Oct 11 02:47 bcf_mf15457.bin
-rw-r--r-- 1 root root 1030 Oct 11 02:47 bcf_mf28551.bin
-rw-r--r-- 1 root root 1753 Oct 11 02:47 bcf_mm_hl1.bin
-rw-r--r-- 1 root root 1774 Oct 11 02:47 bcf_mm_hl1_4v3.bin
-rw-r--r-- 1 root root 459124 Oct 11 02:47 mm6108.bin
root@hlk-7628n-bdd4:~#

It doesn’t look to be from your schematic, but is WAKEUP_IN (pin 6) on the Quectel module routed out to anything?

WAKEUP_IN isn’t connected to anything. Is that the problem?

Most likely, WAKE_IN at minimum needs to be tied high, if you don’t need the power save from sleep, otherwise it’ll need to be routed.

As specified in the documentation, I revised WAKEUP_IN as pull-up and BUSY as pull-down. Before sending the PCB for manufacturing, do you notice any other potential issues that I might have overlooked from a different perspective?

Looking a bit closer you’ll want 10k pull ups to VDDIO on all of your SDIO pins, not just data 1 & 3. The non connected pins should have 10k pull downs to ground as well.

Before spinning out a board I’d take a look at our schematic in MMECH06 Design Package, and have a quick read through the MM610x Hardware Design Guide