Prechádzať zdrojové kódy

qcacld-3.0: Reset wait for hw mode change event

Hw mode change in progress is set after the set_hw_mode
command is queued in serialization. Its not reset in below
cases:
Active command timeout case, serialization command
cancelled case.

Before connect request is queued, if hw mode change is in
progress, there is 6 secs wait and if there is no hw mode
change response, connection failure. This causes subsequent
connection failures and there is no recovery.

Reset the wait for hw mode change event in serialization
command failure cases.

Change-Id: I716982f06198e9c3495685ddb158044778c4b1ff
CRs-Fixed: 3256424
Pragaspathi Thilagaraj 2 rokov pred
rodič
commit
141b046a13

+ 8 - 0
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -2092,6 +2092,14 @@ QDF_STATUS policy_mgr_wait_for_connection_update(
  */
 QDF_STATUS policy_mgr_reset_connection_update(struct wlan_objmgr_psoc *psoc);
 
+/**
+ * policy_mgr_reset_hw_mode_change() - Reset the hw mode change.
+ * @psoc: Pointer to PSOC object
+ *
+ * Return: none
+ */
+void policy_mgr_reset_hw_mode_change(struct wlan_objmgr_psoc *psoc);
+
 /**
  * policy_mgr_set_connection_update() - Set connection update
  * event

+ 8 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

@@ -2991,6 +2991,14 @@ QDF_STATUS policy_mgr_reset_connection_update(struct wlan_objmgr_psoc *psoc)
 	return QDF_STATUS_SUCCESS;
 }
 
+void policy_mgr_reset_hw_mode_change(struct wlan_objmgr_psoc *psoc)
+{
+	policy_mgr_err("Clear hw mode change and connection update evt");
+	policy_mgr_set_hw_mode_change_in_progress(
+			psoc, POLICY_MGR_HW_MODE_NOT_IN_PROGRESS);
+	policy_mgr_reset_connection_update(psoc);
+}
+
 QDF_STATUS policy_mgr_set_connection_update(struct wlan_objmgr_psoc *psoc)
 {
 	QDF_STATUS status;

+ 5 - 0
core/sme/src/common/sme_api.c

@@ -606,6 +606,8 @@ QDF_STATUS sme_ser_cmd_callback(struct wlan_serialization_command *cmd,
 		status = sme_ser_handle_active_cmd(cmd);
 		break;
 	case WLAN_SER_CB_CANCEL_CMD:
+		if (cmd->cmd_type == WLAN_SER_CMD_SET_HW_MODE)
+			policy_mgr_reset_hw_mode_change(mac_ctx->psoc);
 		break;
 	case WLAN_SER_CB_RELEASE_MEM_CMD:
 		if (cmd->vdev)
@@ -622,6 +624,9 @@ QDF_STATUS sme_ser_cmd_callback(struct wlan_serialization_command *cmd,
 			qdf_trigger_self_recovery(mac_ctx->psoc,
 						  QDF_ACTIVE_LIST_TIMEOUT);
 		}
+
+		if (cmd->cmd_type == WLAN_SER_CMD_SET_HW_MODE)
+			policy_mgr_reset_hw_mode_change(mac_ctx->psoc);
 		break;
 	default:
 		sme_debug("unknown reason code");