aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wl12xx
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2012-05-10 05:14:08 -0400
committerLuciano Coelho <coelho@ti.com>2012-06-05 08:58:12 -0400
commit10b1e8a27a45559df7d02c864081e929369d83bf (patch)
tree2e5115698863b858014b5615c57aa79d1dd2f75d /drivers/net/wireless/ti/wl12xx
parentbcca1bbdd412fb6be32d04fc2407c81239de5f8c (diff)
wl12xx: implement fw status debugfs entries
Implement the operations that are necessary to fetch the wl12xx-specific FW statistics. Re-add some of the code removed from wlcore. Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com>
Diffstat (limited to 'drivers/net/wireless/ti/wl12xx')
-rw-r--r--drivers/net/wireless/ti/wl12xx/Makefile2
-rw-r--r--drivers/net/wireless/ti/wl12xx/acx.h223
-rw-r--r--drivers/net/wireless/ti/wl12xx/debugfs.c236
-rw-r--r--drivers/net/wireless/ti/wl12xx/debugfs.h28
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c8
5 files changed, 496 insertions, 1 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/Makefile b/drivers/net/wireless/ti/wl12xx/Makefile
index 87f64b14db35..da509aa7d009 100644
--- a/drivers/net/wireless/ti/wl12xx/Makefile
+++ b/drivers/net/wireless/ti/wl12xx/Makefile
@@ -1,3 +1,3 @@
1wl12xx-objs = main.o cmd.o acx.o 1wl12xx-objs = main.o cmd.o acx.o debugfs.o
2 2
3obj-$(CONFIG_WL12XX) += wl12xx.o 3obj-$(CONFIG_WL12XX) += wl12xx.o
diff --git a/drivers/net/wireless/ti/wl12xx/acx.h b/drivers/net/wireless/ti/wl12xx/acx.h
index d1f5aba0afce..1be0f2d31b19 100644
--- a/drivers/net/wireless/ti/wl12xx/acx.h
+++ b/drivers/net/wireless/ti/wl12xx/acx.h
@@ -24,6 +24,7 @@
24#define __WL12XX_ACX_H__ 24#define __WL12XX_ACX_H__
25 25
26#include "../wlcore/wlcore.h" 26#include "../wlcore/wlcore.h"
27#include "../wlcore/acx.h"
27 28
28struct wl1271_acx_host_config_bitmap { 29struct wl1271_acx_host_config_bitmap {
29 struct acx_header header; 30 struct acx_header header;
@@ -31,6 +32,228 @@ struct wl1271_acx_host_config_bitmap {
31 __le32 host_cfg_bitmap; 32 __le32 host_cfg_bitmap;
32} __packed; 33} __packed;
33 34
35struct wl12xx_acx_tx_statistics {
36 __le32 internal_desc_overflow;
37} __packed;
38
39struct wl12xx_acx_rx_statistics {
40 __le32 out_of_mem;
41 __le32 hdr_overflow;
42 __le32 hw_stuck;
43 __le32 dropped;
44 __le32 fcs_err;
45 __le32 xfr_hint_trig;
46 __le32 path_reset;
47 __le32 reset_counter;
48} __packed;
49
50struct wl12xx_acx_dma_statistics {
51 __le32 rx_requested;
52 __le32 rx_errors;
53 __le32 tx_requested;
54 __le32 tx_errors;
55} __packed;
56
57struct wl12xx_acx_isr_statistics {
58 /* host command complete */
59 __le32 cmd_cmplt;
60
61 /* fiqisr() */
62 __le32 fiqs;
63
64 /* (INT_STS_ND & INT_TRIG_RX_HEADER) */
65 __le32 rx_headers;
66
67 /* (INT_STS_ND & INT_TRIG_RX_CMPLT) */
68 __le32 rx_completes;
69
70 /* (INT_STS_ND & INT_TRIG_NO_RX_BUF) */
71 __le32 rx_mem_overflow;
72
73 /* (INT_STS_ND & INT_TRIG_S_RX_RDY) */
74 __le32 rx_rdys;
75
76 /* irqisr() */
77 __le32 irqs;
78
79 /* (INT_STS_ND & INT_TRIG_TX_PROC) */
80 __le32 tx_procs;
81
82 /* (INT_STS_ND & INT_TRIG_DECRYPT_DONE) */
83 __le32 decrypt_done;
84
85 /* (INT_STS_ND & INT_TRIG_DMA0) */
86 __le32 dma0_done;
87
88 /* (INT_STS_ND & INT_TRIG_DMA1) */
89 __le32 dma1_done;
90
91 /* (INT_STS_ND & INT_TRIG_TX_EXC_CMPLT) */
92 __le32 tx_exch_complete;
93
94 /* (INT_STS_ND & INT_TRIG_COMMAND) */
95 __le32 commands;
96
97 /* (INT_STS_ND & INT_TRIG_RX_PROC) */
98 __le32 rx_procs;
99
100 /* (INT_STS_ND & INT_TRIG_PM_802) */
101 __le32 hw_pm_mode_changes;
102
103 /* (INT_STS_ND & INT_TRIG_ACKNOWLEDGE) */
104 __le32 host_acknowledges;
105
106 /* (INT_STS_ND & INT_TRIG_PM_PCI) */
107 __le32 pci_pm;
108
109 /* (INT_STS_ND & INT_TRIG_ACM_WAKEUP) */
110 __le32 wakeups;
111
112 /* (INT_STS_ND & INT_TRIG_LOW_RSSI) */
113 __le32 low_rssi;
114} __packed;
115
116struct wl12xx_acx_wep_statistics {
117 /* WEP address keys configured */
118 __le32 addr_key_count;
119
120 /* default keys configured */
121 __le32 default_key_count;
122
123 __le32 reserved;
124
125 /* number of times that WEP key not found on lookup */
126 __le32 key_not_found;
127
128 /* number of times that WEP key decryption failed */
129 __le32 decrypt_fail;
130
131 /* WEP packets decrypted */
132 __le32 packets;
133
134 /* WEP decrypt interrupts */
135 __le32 interrupt;
136} __packed;
137
138#define ACX_MISSED_BEACONS_SPREAD 10
139
140struct wl12xx_acx_pwr_statistics {
141 /* the amount of enters into power save mode (both PD & ELP) */
142 __le32 ps_enter;
143
144 /* the amount of enters into ELP mode */
145 __le32 elp_enter;
146
147 /* the amount of missing beacon interrupts to the host */
148 __le32 missing_bcns;
149
150 /* the amount of wake on host-access times */
151 __le32 wake_on_host;
152
153 /* the amount of wake on timer-expire */
154 __le32 wake_on_timer_exp;
155
156 /* the number of packets that were transmitted with PS bit set */
157 __le32 tx_with_ps;
158
159 /* the number of packets that were transmitted with PS bit clear */
160 __le32 tx_without_ps;
161
162 /* the number of received beacons */
163 __le32 rcvd_beacons;
164
165 /* the number of entering into PowerOn (power save off) */
166 __le32 power_save_off;
167
168 /* the number of entries into power save mode */
169 __le16 enable_ps;
170
171 /*
172 * the number of exits from power save, not including failed PS
173 * transitions
174 */
175 __le16 disable_ps;
176
177 /*
178 * the number of times the TSF counter was adjusted because
179 * of drift
180 */
181 __le32 fix_tsf_ps;
182
183 /* Gives statistics about the spread continuous missed beacons.
184 * The 16 LSB are dedicated for the PS mode.
185 * The 16 MSB are dedicated for the PS mode.
186 * cont_miss_bcns_spread[0] - single missed beacon.
187 * cont_miss_bcns_spread[1] - two continuous missed beacons.
188 * cont_miss_bcns_spread[2] - three continuous missed beacons.
189 * ...
190 * cont_miss_bcns_spread[9] - ten and more continuous missed beacons.
191 */
192 __le32 cont_miss_bcns_spread[ACX_MISSED_BEACONS_SPREAD];
193
194 /* the number of beacons in awake mode */
195 __le32 rcvd_awake_beacons;
196} __packed;
197
198struct wl12xx_acx_mic_statistics {
199 __le32 rx_pkts;
200 __le32 calc_failure;
201} __packed;
202
203struct wl12xx_acx_aes_statistics {
204 __le32 encrypt_fail;
205 __le32 decrypt_fail;
206 __le32 encrypt_packets;
207 __le32 decrypt_packets;
208 __le32 encrypt_interrupt;
209 __le32 decrypt_interrupt;
210} __packed;
211
212struct wl12xx_acx_event_statistics {
213 __le32 heart_beat;
214 __le32 calibration;
215 __le32 rx_mismatch;
216 __le32 rx_mem_empty;
217 __le32 rx_pool;
218 __le32 oom_late;
219 __le32 phy_transmit_error;
220 __le32 tx_stuck;
221} __packed;
222
223struct wl12xx_acx_ps_statistics {
224 __le32 pspoll_timeouts;
225 __le32 upsd_timeouts;
226 __le32 upsd_max_sptime;
227 __le32 upsd_max_apturn;
228 __le32 pspoll_max_apturn;
229 __le32 pspoll_utilization;
230 __le32 upsd_utilization;
231} __packed;
232
233struct wl12xx_acx_rxpipe_statistics {
234 __le32 rx_prep_beacon_drop;
235 __le32 descr_host_int_trig_rx_data;
236 __le32 beacon_buffer_thres_host_int_trig_rx_data;
237 __le32 missed_beacon_host_int_trig_rx_data;
238 __le32 tx_xfr_host_int_trig_rx_data;
239} __packed;
240
241struct wl12xx_acx_statistics {
242 struct acx_header header;
243
244 struct wl12xx_acx_tx_statistics tx;
245 struct wl12xx_acx_rx_statistics rx;
246 struct wl12xx_acx_dma_statistics dma;
247 struct wl12xx_acx_isr_statistics isr;
248 struct wl12xx_acx_wep_statistics wep;
249 struct wl12xx_acx_pwr_statistics pwr;
250 struct wl12xx_acx_aes_statistics aes;
251 struct wl12xx_acx_mic_statistics mic;
252 struct wl12xx_acx_event_statistics event;
253 struct wl12xx_acx_ps_statistics ps;
254 struct wl12xx_acx_rxpipe_statistics rxpipe;
255} __packed;
256
34int wl1271_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap); 257int wl1271_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap);
35 258
36#endif /* __WL12XX_ACX_H__ */ 259#endif /* __WL12XX_ACX_H__ */
diff --git a/drivers/net/wireless/ti/wl12xx/debugfs.c b/drivers/net/wireless/ti/wl12xx/debugfs.c
new file mode 100644
index 000000000000..9cc79d8e647b
--- /dev/null
+++ b/drivers/net/wireless/ti/wl12xx/debugfs.c
@@ -0,0 +1,236 @@
1/*
2 * This file is part of wl12xx
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Copyright (C) 2011-2012 Texas Instruments
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 *
21 */
22
23#include "../wlcore/debugfs.h"
24#include "../wlcore/wlcore.h"
25
26#include "wl12xx.h"
27#include "acx.h"
28
29#define WL12XX_DEBUGFS_FWSTATS_FILE(a, b, c) \
30 DEBUGFS_FWSTATS_FILE(a, b, c, wl12xx_acx_statistics)
31
32WL12XX_DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, "%u");
33
34WL12XX_DEBUGFS_FWSTATS_FILE(rx, out_of_mem, "%u");
35WL12XX_DEBUGFS_FWSTATS_FILE(rx, hdr_overflow, "%u");
36WL12XX_DEBUGFS_FWSTATS_FILE(rx, hw_stuck, "%u");
37WL12XX_DEBUGFS_FWSTATS_FILE(rx, dropped, "%u");
38WL12XX_DEBUGFS_FWSTATS_FILE(rx, fcs_err, "%u");
39WL12XX_DEBUGFS_FWSTATS_FILE(rx, xfr_hint_trig, "%u");
40WL12XX_DEBUGFS_FWSTATS_FILE(rx, path_reset, "%u");
41WL12XX_DEBUGFS_FWSTATS_FILE(rx, reset_counter, "%u");
42
43WL12XX_DEBUGFS_FWSTATS_FILE(dma, rx_requested, "%u");
44WL12XX_DEBUGFS_FWSTATS_FILE(dma, rx_errors, "%u");
45WL12XX_DEBUGFS_FWSTATS_FILE(dma, tx_requested, "%u");
46WL12XX_DEBUGFS_FWSTATS_FILE(dma, tx_errors, "%u");
47
48WL12XX_DEBUGFS_FWSTATS_FILE(isr, cmd_cmplt, "%u");
49WL12XX_DEBUGFS_FWSTATS_FILE(isr, fiqs, "%u");
50WL12XX_DEBUGFS_FWSTATS_FILE(isr, rx_headers, "%u");
51WL12XX_DEBUGFS_FWSTATS_FILE(isr, rx_mem_overflow, "%u");
52WL12XX_DEBUGFS_FWSTATS_FILE(isr, rx_rdys, "%u");
53WL12XX_DEBUGFS_FWSTATS_FILE(isr, irqs, "%u");
54WL12XX_DEBUGFS_FWSTATS_FILE(isr, tx_procs, "%u");
55WL12XX_DEBUGFS_FWSTATS_FILE(isr, decrypt_done, "%u");
56WL12XX_DEBUGFS_FWSTATS_FILE(isr, dma0_done, "%u");
57WL12XX_DEBUGFS_FWSTATS_FILE(isr, dma1_done, "%u");
58WL12XX_DEBUGFS_FWSTATS_FILE(isr, tx_exch_complete, "%u");
59WL12XX_DEBUGFS_FWSTATS_FILE(isr, commands, "%u");
60WL12XX_DEBUGFS_FWSTATS_FILE(isr, rx_procs, "%u");
61WL12XX_DEBUGFS_FWSTATS_FILE(isr, hw_pm_mode_changes, "%u");
62WL12XX_DEBUGFS_FWSTATS_FILE(isr, host_acknowledges, "%u");
63WL12XX_DEBUGFS_FWSTATS_FILE(isr, pci_pm, "%u");
64WL12XX_DEBUGFS_FWSTATS_FILE(isr, wakeups, "%u");
65WL12XX_DEBUGFS_FWSTATS_FILE(isr, low_rssi, "%u");
66
67WL12XX_DEBUGFS_FWSTATS_FILE(wep, addr_key_count, "%u");
68WL12XX_DEBUGFS_FWSTATS_FILE(wep, default_key_count, "%u");
69/* skipping wep.reserved */
70WL12XX_DEBUGFS_FWSTATS_FILE(wep, key_not_found, "%u");
71WL12XX_DEBUGFS_FWSTATS_FILE(wep, decrypt_fail, "%u");
72WL12XX_DEBUGFS_FWSTATS_FILE(wep, packets, "%u");
73WL12XX_DEBUGFS_FWSTATS_FILE(wep, interrupt, "%u");
74
75WL12XX_DEBUGFS_FWSTATS_FILE(pwr, ps_enter, "%u");
76WL12XX_DEBUGFS_FWSTATS_FILE(pwr, elp_enter, "%u");
77WL12XX_DEBUGFS_FWSTATS_FILE(pwr, missing_bcns, "%u");
78WL12XX_DEBUGFS_FWSTATS_FILE(pwr, wake_on_host, "%u");
79WL12XX_DEBUGFS_FWSTATS_FILE(pwr, wake_on_timer_exp, "%u");
80WL12XX_DEBUGFS_FWSTATS_FILE(pwr, tx_with_ps, "%u");
81WL12XX_DEBUGFS_FWSTATS_FILE(pwr, tx_without_ps, "%u");
82WL12XX_DEBUGFS_FWSTATS_FILE(pwr, rcvd_beacons, "%u");
83WL12XX_DEBUGFS_FWSTATS_FILE(pwr, power_save_off, "%u");
84WL12XX_DEBUGFS_FWSTATS_FILE(pwr, enable_ps, "%u");
85WL12XX_DEBUGFS_FWSTATS_FILE(pwr, disable_ps, "%u");
86WL12XX_DEBUGFS_FWSTATS_FILE(pwr, fix_tsf_ps, "%u");
87/* skipping cont_miss_bcns_spread for now */
88WL12XX_DEBUGFS_FWSTATS_FILE(pwr, rcvd_awake_beacons, "%u");
89
90WL12XX_DEBUGFS_FWSTATS_FILE(mic, rx_pkts, "%u");
91WL12XX_DEBUGFS_FWSTATS_FILE(mic, calc_failure, "%u");
92
93WL12XX_DEBUGFS_FWSTATS_FILE(aes, encrypt_fail, "%u");
94WL12XX_DEBUGFS_FWSTATS_FILE(aes, decrypt_fail, "%u");
95WL12XX_DEBUGFS_FWSTATS_FILE(aes, encrypt_packets, "%u");
96WL12XX_DEBUGFS_FWSTATS_FILE(aes, decrypt_packets, "%u");
97WL12XX_DEBUGFS_FWSTATS_FILE(aes, encrypt_interrupt, "%u");
98WL12XX_DEBUGFS_FWSTATS_FILE(aes, decrypt_interrupt, "%u");
99
100WL12XX_DEBUGFS_FWSTATS_FILE(event, heart_beat, "%u");
101WL12XX_DEBUGFS_FWSTATS_FILE(event, calibration, "%u");
102WL12XX_DEBUGFS_FWSTATS_FILE(event, rx_mismatch, "%u");
103WL12XX_DEBUGFS_FWSTATS_FILE(event, rx_mem_empty, "%u");
104WL12XX_DEBUGFS_FWSTATS_FILE(event, rx_pool, "%u");
105WL12XX_DEBUGFS_FWSTATS_FILE(event, oom_late, "%u");
106WL12XX_DEBUGFS_FWSTATS_FILE(event, phy_transmit_error, "%u");
107WL12XX_DEBUGFS_FWSTATS_FILE(event, tx_stuck, "%u");
108
109WL12XX_DEBUGFS_FWSTATS_FILE(ps, pspoll_timeouts, "%u");
110WL12XX_DEBUGFS_FWSTATS_FILE(ps, upsd_timeouts, "%u");
111WL12XX_DEBUGFS_FWSTATS_FILE(ps, upsd_max_sptime, "%u");
112WL12XX_DEBUGFS_FWSTATS_FILE(ps, upsd_max_apturn, "%u");
113WL12XX_DEBUGFS_FWSTATS_FILE(ps, pspoll_max_apturn, "%u");
114WL12XX_DEBUGFS_FWSTATS_FILE(ps, pspoll_utilization, "%u");
115WL12XX_DEBUGFS_FWSTATS_FILE(ps, upsd_utilization, "%u");
116
117WL12XX_DEBUGFS_FWSTATS_FILE(rxpipe, rx_prep_beacon_drop, "%u");
118WL12XX_DEBUGFS_FWSTATS_FILE(rxpipe, descr_host_int_trig_rx_data, "%u");
119WL12XX_DEBUGFS_FWSTATS_FILE(rxpipe, beacon_buffer_thres_host_int_trig_rx_data,
120 "%u");
121WL12XX_DEBUGFS_FWSTATS_FILE(rxpipe, missed_beacon_host_int_trig_rx_data, "%u");
122WL12XX_DEBUGFS_FWSTATS_FILE(rxpipe, tx_xfr_host_int_trig_rx_data, "%u");
123
124int wl12xx_debugfs_add_files(struct wl1271 *wl,
125 struct dentry *rootdir)
126{
127 int ret = 0;
128 struct dentry *entry, *stats;
129
130 stats = debugfs_create_dir("wl12xx_fw_stats", rootdir);
131 if (!stats || IS_ERR(stats)) {
132 entry = stats;
133 goto err;
134 }
135
136 DEBUGFS_FWSTATS_ADD(tx, internal_desc_overflow);
137
138 DEBUGFS_FWSTATS_ADD(rx, out_of_mem);
139 DEBUGFS_FWSTATS_ADD(rx, hdr_overflow);
140 DEBUGFS_FWSTATS_ADD(rx, hw_stuck);
141 DEBUGFS_FWSTATS_ADD(rx, dropped);
142 DEBUGFS_FWSTATS_ADD(rx, fcs_err);
143 DEBUGFS_FWSTATS_ADD(rx, xfr_hint_trig);
144 DEBUGFS_FWSTATS_ADD(rx, path_reset);
145 DEBUGFS_FWSTATS_ADD(rx, reset_counter);
146
147 DEBUGFS_FWSTATS_ADD(dma, rx_requested);
148 DEBUGFS_FWSTATS_ADD(dma, rx_errors);
149 DEBUGFS_FWSTATS_ADD(dma, tx_requested);
150 DEBUGFS_FWSTATS_ADD(dma, tx_errors);
151
152 DEBUGFS_FWSTATS_ADD(isr, cmd_cmplt);
153 DEBUGFS_FWSTATS_ADD(isr, fiqs);
154 DEBUGFS_FWSTATS_ADD(isr, rx_headers);
155 DEBUGFS_FWSTATS_ADD(isr, rx_mem_overflow);
156 DEBUGFS_FWSTATS_ADD(isr, rx_rdys);
157 DEBUGFS_FWSTATS_ADD(isr, irqs);
158 DEBUGFS_FWSTATS_ADD(isr, tx_procs);
159 DEBUGFS_FWSTATS_ADD(isr, decrypt_done);
160 DEBUGFS_FWSTATS_ADD(isr, dma0_done);
161 DEBUGFS_FWSTATS_ADD(isr, dma1_done);
162 DEBUGFS_FWSTATS_ADD(isr, tx_exch_complete);
163 DEBUGFS_FWSTATS_ADD(isr, commands);
164 DEBUGFS_FWSTATS_ADD(isr, rx_procs);
165 DEBUGFS_FWSTATS_ADD(isr, hw_pm_mode_changes);
166 DEBUGFS_FWSTATS_ADD(isr, host_acknowledges);
167 DEBUGFS_FWSTATS_ADD(isr, pci_pm);
168 DEBUGFS_FWSTATS_ADD(isr, wakeups);
169 DEBUGFS_FWSTATS_ADD(isr, low_rssi);
170
171 DEBUGFS_FWSTATS_ADD(wep, addr_key_count);
172 DEBUGFS_FWSTATS_ADD(wep, default_key_count);
173 /* skipping wep.reserved */
174 DEBUGFS_FWSTATS_ADD(wep, key_not_found);
175 DEBUGFS_FWSTATS_ADD(wep, decrypt_fail);
176 DEBUGFS_FWSTATS_ADD(wep, packets);
177 DEBUGFS_FWSTATS_ADD(wep, interrupt);
178
179 DEBUGFS_FWSTATS_ADD(pwr, ps_enter);
180 DEBUGFS_FWSTATS_ADD(pwr, elp_enter);
181 DEBUGFS_FWSTATS_ADD(pwr, missing_bcns);
182 DEBUGFS_FWSTATS_ADD(pwr, wake_on_host);
183 DEBUGFS_FWSTATS_ADD(pwr, wake_on_timer_exp);
184 DEBUGFS_FWSTATS_ADD(pwr, tx_with_ps);
185 DEBUGFS_FWSTATS_ADD(pwr, tx_without_ps);
186 DEBUGFS_FWSTATS_ADD(pwr, rcvd_beacons);
187 DEBUGFS_FWSTATS_ADD(pwr, power_save_off);
188 DEBUGFS_FWSTATS_ADD(pwr, enable_ps);
189 DEBUGFS_FWSTATS_ADD(pwr, disable_ps);
190 DEBUGFS_FWSTATS_ADD(pwr, fix_tsf_ps);
191 /* skipping cont_miss_bcns_spread for now */
192 DEBUGFS_FWSTATS_ADD(pwr, rcvd_awake_beacons);
193
194 DEBUGFS_FWSTATS_ADD(mic, rx_pkts);
195 DEBUGFS_FWSTATS_ADD(mic, calc_failure);
196
197 DEBUGFS_FWSTATS_ADD(aes, encrypt_fail);
198 DEBUGFS_FWSTATS_ADD(aes, decrypt_fail);
199 DEBUGFS_FWSTATS_ADD(aes, encrypt_packets);
200 DEBUGFS_FWSTATS_ADD(aes, decrypt_packets);
201 DEBUGFS_FWSTATS_ADD(aes, encrypt_interrupt);
202 DEBUGFS_FWSTATS_ADD(aes, decrypt_interrupt);
203
204 DEBUGFS_FWSTATS_ADD(event, heart_beat);
205 DEBUGFS_FWSTATS_ADD(event, calibration);
206 DEBUGFS_FWSTATS_ADD(event, rx_mismatch);
207 DEBUGFS_FWSTATS_ADD(event, rx_mem_empty);
208 DEBUGFS_FWSTATS_ADD(event, rx_pool);
209 DEBUGFS_FWSTATS_ADD(event, oom_late);
210 DEBUGFS_FWSTATS_ADD(event, phy_transmit_error);
211 DEBUGFS_FWSTATS_ADD(event, tx_stuck);
212
213 DEBUGFS_FWSTATS_ADD(ps, pspoll_timeouts);
214 DEBUGFS_FWSTATS_ADD(ps, upsd_timeouts);
215 DEBUGFS_FWSTATS_ADD(ps, upsd_max_sptime);
216 DEBUGFS_FWSTATS_ADD(ps, upsd_max_apturn);
217 DEBUGFS_FWSTATS_ADD(ps, pspoll_max_apturn);
218 DEBUGFS_FWSTATS_ADD(ps, pspoll_utilization);
219 DEBUGFS_FWSTATS_ADD(ps, upsd_utilization);
220
221 DEBUGFS_FWSTATS_ADD(rxpipe, rx_prep_beacon_drop);
222 DEBUGFS_FWSTATS_ADD(rxpipe, descr_host_int_trig_rx_data);
223 DEBUGFS_FWSTATS_ADD(rxpipe, beacon_buffer_thres_host_int_trig_rx_data);
224 DEBUGFS_FWSTATS_ADD(rxpipe, missed_beacon_host_int_trig_rx_data);
225 DEBUGFS_FWSTATS_ADD(rxpipe, tx_xfr_host_int_trig_rx_data);
226
227 return 0;
228
229err:
230 if (IS_ERR(entry))
231 ret = PTR_ERR(entry);
232 else
233 ret = -ENOMEM;
234
235 return ret;
236}
diff --git a/drivers/net/wireless/ti/wl12xx/debugfs.h b/drivers/net/wireless/ti/wl12xx/debugfs.h
new file mode 100644
index 000000000000..96898e291b78
--- /dev/null
+++ b/drivers/net/wireless/ti/wl12xx/debugfs.h
@@ -0,0 +1,28 @@
1/*
2 * This file is part of wl12xx
3 *
4 * Copyright (C) 2012 Texas Instruments. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 */
21
22#ifndef __WL12XX_DEBUGFS_H__
23#define __WL12XX_DEBUGFS_H__
24
25int wl12xx_debugfs_add_files(struct wl1271 *wl,
26 struct dentry *rootdir);
27
28#endif /* __WL12XX_DEBUGFS_H__ */
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 82e0c6a6ac89..2ac840783551 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -39,6 +39,7 @@
39#include "reg.h" 39#include "reg.h"
40#include "cmd.h" 40#include "cmd.h"
41#include "acx.h" 41#include "acx.h"
42#include "debugfs.h"
42 43
43static char *fref_param; 44static char *fref_param;
44static char *tcxo_param; 45static char *tcxo_param;
@@ -1359,6 +1360,11 @@ out:
1359 return ret; 1360 return ret;
1360} 1361}
1361 1362
1363static int wl12xx_debugfs_init(struct wl1271 *wl, struct dentry *rootdir)
1364{
1365 return wl12xx_debugfs_add_files(wl, rootdir);
1366}
1367
1362static struct wlcore_ops wl12xx_ops = { 1368static struct wlcore_ops wl12xx_ops = {
1363 .identify_chip = wl12xx_identify_chip, 1369 .identify_chip = wl12xx_identify_chip,
1364 .identify_fw = wl12xx_identify_fw, 1370 .identify_fw = wl12xx_identify_fw,
@@ -1381,6 +1387,7 @@ static struct wlcore_ops wl12xx_ops = {
1381 .set_tx_desc_csum = wl12xx_set_tx_desc_csum, 1387 .set_tx_desc_csum = wl12xx_set_tx_desc_csum,
1382 .set_rx_csum = NULL, 1388 .set_rx_csum = NULL,
1383 .ap_get_mimo_wide_rate_mask = NULL, 1389 .ap_get_mimo_wide_rate_mask = NULL,
1390 .debugfs_init = wl12xx_debugfs_init,
1384}; 1391};
1385 1392
1386static struct ieee80211_sta_ht_cap wl12xx_ht_cap = { 1393static struct ieee80211_sta_ht_cap wl12xx_ht_cap = {
@@ -1422,6 +1429,7 @@ static int __devinit wl12xx_probe(struct platform_device *pdev)
1422 wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX; 1429 wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX;
1423 wl->hw_min_ht_rate = WL12XX_CONF_HW_RXTX_RATE_MCS0; 1430 wl->hw_min_ht_rate = WL12XX_CONF_HW_RXTX_RATE_MCS0;
1424 wl->fw_status_priv_len = 0; 1431 wl->fw_status_priv_len = 0;
1432 wl->stats.fw_stats_len = sizeof(struct wl12xx_acx_statistics);
1425 memcpy(&wl->ht_cap, &wl12xx_ht_cap, sizeof(wl12xx_ht_cap)); 1433 memcpy(&wl->ht_cap, &wl12xx_ht_cap, sizeof(wl12xx_ht_cap));
1426 wl12xx_conf_init(wl); 1434 wl12xx_conf_init(wl);
1427 1435