Browse Source

qcacld-3.0: Allow TWT teardown after roaming

Allow TWT teardown event from firmware after roaming or peer
initiated teardown to indicate the value to userspace. Also
make changes to send the wake duration value in microseconds
scaled with the TWT wake duration multiplication factor.

Change-Id: Ibcd0c51b1930094e0efc3832db5b8aadaa5748ea
CRs-Fixed: 2859775
Pragaspathi Thilagaraj 4 years ago
parent
commit
0fef58d6fb
2 changed files with 6 additions and 3 deletions
  1. 4 1
      core/hdd/src/wlan_hdd_twt.c
  2. 2 2
      core/sme/src/common/sme_api.c

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

@@ -495,6 +495,7 @@ hdd_twt_pack_get_params_resp_nlmsg(struct wlan_objmgr_psoc *psoc,
 	enum wlan_twt_session_state state;
 	enum qca_wlan_twt_setup_state converted_state;
 	uint64_t tsf_val;
+	uint32_t wake_duration;
 	int i, attr;
 
 	config_attr = nla_nest_start(reply_skb,
@@ -571,7 +572,9 @@ hdd_twt_pack_get_params_resp_nlmsg(struct wlan_objmgr_psoc *psoc,
 		}
 
 		attr = QCA_WLAN_VENDOR_ATTR_TWT_SETUP_WAKE_DURATION;
-		if (nla_put_u32(reply_skb, attr, params[i].wake_dura_us)) {
+		wake_duration = (params[i].wake_intvl_us /
+				 TWT_WAKE_DURATION_MULTIPLICATION_FACTOR);
+		if (nla_put_u32(reply_skb, attr, wake_duration)) {
 			hdd_err("TWT: get_params failed to put Wake duration");
 			return QDF_STATUS_E_INVAL;
 		}

+ 2 - 2
core/sme/src/common/sme_api.c

@@ -2120,8 +2120,8 @@ sme_process_twt_del_dialog_event(struct mac_context *mac,
 		param->dialog_id, WLAN_TWT_TERMINATE);
 	if (!is_evt_allowed &&
 	    param->dialog_id != WLAN_ALL_SESSIONS_DIALOG_ID &&
-	    (param->status != WMI_HOST_DEL_TWT_STATUS_ROAMING ||
-	     param->status != WMI_HOST_DEL_TWT_STATUS_PEER_INIT_TEARDOWN)) {
+	    param->status != WMI_HOST_DEL_TWT_STATUS_ROAMING &&
+	    param->status != WMI_HOST_DEL_TWT_STATUS_PEER_INIT_TEARDOWN) {
 		sme_debug("add dialog event dropped");
 		return;
 	}