Commit 568f0603 authored by Kalle Valo's avatar Kalle Valo
Browse files

ath11k: debugfs: move some function declarations to correct header files



Some of the function declarations are for functions in debugfs_htt_stats.c and
debugfs_sta.c, move them to corresponding header files. As debugfs_sta.h didn't
exist create it.

Also in debugfs_htt_stats.h move dunction declarations to the end of the file.

No functional changes. Compile tested only.

Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1600264523-12939-4-git-send-email-kvalo@codeaurora.org
parent 56292162
Loading
Loading
Loading
Loading
+1 −27
Original line number Diff line number Diff line
@@ -110,12 +110,9 @@ int ath11k_debugfs_pdev_create(struct ath11k_base *ab);
void ath11k_debugfs_pdev_destroy(struct ath11k_base *ab);
int ath11k_debugfs_register(struct ath11k *ar);
void ath11k_debugfs_unregister(struct ath11k *ar);
void ath11k_dbg_htt_ext_stats_handler(struct ath11k_base *ab,
				      struct sk_buff *skb);
void ath11k_debugfs_fw_stats_process(struct ath11k_base *ab, struct sk_buff *skb);

void ath11k_debugfs_fw_stats_init(struct ath11k *ar);
int ath11k_dbg_htt_stats_req(struct ath11k *ar);

static inline bool ath11k_debugfs_is_pktlog_lite_mode_enabled(struct ath11k *ar)
{
@@ -148,15 +145,6 @@ static inline int ath11k_debugfs_rx_filter(struct ath11k *ar)
	return ar->debug.rx_filter;
}

void ath11k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			    struct ieee80211_sta *sta, struct dentry *dir);
void
ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,
				    struct ath11k_per_peer_tx_stats *peer_stats,
				    u8 legacy_rate_idx);
void ath11k_update_per_peer_stats_from_txcompl(struct ath11k *ar,
					       struct sk_buff *msdu,
					       struct hal_tx_status *ts);
#else
static inline int ath11k_debugfs_soc_create(struct ath11k_base *ab)
{
@@ -209,7 +197,7 @@ static inline int ath11k_debugfs_is_extd_rx_stats_enabled(struct ath11k *ar)
	return 0;
}

static inline int ath11k_dbg_htt_stats_req(struct ath11k *ar)
static inline int ath11k_debugfs_htt_stats_req(struct ath11k *ar)
{
	return 0;
}
@@ -234,20 +222,6 @@ static inline int ath11k_debugfs_rx_filter(struct ath11k *ar)
	return 0;
}

static inline void
ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,
				    struct ath11k_per_peer_tx_stats *peer_stats,
				    u8 legacy_rate_idx)
{
}

static inline void
ath11k_update_per_peer_stats_from_txcompl(struct ath11k *ar,
					  struct sk_buff *msdu,
					  struct hal_tx_status *ts)
{
}

#endif /* CONFIG_MAC80211_DEBUGFS*/

#endif /* _ATH11K_DEBUGFS_H_ */
+4 −4
Original line number Diff line number Diff line
@@ -4253,7 +4253,7 @@ static int ath11k_dbg_htt_ext_stats_parse(struct ath11k_base *ab,
	return 0;
}

