Преглед изворни кода

qcacmn: Add WMI service support for WSI stats info

This change adds service bit support for WSI stats
to FW

Change-Id: I06119c2196b951393e8bbbb82bd4a10436207d63
CRs-Fixed: 3601765
Srinivas Pitla пре 1 година
родитељ
комит
734c9fcae7

+ 25 - 0
target_if/init_deinit/src/init_event_handler.c

@@ -224,6 +224,9 @@ static inline void init_deinit_update_tdls_caps(struct wmi_unified *wmi_handle,
 						struct wlan_objmgr_psoc *psoc)
 {}
 #endif
+static void
+init_deinit_pdev_wsi_stats_info_support(struct wmi_unified *wmi_handle,
+					struct wlan_objmgr_psoc *psoc);
 
 static void init_deinit_mlo_tsf_sync_support(struct wmi_unified *wmi_handle,
 					     struct wlan_objmgr_psoc *psoc);
@@ -384,6 +387,8 @@ static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle,
 	init_deinit_update_wifi_pos_caps(wmi_handle, psoc);
 	init_deinit_update_tdls_caps(wmi_handle, psoc);
 
+	init_deinit_pdev_wsi_stats_info_support(wmi_handle, psoc);
+
 	init_deinit_mlo_tsf_sync_support(wmi_handle, psoc);
 
 	/* override derived value, if it exceeds max peer count */
@@ -879,6 +884,22 @@ static void init_deinit_mlo_update_pdev_ready(struct wlan_objmgr_psoc *psoc,
 				     NULL, 0, WLAN_INIT_DEINIT_ID);
 }
 
