Просмотр исходного кода

qcacld-3.0: Don't delete TWT session if teardown fails

When TWT teardown is received, driver sets the twt setup done
flag to false and clears the TWT dialog id/state for the TWT
session irrespective of the teardown status sent by firmware.
This causes TWT session deletion even if ack is not received for
TWT teardown frame or internal error due to which TWT teardown
frame was not sent over air.

Don't clear the TWT sesson if teardown failure due to internal
error or no ack is received for TWT frame.

Change-Id: I7d5cf423c3cd0d4be9bb2ff0b238a3fa069783cf
CRs-Fixed: 2866195
Pragaspathi Thilagaraj 4 лет назад
Родитель
Сommit
d39fb48f53
2 измененных файлов с 34 добавлено и 11 удалено
  1. 1 7
      core/hdd/src/wlan_hdd_twt.c
  2. 33 4
      core/sme/src/common/sme_api.c

+ 1 - 7
core/hdd/src/wlan_hdd_twt.c

@@ -1523,13 +1523,7 @@ hdd_twt_del_dialog_comp_cb(struct wlan_objmgr_psoc *psoc,
 	}
 
 	wlan_cfg80211_vendor_event(twt_vendor_event, GFP_KERNEL);
-	ucfg_mlme_set_twt_setup_done(
-				adapter->hdd_ctx->psoc,
-				(struct qdf_mac_addr *)params->peer_macaddr,
-				params->dialog_id, false);
-	mlme_init_twt_context(hdd_ctx->psoc,
-			      (struct qdf_mac_addr *)params->peer_macaddr,
-			      params->dialog_id);
+
 	hdd_exit();
 
 	return;

+ 33 - 4
core/sme/src/common/sme_api.c

@@ -2121,6 +2121,24 @@ sme_process_twt_add_dialog_event(struct mac_context *mac,
 		WLAN_TWT_SETUP_STATE_ACTIVE);
 }
 
+static bool
+sme_is_twt_teardown_failed(enum WMI_HOST_DEL_TWT_STATUS teardown_status)
+{
+	switch (teardown_status) {
+	case WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_NOT_EXIST:
+	case WMI_HOST_DEL_TWT_STATUS_INVALID_PARAM:
+	case WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_BUSY:
+	case WMI_HOST_DEL_TWT_STATUS_NO_RESOURCE:
+	case WMI_HOST_DEL_TWT_STATUS_NO_ACK:
+	case WMI_HOST_DEL_TWT_STATUS_UNKNOWN_ERROR:
+		return true;
+	default:
+		return false;
+	}
+
+	return false;
+}
+
 /**
  * sme_process_twt_del_dialog_event() - Process twt del dialog event
  * response from firmware
@@ -2158,14 +2176,25 @@ sme_process_twt_del_dialog_event(struct mac_context *mac,
 			mac->psoc, (struct qdf_mac_addr *)param->peer_macaddr,
 			true);
 
-	ucfg_mlme_set_twt_session_state(
-			mac->psoc, (struct qdf_mac_addr *)param->peer_macaddr,
-			param->dialog_id, WLAN_TWT_SETUP_STATE_NOT_ESTABLISHED);
-
 	/* Reset the active TWT command to none */
 	mlme_set_twt_command_in_progress(
 			mac->psoc, (struct qdf_mac_addr *)param->peer_macaddr,
 			param->dialog_id, WLAN_TWT_NONE);
+
+	if (sme_is_twt_teardown_failed(param->status))
+		return;
+
+	ucfg_mlme_set_twt_setup_done(mac->psoc, (struct qdf_mac_addr *)
+				     param->peer_macaddr,
+				     param->dialog_id, false);
+
+	ucfg_mlme_set_twt_session_state(
+			mac->psoc, (struct qdf_mac_addr *)param->peer_macaddr,
+			param->dialog_id, WLAN_TWT_SETUP_STATE_NOT_ESTABLISHED);
+
+	mlme_init_twt_context(mac->psoc, (struct qdf_mac_addr *)
+			      param->peer_macaddr,
+			      param->dialog_id);
 }
 
 /**