Переглянути джерело

qcacld-3.0: Allow TWT setup re-negotiation for the existing session

Add support to allow TWT setup re-negotiation for the existing session.
If the setup request is received:
   - before the host driver receiving the setup response event from
     firmware for the previous setup request, then return -EINPROGRESS.

   - after the host driver received the setup response event from
     firmware for the previous setup request, then setup_done is
     set to true and this new setup request is sent to firmware
     for parameter re-negotiation.

CRs-Fixed: 2897896
Change-Id: I4d0cc5dac8d569a2e57c70ae6896ad1a24937597
Srinivas Girigowda 4 роки тому
батько
коміт
aa4dd3ddff

+ 3 - 1
components/mlme/core/src/wlan_mlme_twt_api.c

@@ -51,10 +51,12 @@ bool mlme_is_twt_setup_in_progress(struct wlan_objmgr_psoc *psoc,
 	}
 
 	for (i = 0; i < peer_priv->twt_ctx.num_twt_sessions; i++) {
+		bool setup_done = peer_priv->twt_ctx.session_info[i].setup_done;
 		existing_session_dialog_id =
 			peer_priv->twt_ctx.session_info[i].dialog_id;
 		if (existing_session_dialog_id == dialog_id &&
-		    existing_session_dialog_id != WLAN_ALL_SESSIONS_DIALOG_ID) {
+		    existing_session_dialog_id != WLAN_ALL_SESSIONS_DIALOG_ID &&
+		    !setup_done) {
 			wlan_objmgr_peer_release_ref(peer, WLAN_MLME_NB_ID);
 			return true;
 		}

+ 11 - 5
core/hdd/src/wlan_hdd_twt.c

@@ -1337,6 +1337,15 @@ int hdd_send_twt_add_dialog_cmd(struct hdd_context *hdd_ctx,
  * Handles QCA_WLAN_TWT_SET
  *
  * Return: 0 for Success and negative value for failure
+ *
+ *    If the setup request is received:
+ *        before the host driver receiving the setup response event from
+ *        firmware for the previous setup request, then return -EINPROGRESS
+ *
+ *        after the host driver received the setup response event from
+ *        firmware for the previous setup request, then setup_done is
+ *        set to true and this new setup request is sent to firmware
+ *        for parameter re-negotiation.
  */
 static int hdd_twt_setup_session(struct hdd_adapter *adapter,
 				 struct nlattr *twt_param_attr)
@@ -1396,13 +1405,10 @@ static int hdd_twt_setup_session(struct hdd_adapter *adapter,
 
 	if (ucfg_mlme_is_twt_setup_in_progress(adapter->hdd_ctx->psoc,
 					       &hdd_sta_ctx->conn_info.bssid,
-					       params.dialog_id) ||
-	    ucfg_mlme_is_twt_setup_done(adapter->hdd_ctx->psoc,
-					&hdd_sta_ctx->conn_info.bssid,
 					params.dialog_id)) {
-		hdd_err_rl("TWT session exists for dialog:%d",
+		hdd_err_rl("TWT setup is in progress for dialog_id:%d",
 			   params.dialog_id);
-		return -EALREADY;
+		return -EINPROGRESS;
 	}
 
 	ret = hdd_send_twt_add_dialog_cmd(adapter->hdd_ctx, &params);