Skip to content

Commit

Permalink
ath10k: rename fw_stats related stuff
Browse files Browse the repository at this point in the history
The naming was a bit inconsistent.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
  • Loading branch information
Michal Kazior authored and Kalle Valo committed Sep 29, 2014
1 parent d15fb52 commit 60ef401
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 26 deletions.
11 changes: 5 additions & 6 deletions drivers/net/wireless/ath/ath10k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ struct ath10k_wmi {
struct ath10k_mem_chunk mem_chunks[WMI_MAX_MEM_REQS];
};

struct ath10k_peer_stat {
struct ath10k_fw_stats_peer {
u8 peer_macaddr[ETH_ALEN];
u32 peer_rssi;
u32 peer_tx_rate;
u32 peer_rx_rate; /* 10x only */
};

struct ath10k_target_stats {
struct ath10k_fw_stats {
/* PDEV stats */
s32 ch_noise_floor;
u32 tx_frame_count;
Expand Down Expand Up @@ -183,7 +183,7 @@ struct ath10k_target_stats {

/* PEER STATS */
u8 peers;
struct ath10k_peer_stat peer_stat[TARGET_NUM_PEERS];
struct ath10k_fw_stats_peer peer_stat[TARGET_NUM_PEERS];

/* TODO: Beacon filter stats */

Expand Down Expand Up @@ -292,11 +292,10 @@ struct ath10k_fw_crash_data {
struct ath10k_debug {
struct dentry *debugfs_phy;

struct ath10k_target_stats target_stats;
struct ath10k_fw_stats fw_stats;
struct completion fw_stats_complete;
DECLARE_BITMAP(wmi_service_bitmap, WMI_SERVICE_MAX);

struct completion event_stats_compl;

unsigned long htt_stats_mask;
struct delayed_work htt_stats_dwork;
struct ath10k_dfs_stats dfs_stats;
Expand Down
18 changes: 9 additions & 9 deletions drivers/net/wireless/ath/ath10k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,37 +239,37 @@ static const struct file_operations fops_wmi_services = {
.llseek = default_llseek,
};

void ath10k_debug_read_target_stats(struct ath10k *ar, struct sk_buff *skb)
void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb)
{
int ret;

spin_lock_bh(&ar->data_lock);

ret = ath10k_wmi_pull_fw_stats(ar, skb, &ar->debug.target_stats);
ret = ath10k_wmi_pull_fw_stats(ar, skb, &ar->debug.fw_stats);
if (ret) {
ath10k_warn(ar, "failed to pull fw stats: %d\n", ret);
goto unlock;
}

complete(&ar->debug.event_stats_compl);
complete(&ar->debug.fw_stats_complete);

unlock:
spin_unlock_bh(&ar->data_lock);
}

static ssize_t ath10k_read_fw_stats(struct file *file, char __user *user_buf,
static ssize_t ath10k_fw_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath10k *ar = file->private_data;
struct ath10k_target_stats *fw_stats;
struct ath10k_fw_stats *fw_stats;
char *buf = NULL;
unsigned int len = 0, buf_len = 8000;
ssize_t ret_cnt = 0;
long left;
int i;
int ret;

fw_stats = &ar->debug.target_stats;
fw_stats = &ar->debug.fw_stats;

mutex_lock(&ar->conf_mutex);

Expand All @@ -286,7 +286,7 @@ static ssize_t ath10k_read_fw_stats(struct file *file, char __user *user_buf,
goto exit;
}

left = wait_for_completion_timeout(&ar->debug.event_stats_compl, 1*HZ);
left = wait_for_completion_timeout(&ar->debug.fw_stats_complete, 1*HZ);
if (left <= 0)
goto exit;

Expand Down Expand Up @@ -445,7 +445,7 @@ static ssize_t ath10k_read_fw_stats(struct file *file, char __user *user_buf,
}

static const struct file_operations fops_fw_stats = {
.read = ath10k_read_fw_stats,
.read = ath10k_fw_stats_read,
.open = simple_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
Expand Down Expand Up @@ -1147,7 +1147,7 @@ int ath10k_debug_register(struct ath10k *ar)
INIT_DELAYED_WORK(&ar->debug.htt_stats_dwork,
ath10k_debug_htt_stats_dwork);

init_completion(&ar->debug.event_stats_compl);
init_completion(&ar->debug.fw_stats_complete);

debugfs_create_file("fw_stats", S_IRUSR, ar->debug.debugfs_phy, ar,
&fops_fw_stats);
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/wireless/ath/ath10k/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void ath10k_debug_unregister(struct ath10k *ar);
void ath10k_debug_read_service_map(struct ath10k *ar,
const void *service_map,
size_t map_size);
void ath10k_debug_read_target_stats(struct ath10k *ar, struct sk_buff *skb);
void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb);
struct ath10k_fw_crash_data *
ath10k_debug_get_new_fw_crash_data(struct ath10k *ar);

Expand Down Expand Up @@ -97,8 +97,8 @@ static inline void ath10k_debug_read_service_map(struct ath10k *ar,
{
}

static inline void ath10k_debug_read_target_stats(struct ath10k *ar,
struct sk_buff *skb)
static inline void ath10k_debug_fw_stats_process(struct ath10k *ar,
struct sk_buff *skb)
{
}

Expand Down
12 changes: 6 additions & 6 deletions drivers/net/wireless/ath/ath10k/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ static int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
}

static void ath10k_wmi_pull_pdev_stats(const struct wmi_pdev_stats *src,
struct ath10k_target_stats *dst)
struct ath10k_fw_stats *dst)
{
const struct wal_dbg_tx_stats *tx = &src->wal.tx;
const struct wal_dbg_rx_stats *rx = &src->wal.rx;
Expand Down Expand Up @@ -1383,7 +1383,7 @@ static void ath10k_wmi_pull_pdev_stats(const struct wmi_pdev_stats *src,
}

static void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src,
struct ath10k_peer_stat *dst)
struct ath10k_fw_stats_peer *dst)
{
ether_addr_copy(dst->peer_macaddr, src->peer_macaddr.addr);
dst->peer_rssi = __le32_to_cpu(src->peer_rssi);
Expand All @@ -1392,7 +1392,7 @@ static void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src,

static int ath10k_wmi_main_pull_fw_stats(struct ath10k *ar,
struct sk_buff *skb,
struct ath10k_target_stats *stats)
struct ath10k_fw_stats *stats)
{
const struct wmi_stats_event *ev = (void *)skb->data;
u32 num_pdev_stats, num_vdev_stats, num_peer_stats;
Expand Down Expand Up @@ -1432,7 +1432,7 @@ static int ath10k_wmi_main_pull_fw_stats(struct ath10k *ar,

static int ath10k_wmi_10x_pull_fw_stats(struct ath10k *ar,
struct sk_buff *skb,
struct ath10k_target_stats *stats)
struct ath10k_fw_stats *stats)
{
const struct wmi_stats_event *ev = (void *)skb->data;
u32 num_pdev_stats, num_vdev_stats, num_peer_stats;
Expand Down Expand Up @@ -1481,7 +1481,7 @@ static int ath10k_wmi_10x_pull_fw_stats(struct ath10k *ar,
}

int ath10k_wmi_pull_fw_stats(struct ath10k *ar, struct sk_buff *skb,
struct ath10k_target_stats *stats)
struct ath10k_fw_stats *stats)
{
if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
return ath10k_wmi_10x_pull_fw_stats(ar, skb, stats);
Expand All @@ -1493,7 +1493,7 @@ static void ath10k_wmi_event_update_stats(struct ath10k *ar,
struct sk_buff *skb)
{
ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_UPDATE_STATS_EVENTID\n");
ath10k_debug_read_target_stats(ar, skb);
ath10k_debug_fw_stats_process(ar, skb);
}

static void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar,
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath10k/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -4573,7 +4573,7 @@ struct wmi_svc_rdy_ev_arg {

struct ath10k;
struct ath10k_vif;
struct ath10k_target_stats;
struct ath10k_fw_stats;

int ath10k_wmi_attach(struct ath10k *ar);
void ath10k_wmi_detach(struct ath10k *ar);
Expand Down Expand Up @@ -4646,6 +4646,6 @@ int ath10k_wmi_force_fw_hang(struct ath10k *ar,
int ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *skb);
int ath10k_wmi_dbglog_cfg(struct ath10k *ar, u32 module_enable);
int ath10k_wmi_pull_fw_stats(struct ath10k *ar, struct sk_buff *skb,
struct ath10k_target_stats *stats);
struct ath10k_fw_stats *stats);

#endif /* _WMI_H_ */

0 comments on commit 60ef401

Please sign in to comment.