diff mbox series

[v3] ath11k: fix build issues on disabling ATH11K_DEBUG

Message ID 1556860487-31604-1-git-send-email-akolli@codeaurora.org (mailing list archive)
State Accepted
Commit 58ee85958c42534d1a3edfefb57d01a0b491603c
Delegated to: Kalle Valo
Headers show
Series [v3] ath11k: fix build issues on disabling ATH11K_DEBUG | expand

Commit Message

Anilkumar Kolli May 3, 2019, 5:14 a.m. UTC
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(-)

Comments

Kalle Valo May 6, 2019, 1:03 p.m. UTC | #1
Anilkumar Kolli <akolli@codeaurora.org> wrote:

> 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>

Patch applied to ath.git, thanks.

58ee85958c42 ath11k: fix build issues on disabling ATH11K_DEBUG
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/debug.h b/drivers/net/wireless/ath/ath11k/debug.h
index 4c1fcca2d8b5..7f62da8d8b8b 100644
--- a/drivers/net/wireless/ath/ath11k/debug.h
+++ b/drivers/net/wireless/ath/ath11k/debug.h
@@ -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
diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
index 78f7423a66e9..257dd97275d8 100644
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -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);