void ath11k_dbg_htt_ext_stats_handler(struct ath11k_base *ab,
void ath11k_debugfs_htt_ext_stats_handler(struct ath11k_base *ab,
					  struct sk_buff *skb)
{
	struct ath11k_htt_extd_stats_msg *msg;
@@ -4402,7 +4402,7 @@ static int ath11k_prep_htt_stats_cfg_params(struct ath11k *ar, u8 type,
	return 0;
}

int ath11k_dbg_htt_stats_req(struct ath11k *ar)
int ath11k_debugfs_htt_stats_req(struct ath11k *ar)
{
	struct debug_htt_stats_req *stats_req = ar->debug.htt_stats.stats_req;
	u8 type = stats_req->type;
@@ -4476,7 +4476,7 @@ static int ath11k_open_htt_stats(struct inode *inode, struct file *file)
	ar->debug.htt_stats.stats_req = stats_req;
	stats_req->type = type;

	ret = ath11k_dbg_htt_stats_req(ar);
	ret = ath11k_debugfs_htt_stats_req(ar);
	if (ret < 0)
		goto out;

+5 −2
Original line number Diff line number Diff line
@@ -1660,8 +1660,6 @@ struct htt_pdev_obss_pd_stats_tlv {
	u32        num_obss_tx_ppdu_failure;
};

void ath11k_debugfs_htt_stats_init(struct ath11k *ar);

struct htt_ring_backpressure_stats_tlv {
	u32 pdev_id;
	u32 current_head_idx;
@@ -1687,4 +1685,9 @@ struct htt_ring_backpressure_stats_tlv {
	u32 backpressure_hist[5];
};

void ath11k_debugfs_htt_stats_init(struct ath11k *ar);
void ath11k_debugfs_htt_ext_stats_handler(struct ath11k_base *ab,
					  struct sk_buff *skb);
int ath11k_debugfs_htt_stats_req(struct ath11k *ar);

#endif
+12 −11
Original line number Diff line number Diff line
@@ -5,14 +5,14 @@

#include <linux/vmalloc.h>

#include "debugfs_sta.h"
#include "core.h"
#include "peer.h"
#include "debug.h"
#include "dp_tx.h"
#include "debugfs_htt_stats.h"

void
ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,
void ath11k_debugfs_sta_add_tx_stats(struct ath11k_sta *arsta,
				     struct ath11k_per_peer_tx_stats *peer_stats,
				     u8 legacy_rate_idx)
{
@@ -125,7 +125,7 @@ ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,
	tx_stats->tx_duration += peer_stats->duration;
}

void ath11k_update_per_peer_stats_from_txcompl(struct ath11k *ar,
void ath11k_debugfs_sta_update_txcompl(struct ath11k *ar,
				       struct sk_buff *msdu,
				       struct hal_tx_status *ts)
{
@@ -200,7 +200,8 @@ void ath11k_update_per_peer_stats_from_txcompl(struct ath11k *ar,
	arsta->txrate.nss = arsta->last_txrate.nss;
	arsta->txrate.bw = ath11k_mac_bw_to_mac80211_bw(bw);

	ath11k_accumulate_per_peer_tx_stats(arsta, peer_stats, rate_idx);
	ath11k_debugfs_sta_add_tx_stats(arsta, peer_stats, rate_idx);

err_out:
	spin_unlock_bh(&ab->base_lock);
	rcu_read_unlock();
@@ -428,7 +429,7 @@ ath11k_dbg_sta_open_htt_peer_stats(struct inode *inode, struct file *file)
	ar->debug.htt_stats.stats_req = stats_req;
	stats_req->type = ATH11K_DBG_HTT_EXT_STATS_PEER_INFO;
	memcpy(stats_req->peer_addr, sta->addr, ETH_ALEN);
	ret = ath11k_dbg_htt_stats_req(ar);
	ret = ath11k_debugfs_htt_stats_req(ar);
	mutex_unlock(&ar->conf_mutex);
	if (ret < 0)
		goto out;
@@ -820,7 +821,7 @@ static const struct file_operations fops_htt_peer_stats_reset = {
	.llseek = default_llseek,
};

void ath11k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
void ath11k_debugfs_sta_op_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			       struct ieee80211_sta *sta, struct dentry *dir)
{
	struct ath11k *ar = hw->priv;
+44 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
/*
 * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
 */

#ifndef _ATH11K_DEBUGFS_STA_H_
#define _ATH11K_DEBUGFS_STA_H_

#include <net/mac80211.h>

#include "core.h"
#include "hal_tx.h"

#ifdef CONFIG_ATH11K_DEBUGFS

void ath11k_debugfs_sta_op_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			       struct ieee80211_sta *sta, struct dentry *dir);
void ath11k_debugfs_sta_add_tx_stats(struct ath11k_sta *arsta,
				     struct ath11k_per_peer_tx_stats *peer_stats,
				     u8 legacy_rate_idx);
void ath11k_debugfs_sta_update_txcompl(struct ath11k *ar,
				       struct sk_buff *msdu,
				       struct hal_tx_status *ts);

#else /* CONFIG_ATH11K_DEBUGFS */

#define ath11k_debugfs_sta_op_add NULL

static inline void
ath11k_debugfs_sta_add_tx_stats(struct ath11k_sta *arsta,
				struct ath11k_per_peer_tx_stats *peer_stats,
				u8 legacy_rate_idx)
{
}

static inline void ath11k_debugfs_sta_update_txcompl(struct ath11k *ar,
						     struct sk_buff *msdu,
						     struct hal_tx_status *ts)
{
}

#endif /* CONFIG_ATH11K_DEBUGFS */

#endif /* _ATH11K_DEBUGFS_STA_H_ */
Loading