qcacmn: Support PDEV CP Stats for DA
Add change to define pdev cp stats structure for DA and provide APIs to get/set cp stats Change-Id: Ib46d8b55b4c38b2c7a9e2bea45977de23ad21939
This commit is contained in:
committed by
nshrivas
parent
cabd46d044
commit
3ca68af4ff
@@ -184,12 +184,80 @@ struct pdev_80211_stats {
|
||||
struct pdev_hw_stats hw_stats;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct lmac_pdev_80211_stats - control plane stats at pdev
|
||||
*
|
||||
* the same statistics were earlier maintained with a reference to
|
||||
* ath_stats structure, now the same structure will be
|
||||
* used as interface structure with user space application
|
||||
*
|
||||
* @cs_ast_reset_on_error: resets on error
|
||||
* @cs_ast_hardware: fatal hardware error interrupts
|
||||
* @cs_ast_halresets: HAL resets
|
||||
* @cs_ast_bmiss: beacon miss interrupts
|
||||
* @cs_ast_brssi: beacon rssi threshold interrupts
|
||||
* @cs_ast_tx_fifoerr: management frames transmitted
|
||||
* @cs_ast_tx_filtered: tx failed 'cuz xmit filtered
|
||||
* @cs_ast_tx_noack: tx frames with no ack marked
|
||||
* @cs_ast_tx_shortpre: tx frames with short preamble
|
||||
* @cs_ast_tx_altrate: tx frames with alternate rate
|
||||
* @cs_ast_tx_protect: tx frames with protection
|
||||
* @cs_ast_rx_nobuf: rx setup failed 'cuz no skbuff
|
||||
* @cs_ast_rx_hal_in_progress: rx hal in progress
|
||||
* @cs_ast_rx_num_unknown: rx num unknown
|
||||
* @cs_ast_per_cal: periodic calibration calls
|
||||
* @cs_ast_per_calfai: periodic calibration failed
|
||||
* @cs_ast_per_rfgain: periodic calibration rfgain reset
|
||||
* @cs_ast_ant_defswitch: rx/default antenna switches
|
||||
* @cs_ast_bb_hang: BB hang detected
|
||||
* @cs_ast_mac_hang: MAC hang detected
|
||||
* @cs_ast_wow_wakeups: count of hibernate and standby wakeups
|
||||
* @cs_ast_wow_wakeupsok: count of wakeups thru WoW
|
||||
* @cs_ast_cfend_sched: count of CF-END frames scheduled
|
||||
* @cs_ast_cfend_sent: count of CF-END frames sent
|
||||
* @cs_ast_noise_floor: noise floor
|
||||
*/
|
||||
|
||||
struct lmac_pdev_80211_stats {
|
||||
uint32_t cs_ast_reset_on_error;
|
||||
uint32_t cs_ast_hardware;
|
||||
uint32_t cs_ast_halresets;
|
||||
uint32_t cs_ast_bmiss;
|
||||
uint32_t cs_ast_brssi;
|
||||
uint32_t cs_ast_tx_fifoerr;
|
||||
uint32_t cs_ast_tx_filtered;
|
||||
uint32_t cs_ast_tx_noack;
|
||||
uint32_t cs_ast_tx_shortpre;
|
||||
uint32_t cs_ast_tx_altrate;
|
||||
uint32_t cs_ast_tx_protect;
|
||||
uint32_t cs_ast_rx_nobuf;
|
||||
uint32_t cs_ast_rx_hal_in_progress;
|
||||
uint32_t cs_ast_rx_num_unknown;
|
||||
uint32_t cs_ast_per_cal;
|
||||
uint32_t cs_ast_per_calfail;
|
||||
uint32_t cs_ast_per_rfgain;
|
||||
uint32_t cs_ast_ant_defswitch;
|
||||
uint32_t cs_ast_bb_hang;
|
||||
uint32_t cs_ast_mac_hang;
|
||||
#ifdef ATH_WOW
|
||||
uint32_t cs_ast_wow_wakeups;
|
||||
uint32_t cs_ast_wow_wakeupsok;
|
||||
#endif
|
||||
#ifdef ATH_SUPPORT_CFEND
|
||||
uint32_t cs_ast_cfend_sched;
|
||||
uint32_t cs_ast_cfend_sent;
|
||||
#endif
|
||||
int16_t cs_ast_noise_floor;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct pdev_ic_cp_stats - control plane stats specific to WIN at pdev
|
||||
* @stats: 80211 stats
|
||||
* @lmac_stats: lmac 80211 stats
|
||||
*/
|
||||
struct pdev_ic_cp_stats {
|
||||
struct pdev_80211_stats stats;
|
||||
struct lmac_pdev_80211_stats lmac_stats;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -148,6 +148,8 @@ UCFG_PDEV_CP_STATS_SET_FUNCS(obss_util);
|
||||
return 0; \
|
||||
}
|
||||
|
||||
UCFG_PDEV_CP_STATS_GET_FUNCS(tx_mgmt);
|
||||
UCFG_PDEV_CP_STATS_GET_FUNCS(rx_num_mgmt);
|
||||
UCFG_PDEV_CP_STATS_GET_FUNCS(ap_stats_tx_cal_enable);
|
||||
UCFG_PDEV_CP_STATS_GET_FUNCS(wmi_tx_mgmt);
|
||||
UCFG_PDEV_CP_STATS_GET_FUNCS(wmi_tx_mgmt_completions);
|
||||
@@ -165,6 +167,104 @@ static inline void ucfg_pdev_cp_stats_reset(struct wlan_objmgr_pdev *_pdev)
|
||||
qdf_mem_zero(pdev_cps->pdev_stats, sizeof(struct pdev_ic_cp_stats));
|
||||
}
|
||||
|
||||
#define UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(field) \
|
||||
static inline void \
|
||||
ucfg_pdev_lmac_cp_stats_##field##_inc(struct wlan_objmgr_pdev *_pdev, \
|
||||
uint64_t _val) \
|
||||
{ \
|
||||
struct pdev_cp_stats *_pdev_cs = \
|
||||
wlan_cp_stats_get_pdev_stats_obj(_pdev); \
|
||||
if (_pdev_cs) { \
|
||||
struct pdev_ic_cp_stats *_pdev_ics = \
|
||||
_pdev_cs->pdev_stats; \
|
||||
if (_pdev_ics) { \
|
||||
_pdev_ics->lmac_stats.cs_##field += _val;\
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
static inline void \
|
||||
ucfg_pdev_lmac_cp_stats_##field##_dec(struct wlan_objmgr_pdev *_pdev, \
|
||||
uint64_t _val) \
|
||||
{ \
|
||||
struct pdev_cp_stats *_pdev_cs = \
|
||||
wlan_cp_stats_get_pdev_stats_obj(_pdev); \
|
||||
if (_pdev_cs) { \
|
||||
struct pdev_ic_cp_stats *_pdev_ics = \
|
||||
_pdev_cs->pdev_stats; \
|
||||
if (_pdev_ics) { \
|
||||
_pdev_ics->lmac_stats.cs_##field -= _val;\
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
static inline void \
|
||||
ucfg_pdev_lmac_cp_stats_##field##_update( \
|
||||
struct wlan_objmgr_pdev *_pdev, uint64_t _val) \
|
||||
{ \
|
||||
struct pdev_cp_stats *_pdev_cs = \
|
||||
wlan_cp_stats_get_pdev_stats_obj(_pdev); \
|
||||
if (_pdev_cs) { \
|
||||
struct pdev_ic_cp_stats *_pdev_ics = \
|
||||
_pdev_cs->pdev_stats; \
|
||||
if (_pdev_ics) { \
|
||||
_pdev_ics->lmac_stats.cs_##field = _val;\
|
||||
} \
|
||||
} \
|
||||
}
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_reset_on_error);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_hardware);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_halresets);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_bmiss);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_brssi);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_tx_fifoerr);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_tx_filtered);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_tx_noack);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_tx_shortpre);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_tx_altrate);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_tx_protect);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_rx_nobuf);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_rx_hal_in_progress);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_rx_num_unknown);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_per_cal);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_per_calfail);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_per_rfgain);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_ant_defswitch);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_bb_hang);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_mac_hang);
|
||||
#ifdef ATH_WOW
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_wow_wakeups);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_wow_wakeupsok);
|
||||
#endif
|
||||
#ifdef ATH_SUPPORT_CFEND
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_cfend_sched);
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_cfend_sent);
|
||||
#endif
|
||||
UCFG_PDEV_LMAC_CP_STATS_SET_FUNCS(ast_noise_floor);
|
||||
|
||||
#define UCFG_PDEV_LMAC_CP_STATS_GET_FUNCS(field) \
|
||||
static inline uint64_t \
|
||||
ucfg_pdev_lmac_cp_stats_##field##_get(struct wlan_objmgr_pdev *_pdev) \
|
||||
{ \
|
||||
struct pdev_cp_stats *_pdev_cs = \
|
||||
wlan_cp_stats_get_pdev_stats_obj(_pdev); \
|
||||
struct pdev_ic_cp_stats *_pdev_ics; \
|
||||
uint64_t stat = 0; \
|
||||
if (_pdev_cs) { \
|
||||
wlan_cp_stats_pdev_obj_lock(_pdev_cs); \
|
||||
_pdev_ics = _pdev_cs->pdev_stats; \
|
||||
if (_pdev_ics) { \
|
||||
stat = _pdev_ics->lmac_stats.cs_##field; \
|
||||
} \
|
||||
wlan_cp_stats_pdev_obj_unlock(_pdev_cs); \
|
||||
return stat; \
|
||||
} \
|
||||
else \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
UCFG_PDEV_LMAC_CP_STATS_GET_FUNCS(ast_tx_fifoerr);
|
||||
UCFG_PDEV_LMAC_CP_STATS_GET_FUNCS(ast_tx_filtered);
|
||||
UCFG_PDEV_LMAC_CP_STATS_GET_FUNCS(ast_noise_floor);
|
||||
|
||||
#define UCFG_VDEV_CP_STATS_SET_FUNCS(field) \
|
||||
static inline void \
|
||||
ucfg_vdev_cp_stats_##field##_inc(struct wlan_objmgr_vdev *_vdev, \
|
||||
|
@@ -362,6 +362,8 @@ PDEV_CP_STATS_SET_FUNCS(obss_util);
|
||||
return ucfg_pdev_cp_stats_##field##_get(_pdev); \
|
||||
}
|
||||
|
||||
PDEV_CP_STATS_GET_FUNCS(tx_mgmt);
|
||||
PDEV_CP_STATS_GET_FUNCS(rx_num_mgmt);
|
||||
PDEV_CP_STATS_GET_FUNCS(ap_stats_tx_cal_enable);
|
||||
PDEV_CP_STATS_GET_FUNCS(wmi_tx_mgmt);
|
||||
PDEV_CP_STATS_GET_FUNCS(wmi_tx_mgmt_completions);
|
||||
@@ -373,6 +375,60 @@ static inline void pdev_cp_stats_reset(struct wlan_objmgr_pdev *pdev)
|
||||
ucfg_pdev_cp_stats_reset(pdev);
|
||||
}
|
||||
|
||||
#define PDEV_LMAC_CP_STATS_SET_FUNCS(field) \
|
||||
static inline void \
|
||||
pdev_lmac_cp_stats_##field##_inc(struct wlan_objmgr_pdev *_pdev, \
|
||||
uint64_t _val) \
|
||||
{ \
|
||||
ucfg_pdev_lmac_cp_stats_##field##_inc(_pdev, _val); \
|
||||
} \
|
||||
static inline void \
|
||||
pdev_lmac_cp_stats_##field##_update(struct wlan_objmgr_pdev *_pdev, \
|
||||
uint64_t _val) \
|
||||
{ \
|
||||
ucfg_pdev_lmac_cp_stats_##field##_update(_pdev, _val); \
|
||||
}
|
||||
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_reset_on_error);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_hardware);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_halresets);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_bmiss);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_brssi);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_tx_fifoerr);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_tx_filtered);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_tx_noack);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_tx_shortpre);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_tx_altrate);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_tx_protect);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_rx_nobuf);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_rx_hal_in_progress);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_rx_num_unknown);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_per_cal);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_per_calfail);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_per_rfgain);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_ant_defswitch);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_bb_hang);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_mac_hang);
|
||||
#ifdef ATH_WOW
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_wow_wakeups);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_wow_wakeupsok);
|
||||
#endif
|
||||
#ifdef ATH_SUPPORT_CFEND
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_cfend_sched);
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_cfend_sent);
|
||||
#endif
|
||||
PDEV_LMAC_CP_STATS_SET_FUNCS(ast_noise_floor);
|
||||
|
||||
#define PDEV_LMAC_CP_STATS_GET_FUNCS(field) \
|
||||
static inline uint64_t \
|
||||
pdev_lmac_cp_stats_##field##_get(struct wlan_objmgr_pdev *_pdev) \
|
||||
{ \
|
||||
return ucfg_pdev_lmac_cp_stats_##field##_get(_pdev); \
|
||||
}
|
||||
PDEV_LMAC_CP_STATS_GET_FUNCS(ast_tx_fifoerr);
|
||||
PDEV_LMAC_CP_STATS_GET_FUNCS(ast_tx_filtered);
|
||||
PDEV_LMAC_CP_STATS_GET_FUNCS(ast_noise_floor);
|
||||
|
||||
/**
|
||||
* wlan_get_pdev_cp_stats_ref() - API to reference to pdev cp stats object
|
||||
* @pdev: pointer to pdev object
|
||||
|
Reference in New Issue
Block a user