Nighthawk x4 R7500 v1 5GHz - Compile Quantenna Driver

I am working on integrating the Quantenna QTNFMAC WiFi driver into my OpenWrt build for a Netgear R7500V1 router. While the driver compiles and the resulting .ko files are present in the OpenWrt image under /lib/modules/5.15.167/, I encounter Unknown symbol errors related to cfg80211 when loading the driver at runtime. Below, I have documented the steps taken so far and the current error messages encountered. I hope the OpenWrt community can assist in resolving this issue.

Steps Taken So Far

  1. Compiled the Driver:
  • The kernel v5.15.167 has the driver code under /drivers/net/wireless/quantenna.
  • Built the qtnfmac driver as part of the OpenWrt build process (Makefile Below).
  • Compiled the module successfully, generating the following files:
    • qtnfmac.ko
    • qtnfmac_pcie.ko

Verified Image Contents:

  • After flashing the image to the router, I verified that both .ko files are present in /lib/modules/5.15.167/.
  • The modules.order file confirms that the qtnfmac and qtnfmac_pcie modules were correctly listed.

Dependencies and Makefile Configuration:

  • In the Makefile, I defined a dependency on cfg80211 to ensure it loads before the qtnfmac driver:

DEPENDS := +kmod-cfg80211

Below is the relevant portion of the Makefile

define KernelPackage/qtnfmac
  SECTION:=kernel
  CATEGORY:=Kernel modules
  SUBMENU:=Wireless Drivers
  TITLE:=Quantenna WiFi driver (QTNFMAC)
  DEPENDS:=+kmod-cfg80211
  FILES:=$(DRIVER_DIR)/qtnfmac.ko \
          $(DRIVER_DIR)/qtnfmac_pcie.ko
  AUTOLOAD:=$(call AutoLoad,50,qtnfmac qtnfmac_pcie)
endef

Current Issue

Even though the cfg80211 module is present and loads successfully, the qtnfmac module fails with Unknown symbol errors for symbols that are exported by cfg80211. This suggests that:

  1. There might be an incompatibility between the cfg80211 module and the qtnfmac driver, potentially due to mismatched kernel configurations or compilation issues.
  2. The driver might be trying to access symbols that require additional kernel features or options to be enabled.

Questions for the Community

  1. Kernel Symbol Resolution:
  • Could there be any additional configurations required to ensure qtnfmac can properly link with symbols from cfg80211?
  • Are there known compatibility issues or additional dependencies for Quantenna drivers?
  1. Kernel Module Build Process:
  • Do I need to perform any manual steps beyond what the OpenWrt build system already handles (e.g., linking the symbols or configuring kernel options)?
  1. Potential Workarounds:
  • Is there a way to force re-export of symbols or load the modules differently to resolve the unknown symbol issue?

Any guidance or suggestions would be greatly appreciated. Thank you!

Keep in mind that you need to build against the mac80211 (backports) package, not the kernel itself - and remember that this proprietary driver has been neglected for years.

Slh, first off thank you for taking the time to go through my issue.

There is a good chance that I have a process gap(been 15+ years that i have not worked on c/cpp code).

As per my understanding, since the kernel compiled and the .ko files were created for the qtnfmac module, the code should be compatible. All functions, headers etc would have been present.

Is there a particular patch that I need to apply to mac80211/cfg80211?

Backporting would be required if the kernel did not have the qtnfmac code in it?

I could be way off and would like to state that I have no intention of offending someone.

Regards!

It's a bit more complicated in this case for OpenWrt.

The wireless subsystem and drivers are part of the mainline kernel, but OpenWrt opts not to use the matching version from the (older LTS-) kernel kernel (v6.6.57 at the moment), but rather keeps all of this disabled and builds the wireless subsystem (mac80211/ cfg80211/ nl80211 and friends) from the 'mac80211' package (a backport of these drivers from a newer kernel, v6.11.2 at the moment), to gain newer hardware support that way. This makes it easy to get symbol mismatches, if you aren't careful and build against the older in-kernel versions, rather than the newer out-of-tree mac80211 backports (additional packaging complexity required).

Examples for correctly doing this would be ath10k-ct, mt76, mwlwifi and rtl8812au-ct, so make sure to model your packaging (the Makefiles) after those examples (as mt76 is typically newer code than the mac80211 backports, I'd suggest not to look too closely at this rather special case, ath10k-ct, mwlwifi or rtl8812au-ct are probably better examples for your specific use case).

Noted.I will examine the rtl8812au-ct package and report back with my findings

1 Like

Hi @eddie619

I'm definitely interested if you manage to get the 5Ghz working with OpenWRT on the R7500v1! :grinning: :grinning: :grinning:

Hey Jack,

The friend who owns the router is travelling for a work assignment so I am unable to test and debug issues further.
This will need to wait till I get my hands back on the router.