+static void
+init_deinit_pdev_wsi_stats_info_support(struct wmi_unified *wmi_handle,
+					struct wlan_objmgr_psoc *psoc)
+{
+	bool wsi_stats_info_support = false;
+
+	if (!init_deinit_mlo_capable(psoc))
+		return;
+
+	if (wmi_service_enabled(wmi_handle,
+				wmi_service_pdev_wsi_stats_info_support))
+		wsi_stats_info_support = true;
+
+	mlo_update_wsi_stats_info_support(psoc, wsi_stats_info_support);
+}
+
 static void init_deinit_mlo_tsf_sync_support(struct wmi_unified *wmi_handle,
 					     struct wlan_objmgr_psoc *psoc)
 {
@@ -899,6 +920,10 @@ static void init_deinit_mlo_update_soc_ready(struct wlan_objmgr_psoc *psoc)
 static void init_deinit_mlo_update_pdev_ready(struct wlan_objmgr_psoc *psoc,
 					      uint8_t num_radios)
 {}
+static void
+init_deinit_pdev_wsi_stats_info_support(struct wmi_unified *wmi_handle,
+					struct wlan_objmgr_psoc *psoc)
+{}
 static void init_deinit_mlo_tsf_sync_support(struct wmi_unified *wmi_handle,
 					     struct wlan_objmgr_psoc *psoc)
 {}

+ 2 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h

@@ -172,6 +172,7 @@ struct mlo_chip_info {
  * @dp_handle: pointer to DP ML context
  * @chip_info: chip specific info of the soc
  * @tsf_sync_enabled: MLO TSF sync is enabled at FW or not
+ * @wsi_stats_info_support: WSI stats support at FW or not
  */
 struct mlo_setup_info {
 	uint8_t ml_grp_id;
@@ -192,6 +193,7 @@ struct mlo_setup_info {
 	struct cdp_mlo_ctxt *dp_handle;
 	struct mlo_chip_info chip_info;
 	bool tsf_sync_enabled;
+	uint8_t wsi_stats_info_support;
 };
 
 /**

+ 27 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_setup.h

@@ -239,6 +239,27 @@ QDF_STATUS mlo_check_all_pdev_state(struct wlan_objmgr_psoc *psoc,
 				    uint8_t grp_id,
 				    enum MLO_LINK_STATE state);
 
+/**
+ * mlo_update_wsi_stats_info_support() - API to update WSI stats info
+ *					 support
+ * @psoc: Pointer to psoc object
+ * @wsi_stats_info_support: Indicates WSI stats info is to be enabled or not
+ *
+ * Return: None
+ */
+void mlo_update_wsi_stats_info_support(struct wlan_objmgr_psoc *psoc,
+				       bool wsi_stats_info_support);
+
+/**
+ * mlo_get_wsi_stats_info_support() - API to get whether WSI stats info
+ *                                    support
+ * @psoc: Pointer to psoc object
+ *
+ * Return: 1 enable
+ *	   0 disable
+ */
+uint8_t mlo_get_wsi_stats_info_support(struct wlan_objmgr_psoc *psoc);
+
 /**
  * mlo_update_tsf_sync_support() - API to update TSF sync support per MLO
  *				   group.
@@ -291,6 +312,12 @@ bool mlo_psoc_get_grp_id(struct wlan_objmgr_psoc *psoc, uint8_t *grp_id)
 	return 0;
 }
 
+static inline
+void init_deinit_pdev_wsi_stats_info_support(struct wlan_objmgr_psoc *psoc,
+					     bool wsi_stats_info_support)
+{
+}
+
 static inline
 void mlo_update_tsf_sync_support(struct wlan_objmgr_psoc *psoc,
 				 bool tsf_sync_enab)

+ 8 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_peer.c

@@ -2461,6 +2461,7 @@ wlan_mlo_peer_wsi_link_update(struct wlan_mlo_peer_context *ml_peer, bool add)
 	uint32_t prim_psoc_ix_grp, sec_psoc_ix_grp;
 	uint32_t i, j;
 	struct mlo_wsi_psoc_grp *mlo_psoc_grp;
+	struct wlan_objmgr_psoc *psoc;
 
 	/* Check if ml_peer is valid */
 	if (!ml_peer) {
@@ -2501,6 +2502,13 @@ wlan_mlo_peer_wsi_link_update(struct wlan_mlo_peer_context *ml_peer, bool add)
 			continue;
 		}
 
+		psoc = wlan_peer_get_psoc(peer_entry->link_peer);
+		if (!mlo_get_wsi_stats_info_support(psoc)) {
+			mlo_info("WSI stats support is not enabled on psoc %d",
+				 wlan_psoc_get_id(psoc));
+			return QDF_STATUS_E_INVAL;
+		}
+
 		/*
 		 * Consider all non-primary peers as secondary links.
 		 * Additionally, consider all active peers as secondary link if

+ 45 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_setup.c

@@ -476,6 +476,8 @@ void mlo_setup_init(uint8_t total_grp)
 	mlo_ctx->setup_info[0].ml_grp_id = 0;
 	for (id = 0; id < total_grp; id++) {
 		mlo_ctx->setup_info[id].tsf_sync_enabled = true;
+		mlo_ctx->setup_info[id].wsi_stats_info_support = 0xff;
+
 		if (qdf_event_create(&mlo_ctx->setup_info[id].event) !=
 							QDF_STATUS_SUCCESS)
 			mlo_err("Unable to create teardown event");
@@ -1144,6 +1146,49 @@ QDF_STATUS mlo_link_teardown_link(struct wlan_objmgr_psoc *psoc,
 
 qdf_export_symbol(mlo_link_teardown_link);
 
+void mlo_update_wsi_stats_info_support(struct wlan_objmgr_psoc *psoc,
+				       bool wsi_stats_info_support)
+{
+	uint8_t ml_grp_id;
+	struct mlo_mgr_context *mlo_ctx = wlan_objmgr_get_mlo_ctx();
+	struct mlo_setup_info *mlo_setup;
+
+	ml_grp_id = wlan_mlo_get_psoc_group_id(psoc);
+	if ((ml_grp_id ==  WLAN_MLO_GROUP_INVALID) ||
+	    (ml_grp_id < 0)) {
+		mlo_err("Invalid ML Grp ID %d", ml_grp_id);
+		return;
+	}
+
+	mlo_setup = &mlo_ctx->setup_info[ml_grp_id];
+	if (mlo_setup->wsi_stats_info_support == 0xFF)
+		mlo_setup->wsi_stats_info_support = wsi_stats_info_support;
+	else
+		mlo_setup->wsi_stats_info_support &= wsi_stats_info_support;
+}
+
+qdf_export_symbol(mlo_update_wsi_stats_info_support);
+
+uint8_t mlo_get_wsi_stats_info_support(struct wlan_objmgr_psoc *psoc)
+{
+	uint8_t ml_grp_id;
+	struct mlo_mgr_context *mlo_ctx = wlan_objmgr_get_mlo_ctx();
+	struct mlo_setup_info *mlo_setup;
+
+	ml_grp_id = wlan_mlo_get_psoc_group_id(psoc);
+	if ((ml_grp_id ==  WLAN_MLO_GROUP_INVALID) ||
+	    (ml_grp_id < 0)) {
+		mlo_err("Invalid ML Grp ID %d", ml_grp_id);
+		return 0;
+	}
+
+	mlo_setup = &mlo_ctx->setup_info[ml_grp_id];
+	if (mlo_setup->wsi_stats_info_support == 0xFF)
+		return 0;
+
+	return mlo_setup->wsi_stats_info_support;
+}
+
 void mlo_update_tsf_sync_support(struct wlan_objmgr_psoc *psoc,
 				 bool tsf_sync_enab)
 {

+ 1 - 0
wmi/inc/wmi_unified_param.h

@@ -6440,6 +6440,7 @@ typedef enum {
 	wmi_service_mlo_tsf_sync,
 	wmi_service_n_link_mlo_support,
 	wmi_service_per_link_stats_support,
+	wmi_service_pdev_wsi_stats_info_support,
 #endif
 	wmi_service_aux_mac_support,
 #ifdef WLAN_ATF_INCREASED_STA

+ 2 - 0
wmi/src/wmi_unified_tlv.c

@@ -22815,6 +22815,8 @@ static void populate_tlv_service(uint32_t *wmi_service)
 			WMI_SERVICE_N_LINK_MLO_SUPPORT;
 	wmi_service[wmi_service_per_link_stats_support] =
 					WMI_SERVICE_PER_LINK_STATS_SUPPORT;
+	wmi_service[wmi_service_pdev_wsi_stats_info_support] =
+			WMI_SERVICE_PDEV_WSI_STATS_INFO_SUPPORT;
 #endif
 	wmi_service[wmi_service_aux_mac_support] = WMI_SERVICE_AUX_MAC_SUPPORT;
 #ifdef WLAN_ATF_INCREASED_STA