From e23c2cacd9dc04261a660097110016a1963357d5 Mon Sep 17 00:00:00 2001 From: Vulupala Shashank Reddy Date: Tue, 13 Jul 2021 18:07:00 +0530 Subject: [PATCH 01/19] qcacld-3.0: Update the channel only if AUTH resp is successful Currently channel is updated whenever AUTH frame is received irrespective of its status. So in case of unsuccessful AUTH wrong channel is updated in pkt capture mode. To fix this issue, update the channel only if AUTH response is successful. Also if after AUTH success, association or reassociation fails update the channel with last connected channel. Change-Id: I51ee6bb2466f765ce6058c411b0dc0ab74a0dd04 CRs-Fixed: 2987748 --- .../core/inc/wlan_pkt_capture_priv.h | 6 +- .../core/src/wlan_pkt_capture_main.c | 2 + .../core/src/wlan_pkt_capture_mon_thread.c | 75 ++++++++++++++++++- 3 files changed, 78 insertions(+), 5 deletions(-) diff --git a/components/pkt_capture/core/inc/wlan_pkt_capture_priv.h b/components/pkt_capture/core/inc/wlan_pkt_capture_priv.h index ce37798894ed..93ab1eac698b 100644 --- a/components/pkt_capture/core/inc/wlan_pkt_capture_priv.h +++ b/components/pkt_capture/core/inc/wlan_pkt_capture_priv.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -63,6 +63,8 @@ struct pkt_capture_cb_context { * @ppdu_stats_q: list used for storing smu related ppdu stats * @lock_q: spinlock for ppdu_stats q * @tx_nss: nss of tx data packets received from ppdu stats + * @last_freq: Last connected freq + * @curr_freq: current connected freq */ struct pkt_capture_vdev_priv { struct wlan_objmgr_vdev *vdev; @@ -74,6 +76,8 @@ struct pkt_capture_vdev_priv { qdf_list_t ppdu_stats_q; qdf_spinlock_t lock_q; uint8_t tx_nss; + qdf_freq_t last_freq; + qdf_freq_t curr_freq; }; /** diff --git a/components/pkt_capture/core/src/wlan_pkt_capture_main.c b/components/pkt_capture/core/src/wlan_pkt_capture_main.c index 04f11b1143b0..5d1e3ee2b7d8 100644 --- a/components/pkt_capture/core/src/wlan_pkt_capture_main.c +++ b/components/pkt_capture/core/src/wlan_pkt_capture_main.c @@ -754,6 +754,8 @@ pkt_capture_register_callbacks(struct wlan_objmgr_vdev *vdev, target_if_pkt_capture_register_rx_ops(&psoc_priv->rx_ops); pkt_capture_wdi_event_subscribe(psoc); pkt_capture_record_channel(vdev); + vdev_priv->curr_freq = vdev->vdev_mlme.des_chan->ch_freq; + vdev_priv->last_freq = vdev_priv->curr_freq; status = tgt_pkt_capture_register_ev_handler(vdev); if (QDF_IS_STATUS_ERROR(status)) diff --git a/components/pkt_capture/core/src/wlan_pkt_capture_mon_thread.c b/components/pkt_capture/core/src/wlan_pkt_capture_mon_thread.c index 599edf22d261..be99be8ee939 100644 --- a/components/pkt_capture/core/src/wlan_pkt_capture_mon_thread.c +++ b/components/pkt_capture/core/src/wlan_pkt_capture_mon_thread.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -25,6 +26,7 @@ #include "wlan_mgmt_txrx_utils_api.h" #include "cdp_txrx_ctrl.h" #include "cfg_ucfg_api.h" +#include "wlan_mgmt_txrx_utils_api.h" void pkt_capture_mon(struct pkt_capture_cb_context *cb_ctx, qdf_nbuf_t msdu, struct wlan_objmgr_vdev *vdev, uint16_t ch_freq) @@ -35,6 +37,9 @@ void pkt_capture_mon(struct pkt_capture_cb_context *cb_ctx, qdf_nbuf_t msdu, void *soc = cds_get_context(QDF_MODULE_ID_SOC); struct wlan_objmgr_pdev *pdev = wlan_vdev_get_pdev(vdev); cdp_config_param_type val; + uint16_t status; + tSirMacAuthFrameBody *auth; + struct pkt_capture_vdev_priv *vdev_priv; rthdr = (struct radiotap_header *)qdf_nbuf_data(msdu); rtlen = rthdr->it_len; @@ -42,17 +47,79 @@ void pkt_capture_mon(struct pkt_capture_cb_context *cb_ctx, qdf_nbuf_t msdu, type = (wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK; sub_type = (wh)->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; + vdev_priv = pkt_capture_vdev_get_priv(vdev); + if (!vdev_priv) { + pkt_capture_err("packet capture vdev priv is NULL"); + return; + } + + /* + * Update channel only if successful AUTH Resp is received. + * This is done so that EAPOL M1 data frame have correct + * channel + */ if ((type == IEEE80211_FC0_TYPE_MGT) && (sub_type == MGMT_SUBTYPE_AUTH)) { uint8_t chan = wlan_freq_to_chan(ch_freq); - val.cdp_pdev_param_monitor_chan = chan; - cdp_txrx_set_pdev_param(soc, wlan_objmgr_pdev_get_pdev_id(pdev), + auth = (tSirMacAuthFrameBody *)(qdf_nbuf_data(msdu) + rtlen + + sizeof(tSirMacMgmtHdr)); + + if (auth->authTransactionSeqNumber == SIR_MAC_AUTH_FRAME_2 || + auth->authTransactionSeqNumber == SIR_MAC_AUTH_FRAME_4) { + if (auth->authStatusCode == STATUS_SUCCESS) { + val.cdp_pdev_param_monitor_chan = chan; + cdp_txrx_set_pdev_param( + soc, wlan_objmgr_pdev_get_pdev_id(pdev), CDP_MONITOR_CHANNEL, val); - val.cdp_pdev_param_mon_freq = ch_freq; - cdp_txrx_set_pdev_param(soc, wlan_objmgr_pdev_get_pdev_id(pdev), + val.cdp_pdev_param_mon_freq = ch_freq; + cdp_txrx_set_pdev_param( + soc, wlan_objmgr_pdev_get_pdev_id(pdev), CDP_MONITOR_FREQUENCY, val); + } + } + } + + /* + * Update channel to last connected channel in case of assoc/reassoc + * response failure and save current chan in case of success + */ + if ((type == IEEE80211_FC0_TYPE_MGT) && + ((sub_type == MGMT_SUBTYPE_ASSOC_RESP) || + (sub_type == MGMT_SUBTYPE_REASSOC_RESP))) { + if (qdf_nbuf_len(msdu) < (rtlen + sizeof(tSirMacMgmtHdr) + + SIR_MAC_ASSOC_RSP_STATUS_CODE_OFFSET)) { + pkt_capture_err("Packet length is less than expected"); + qdf_nbuf_free(msdu); + return; + } + + status = (uint16_t)(*(qdf_nbuf_data(msdu) + rtlen + + sizeof(tSirMacMgmtHdr) + + SIR_MAC_ASSOC_RSP_STATUS_CODE_OFFSET)); + + if (status == STATUS_SUCCESS) { + vdev_priv->last_freq = vdev_priv->curr_freq; + vdev_priv->curr_freq = ch_freq; + } else { + uint8_t chan_num; + + chan_num = wlan_reg_freq_to_chan(pdev, + vdev_priv->last_freq); + + val.cdp_pdev_param_monitor_chan = chan_num; + cdp_txrx_set_pdev_param( + soc, wlan_objmgr_pdev_get_pdev_id(pdev), + CDP_MONITOR_CHANNEL, val); + + val.cdp_pdev_param_mon_freq = vdev_priv->last_freq; + cdp_txrx_set_pdev_param( + soc, wlan_objmgr_pdev_get_pdev_id(pdev), + CDP_MONITOR_FREQUENCY, val); + + vdev_priv->curr_freq = vdev_priv->last_freq; + } } if (cb_ctx->mon_cb(cb_ctx->mon_ctx, msdu) != QDF_STATUS_SUCCESS) { From 4781f10dbffeca5a35c7173dbc4c8d883b128a0c Mon Sep 17 00:00:00 2001 From: Ananya Gupta Date: Wed, 20 Jul 2022 17:10:32 +0530 Subject: [PATCH 02/19] qcacld-3.0: Set bus bandwidth state to NONE in rutime suspend Currently, runtime suspend is not setting bus bandwiddth state to NONE but to IDLE level. Change is to set bandwidth state to None after setting it to IDLE. Change-Id: Iabd20b7e4a23019768de7604cb0efda0328e7d57 CRs-Fixed: 3229952 --- core/hdd/src/wlan_hdd_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 467ee065e202..37931121aac2 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -16392,8 +16392,10 @@ exit: uint64_t interval_us = hdd_ctx->config->bus_bw_compute_interval * 1000; qdf_atomic_set(&hdd_ctx->num_latency_critical_clients, 0); - hdd_ctx->cur_vote_level = PLD_BUS_WIDTH_NONE; hdd_pld_request_bus_bandwidth(hdd_ctx, 0, 0, interval_us); + hdd_ctx->cur_vote_level = PLD_BUS_WIDTH_NONE; + pld_request_bus_bandwidth(hdd_ctx->parent_dev, + PLD_BUS_WIDTH_NONE); } } From e777bf84d1d683d72da41f1c589658ec8f5063cb Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Fri, 22 Jul 2022 07:57:37 -0700 Subject: [PATCH 03/19] Release 2.0.8.30T Release 2.0.8.30T Change-Id: I65cd7fde761f702d2a5fd22eff73bbbd78db17d7 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 41877f3173f0..26a6173a236d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "S" +#define QWLAN_VERSION_EXTRA "T" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "2.0.8.30S" +#define QWLAN_VERSIONSTR "2.0.8.30T" #endif /* QWLAN_VERSION_H */ From c2f45cf1d9be701707445980b6b0baeee67702a6 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Thu, 21 Jul 2022 17:04:02 +0530 Subject: [PATCH 04/19] qcacld-3.0: Enable the ini param enable_pending_list_req by default Firmware aborts the ongoing scan upon receiving new scan channel list (through WMI_SCAN_CHAN_LIST_CMDID). Channel list might get updated from userspace through commands like country code change, power level change(SET_FCC_CHANNEL),... It affects the features that are dependent on that scan, e.g. ongoing connection, p2p find, etc.. Few frames might be stuck in firmware as the scan is canceled. It's recommended to defer the scan channel list update till the current scan is done. This is already supported and guarded through the ini param enable_pending_list_req but disabled by default. Enable the ini param to make sure above scenarios are not affected due to channel list update. Change-Id: I4176bb6a03657cf32f0c099b72254d61207ea6ca CRs-Fixed: 3250137 --- components/mlme/dispatcher/inc/cfg_mlme_reg.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/mlme/dispatcher/inc/cfg_mlme_reg.h b/components/mlme/dispatcher/inc/cfg_mlme_reg.h index c28c119db46b..24c6f54a4d0f 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_reg.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_reg.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -292,7 +293,7 @@ * enable_pending_list_req - Sets Pending channel List Req. * @Min: 0 * @Max: 1 - * @Default: 0 + * @Default: 1 * * This option enables/disables SCAN_CHAN_LIST_CMDID channel list command to FW * till the current scan is complete. @@ -307,7 +308,7 @@ */ #define CFG_ENABLE_PENDING_CHAN_LIST_REQ CFG_INI_BOOL( \ "enable_pending_list_req", \ - 0, \ + 1, \ "Enable Pending list req") /* From 0be03ac3739875623d489d2c14e0f42b0fd7b843 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Mon, 25 Jul 2022 04:29:25 -0700 Subject: [PATCH 05/19] Release 2.0.8.30U Release 2.0.8.30U Change-Id: Ib2c2b7ee520f026b168aee46d7536f55734a6d68 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 26a6173a236d..fbb09f162790 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "T" +#define QWLAN_VERSION_EXTRA "U" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "2.0.8.30T" +#define QWLAN_VERSIONSTR "2.0.8.30U" #endif /* QWLAN_VERSION_H */ From 4173ac8d98c5289cf1ca66c62665b386bcae675f Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Tue, 26 Jul 2022 11:21:48 +0530 Subject: [PATCH 06/19] 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; } From 5e0e424484bc0cb05c380cf9b967ba7635f32c51 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Tue, 26 Jul 2022 06:20:24 -0700 Subject: [PATCH 07/19] Release 2.0.8.30V Release 2.0.8.30V Change-Id: I0c0596df133afc763c578114b2048111d2867e26 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index fbb09f162790..7f78d5550c83 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "U" +#define QWLAN_VERSION_EXTRA "V" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "2.0.8.30U" +#define QWLAN_VERSIONSTR "2.0.8.30V" #endif /* QWLAN_VERSION_H */ From 9fcc449dbbdc3e3962ea3c05563ffb895cde7789 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Wed, 20 Jul 2022 12:37:20 +0530 Subject: [PATCH 08/19] qcacld-3.0: Rate limit DELBA process logs AP/peer may send DELBA continuously in some error scenarios. Host driver generates a dump of the frame in INFO level and a log in ERROR level for each DELBA received. This results in excessive logs to the kernel logging. Rate limit the logs to avoid spamming kernel logs. Change-Id: I94b11b76b862924672e06520b5bf2e731ec462df CRs-Fixed: 3248606 --- core/mac/src/pe/lim/lim_process_action_frame.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c index 5fc20c00966a..1a683db31d7d 100644 --- a/core/mac/src/pe/lim/lim_process_action_frame.c +++ b/core/mac/src/pe/lim/lim_process_action_frame.c @@ -1552,7 +1552,7 @@ static void lim_process_delba_req(struct mac_context *mac_ctx, uint8_t *rx_pkt_i body_ptr = WMA_GET_RX_MPDU_DATA(rx_pkt_info); frame_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, body_ptr, frame_len); delba_req = qdf_mem_malloc(sizeof(*delba_req)); @@ -1576,7 +1576,7 @@ static void lim_process_delba_req(struct mac_context *mac_ctx, uint8_t *rx_pkt_i delba_req->delba_param_set.tid, delba_req->Reason.code); if (QDF_STATUS_SUCCESS != qdf_status) - pe_err("Failed to process delba request"); + pe_err_rl("Failed to process delba request"); error: qdf_mem_free(delba_req); From 225631cd9fc9597f373e345c9aaae39c88d9a0b8 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Tue, 26 Jul 2022 08:45:33 -0700 Subject: [PATCH 09/19] Release 2.0.8.30W Release 2.0.8.30W Change-Id: Iaf73a3b75abf13f65b7b7125bc995be81eead33d CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 7f78d5550c83..51d907ab5ed8 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "V" +#define QWLAN_VERSION_EXTRA "W" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "2.0.8.30V" +#define QWLAN_VERSIONSTR "2.0.8.30W" #endif /* QWLAN_VERSION_H */ From d7655edacca8d5dee7f3a5dbdb0a06e992846ac0 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Mon, 16 May 2022 10:10:46 +0800 Subject: [PATCH 10/19] qcacld-3.0: notify reg change event once wifi on from GUI Add regulatory notify event when wifi ON by GUI. In new framework test, When turning on Wi-Fi, it is expecting driver to indicate NL80211_CMD_[WIPHY]_ REG_CHANGE event with country code to wificond. Change-Id: Icb0bdec097db14905de6234573d05fffbe0e4500 CRs-Fixed: 3186188 --- core/hdd/src/wlan_hdd_main.c | 43 ++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 37931121aac2..6d89f88084d1 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -16806,6 +16806,36 @@ void hdd_init_start_completion(void) INIT_COMPLETION(wlan_start_comp); } +#if defined CFG80211_USER_HINT_CELL_BASE_SELF_MANAGED || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)) +static void hdd_inform_wifi_on(void) +{ + int ret; + struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + struct osif_psoc_sync *psoc_sync; + + hdd_nofl_debug("inform regdomain for wifi on"); + ret = wlan_hdd_validate_context(hdd_ctx); + if (ret) + return; + if (!wlan_hdd_validate_modules_state(hdd_ctx)) + return; + if (!hdd_ctx->wiphy) + return; + ret = osif_psoc_sync_op_start(wiphy_dev(hdd_ctx->wiphy), &psoc_sync); + if (ret) + return; + if (hdd_ctx->wiphy->registered) + hdd_send_wiphy_regd_sync_event(hdd_ctx); + + osif_psoc_sync_op_stop(psoc_sync); +} +#else +static void hdd_inform_wifi_on(void) +{ +} +#endif + static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp, const char __user *user_buf, size_t count, @@ -16817,6 +16847,7 @@ static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp, int ret; unsigned long rc; struct hdd_context *hdd_ctx; + bool turning_on = false; if (copy_from_user(buf, user_buf, 3)) { pr_err("Failed to read buffer\n"); @@ -16824,13 +16855,15 @@ static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp, } if (strncmp(buf, wlan_off_str, strlen(wlan_off_str)) == 0) { - pr_debug("Wifi turning off from UI\n"); + hdd_info("Wifi turning off from UI\n"); hdd_inform_wifi_off(); goto exit; } - if (strncmp(buf, wlan_on_str, strlen(wlan_on_str)) == 0) - pr_info("Wifi Turning On from UI\n"); + if (strncmp(buf, wlan_on_str, strlen(wlan_on_str)) == 0) { + hdd_info("Wifi Turning On from UI\n"); + turning_on = true; + } if (strncmp(buf, wlan_on_str, strlen(wlan_on_str)) != 0) { pr_err("Invalid value received from framework"); @@ -16854,8 +16887,10 @@ static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp, hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (hdd_ctx) hdd_psoc_idle_timer_stop(hdd_ctx); - exit: + if (turning_on) + hdd_inform_wifi_on(); + return count; } From b1218914d1011690a6a02b105a410f11c72c59b3 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Thu, 28 Jul 2022 01:44:29 -0700 Subject: [PATCH 11/19] Release 2.0.8.30X Release 2.0.8.30X Change-Id: I7b757f18364e31bbbb29d917f01a4dd6109f0f25 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 51d907ab5ed8..49b160cd194d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "W" +#define QWLAN_VERSION_EXTRA "X" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "2.0.8.30W" +#define QWLAN_VERSIONSTR "2.0.8.30X" #endif /* QWLAN_VERSION_H */ From 841cdd632d58c28c0debf5aa8ee7ebebfa4e65fd Mon Sep 17 00:00:00 2001 From: Arun Kumar Khandavalli Date: Mon, 1 Nov 2021 15:44:32 +0530 Subject: [PATCH 12/19] qcacld-3.0: unblock the state control param thread at end of SSR Currently the state control param thread is unblocked 1st and then the psoc transition is completed, there could be a chance that SSR thread got scheduled out and wifi thread tried to comeup and issue interface up which could fail because psoc transition is till in progress. So, unblock the wifi thread waiting on state control param after stopping the psoc transition at the end of SSR. Change-Id: I4631fb9aae6a5416ba70b24fe3c053528bd3b7d9 CRs-Fixed: 3066968 --- core/hdd/src/wlan_hdd_driver_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 6a0822a8c41b..7f782feffdb9 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -754,7 +754,6 @@ static int __hdd_soc_recovery_reinit(struct device *dev, } hdd_soc_load_unlock(dev); - hdd_start_complete(0); return 0; @@ -811,6 +810,7 @@ static int hdd_soc_recovery_reinit(struct device *dev, osif_psoc_sync_trans_stop(psoc_sync); + hdd_start_complete(0); return errno; } From 5b7d2d468896ae14aa585d51d202e2055b8fb921 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Thu, 28 Jul 2022 04:09:09 -0700 Subject: [PATCH 13/19] Release 2.0.8.30Y Release 2.0.8.30Y Change-Id: I01090196094b70a105fb46bd30d443943f6a80c7 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 49b160cd194d..4a49cc0d6014 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "X" +#define QWLAN_VERSION_EXTRA "Y" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "2.0.8.30X" +#define QWLAN_VERSIONSTR "2.0.8.30Y" #endif /* QWLAN_VERSION_H */ From 10e6c8669fd2eddb36b349c949a5baa1e9f8ab66 Mon Sep 17 00:00:00 2001 From: Aditya Kodukula Date: Tue, 26 Jul 2022 15:10:31 -0700 Subject: [PATCH 14/19] qcacld-3.0: Fix variable type in sch_gen_timing_advert_frame Currently inside the function sch_gen_timing_advert_frame, the variable type used to hold the return value of populate_dot11f_timing_advert_frame, is incorrect. So, fix it with correct variable type. Change-Id: I592c1b3c291b4c9dce2cbe731021cf512cb598f2 CRs-Fixed: 3243257 --- core/mac/src/pe/sch/sch_api.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/core/mac/src/pe/sch/sch_api.c b/core/mac/src/pe/sch/sch_api.c index b88f14284f65..7b51fae0dcca 100644 --- a/core/mac/src/pe/sch/sch_api.c +++ b/core/mac/src/pe/sch/sch_api.c @@ -370,9 +370,10 @@ uint32_t lim_send_probe_rsp_template_to_hal(struct mac_context *mac, int sch_gen_timing_advert_frame(struct mac_context *mac_ctx, tSirMacAddr self_addr, uint8_t **buf, uint32_t *timestamp_offset, uint32_t *time_value_offset) { - tDot11fTimingAdvertisementFrame frame = {0}; + tDot11fTimingAdvertisementFrame frame = {}; uint32_t payload_size, buf_size; - int status; + QDF_STATUS status; + uint32_t ret; struct qdf_mac_addr wildcard_bssid = { {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, }; @@ -384,13 +385,13 @@ int sch_gen_timing_advert_frame(struct mac_context *mac_ctx, tSirMacAddr self_ad return qdf_status_to_os_return(status); } - status = dot11f_get_packed_timing_advertisement_frame_size(mac_ctx, + ret = dot11f_get_packed_timing_advertisement_frame_size(mac_ctx, &frame, &payload_size); - if (DOT11F_FAILED(status)) { - pe_err("Error getting packed frame size %x", status); + if (DOT11F_FAILED(ret)) { + pe_err("Error getting packed frame size %x", ret); return -EINVAL; } - if (DOT11F_WARNED(status)) + if (DOT11F_WARNED(ret)) pe_warn("Warning getting packed frame size"); buf_size = sizeof(tSirMacMgmtHdr) + payload_size; @@ -399,15 +400,15 @@ int sch_gen_timing_advert_frame(struct mac_context *mac_ctx, tSirMacAddr self_ad return -ENOMEM; payload_size = 0; - status = dot11f_pack_timing_advertisement_frame(mac_ctx, &frame, + ret = dot11f_pack_timing_advertisement_frame(mac_ctx, &frame, *buf + sizeof(tSirMacMgmtHdr), buf_size - sizeof(tSirMacMgmtHdr), &payload_size); pe_debug("TA payload size2 = %d", payload_size); - if (DOT11F_FAILED(status)) { - pe_err("Error packing frame %x", status); + if (DOT11F_FAILED(ret)) { + pe_err("Error packing frame %x", ret); goto fail; } - if (DOT11F_WARNED(status)) + if (DOT11F_WARNED(ret)) pe_warn("Warning packing frame"); lim_populate_mac_header(mac_ctx, *buf, SIR_MAC_MGMT_FRAME, From be6039dd5a46482bec5ea77b91efeb2e10c1c985 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Mon, 1 Aug 2022 19:28:51 -0700 Subject: [PATCH 15/19] Release 2.0.8.30Z Release 2.0.8.30Z Change-Id: I82cf6425475eacae538eddf6ba26c79e8b96fd17 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 4a49cc0d6014..8554cd49fc3d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "Y" +#define QWLAN_VERSION_EXTRA "Z" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "2.0.8.30Y" +#define QWLAN_VERSIONSTR "2.0.8.30Z" #endif /* QWLAN_VERSION_H */ From f502b47633087e43cdd38aecabc8ca402631364d Mon Sep 17 00:00:00 2001 From: Surabhi Vishnoi Date: Fri, 22 Jul 2022 16:17:05 +0530 Subject: [PATCH 16/19] qcacld-3.0: Allow monitor mode vendor cmd only if mon iface is created QCA_NL80211_VENDOR_SUBCMD_SET_MONITOR_MODE is used to set the config for packet capture feature on STA interface. Currently this vendor command is allowed even if monitor interface which will be used in packet capture mode is not created, which is wrong. To fix this, allow monitor mode config related to packet capture feature only if monitor interface is created. Change-Id: Iea94b4cd5f21d8ce13643c209d4027972d7a16d3 CRs-Fixed: 3256298 --- core/hdd/src/wlan_hdd_cfg80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 1f182a8fbc12..08b6ed22fc77 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -15714,7 +15714,8 @@ __wlan_hdd_cfg80211_set_monitor_mode(struct wiphy *wiphy, return -EPERM; } - if (!ucfg_pkt_capture_get_mode(hdd_ctx->psoc)) + if (!ucfg_pkt_capture_get_mode(hdd_ctx->psoc) || + !hdd_is_pkt_capture_mon_enable(adapter)) return -EPERM; errno = hdd_validate_adapter(adapter); From d1bd8e66e9cadcba06327cae849b79861475deb3 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Wed, 3 Aug 2022 07:30:24 -0700 Subject: [PATCH 17/19] Release 2.0.8.31 Release 2.0.8.31 Change-Id: I60530c697e5ead95868dce10bbdff8d37f337fd4 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 8554cd49fc3d..c10903319e19 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "Z" -#define QWLAN_VERSION_BUILD 30 +#define QWLAN_VERSION_EXTRA "" +#define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "2.0.8.30Z" +#define QWLAN_VERSIONSTR "2.0.8.31" #endif /* QWLAN_VERSION_H */ From 4c069f07e7ebfb2105a0eea87c9c851d4a5b749b Mon Sep 17 00:00:00 2001 From: Ashish Date: Thu, 14 Apr 2022 18:27:17 +0530 Subject: [PATCH 18/19] qcacld-3.0: Init start completion in fw down instead of reovery shutdown Currently driver initializes start completion on recovery shutdown which leads to an issue where userspace thread does not wait when it writes state ctrl params with below event sequence because of which wifi on fails. On fw down driver sets recovery in progress, on shutdown it resets wlan_start_complete and on reinit, it sets wlan_start_complete. Now if driver again receives fw down it sets recovery in progress and when userspace tries to write state ctrl param this thread does not wait here as wlan_start_comp was set in previous SSR sequence. If driver does not block this thread, userspace tries to iface up which fails because SSR is still in progress. To address above issue, init start completion in fw down instead of recovery shutdown so that driver can block the state ctrl param thread until SSR completes, when it tries to set the params. Change-Id: I3fe3768b1ec431620b37055d783de0201371e774 CRs-Fixed: 3244479 --- core/hdd/src/wlan_hdd_driver_ops.c | 2 +- core/hdd/src/wlan_hdd_main.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 7f782feffdb9..3fac407753c1 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -982,7 +982,6 @@ static void __hdd_soc_recovery_shutdown(void) /* recovery starts via firmware down indication; ensure we got one */ QDF_BUG(cds_is_driver_recovering()); - hdd_init_start_completion(); hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) { @@ -2097,6 +2096,7 @@ wlan_hdd_pld_uevent(struct device *dev, struct pld_uevent_data *event_data) cds_set_target_ready(false); cds_set_recovery_in_progress(true); + hdd_init_start_completion(); /* Notify external threads currently waiting on firmware * by forcefully completing waiting events with a "reset" diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 6d89f88084d1..2a1b2efd5349 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -16870,6 +16870,9 @@ static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp, goto exit; } + hdd_info("is_driver_loaded %d is_driver_recovering %d", + cds_is_driver_loaded(), cds_is_driver_recovering()); + if (!cds_is_driver_loaded() || cds_is_driver_recovering()) { rc = wait_for_completion_timeout(&wlan_start_comp, msecs_to_jiffies(HDD_WLAN_START_WAIT_TIME)); From ea311cdd436a78ecedf6f9d4dbafbad3bcb2f34f Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Tue, 16 Aug 2022 07:47:10 -0700 Subject: [PATCH 19/19] Release 2.0.8.31A Release 2.0.8.31A Change-Id: I5ef4d1e3637e43ee8cce2e66936a0036627c64a0 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index c10903319e19..bb7e9f8c1a2c 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "" +#define QWLAN_VERSION_EXTRA "A" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "2.0.8.31" +#define QWLAN_VERSIONSTR "2.0.8.31A" #endif /* QWLAN_VERSION_H */