From 863d60769c8dde5a8f0557025c7dc554ca21a351 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Mon, 3 Feb 2020 01:50:31 +0800 Subject: [PATCH] ath10k-ct: provide a build variant for small ram devices (#2925) --- package/firmware/ath10k-firmware/Makefile | 62 +++++++++---------- package/kernel/ath10k-ct/Makefile | 14 ++++- ...0-0010-ath10k-limit-htt-rx-ring-size.patch | 11 ++-- ...60-0011-ath10k-limit-pci-buffer-size.patch | 50 +++++++++++++++ ...60-0011-ath10k-limit-pci-buffer-size.patch | 38 ------------ 5 files changed, 100 insertions(+), 75 deletions(-) rename package/kernel/{mac80211/patches/ath => ath10k-ct/patches}/960-0010-ath10k-limit-htt-rx-ring-size.patch (57%) create mode 100644 package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch delete mode 100644 package/kernel/mac80211/patches/ath/960-0011-ath10k-limit-pci-buffer-size.patch diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile index b335c27c5..1d416a83d 100644 --- a/package/firmware/ath10k-firmware/Makefile +++ b/package/firmware/ath10k-firmware/Makefile @@ -64,92 +64,92 @@ define Download/ct-firmware-htt URL_FILE:=$($(1)_FIRMWARE_FILE_CT_HTT) endef -QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.011 +QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.014 define Download/ath10k-firmware-qca988x-ct $(call Download/ct-firmware,QCA988X,) - HASH:=5872fe046d90d844a6d3e232e47a6865bac551d7043b2874147c077e356b35d8 + HASH:=19db86003509dedb8ace339c183813ca637d65af24d00666411d1590efe33e13 endef $(eval $(call Download,ath10k-firmware-qca988x-ct)) -QCA988X_FIRMWARE_FILE_CT_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.011 +QCA988X_FIRMWARE_FILE_CT_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.014 define Download/ath10k-firmware-qca988x-ct-htt $(call Download/ct-firmware-htt,QCA988X,) - HASH:=4568c3895a101ad28363491ea935f56a48bddea4c1be1889a6ba8d151902062a + HASH:=454e67dab545e720369a07be2fee16de008c76db4ab3119e7760bf9f7504c066 endef $(eval $(call Download,ath10k-firmware-qca988x-ct-htt)) -QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.011 +QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.014 define Download/ath10k-firmware-qca9887-ct $(call Download/ct-firmware,QCA9887,ath10k-9887) - HASH:=2c64ab22159d04cd345b8caffdd76ac95c0409729121a7a4095c5192f46013b2 + HASH:=b3c738328427e124701a5735d65cde0f60e4172ae5bc23b00e5b16df7995dbd4 endef $(eval $(call Download,ath10k-firmware-qca9887-ct)) -QCA9887_FIRMWARE_FILE_CT_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.011 +QCA9887_FIRMWARE_FILE_CT_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.014 define Download/ath10k-firmware-qca9887-ct-htt $(call Download/ct-firmware-htt,QCA9887,ath10k-9887) - HASH:=c806b8894faf3bbb11004f77196c6d711b9a6c187b1512d84e05fa98a5aba2ab + HASH:=4432ccee23133bbaa4a5552e50a1e7e889b257362603e05530e751b67c29b7b5 endef $(eval $(call Download,ath10k-firmware-qca9887-ct-htt)) -QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.011 +QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.014 define Download/ath10k-firmware-qca99x0-ct $(call Download/ct-firmware,QCA99X0,ath10k-10-4b) - HASH:=4ed106dbe8431945afc6a995765f245f574713095b567df35f1397bba5f6fa2e + HASH:=9a908f743604a468b651a5f73c49e6b0ba11a05c677b9726fbf041b849d88b25 endef $(eval $(call Download,ath10k-firmware-qca99x0-ct)) -QCA99X0_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.011 +QCA99X0_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.014 define Download/ath10k-firmware-qca99x0-ct-htt $(call Download/ct-firmware-htt,QCA99X0,ath10k-10-4b) - HASH:=7434c84c501e00a24cbca338569ba150a9ec137ee2b9fa52d13484794300924c + HASH:=800dd0816702aaca75f3eb5436c2ea724a6c24833838cd54399b9286b4d4fbe8 endef $(eval $(call Download,ath10k-firmware-qca99x0-ct-htt)) -QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.011 +QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.014 define Download/ath10k-firmware-qca9984-ct $(call Download/ct-firmware,QCA9984,ath10k-9984-10-4b) - HASH:=9af817e65dc9f195517f05ad25f0eca693632ea03b55739a2e0f0fc82e810405 + HASH:=a8b12dba478e8c9d4a215f82324382c7554a900e83c31775f8511af84e59fef7 endef $(eval $(call Download,ath10k-firmware-qca9984-ct)) -QCA9984_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.011 +QCA9984_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.014 define Download/ath10k-firmware-qca9984-ct-htt $(call Download/ct-firmware-htt,QCA9984,ath10k-9984-10-4b) - HASH:=11e116631555550185e712f70bd29ac41b495bf0ecbfc3334cada8a8c10a42f0 + HASH:=d185651b5d3d1f0082720bc6c2bbe43b2a00cdb6333403fac9336a720b1d93ae endef $(eval $(call Download,ath10k-firmware-qca9984-ct-htt)) -QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.011 +QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.014 define Download/ath10k-firmware-qca4019-ct $(call Download/ct-firmware,QCA4019,ath10k-4019-10-4b) - HASH:=21a6b5b69e3c1591cb9fe6077971ddadb003cac698f2962d4d8d73bc04038bbf + HASH:=4c2e48835219f420b18dc58e31d1387dae0da70d8170c3fc5e7bce39c06cf355 endef $(eval $(call Download,ath10k-firmware-qca4019-ct)) -QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.011 +QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.014 define Download/ath10k-firmware-qca4019-ct-htt $(call Download/ct-firmware-htt,QCA4019,ath10k-4019-10-4b) - HASH:=87111717ec5279125d397bea45386707684ee707a91f6c58298818fd02bf567f + HASH:=743da4d537d094a7839bd8e1f792e4cb8b517101f66777c84fd84585f0b85e64 endef $(eval $(call Download,ath10k-firmware-qca4019-ct-htt)) -QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.011 +QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.014 define Download/ath10k-firmware-qca9888-ct $(call Download/ct-firmware,QCA9888,ath10k-9888-10-4b) - HASH:=3c9f2e914d2a5eb3a413872239045dfcca105483ba83dd9b293e6b8855fda883 + HASH:=5809c8a6b3bd81cbc829b5e90af3c0a3300488fe194524a90e260448158016b6 endef $(eval $(call Download,ath10k-firmware-qca9888-ct)) -QCA9888_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.011 +QCA9888_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.014 define Download/ath10k-firmware-qca9888-ct-htt $(call Download/ct-firmware-htt,QCA9888,ath10k-9888-10-4b) - HASH:=dcb1bd826e5e1ef266fd7ee04410b44d4474d59f6eca0cc634e6432aaf326426 + HASH:=a284943c203ff66ec2e865f20ae2d2aa049b450801d7205b53c9163862228f15 endef $(eval $(call Download,ath10k-firmware-qca9888-ct-htt)) @@ -174,7 +174,7 @@ $(Package/ath10k-firmware-default) SECTION:=firmware CATEGORY:=Firmware PROVIDES:=ath10k-firmware-qca988x - DEPENDS:=+kmod-ath10k-ct + DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct endef define Package/ath10k-firmware-qca9887-ct @@ -190,7 +190,7 @@ $(Package/ath10k-firmware-default) SECTION:=firmware CATEGORY:=Firmware PROVIDES:=ath10k-firmware-qca9887 - DEPENDS:=+kmod-ath10k-ct + DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct endef define Package/ath10k-firmware-qca988x-ct/description @@ -308,7 +308,7 @@ $(Package/ath10k-firmware-default) SECTION:=firmware CATEGORY:=Firmware PROVIDES:=ath10k-firmware-qca99x0 - DEPENDS:=+kmod-ath10k-ct + DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct endef define Package/ath10k-firmware-qca9984-ct @@ -324,7 +324,7 @@ $(Package/ath10k-firmware-default) SECTION:=firmware CATEGORY:=Firmware PROVIDES:=ath10k-firmware-qca9984 - DEPENDS:=+kmod-ath10k-ct + DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct endef define Package/ath10k-firmware-qca4019-ct @@ -340,7 +340,7 @@ $(Package/ath10k-firmware-default) SECTION:=firmware CATEGORY:=Firmware PROVIDES:=ath10k-firmware-qca4019 - DEPENDS:=+kmod-ath10k-ct + DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct endef define Package/ath10k-firmware-qca9888-ct @@ -356,11 +356,9 @@ $(Package/ath10k-firmware-default) SECTION:=firmware CATEGORY:=Firmware PROVIDES:=ath10k-firmware-qca9888 - DEPENDS:=+kmod-ath10k-ct + DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct endef - - define Package/ath10k-firmware-qca9984 $(Package/ath10k-firmware-default) TITLE:=ath10k firmware for QCA9984 devices diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index eee8b7d0d..c46c3a834 100644 --- a/package/kernel/ath10k-ct/Makefile +++ b/package/kernel/ath10k-ct/Makefile @@ -35,6 +35,7 @@ define KernelPackage/ath10k-ct $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko AUTOLOAD:=$(call AutoProbe,ath10k_pci) PROVIDES:=kmod-ath10k + VARIANT:=regular endef define KernelPackage/ath10k-ct/config @@ -42,7 +43,13 @@ define KernelPackage/ath10k-ct/config config ATH10K-CT_LEDS bool "Enable LED support" default y - depends on PACKAGE_kmod-ath10k-ct + depends on PACKAGE_kmod-ath10k-ct || PACKAGE_kmod-ath10k-ct-smallbuffers +endef + +define KernelPackage/ath10k-ct-smallbuffers +$(call KernelPackage/ath10k-ct) + TITLE+= (small buffers for low-RAM devices) + VARIANT:=smallbuffers endef NOSTDINC_FLAGS = \ @@ -90,6 +97,10 @@ ifeq ($(CONFIG_ATH10K-CT_LEDS),y) NOSTDINC_FLAGS += -DCONFIG_ATH10K_LEDS endif +ifeq ($(BUILD_VARIANT),smallbuffers) + NOSTDINC_FLAGS += -DCONFIG_ATH10K_SMALLBUFFERS +endif + define Build/Configure cp $(STAGING_DIR)/usr/include/mac80211/ath/*.h $(PKG_BUILD_DIR) endef @@ -107,3 +118,4 @@ define Build/Compile endef $(eval $(call KernelPackage,ath10k-ct)) +$(eval $(call KernelPackage,ath10k-ct-smallbuffers)) diff --git a/package/kernel/mac80211/patches/ath/960-0010-ath10k-limit-htt-rx-ring-size.patch b/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch similarity index 57% rename from package/kernel/mac80211/patches/ath/960-0010-ath10k-limit-htt-rx-ring-size.patch rename to package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch index 810e97a78..a62d9b791 100644 --- a/package/kernel/mac80211/patches/ath/960-0010-ath10k-limit-htt-rx-ring-size.patch +++ b/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch @@ -1,11 +1,14 @@ ---- a/drivers/net/wireless/ath/ath10k/htt.h -+++ b/drivers/net/wireless/ath/ath10k/htt.h -@@ -238,7 +238,7 @@ enum htt_rx_ring_flags { +--- a/ath10k-4.19/htt.h ++++ b/ath10k-4.19/htt.h +@@ -237,7 +237,11 @@ enum htt_rx_ring_flags { }; #define HTT_RX_RING_SIZE_MIN 128 --#define HTT_RX_RING_SIZE_MAX 2048 ++#ifndef CONFIG_ATH10K_SMALLBUFFERS + #define HTT_RX_RING_SIZE_MAX 2048 ++#else +#define HTT_RX_RING_SIZE_MAX 512 ++#endif #define HTT_RX_RING_SIZE HTT_RX_RING_SIZE_MAX #define HTT_RX_RING_FILL_LEVEL (((HTT_RX_RING_SIZE) / 2) - 1) #define HTT_RX_RING_FILL_LEVEL_DUAL_MAC (HTT_RX_RING_SIZE - 1) diff --git a/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch b/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch new file mode 100644 index 000000000..2cbcb08af --- /dev/null +++ b/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch @@ -0,0 +1,50 @@ +--- a/ath10k-4.19/pci.c ++++ b/ath10k-4.19/pci.c +@@ -142,7 +142,11 @@ static struct ce_attr host_ce_config_wla + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, ++#ifndef CONFIG_ATH10K_SMALLBUFFERS + .dest_nentries = 512, ++#else ++ .dest_nentries = 128, ++#endif + .recv_cb = ath10k_pci_htt_htc_rx_cb, + }, + +@@ -151,7 +155,11 @@ static struct ce_attr host_ce_config_wla + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, ++#ifndef CONFIG_ATH10K_SMALLBUFFERS + .dest_nentries = 128, ++#else ++ .dest_nentries = 64, ++#endif + .recv_cb = ath10k_pci_htc_rx_cb, + }, + +@@ -178,7 +186,11 @@ static struct ce_attr host_ce_config_wla + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 512, ++#ifndef CONFIG_ATH10K_SMALLBUFFERS + .dest_nentries = 512, ++#else ++ .dest_nentries = 128, ++#endif + .recv_cb = ath10k_pci_htt_rx_cb, + }, + +@@ -203,7 +215,11 @@ static struct ce_attr host_ce_config_wla + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, ++#ifndef CONFIG_ATH10K_SMALLBUFFERS + .dest_nentries = 128, ++#else ++ .dest_nentries = 96, ++#endif + .recv_cb = ath10k_pci_pktlog_rx_cb, + }, + diff --git a/package/kernel/mac80211/patches/ath/960-0011-ath10k-limit-pci-buffer-size.patch b/package/kernel/mac80211/patches/ath/960-0011-ath10k-limit-pci-buffer-size.patch deleted file mode 100644 index 283f4d819..000000000 --- a/package/kernel/mac80211/patches/ath/960-0011-ath10k-limit-pci-buffer-size.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/drivers/net/wireless/ath/ath10k/pci.c -+++ b/drivers/net/wireless/ath/ath10k/pci.c -@@ -142,7 +142,7 @@ static struct ce_attr host_ce_config_wla - .flags = CE_ATTR_FLAGS, - .src_nentries = 0, - .src_sz_max = 2048, -- .dest_nentries = 512, -+ .dest_nentries = 128, - .recv_cb = ath10k_pci_htt_htc_rx_cb, - }, - -@@ -151,7 +151,7 @@ static struct ce_attr host_ce_config_wla - .flags = CE_ATTR_FLAGS, - .src_nentries = 0, - .src_sz_max = 2048, -- .dest_nentries = 128, -+ .dest_nentries = 64, - .recv_cb = ath10k_pci_htc_rx_cb, - }, - -@@ -178,7 +178,7 @@ static struct ce_attr host_ce_config_wla - .flags = CE_ATTR_FLAGS, - .src_nentries = 0, - .src_sz_max = 512, -- .dest_nentries = 512, -+ .dest_nentries = 128, - .recv_cb = ath10k_pci_htt_rx_cb, - }, - -@@ -203,7 +203,7 @@ static struct ce_attr host_ce_config_wla - .flags = CE_ATTR_FLAGS, - .src_nentries = 0, - .src_sz_max = 2048, -- .dest_nentries = 128, -+ .dest_nentries = 96, - .recv_cb = ath10k_pci_pktlog_rx_cb, - }, -