blob: 1fea5b29a8194617efeff76db7b5fc941d56308d [file] [log] [blame]
Solomon Peachya910e4a2013-05-24 20:04:38 -04001/*
2 * DebugFS code for ST-Ericsson CW1200 mac80211 driver
3 *
4 * Copyright (c) 2011, ST-Ericsson
5 * Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef CW1200_DEBUG_H_INCLUDED
13#define CW1200_DEBUG_H_INCLUDED
14
15#include "itp.h"
16
17struct cw1200_debug_priv {
18 struct dentry *debugfs_phy;
19 int tx;
20 int tx_agg;
21 int rx;
22 int rx_agg;
23 int tx_multi;
24 int tx_multi_frames;
25 int tx_cache_miss;
26 int tx_align;
27 int tx_ttl;
28 int tx_burst;
29 int ba_cnt;
30 int ba_acc;
31 int ba_cnt_rx;
32 int ba_acc_rx;
33#ifdef CONFIG_CW1200_ITP
34 struct cw1200_itp itp;
35#endif /* CONFIG_CW1200_ITP */
36};
37
38int cw1200_debug_init(struct cw1200_common *priv);
39void cw1200_debug_release(struct cw1200_common *priv);
40
41static inline void cw1200_debug_txed(struct cw1200_common *priv)
42{
43 ++priv->debug->tx;
44}
45
46static inline void cw1200_debug_txed_agg(struct cw1200_common *priv)
47{
48 ++priv->debug->tx_agg;
49}
50
51static inline void cw1200_debug_txed_multi(struct cw1200_common *priv,
52 int count)
53{
54 ++priv->debug->tx_multi;
55 priv->debug->tx_multi_frames += count;
56}
57
58static inline void cw1200_debug_rxed(struct cw1200_common *priv)
59{
60 ++priv->debug->rx;
61}
62
63static inline void cw1200_debug_rxed_agg(struct cw1200_common *priv)
64{
65 ++priv->debug->rx_agg;
66}
67
68static inline void cw1200_debug_tx_cache_miss(struct cw1200_common *priv)
69{
70 ++priv->debug->tx_cache_miss;
71}
72
73static inline void cw1200_debug_tx_align(struct cw1200_common *priv)
74{
75 ++priv->debug->tx_align;
76}
77
78static inline void cw1200_debug_tx_ttl(struct cw1200_common *priv)
79{
80 ++priv->debug->tx_ttl;
81}
82
83static inline void cw1200_debug_tx_burst(struct cw1200_common *priv)
84{
85 ++priv->debug->tx_burst;
86}
87
88static inline void cw1200_debug_ba(struct cw1200_common *priv,
89 int ba_cnt, int ba_acc,
90 int ba_cnt_rx, int ba_acc_rx)
91{
92 priv->debug->ba_cnt = ba_cnt;
93 priv->debug->ba_acc = ba_acc;
94 priv->debug->ba_cnt_rx = ba_cnt_rx;
95 priv->debug->ba_acc_rx = ba_acc_rx;
96}
97
98#endif /* CW1200_DEBUG_H_INCLUDED */