Browse Source

qcacmn: fix ipa mcc scc event notification

Issue is under AP-AP MCC config, mcc event is not sent from wlan
to IPA driver. mcc mode is decided with the help of connection
table. But for AP mode, mcc mode is checked and updated before
connection table is updated by adding the SAP vdev entry.

Fix is to make ipa mcc mode check and notification when connection
table is updated.

Change-Id: I1ba3fcb874b014f05cebd8af90530b9aa54980a2
CRs-Fixed: 2214351
jiad 7 years ago
parent
commit
de2ec73f9b

+ 2 - 0
umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -866,10 +866,12 @@ struct policy_mgr_cdp_cbacks {
  * from policy manager
  * @hdd_disable_lro_in_concurrency: Callback to disable LRO
  * @hdd_set_rx_mode_rps_cb: Callback to set RPS
+ * @hdd_ipa_set_mcc_mode_cb: Callback to set mcc mode for ipa module
  */
 struct policy_mgr_dp_cbacks {
 	void (*hdd_disable_lro_in_concurrency)(bool);
 	void (*hdd_set_rx_mode_rps_cb)(bool);
+	void (*hdd_ipa_set_mcc_mode_cb)(bool);
 };
 
 /**

+ 13 - 0
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c

@@ -552,6 +552,7 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc,
 		bool in_use)
 {
 	struct policy_mgr_psoc_priv_obj *pm_ctx;
+	bool mcc_mode;
 
 	pm_ctx = policy_mgr_get_context(psoc);
 	if (!pm_ctx) {
@@ -564,6 +565,8 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc,
 			conn_index);
 		return;
 	}
+
+	qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
 	pm_conc_connection_list[conn_index].mode = mode;
 	pm_conc_connection_list[conn_index].chan = chan;
 	pm_conc_connection_list[conn_index].bw = bw;
@@ -572,6 +575,7 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc,
 	pm_conc_connection_list[conn_index].original_nss = original_nss;
 	pm_conc_connection_list[conn_index].vdev_id = vdev_id;
 	pm_conc_connection_list[conn_index].in_use = in_use;
+	qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
 
 	if (pm_ctx->mode_change_cb)
 		pm_ctx->mode_change_cb();
@@ -580,6 +584,15 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc,
 	if (pm_ctx->cdp_cbacks.cdp_update_mac_id)
 		pm_ctx->cdp_cbacks.cdp_update_mac_id(psoc, vdev_id, mac);
 
+	/* IPA only cares about STA or SAP mode */
+	if (mode == PM_STA_MODE || mode == PM_SAP_MODE) {
+		qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
+		mcc_mode = policy_mgr_current_concurrency_is_mcc(psoc);
+		qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
+
+		if (pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb)
+			pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb(mcc_mode);
+	}
 }
 
 /**

+ 14 - 0
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -1190,6 +1190,7 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc,
 {
 	struct policy_mgr_psoc_priv_obj *pm_ctx;
 	QDF_STATUS qdf_status;
+	bool mcc_mode;
 
 	pm_ctx = policy_mgr_get_context(psoc);
 	if (!pm_ctx) {
@@ -1248,6 +1249,19 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc,
 
 	policy_mgr_dump_current_concurrency(psoc);
 
+	/*
+	 * Check mode of entry being removed. Update mcc_mode only when STA
+	 * or SAP since IPA only cares about these two
+	 */
+	if (mode == QDF_STA_MODE || mode == QDF_SAP_MODE) {
+		qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
+		mcc_mode = policy_mgr_current_concurrency_is_mcc(psoc);
+		qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
+
+		if (pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb)
+			pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb(mcc_mode);
+	}
+
 	return qdf_status;
 }
 

+ 2 - 0
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c

@@ -649,6 +649,8 @@ QDF_STATUS policy_mgr_register_dp_cb(struct wlan_objmgr_psoc *psoc,
 		dp_cbacks->hdd_disable_lro_in_concurrency;
 	pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb =
 		dp_cbacks->hdd_set_rx_mode_rps_cb;
+	pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb =
+		dp_cbacks->hdd_ipa_set_mcc_mode_cb;
 
 	return QDF_STATUS_SUCCESS;
 }