浏览代码

qcacmn: Avoid new connection while HW mode change is issued

In the case of concurrency, when the session decrements, the
opportunistic timer is started. After a while, when the
opportunistic time is expired, and the hw mode change for SMM
is issued, and the same time new interface comes up, then the
new connection forms MCC with the existing connection instead
of forming DBS.
The change is to avoid the race condition to form MCC instead of
DBS.

Change-Id: I33ad8a76bdca2f17b09c0d2f072b46cba8d376f8
CRs-Fixed: 2009818
Tushnim Bhattacharyya 8 年之前
父节点
当前提交
be42766846

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

@@ -1609,4 +1609,43 @@ bool policy_mgr_get_dbs_plus_agile_scan_config(struct wlan_objmgr_psoc *psoc);
  */
 bool policy_mgr_get_single_mac_scan_with_dfs_config(
 		struct wlan_objmgr_psoc *psoc);
+
+/**
+ * policy_mgr_set_hw_mode_change_in_progress() - Set value
+ * corresponding to policy_mgr_hw_mode_change that indicate if
+ * HW mode change is in progress
+ * @psoc: PSOC object information
+ * @value: Indicate if hw mode change is in progress
+ *
+ * Set the value corresponding to policy_mgr_hw_mode_change that
+ * indicated if hw mode change is in progress.
+ *
+ * Return: None
+ */
+void policy_mgr_set_hw_mode_change_in_progress(
+	struct wlan_objmgr_psoc *psoc, enum policy_mgr_hw_mode_change value);
+
+/**
+ * policy_mgr_is_hw_mode_change_in_progress() - Check if HW mode
+ * change is in progress.
+ * @psoc: PSOC object information
+ *
+ * Returns the corresponding policy_mgr_hw_mode_change value.
+ *
+ * Return: policy_mgr_hw_mode_change value.
+ */
+enum policy_mgr_hw_mode_change policy_mgr_is_hw_mode_change_in_progress(
+	struct wlan_objmgr_psoc *psoc);
+
+/**
+ * policy_mgr_get_hw_mode_change_from_hw_mode_index() - Get
+ * matching HW mode from index
+ * @psoc: PSOC object information
+ * @hw_mode_index: HW mode index
+ * Returns the corresponding policy_mgr_hw_mode_change HW mode.
+ *
+ * Return: policy_mgr_hw_mode_change value.
+ */
+enum policy_mgr_hw_mode_change policy_mgr_get_hw_mode_change_from_hw_mode_index(
+	struct wlan_objmgr_psoc *psoc, uint32_t hw_mode_index);
 #endif /* __WLAN_POLICY_MGR_API_H */

+ 18 - 0
umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h

@@ -749,6 +749,24 @@ enum set_hw_mode_status {
 	SET_HW_MODE_STATUS_ECOEX,
 };
 
+/**
+ * enum policy_mgr_hw_mode_change - identify the HW mode switching to.
+ *
+ * @POLICY_MGR_HW_MODE_NOT_IN_PROGRESS: HW mode change not in progress
+ * @POLICY_MGR_SMM_IN_PROGRESS: switching to SMM mode
+ * @POLICY_MGR_DBS_IN_PROGRESS: switching to DBS mode
+ * @POLICY_MGR_SBS_IN_PROGRESS: switching to SBS mode
+ *
+ * These are generic IDs that identify the various roles
+ * in the software system
+ */
+enum policy_mgr_hw_mode_change {
+	POLICY_MGR_HW_MODE_NOT_IN_PROGRESS = 0,
+	POLICY_MGR_SMM_IN_PROGRESS,
+	POLICY_MGR_DBS_IN_PROGRESS,
+	POLICY_MGR_SBS_IN_PROGRESS
+};
+
 /**
  * struct policy_mgr_conc_connection_info - information of all existing
  * connections in the wlan system

+ 17 - 0
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

@@ -177,6 +177,23 @@ void policy_mgr_checkn_update_hw_mode_single_mac_mode(
 {
 }
 
+void policy_mgr_set_hw_mode_change_in_progress(
+	struct wlan_objmgr_psoc *psoc, enum policy_mgr_hw_mode_change value)
+{
+}
+
+enum policy_mgr_hw_mode_change policy_mgr_is_hw_mode_change_in_progress(
+	struct wlan_objmgr_psoc *psoc)
+{
+	return POLICY_MGR_HW_MODE_NOT_IN_PROGRESS;
+}
+
+enum policy_mgr_hw_mode_change policy_mgr_get_hw_mode_change_from_hw_mode_index(
+	struct wlan_objmgr_psoc *psoc, uint32_t hw_mode_index)
+{
+	return POLICY_MGR_HW_MODE_NOT_IN_PROGRESS;
+}
+
 #ifdef MPC_UT_FRAMEWORK
 QDF_STATUS policy_mgr_update_connection_info_utfw(
 		struct wlan_objmgr_psoc *psoc,

+ 3 - 0
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h

@@ -252,6 +252,8 @@ extern enum policy_mgr_conc_next_action
  *                  config
  * @dual_mac_cfg: DBS configuration currenctly used by FW for
  *              scan & connections
+ * @hw_mode_change_in_progress: This is to track if HW mode
+ *                            change is in progress
  */
 struct policy_mgr_psoc_priv_obj {
 		struct wlan_objmgr_psoc *psoc;
@@ -279,6 +281,7 @@ struct policy_mgr_psoc_priv_obj {
 		uint8_t gMaxConcurrentActiveSessions;
 		uint8_t conc_system_pref;
 		struct dual_mac_config dual_mac_cfg;
+		uint32_t hw_mode_change_in_progress;
 };
 
 struct policy_mgr_psoc_priv_obj *policy_mgr_get_context(