From 4173ac8d98c5289cf1ca66c62665b386bcae675f Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Tue, 26 Jul 2022 11:21:48 +0530 Subject: [PATCH] qcacld-3.0: Fix the TWT suspend operation command failure TWT params are optional attributes for TWT suspend operation. Do not mandate the check for TWT params for TWT suspend command. Parse the TWT params if attribute is present in the suspend command else use the default value. Change-Id: I62fa5e0e8a9c0346957184b9578bdd273017df21 CRs-Fixed: 3027776 --- core/hdd/src/wlan_hdd_twt.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/core/hdd/src/wlan_hdd_twt.c b/core/hdd/src/wlan_hdd_twt.c index 05977120b16e..14a03fcced35 100644 --- a/core/hdd/src/wlan_hdd_twt.c +++ b/core/hdd/src/wlan_hdd_twt.c @@ -2728,22 +2728,25 @@ static int hdd_twt_pause_session(struct hdd_adapter *adapter, qdf_mem_copy(params.peer_macaddr, hdd_sta_ctx->conn_info.bssid.bytes, QDF_MAC_ADDR_SIZE); params.vdev_id = adapter->vdev_id; + params.dialog_id = 0; - ret = wlan_cfg80211_nla_parse_nested(tb, + if (twt_param_attr) { + ret = wlan_cfg80211_nla_parse_nested(tb, QCA_WLAN_VENDOR_ATTR_TWT_SETUP_MAX, twt_param_attr, qca_wlan_vendor_twt_add_dialog_policy); - if (ret) { - hdd_debug("command parsing failed"); - return ret; - } + if (ret) { + hdd_debug("command parsing failed"); + return ret; + } - id = QCA_WLAN_VENDOR_ATTR_TWT_SETUP_FLOW_ID; - if (tb[id]) { - params.dialog_id = nla_get_u8(tb[id]); + id = QCA_WLAN_VENDOR_ATTR_TWT_SETUP_FLOW_ID; + if (tb[id]) + params.dialog_id = nla_get_u8(tb[id]); + else + hdd_debug("TWT: FLOW_ID not specified. set to zero"); } else { - params.dialog_id = 0; - hdd_debug("TWT: FLOW_ID not specified. set to zero"); + hdd_debug("TWT param not present. flow id set to zero"); } status = hdd_twt_check_all_twt_support(adapter->hdd_ctx->psoc, @@ -3877,7 +3880,8 @@ static int hdd_twt_configure(struct hdd_adapter *adapter, twt_param_attr = tb[id]; if (!twt_param_attr && - twt_oper != QCA_WLAN_TWT_GET_CAPABILITIES) { + twt_oper != QCA_WLAN_TWT_GET_CAPABILITIES && + twt_oper != QCA_WLAN_TWT_SUSPEND) { hdd_err("TWT parameters NOT specified"); return -EINVAL; }