How to add ath11k in package mac80211(AX3600)?

Hi All,

We have ethernet on AX3600 now, I want to try ath11k on it.
How can I add ath11k kernel module in mac80211?

Thanks!

https://git.openwrt.org/?p=openwrt/staging/hauke.git;a=shortlog;h=refs/heads/mac80211-5.6

You'll need the top three patches (that doesn't mean that will be sufficient).

I don't like ath11k
This is qca-wifi

I applied this patch, but I still can't select and enable ath11k module.
Don't know why.

index 352d192fa1..c9211162b1 100644
--- a/package/kernel/mac80211/ath.mk
+++ b/package/kernel/mac80211/ath.mk
@@ -1,6 +1,6 @@
 PKG_DRIVERS += \
        ath ath5k ath6kl ath6kl-sdio ath6kl-usb ath9k ath9k-common ath9k-htc ath10k \
-       carl9170 owl-loader
+       ath11k carl9170 owl-loader

 PKG_CONFIG_DEPENDS += \
        CONFIG_PACKAGE_ATH_DEBUG \
@@ -19,6 +19,7 @@ ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
        ATH9K_DEBUGFS \
        ATH9K_HTC_DEBUGFS \
        ATH10K_DEBUGFS \
+       ATH11K_DEBUGFS \
        CARL9170_DEBUGFS \
        ATH5K_DEBUG \
        ATH6KL_DEBUG
@@ -27,13 +28,14 @@ endif
 ifdef CONFIG_PACKAGE_MAC80211_TRACING
   config-y += \
        ATH10K_TRACING \
+       ATH11K_TRACING \
        ATH6KL_TRACING \
        ATH_TRACEPOINTS \
        ATH5K_TRACER
 endif

 config-$(call config_package,ath) += ATH_CARDS ATH_COMMON ATH_REG_DYNAMIC_USER_REG_HINTS
-config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG ATH9K_STATION_STATISTICS
+config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG ATH11K_DEBUG ATH9K_STATION_STATISTICS
 config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED
 config-$(CONFIG_PACKAGE_ATH_SPECTRAL) += ATH9K_COMMON_SPECTRAL ATH10K_SPECTRAL
 config-$(CONFIG_PACKAGE_ATH_DYNACK) += ATH9K_DYNACK
@@ -54,6 +56,7 @@ config-$(CONFIG_ATH10K_THERMAL) += ATH10K_THERMAL

 config-$(call config_package,ath9k-htc) += ATH9K_HTC
 config-$(call config_package,ath10k) += ATH10K ATH10K_PCI
+config-$(call config_package,ath11k) += ATH11K

 config-$(call config_package,ath5k) += ATH5K
 ifdef CONFIG_TARGET_ath25
@@ -276,6 +279,21 @@ define KernelPackage/ath10k/config

 endef

+define KernelPackage/ath11k
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Qualcomm 802.11ax wireless chipset support
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath11k
+  DEPENDS+= @TARGET_ipq807x +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11AX_SUPPORT +@DRIVER_11W_SUPPORT +kmod-crypto-michael-mic
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath11k/ath11k.ko
+  AUTOLOAD:=$(call AutoProbe,ath11k)
+endef
+
+define KernelPackage/ath11k/description
+This module adds support for Qualcomm Technologies 802.11ax family of
+chipsets.
+endef
+
+
 define KernelPackage/carl9170
   $(call KernelPackage/mac80211/Default)
   TITLE:=Driver for Atheros AR9170 USB sticks
$ git clone https://git.openwrt.org/openwrt/openwrt.git

$ cd openwrt

$ git pull https://git.openwrt.org/openwrt/staging/hauke.git mac80211-5.6

$ printf "CONFIG_TARGET_ipq807x=y\nCONFIG_TARGET_BOARD=\"ipq807x\"\nCONFIG_PACKAGE_kmod-ath11k=y\n" >.config

$ make defconfig oldconfig

$ ./scripts/diffconfig.sh 
CONFIG_TARGET_ipq807x=y
CONFIG_TARGET_ipq807x_Default=y
CONFIG_TARGET_BOARD="ipq807x"
CONFIG_ATH_USER_REGD=y
CONFIG_DRIVER_11AC_SUPPORT=y
CONFIG_DRIVER_11AX_SUPPORT=y
CONFIG_DRIVER_11N_SUPPORT=y
CONFIG_DRIVER_11W_SUPPORT=y
CONFIG_PACKAGE_ATH_DFS=y
CONFIG_PACKAGE_MAC80211_DEBUGFS=y
CONFIG_PACKAGE_MAC80211_MESH=y
CONFIG_PACKAGE_hostapd-common=y
CONFIG_PACKAGE_iw=y
CONFIG_PACKAGE_kmod-ath=y
CONFIG_PACKAGE_kmod-ath11k=y
CONFIG_PACKAGE_kmod-cfg80211=y
CONFIG_PACKAGE_kmod-crypto-hash=y
CONFIG_PACKAGE_kmod-crypto-michael-mic=y
CONFIG_PACKAGE_kmod-mac80211=y
CONFIG_PACKAGE_wireless-regdb=y

I need to remove the directory tmp to recollection the package info then I can find and select ath11k. :laughing:

Thanks!

Btw., I think (based on your diff above) you might be missing the changes to target/linux/ipq807x/config-default.

$ git diff remotes/origin/master..HEAD | diffstat -p1
 package/kernel/mac80211/ath.mk      |   21 +++++++-
 target/linux/ipq807x/config-default |  146 ++++++++++++++++++++++++++++++++++++++++++++---------------
 2 files changed, 129 insertions(+), 38 deletions(-)

Failed to build package mac80211.
Why I need to change the kernel config?

ERROR: module '/data/work/buildopenwrt/master/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x/backports-5.8-rc2-1/drivers/net/wireless/ath/ath11k/ath11k.ko' is missing.

You question is answered in the commit description of:
https://git.openwrt.org/?p=openwrt/staging/hauke.git;a=commit;h=63a02112ef1ca906eff3868f0c163887a91a3311

You will also need the DTS entries for wcss pil, see example documentation :

https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/tree/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml?h=for-next

Thanks all of you, I'll try it later.

Fantastic work on the eth driver by the way, ill build with your changes later today.

Its also worth looking at how stock FW extracts calibration data, I have extracted the following from the stock rom

            ap-hk* | ap-ac* | ap-oa*)
                    mkdir -p ${apdk}/IPQ8074
                    dd if=${mtdblock} of=${apdk}/wifi1.caldata bs=1 count=2116 skip=208896
                    if [ -f "$HK_BD_FILENAME" ]; then
                        FILESIZE=$(stat -Lc%s "$HK_BD_FILENAME")
                    else
                        FILESIZE=131072
                    fi
                    dd if=${mtdblock} of=${apdk}/IPQ8074/caldata.bin bs=1 count=$FILESIZE skip=4096
                    [ -L /lib/firmware/IPQ8074/caldata.bin ] || \
                    ln -s ${apdk}/IPQ8074/caldata.bin /lib/firmware/IPQ8074/caldata.bin
            ;;

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.