[PATCH v1 1/3] mac80211: make relay support depend on ATH_DEBUG
Christian Lamparter
chunkeey at googlemail.com
Fri Feb 10 08:44:42 PST 2017
both ath9k and ath10k use the kernel's relay framework
to pass spectral data to userspace. However, both drivers
only have this option enabled if the driver's debugfs
option is enabled as well.
In case of ath10k_*, the relayfs dependency can be moved
to the config ATH_DEBUG symbol.
ath9k needed more work. A patch to the ath9k driver was
added to detangle RELAY and DEBUG_FS:
"ath9k: move RELAY and DEBUG_FS to ATH9K[_HTC]_DEBUGFS"
<https://patchwork.kernel.org/patch/9501361/>.
NB: CONFIG_PACKAGE_MAC80211_DEBUGFS needs to be disabled to
notice the change.
Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
---
Here are some numbers for my WD Range Extender (AR7370 with a AR9300):
For both configurations MAC80211_DEBUGFS and ATH_DEBUG is disabled.
(if they are enabled, there should be no change). All sizes are in
bytes. And I only test with or without the patch applied.
module | file size | .text size |
ath9k_common.ko (w/o) | 32208 | 12832 |
ath9k_common.ko (with) | 12204 | 3456 |
Note: The kernel with the patch, doesn't need RELAY support anymore.
Therefore it shrinks a bit as well.
| lzma uimage size | .text size |
4.4 kernel (w/o) | 1181777 | 3004592 |
4.4 kernel (with) | 1179666 | 2999448 |
If anyone wants to play with it, I made a test-patch For LEDE [0].
Just remember to disable CONFIG_PACKAGE_MAC80211_DEBUGFS and
CONFIG_PACKAGE_ATH_DEBUG.
The main motivation was that relayfs can be very costly on the RAM
as well (on ath10k in can eat like 4MiB per device with VM debugging
etc...).
---
package/kernel/mac80211/Makefile | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 5a591e4b83..cb709c85d2 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -173,6 +173,7 @@ define KernelPackage/ath/config
config PACKAGE_ATH_DEBUG
bool "Atheros wireless debugging"
+ select KERNEL_RELAY
help
Say Y, if you want to debug atheros wireless drivers.
Only ath9k & ath10k make use of this.
@@ -220,7 +221,7 @@ define KernelPackage/ath9k-common
TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc)
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
HIDDEN:=1
- DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-ath + at DRIVER_11N_SUPPORT + at DRIVER_11W_SUPPORT + at KERNEL_RELAY
+ DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-ath + at DRIVER_11N_SUPPORT + at DRIVER_11W_SUPPORT
FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
@@ -277,7 +278,7 @@ define KernelPackage/ath10k
$(call KernelPackage/mac80211/Default)
TITLE:=Atheros 802.11ac wireless cards support
URL:=https://wireless.wiki.kernel.org/en/users/Drivers/ath10k
- DEPENDS+= @PCI_SUPPORT +kmod-ath + at DRIVER_11N_SUPPORT + at DRIVER_11AC_SUPPORT + at DRIVER_11W_SUPPORT + at KERNEL_RELAY
+ DEPENDS+= @PCI_SUPPORT +kmod-ath + at DRIVER_11N_SUPPORT + at DRIVER_11AC_SUPPORT + at DRIVER_11W_SUPPORT
FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko
@@ -1476,9 +1477,6 @@ ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
config-y += \
CFG80211_DEBUGFS \
MAC80211_DEBUGFS \
- ATH9K_DEBUGFS \
- ATH9K_HTC_DEBUGFS \
- ATH10K_DEBUGFS \
CARL9170_DEBUGFS \
ATH5K_DEBUG
endif
@@ -1498,7 +1496,7 @@ config-$(call config_package,lib80211) += LIB80211 LIB80211_CRYPT_WEP LIB80211_C
config-$(call config_package,airo) += AIRO
config-$(call config_package,ath) += ATH_CARDS ATH_COMMON
-config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG ATH9K_STATION_STATISTICS
+config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG ATH9K_DEBUGFS ATH9K_HTC_DEBUGFS ATH9K_STATION_STATISTICS
config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED
config-$(call config_package,ath9k) += ATH9K
--
2.11.0
More information about the Lede-dev
mailing list