18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (c) 2008-2011 Atheros Communications Inc.
38c2ecf20Sopenharmony_ci * Copyright (c) 2011 Neratec Solutions AG
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any
68c2ecf20Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above
78c2ecf20Sopenharmony_ci * copyright notice and this permission notice appear in all copies.
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
108c2ecf20Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
118c2ecf20Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
128c2ecf20Sopenharmony_ci * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
138c2ecf20Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
148c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
158c2ecf20Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
168c2ecf20Sopenharmony_ci */
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#ifndef ATH9K_DFS_DEBUG_H
208c2ecf20Sopenharmony_ci#define ATH9K_DFS_DEBUG_H
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#include "hw.h"
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_cistruct ath_softc;
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci/**
278c2ecf20Sopenharmony_ci * struct ath_dfs_stats - DFS Statistics per wiphy
288c2ecf20Sopenharmony_ci * @pulses_total:     pulses reported by HW
298c2ecf20Sopenharmony_ci * @pulses_no_dfs:    pulses wrongly reported as DFS
308c2ecf20Sopenharmony_ci * @pulses_detected:  pulses detected so far
318c2ecf20Sopenharmony_ci * @datalen_discards: pulses discarded due to invalid datalen
328c2ecf20Sopenharmony_ci * @rssi_discards:    pulses discarded due to invalid RSSI
338c2ecf20Sopenharmony_ci * @bwinfo_discards:  pulses discarded due to invalid BW info
348c2ecf20Sopenharmony_ci * @pri_phy_errors:   pulses reported for primary channel
358c2ecf20Sopenharmony_ci * @ext_phy_errors:   pulses reported for extension channel
368c2ecf20Sopenharmony_ci * @dc_phy_errors:    pulses reported for primary + extension channel
378c2ecf20Sopenharmony_ci * @pulses_processed: pulses forwarded to detector
388c2ecf20Sopenharmony_ci * @radar_detected:   radars detected
398c2ecf20Sopenharmony_ci */
408c2ecf20Sopenharmony_cistruct ath_dfs_stats {
418c2ecf20Sopenharmony_ci	/* pulse stats */
428c2ecf20Sopenharmony_ci	u32 pulses_total;
438c2ecf20Sopenharmony_ci	u32 pulses_no_dfs;
448c2ecf20Sopenharmony_ci	u32 pulses_detected;
458c2ecf20Sopenharmony_ci	u32 datalen_discards;
468c2ecf20Sopenharmony_ci	u32 rssi_discards;
478c2ecf20Sopenharmony_ci	u32 bwinfo_discards;
488c2ecf20Sopenharmony_ci	u32 pri_phy_errors;
498c2ecf20Sopenharmony_ci	u32 ext_phy_errors;
508c2ecf20Sopenharmony_ci	u32 dc_phy_errors;
518c2ecf20Sopenharmony_ci	/* pattern detection stats */
528c2ecf20Sopenharmony_ci	u32 pulses_processed;
538c2ecf20Sopenharmony_ci	u32 radar_detected;
548c2ecf20Sopenharmony_ci};
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci#if defined(CONFIG_ATH9K_DFS_DEBUGFS)
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#define DFS_STAT_INC(sc, c) (sc->debug.stats.dfs_stats.c++)
598c2ecf20Sopenharmony_civoid ath9k_dfs_init_debug(struct ath_softc *sc);
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ciextern struct ath_dfs_pool_stats global_dfs_pool_stats;
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci#else
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#define DFS_STAT_INC(sc, c) do { } while (0)
668c2ecf20Sopenharmony_cistatic inline void ath9k_dfs_init_debug(struct ath_softc *sc) { }
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci#endif /* CONFIG_ATH9K_DFS_DEBUGFS */
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci#endif /* ATH9K_DFS_DEBUG_H */
71