703051fe1927fb1074acff728f851d05a7ccc7ea
[openwrt/staging/yousong.git] /
1 From 9df7ddc3ed25b7d3473f117a0680b9418adb5753 Mon Sep 17 00:00:00 2001
2 Message-Id: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net>
3 From: Matthias Schiffer <mschiffer@universe-factory.net>
4 Date: Mon, 27 Nov 2017 18:56:22 +0100
5 Subject: [PATCH 1/2] ath9k: move spectral scan support under a separate config
6 symbol
7
8 At the moment, spectral scan support, and with it RELAY, is always enabled
9 with ATH9K[_HTC]_DEBUGFS. Spectral scan support is currently the only user
10 of RELAY in ath9k, and it unconditionally reserves a relay channel.
11
12 Having debugfs support in ath9k is often useful even on very small embedded
13 routers, where we'd rather like to avoid the code size and RAM usage of the
14 relay support.
15
16 Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
17 Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
18 ---
19 drivers/net/wireless/ath/ath9k/Kconfig | 14 ++++++++++----
20 drivers/net/wireless/ath/ath9k/Makefile | 4 ++--
21 drivers/net/wireless/ath/ath9k/common-spectral.h | 4 ++--
22 3 files changed, 14 insertions(+), 8 deletions(-)
23
24 --- a/drivers/net/wireless/ath/ath9k/Kconfig
25 +++ b/drivers/net/wireless/ath/ath9k/Kconfig
26 @@ -64,13 +64,12 @@ config ATH9K_DEBUGFS
27 depends on ATH9K && DEBUG_FS
28 select MAC80211_DEBUGFS
29 select ATH9K_COMMON_DEBUG
30 - depends on RELAY
31 ---help---
32 Say Y, if you need access to ath9k's statistics for
33 interrupts, rate control, etc.
34
35 - Also required for changing debug message flags at run time.
36 - As well as access to the FFT/spectral data and TX99.
37 + Also required for changing debug message flags at run time and for
38 + TX99.
39
40 config ATH9K_STATION_STATISTICS
41 bool "Detailed station statistics"
42 @@ -181,7 +180,6 @@ config ATH9K_HTC_DEBUGFS
43 bool "Atheros ath9k_htc debugging"
44 depends on ATH9K_HTC && DEBUG_FS
45 select ATH9K_COMMON_DEBUG
46 - depends on RELAY
47 ---help---
48 Say Y, if you need access to ath9k_htc's statistics.
49 As well as access to the FFT/spectral data.
50 @@ -197,3 +195,11 @@ config ATH9K_HWRNG
51
52 Say Y, feeds the entropy directly from the WiFi driver to the input
53 pool.
54 +
55 +config ATH9K_COMMON_SPECTRAL
56 + bool "Atheros ath9k/ath9k_htc spectral scan support"
57 + depends on ATH9K_DEBUGFS || ATH9K_HTC_DEBUGFS
58 + depends on RELAY
59 + default n
60 + ---help---
61 + Say Y to enable access to the FFT/spectral data via debugfs.
62 --- a/drivers/net/wireless/ath/ath9k/Makefile
63 +++ b/drivers/net/wireless/ath/ath9k/Makefile
64 @@ -61,8 +61,8 @@ ath9k_common-y:= common.o \
65 common-init.o \
66 common-beacon.o \
67
68 -ath9k_common-$(CPTCFG_ATH9K_COMMON_DEBUG) += common-debug.o \
69 - common-spectral.o
70 +ath9k_common-$(CPTCFG_ATH9K_COMMON_DEBUG) += common-debug.o
71 +ath9k_common-$(CPTCFG_ATH9K_COMMON_SPECTRAL) += common-spectral.o
72
73 ath9k_htc-y += htc_hst.o \
74 hif_usb.o \
75 --- a/drivers/net/wireless/ath/ath9k/common-spectral.h
76 +++ b/drivers/net/wireless/ath/ath9k/common-spectral.h
77 @@ -151,7 +151,7 @@ static inline u8 spectral_bitmap_weight(
78 return bins[0] & 0x3f;
79 }
80
81 -#ifdef CPTCFG_ATH9K_COMMON_DEBUG
82 +#ifdef CPTCFG_ATH9K_COMMON_SPECTRAL
83 void ath9k_cmn_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, struct dentry *debugfs_phy);
84 void ath9k_cmn_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv);
85
86 @@ -183,6 +183,6 @@ static inline int ath_cmn_process_fft(st
87 {
88 return 0;
89 }
90 -#endif /* CPTCFG_ATH9K_COMMON_DEBUG */
91 +#endif /* CPTCFG_ATH9K_COMMON_SPECTRAL */
92
93 #endif /* SPECTRAL_H */
94 --- a/local-symbols
95 +++ b/local-symbols
96 @@ -116,6 +116,7 @@ ATH9K_PCOEM=
97 ATH9K_HTC=
98 ATH9K_HTC_DEBUGFS=
99 ATH9K_HWRNG=
100 +ATH9K_COMMON_SPECTRAL=
101 CARL9170=
102 CARL9170_LEDS=
103 CARL9170_DEBUGFS=