Commit 1077ec47 authored by Christian Lamparter's avatar Christian Lamparter Committed by Kalle Valo

ath9k: move RELAY and DEBUG_FS to ATH9K[_HTC]_DEBUGFS

Currently, the common ath9k_common module needs to have a
dependency on RELAY and DEBUG_FS in order to built. This
is usually not a problem. But for RAM and FLASH starved
AR71XX devices, every little bit counts.

This patch adds a new symbol CONFIG_ATH9K_COMMON_DEBUG
which makes it possible to drop the RELAY and DEBUG_FS
dependency there and move it to ATH_(HTC)_DEBUGFS.

Note: The shared FFT/spectral code (which is the only user
of the relayfs in ath9k*) needs DEBUG_FS to export the relayfs
interface to dump the data to userspace. So it makes no sense
to have the functions compiled in, if DEBUG_FS is not there.
Signed-off-by: default avatarChristian Lamparter <chunkeey@googlemail.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent c1e3330f
...@@ -3,8 +3,8 @@ config ATH9K_HW ...@@ -3,8 +3,8 @@ config ATH9K_HW
config ATH9K_COMMON config ATH9K_COMMON
tristate tristate
select ATH_COMMON select ATH_COMMON
select DEBUG_FS config ATH9K_COMMON_DEBUG
select RELAY bool
config ATH9K_DFS_DEBUGFS config ATH9K_DFS_DEBUGFS
def_bool y def_bool y
depends on ATH9K_DEBUGFS && ATH9K_DFS_CERTIFIED depends on ATH9K_DEBUGFS && ATH9K_DFS_CERTIFIED
...@@ -60,12 +60,14 @@ config ATH9K_DEBUGFS ...@@ -60,12 +60,14 @@ config ATH9K_DEBUGFS
bool "Atheros ath9k debugging" bool "Atheros ath9k debugging"
depends on ATH9K && DEBUG_FS depends on ATH9K && DEBUG_FS
select MAC80211_DEBUGFS select MAC80211_DEBUGFS
select ATH9K_COMMON_DEBUG
select RELAY select RELAY
---help--- ---help---
Say Y, if you need access to ath9k's statistics for Say Y, if you need access to ath9k's statistics for
interrupts, rate control, etc. interrupts, rate control, etc.
Also required for changing debug message flags at run time. Also required for changing debug message flags at run time.
As well as access to the FFT/spectral data and TX99.
config ATH9K_STATION_STATISTICS config ATH9K_STATION_STATISTICS
bool "Detailed station statistics" bool "Detailed station statistics"
...@@ -174,8 +176,11 @@ config ATH9K_HTC ...@@ -174,8 +176,11 @@ config ATH9K_HTC
config ATH9K_HTC_DEBUGFS config ATH9K_HTC_DEBUGFS
bool "Atheros ath9k_htc debugging" bool "Atheros ath9k_htc debugging"
depends on ATH9K_HTC && DEBUG_FS depends on ATH9K_HTC && DEBUG_FS
select ATH9K_COMMON_DEBUG
select RELAY
---help--- ---help---
Say Y, if you need access to ath9k_htc's statistics. Say Y, if you need access to ath9k_htc's statistics.
As well as access to the FFT/spectral data.
config ATH9K_HWRNG config ATH9K_HWRNG
bool "Random number generator support" bool "Random number generator support"
......
...@@ -60,8 +60,9 @@ obj-$(CONFIG_ATH9K_COMMON) += ath9k_common.o ...@@ -60,8 +60,9 @@ obj-$(CONFIG_ATH9K_COMMON) += ath9k_common.o
ath9k_common-y:= common.o \ ath9k_common-y:= common.o \
common-init.o \ common-init.o \
common-beacon.o \ common-beacon.o \
common-debug.o \
common-spectral.o ath9k_common-$(CONFIG_ATH9K_COMMON_DEBUG) += common-debug.o \
common-spectral.o
ath9k_htc-y += htc_hst.o \ ath9k_htc-y += htc_hst.o \
hif_usb.o \ hif_usb.o \
......
...@@ -60,6 +60,7 @@ struct ath_rx_stats { ...@@ -60,6 +60,7 @@ struct ath_rx_stats {
u32 rx_spectral; u32 rx_spectral;
}; };
#ifdef CONFIG_ATH9K_COMMON_DEBUG
void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy, void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy,
struct ath_hw *ah); struct ath_hw *ah);
void ath9k_cmn_debug_base_eeprom(struct dentry *debugfs_phy, void ath9k_cmn_debug_base_eeprom(struct dentry *debugfs_phy,
...@@ -70,3 +71,29 @@ void ath9k_cmn_debug_recv(struct dentry *debugfs_phy, ...@@ -70,3 +71,29 @@ void ath9k_cmn_debug_recv(struct dentry *debugfs_phy,
struct ath_rx_stats *rxstats); struct ath_rx_stats *rxstats);
void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy, void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy,
struct ath_rx_stats *rxstats); struct ath_rx_stats *rxstats);
#else
static inline void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy,
struct ath_hw *ah)
{
}
static inline void ath9k_cmn_debug_base_eeprom(struct dentry *debugfs_phy,
struct ath_hw *ah)
{
}
static inline void ath9k_cmn_debug_stat_rx(struct ath_rx_stats *rxstats,
struct ath_rx_status *rs)
{
}
static inline void ath9k_cmn_debug_recv(struct dentry *debugfs_phy,
struct ath_rx_stats *rxstats)
{
}
static inline void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy,
struct ath_rx_stats *rxstats)
{
}
#endif /* CONFIG_ATH9K_COMMON_DEBUG */
...@@ -1075,7 +1075,7 @@ static struct rchan_callbacks rfs_spec_scan_cb = { ...@@ -1075,7 +1075,7 @@ static struct rchan_callbacks rfs_spec_scan_cb = {
void ath9k_cmn_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv) void ath9k_cmn_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv)
{ {
if (IS_ENABLED(CONFIG_ATH9K_DEBUGFS) && spec_priv->rfs_chan_spec_scan) { if (spec_priv->rfs_chan_spec_scan) {
relay_close(spec_priv->rfs_chan_spec_scan); relay_close(spec_priv->rfs_chan_spec_scan);
spec_priv->rfs_chan_spec_scan = NULL; spec_priv->rfs_chan_spec_scan = NULL;
} }
......
...@@ -151,6 +151,7 @@ static inline u8 spectral_bitmap_weight(u8 *bins) ...@@ -151,6 +151,7 @@ static inline u8 spectral_bitmap_weight(u8 *bins)
return bins[0] & 0x3f; return bins[0] & 0x3f;
} }
#ifdef CONFIG_ATH9K_COMMON_DEBUG
void ath9k_cmn_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, struct dentry *debugfs_phy); 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); void ath9k_cmn_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv);
...@@ -161,5 +162,27 @@ int ath9k_cmn_spectral_scan_config(struct ath_common *common, ...@@ -161,5 +162,27 @@ int ath9k_cmn_spectral_scan_config(struct ath_common *common,
enum spectral_mode spectral_mode); enum spectral_mode spectral_mode);
int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_hdr *hdr, int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_hdr *hdr,
struct ath_rx_status *rs, u64 tsf); struct ath_rx_status *rs, u64 tsf);
#else
static inline void ath9k_cmn_spectral_init_debug(struct ath_spec_scan_priv *spec_priv,
struct dentry *debugfs_phy)
{
}
static inline void ath9k_cmn_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv)
{
}
static inline void ath9k_cmn_spectral_scan_trigger(struct ath_common *common,
struct ath_spec_scan_priv *spec_priv)
{
}
static inline int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv,
struct ieee80211_hdr *hdr,
struct ath_rx_status *rs, u64 tsf)
{
return 0;
}
#endif /* CONFIG_ATH9K_COMMON_DEBUG */
#endif /* SPECTRAL_H */ #endif /* SPECTRAL_H */
...@@ -72,7 +72,7 @@ static bool ath9k_hw_4k_fill_eeprom(struct ath_hw *ah) ...@@ -72,7 +72,7 @@ static bool ath9k_hw_4k_fill_eeprom(struct ath_hw *ah)
return __ath9k_hw_4k_fill_eeprom(ah); return __ath9k_hw_4k_fill_eeprom(ah);
} }
#if defined(CONFIG_ATH9K_DEBUGFS) || defined(CONFIG_ATH9K_HTC_DEBUGFS) #ifdef CONFIG_ATH9K_COMMON_DEBUG
static u32 ath9k_dump_4k_modal_eeprom(char *buf, u32 len, u32 size, static u32 ath9k_dump_4k_modal_eeprom(char *buf, u32 len, u32 size,
struct modal_eep_4k_header *modal_hdr) struct modal_eep_4k_header *modal_hdr)
{ {
......
...@@ -75,7 +75,7 @@ static bool ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah) ...@@ -75,7 +75,7 @@ static bool ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah)
return __ath9k_hw_ar9287_fill_eeprom(ah); return __ath9k_hw_ar9287_fill_eeprom(ah);
} }
#if defined(CONFIG_ATH9K_DEBUGFS) || defined(CONFIG_ATH9K_HTC_DEBUGFS) #ifdef CONFIG_ATH9K_COMMON_DEBUG
static u32 ar9287_dump_modal_eeprom(char *buf, u32 len, u32 size, static u32 ar9287_dump_modal_eeprom(char *buf, u32 len, u32 size,
struct modal_eep_ar9287_header *modal_hdr) struct modal_eep_ar9287_header *modal_hdr)
{ {
......
...@@ -131,7 +131,7 @@ static bool ath9k_hw_def_fill_eeprom(struct ath_hw *ah) ...@@ -131,7 +131,7 @@ static bool ath9k_hw_def_fill_eeprom(struct ath_hw *ah)
return __ath9k_hw_def_fill_eeprom(ah); return __ath9k_hw_def_fill_eeprom(ah);
} }
#if defined(CONFIG_ATH9K_DEBUGFS) || defined(CONFIG_ATH9K_HTC_DEBUGFS) #ifdef CONFIG_ATH9K_COMMON_DEBUG
static u32 ath9k_def_dump_modal_eeprom(char *buf, u32 len, u32 size, static u32 ath9k_def_dump_modal_eeprom(char *buf, u32 len, u32 size,
struct modal_eep_header *modal_hdr) struct modal_eep_header *modal_hdr)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment