qcacmn: Register monitor feature ops after mon object initialization

Register monitor dependent feature ops after monitor
object initialization to avoid race condition

Change-Id: Ia7973cdc2660c65f8afb708d251b7a1ec09c573c
CRs-Fixed: 3074789
This commit is contained in:
Jeevan Kukkalli
2021-11-23 21:19:34 +05:30
committed by Madan Koyyalamudi
parent 45be95484a
commit 6057057ee1
4 changed files with 257 additions and 193 deletions

View File

@@ -537,6 +537,7 @@ struct dp_mon_ops {
#ifndef DISABLE_MON_CONFIG
void (*mon_register_intr_ops)(struct dp_soc *soc);
#endif
void (*mon_register_feature_ops)(struct dp_soc *soc);
};
struct dp_mon_soc {
@@ -3251,4 +3252,24 @@ struct dp_mon_ops *dp_mon_ops_get_2_0(void);
struct cdp_mon_ops *dp_mon_cdp_ops_get_2_0(void);
#endif
/**
* dp_mon_register_feature_ops(): Register mon feature ops
* @soc: Datapath soc context
*
* return: void
*/
static inline
void dp_mon_register_feature_ops(struct dp_soc *soc)
{
struct dp_mon_ops *mon_ops = NULL;
mon_ops = dp_mon_ops_get(soc);
if (!mon_ops) {
dp_mon_err("Monitor ops is NULL");
return;
}
if (mon_ops->mon_register_feature_ops)
mon_ops->mon_register_feature_ops(soc);
}
#endif /* _DP_MON_H_ */