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") /* 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); diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 6a0822a8c41b..3fac407753c1 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; } @@ -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 467ee065e202..2a1b2efd5349 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); } } @@ -16804,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, @@ -16815,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"); @@ -16822,19 +16855,24 @@ 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"); 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)); @@ -16852,8 +16890,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; } 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; } diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 41877f3173f0..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 "S" -#define QWLAN_VERSION_BUILD 30 +#define QWLAN_VERSION_EXTRA "A" +#define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "2.0.8.30S" +#define QWLAN_VERSIONSTR "2.0.8.31A" #endif /* QWLAN_VERSION_H */ 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); 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,