@@ -146,6 +146,22 @@ void ath11k_debug_fw_stats_process(struct ath11k_base *ab, u8 *evt_buf,
int ath11k_dbg_htt_stats_req(struct ath11k *ar,
struct debug_htt_stats_req *stats_req);
+static inline bool ath11k_debug_is_pktlog_lite_mode_enabled(struct ath11k *ar)
+{
+ return (ar->debug.pktlog_mode == ATH11K_PKTLOG_MODE_LITE);
+}
+
+static inline bool ath11k_debug_is_pktlog_rx_stats_enabled(struct ath11k *ar)
+{
+ return (!ar->debug.pktlog_peer_valid && ar->debug.pktlog_mode);
+}
+
+static inline bool ath11k_debug_is_pktlog_peer_vaild(struct ath11k *ar, u8 *addr)
+{
+ return (ar->debug.pktlog_peer_valid && ar->debug.pktlog_mode &&
+ ether_addr_equal(addr, ar->debug.pktlog_peer_addr));
+}
+
static inline int ath11k_debug_is_extd_tx_stats_enabled(struct ath11k *ar)
{
return ar->debug.extd_tx_stats;
@@ -207,6 +223,21 @@ static inline int ath11k_dbg_htt_stats_req(struct ath11k *ar,
{
return 0;
}
+
+static inline bool ath11k_debug_is_pktlog_lite_mode_enabled(struct ath11k *ar)
+{
+ return false;
+}
+
+static inline bool ath11k_debug_is_pktlog_rx_stats_enabled(struct ath11k *ar)
+{
+ return false;
+}
+
+static inline bool ath11k_debug_is_pktlog_peer_vaild(struct ath11k *ar, u8 *addr)
+{
+ return false;
+}
#endif /* CONFIG_ATH11K_DEBUGFS */
#ifdef CONFIG_MAC80211_DEBUGFS
@@ -988,7 +988,7 @@ static int ath11k_htt_pull_ppdu_stats(struct ath11k_base *ab,
ppdu_id = *((u32 *)data + 1);
ar = ab->pdevs[pdev_id].ar;
- if (ar->debug.pktlog_mode == ATH11K_PKTLOG_MODE_LITE) {
+ if (ath11k_debug_is_pktlog_lite_mode_enabled(ar)) {
/* TODO update the pktlog tracing */
}
@@ -2300,7 +2300,7 @@ int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id,
memset(&ppdu_info, 0, sizeof(ppdu_info));
ppdu_info.peer_id = HAL_INVALID_PEERID;
- if (!ar->debug.pktlog_peer_valid) {
+ if (ath11k_debug_is_pktlog_rx_stats_enabled(ar)) {
/* TODO update the pktlog tracing */
}
@@ -2329,8 +2329,7 @@ int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id,
arsta = (struct ath11k_sta *)peer->sta->drv_priv;
ath11k_dp_rx_update_peer_stats(arsta, &ppdu_info);
- if (ar->debug.pktlog_peer_valid &&
- ether_addr_equal(peer->addr, ar->debug.pktlog_peer_addr)) {
+ if (ath11k_debug_is_pktlog_peer_vaild(ar, peer->addr)) {
/* TODO update the pktlog tracing for one peer*/
}
spin_unlock_bh(&ab->data_lock);
On CONFIG_ATH11K_DEBUG disable fix these build errors ath11k/dp_rx.c: In function ‘ath11k_htt_pull_ppdu_stats’: ath11k/dp_rx.c:991:8: error: ‘struct ath11k’ has no member named ‘debug’ if (ar->debug.pktlog_mode == ATH11K_PKTLOG_MODE_LITE) { ^ ath11k/dp_rx.c: In function ‘ath11k_dp_rx_process_mon_status’: ath11k/dp_rx.c:2278:10: error: ‘struct ath11k’ has no member named ‘debug’ if (!ar->debug.pktlog_peer_valid) { ^ ath11k/dp_rx.c:2307:9: error: ‘struct ath11k’ has no member named ‘debug’ if (ar->debug.pktlog_peer_valid && ^ ath11k/dp_rx.c:2308:38: error: ‘struct ath11k’ has no member named ‘debug’ ether_addr_equal(peer->addr, ar->debug.pktlog_peer_addr)) { Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org> --- V2: - Rebased on top of tree - changed ath11k_debug_is_pktlog_per_peer_enabled() to ath11k_debug_is_pktlog_rx_stats_enabled() drivers/net/wireless/ath/ath11k/debug.h | 31 +++++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/dp_rx.c | 7 +++---- 2 files changed, 34 insertions(+), 4 deletions(-)