ath9k: move spectral scan support under a separate config symbol
authorMatthias Schiffer <mschiffer@universe-factory.net>
Mon, 27 Nov 2017 17:56:22 +0000 (18:56 +0100)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 7 Dec 2017 14:31:57 +0000 (16:31 +0200)
At the moment, spectral scan support, and with it RELAY, is always enabled
with ATH9K[_HTC]_DEBUGFS. Spectral scan support is currently the only user
of RELAY in ath9k, and it unconditionally reserves a relay channel.

Having debugfs support in ath9k is often useful even on very small embedded
routers, where we'd rather like to avoid the code size and RAM usage of the
relay support.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath9k/Kconfig
drivers/net/wireless/ath/ath9k/Makefile
drivers/net/wireless/ath/ath9k/common-spectral.h

index 783a38f1a626a435f5f2eb6b39f2ef9724292f06..1f3523019509fe8fc28ebf329b3855652cb122f1 100644 (file)
@@ -61,13 +61,12 @@ config ATH9K_DEBUGFS
        depends on ATH9K && DEBUG_FS
        select MAC80211_DEBUGFS
        select ATH9K_COMMON_DEBUG
-       select RELAY
        ---help---
          Say Y, if you need access to ath9k's statistics for
          interrupts, rate control, etc.
 
-         Also required for changing debug message flags at run time.
-         As well as access to the FFT/spectral data and TX99.
+         Also required for changing debug message flags at run time and for
+         TX99.
 
 config ATH9K_STATION_STATISTICS
        bool "Detailed station statistics"
@@ -177,7 +176,6 @@ config ATH9K_HTC_DEBUGFS
        bool "Atheros ath9k_htc debugging"
        depends on ATH9K_HTC && DEBUG_FS
        select ATH9K_COMMON_DEBUG
-       select RELAY
        ---help---
          Say Y, if you need access to ath9k_htc's statistics.
          As well as access to the FFT/spectral data.
@@ -192,3 +190,11 @@ config ATH9K_HWRNG
 
          Say Y, feeds the entropy directly from the WiFi driver to the input
          pool.
+
+config ATH9K_COMMON_SPECTRAL
+       bool "Atheros ath9k/ath9k_htc spectral scan support"
+       depends on ATH9K_DEBUGFS || ATH9K_HTC_DEBUGFS
+       select RELAY
+       default n
+       ---help---
+         Say Y to enable access to the FFT/spectral data via debugfs.
index d804ce7391a0ee88cd544cb1eeb2dc7f128b0d3b..f71b2ad8275cdbacc741a2cc167bed29bcadc500 100644 (file)
@@ -62,8 +62,8 @@ ath9k_common-y:=      common.o \
                        common-init.o \
                        common-beacon.o \
 
-ath9k_common-$(CONFIG_ATH9K_COMMON_DEBUG) += common-debug.o \
-                                            common-spectral.o
+ath9k_common-$(CONFIG_ATH9K_COMMON_DEBUG) += common-debug.o
+ath9k_common-$(CONFIG_ATH9K_COMMON_SPECTRAL) += common-spectral.o
 
 ath9k_htc-y += htc_hst.o \
                hif_usb.o \
index 5d1a51d83aa646006f20298e206bb391830b5a78..303ab470ce34b6d92efaade5492ddd2515ccfdd2 100644 (file)
@@ -151,7 +151,7 @@ static inline u8 spectral_bitmap_weight(u8 *bins)
        return bins[0] & 0x3f;
 }
 
-#ifdef CONFIG_ATH9K_COMMON_DEBUG
+#ifdef CONFIG_ATH9K_COMMON_SPECTRAL
 void ath9k_cmn_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, struct dentry *debugfs_phy);
 void ath9k_cmn_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv);
 
@@ -183,6 +183,6 @@ static inline int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv,
 {
        return 0;
 }
-#endif /* CONFIG_ATH9K_COMMON_DEBUG */
+#endif /* CONFIG_ATH9K_COMMON_SPECTRAL */
 
 #endif /* SPECTRAL_H */