18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * DebugFS code for ST-Ericsson CW1200 mac80211 driver 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (c) 2011, ST-Ericsson 68c2ecf20Sopenharmony_ci * Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no> 78c2ecf20Sopenharmony_ci */ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#ifndef CW1200_DEBUG_H_INCLUDED 108c2ecf20Sopenharmony_ci#define CW1200_DEBUG_H_INCLUDED 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_cistruct cw1200_debug_priv { 138c2ecf20Sopenharmony_ci struct dentry *debugfs_phy; 148c2ecf20Sopenharmony_ci int tx; 158c2ecf20Sopenharmony_ci int tx_agg; 168c2ecf20Sopenharmony_ci int rx; 178c2ecf20Sopenharmony_ci int rx_agg; 188c2ecf20Sopenharmony_ci int tx_multi; 198c2ecf20Sopenharmony_ci int tx_multi_frames; 208c2ecf20Sopenharmony_ci int tx_cache_miss; 218c2ecf20Sopenharmony_ci int tx_align; 228c2ecf20Sopenharmony_ci int tx_ttl; 238c2ecf20Sopenharmony_ci int tx_burst; 248c2ecf20Sopenharmony_ci int ba_cnt; 258c2ecf20Sopenharmony_ci int ba_acc; 268c2ecf20Sopenharmony_ci int ba_cnt_rx; 278c2ecf20Sopenharmony_ci int ba_acc_rx; 288c2ecf20Sopenharmony_ci}; 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ciint cw1200_debug_init(struct cw1200_common *priv); 318c2ecf20Sopenharmony_civoid cw1200_debug_release(struct cw1200_common *priv); 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_cistatic inline void cw1200_debug_txed(struct cw1200_common *priv) 348c2ecf20Sopenharmony_ci{ 358c2ecf20Sopenharmony_ci ++priv->debug->tx; 368c2ecf20Sopenharmony_ci} 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_cistatic inline void cw1200_debug_txed_agg(struct cw1200_common *priv) 398c2ecf20Sopenharmony_ci{ 408c2ecf20Sopenharmony_ci ++priv->debug->tx_agg; 418c2ecf20Sopenharmony_ci} 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_cistatic inline void cw1200_debug_txed_multi(struct cw1200_common *priv, 448c2ecf20Sopenharmony_ci int count) 458c2ecf20Sopenharmony_ci{ 468c2ecf20Sopenharmony_ci ++priv->debug->tx_multi; 478c2ecf20Sopenharmony_ci priv->debug->tx_multi_frames += count; 488c2ecf20Sopenharmony_ci} 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_cistatic inline void cw1200_debug_rxed(struct cw1200_common *priv) 518c2ecf20Sopenharmony_ci{ 528c2ecf20Sopenharmony_ci ++priv->debug->rx; 538c2ecf20Sopenharmony_ci} 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_cistatic inline void cw1200_debug_rxed_agg(struct cw1200_common *priv) 568c2ecf20Sopenharmony_ci{ 578c2ecf20Sopenharmony_ci ++priv->debug->rx_agg; 588c2ecf20Sopenharmony_ci} 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_cistatic inline void cw1200_debug_tx_cache_miss(struct cw1200_common *priv) 618c2ecf20Sopenharmony_ci{ 628c2ecf20Sopenharmony_ci ++priv->debug->tx_cache_miss; 638c2ecf20Sopenharmony_ci} 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_cistatic inline void cw1200_debug_tx_align(struct cw1200_common *priv) 668c2ecf20Sopenharmony_ci{ 678c2ecf20Sopenharmony_ci ++priv->debug->tx_align; 688c2ecf20Sopenharmony_ci} 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_cistatic inline void cw1200_debug_tx_ttl(struct cw1200_common *priv) 718c2ecf20Sopenharmony_ci{ 728c2ecf20Sopenharmony_ci ++priv->debug->tx_ttl; 738c2ecf20Sopenharmony_ci} 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_cistatic inline void cw1200_debug_tx_burst(struct cw1200_common *priv) 768c2ecf20Sopenharmony_ci{ 778c2ecf20Sopenharmony_ci ++priv->debug->tx_burst; 788c2ecf20Sopenharmony_ci} 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_cistatic inline void cw1200_debug_ba(struct cw1200_common *priv, 818c2ecf20Sopenharmony_ci int ba_cnt, int ba_acc, 828c2ecf20Sopenharmony_ci int ba_cnt_rx, int ba_acc_rx) 838c2ecf20Sopenharmony_ci{ 848c2ecf20Sopenharmony_ci priv->debug->ba_cnt = ba_cnt; 858c2ecf20Sopenharmony_ci priv->debug->ba_acc = ba_acc; 868c2ecf20Sopenharmony_ci priv->debug->ba_cnt_rx = ba_cnt_rx; 878c2ecf20Sopenharmony_ci priv->debug->ba_acc_rx = ba_acc_rx; 888c2ecf20Sopenharmony_ci} 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ci#endif /* CW1200_DEBUG_H_INCLUDED */ 91