From df618544a303bc07b8dafac154aaaef6193a473f Mon Sep 17 00:00:00 2001 From: abhinav kumar Date: Thu, 6 Apr 2023 00:11:30 +0530 Subject: [PATCH] qcacmn: Process get_cu_for_each_subbw driver command 1. Read the new service capability: WMI_SERVICE_CCA_BUSY_INFO_FOREACH_20 MHz: Via this host knows whether FW supports reporting of CCA busy info for each 20 MHz subband of wideband scan channel or not. WMI_SERVICE_VDEV_PARAM_CHWIDTH_WITH_NOTIFY_SUPPORT: Via this host knows whether FW supports VDEV param channel width switch with OMN/OMI notification or not 2. Register osif callback to send scan done indication to upper layer 3. Add 2 new scan flags pause_home_channel and report_cca_busy_for_each_20 MHz Change-Id: I63d561a3c5f8e49a3ca42d956e6b630c63edeaf4 CRs-Fixed: 3460901 --- os_if/linux/mlme/inc/osif_vdev_mgr_util.h | 5 ++- os_if/linux/mlme/src/osif_vdev_mgr_util.c | 13 +++++-- os_if/linux/wlan_cfg80211.h | 3 ++ .../init_deinit/src/init_event_handler.c | 9 +++++ .../obj_mgr/inc/wlan_objmgr_psoc_obj.h | 5 +++ umac/mlme/include/wlan_mlme_cmn.h | 31 ++++++++++++++++ .../dispatcher/src/wlan_cmn_mlme_main.c | 28 +++++++++++++++ .../dispatcher/src/wlan_vdev_mlme_main.c | 35 ++++++++++++------- umac/scan/core/src/wlan_scan_manager.c | 22 +++++++++--- .../dispatcher/inc/wlan_scan_public_structs.h | 9 +++-- wmi/inc/wmi_unified_param.h | 5 +++ wmi/src/wmi_unified_tlv.c | 10 ++++++ 12 files changed, 153 insertions(+), 22 deletions(-) diff --git a/os_if/linux/mlme/inc/osif_vdev_mgr_util.h b/os_if/linux/mlme/inc/osif_vdev_mgr_util.h index 2293f5e564..1defa9c3b4 100644 --- a/os_if/linux/mlme/inc/osif_vdev_mgr_util.h +++ b/os_if/linux/mlme/inc/osif_vdev_mgr_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021, 2023 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 above @@ -27,12 +27,15 @@ * struct osif_vdev_mgr_ops - VDEV mgr legacy callbacks * @osif_vdev_mgr_set_mac_addr_response: Callback to indicate set MAC address * response from FW + * @osif_vdev_mgr_send_scan_done_complete_cb: send scan done indication to + * upper layer */ struct osif_vdev_mgr_ops { #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE void (*osif_vdev_mgr_set_mac_addr_response)(uint8_t vdev_id, uint8_t resp_status); #endif + void (*osif_vdev_mgr_send_scan_done_complete_cb)(uint8_t vdev_id); }; /** diff --git a/os_if/linux/mlme/src/osif_vdev_mgr_util.c b/os_if/linux/mlme/src/osif_vdev_mgr_util.c index cf2f0e2d88..21304e1061 100644 --- a/os_if/linux/mlme/src/osif_vdev_mgr_util.c +++ b/os_if/linux/mlme/src/osif_vdev_mgr_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021, 2023 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 above @@ -38,12 +38,21 @@ static QDF_STATUS osif_vdev_mgr_set_mac_addr_response(uint8_t vdev_id, return QDF_STATUS_SUCCESS; } #endif +static void osif_vdev_mgr_send_scan_done_complete_cb(uint8_t vdev_id) +{ + if (osif_vdev_mgr_legacy_ops && + osif_vdev_mgr_legacy_ops->osif_vdev_mgr_send_scan_done_complete_cb) + osif_vdev_mgr_legacy_ops->osif_vdev_mgr_send_scan_done_complete_cb( + vdev_id); +} static struct mlme_vdev_mgr_ops vdev_mgr_ops = { #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE .mlme_vdev_mgr_set_mac_addr_response = - osif_vdev_mgr_set_mac_addr_response + osif_vdev_mgr_set_mac_addr_response, #endif + .mlme_vdev_mgr_send_scan_done_complete_cb = + osif_vdev_mgr_send_scan_done_complete_cb, }; /** diff --git a/os_if/linux/wlan_cfg80211.h b/os_if/linux/wlan_cfg80211.h index befeb3dd2a..6e2cab0319 100644 --- a/os_if/linux/wlan_cfg80211.h +++ b/os_if/linux/wlan_cfg80211.h @@ -175,6 +175,8 @@ * @QCA_NL80211_VENDOR_SUBCMD_AFC_EVENT_INDEX: AFC Event index * @QCA_NL80211_VENDOR_SUBCMD_DOZED_AP_INDEX: Dozed AP event index * @QCA_NL80211_VENDOR_SUBCMD_ROAM_STATS_INDEX: Roam stats index index + * @QCA_NL80211_VENDOR_SUBCMD_CONNECTED_CHANNEL_STATS_INDEX: Connected channel + * stats index * @QCA_NL80211_VENDOR_SUBCMD_DRIVER_DISCONNECT_REASON_INDEX: * Driver disconnect reason index */ @@ -303,6 +305,7 @@ enum qca_nl80211_vendor_subcmds_index { #ifdef WLAN_FEATURE_ROAM_INFO_STATS QCA_NL80211_VENDOR_SUBCMD_ROAM_STATS_INDEX, #endif + QCA_NL80211_VENDOR_SUBCMD_CONNECTED_CHANNEL_STATS_INDEX, }; #if !defined(SUPPORT_WDEV_CFG80211_VENDOR_EVENT_ALLOC) && \ diff --git a/target_if/init_deinit/src/init_event_handler.c b/target_if/init_deinit/src/init_event_handler.c index 96cc5b3a56..da87a85be9 100644 --- a/target_if/init_deinit/src/init_event_handler.c +++ b/target_if/init_deinit/src/init_event_handler.c @@ -451,6 +451,15 @@ static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle, init_deinit_update_vendor_handoff_control_caps(wmi_handle, psoc); + if (wmi_service_enabled(wmi_handle, + wmi_service_cca_busy_info_for_each_20mhz)) + wlan_psoc_nif_fw_ext2_cap_set(psoc, + WLAN_CCA_BUSY_INFO_FOREACH_20MHZ); + if (wmi_service_enabled(wmi_handle, + wmi_service_vdev_param_chwidth_with_notify_support)) + wlan_psoc_nif_fw_ext2_cap_set(psoc, + WLAN_VDEV_PARAM_CHWIDTH_WITH_NOTIFY_SUPPORT); + if (wmi_service_enabled(wmi_handle, wmi_service_ext_msg)) { target_if_debug("Wait for EXT message"); } else { diff --git a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h index f323e0d5e3..8366e7084f 100644 --- a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h +++ b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h @@ -259,6 +259,11 @@ /* 11AZ Trigger based ranging Responder support */ #define WLAN_RTT_11AZ_TB_RSTA_SUPPORT 0x00000200 +/* CCA busy info for each 20Mhz subband of wideband scan channel support */ +#define WLAN_CCA_BUSY_INFO_FOREACH_20MHZ 0x00000400 +/* ch width notify support */ +#define WLAN_VDEV_PARAM_CHWIDTH_WITH_NOTIFY_SUPPORT 0x00000800 + /* PSOC op flags */ /* Invalid VHT cap */ diff --git a/umac/mlme/include/wlan_mlme_cmn.h b/umac/mlme/include/wlan_mlme_cmn.h index f30beaa6ec..972b9a157a 100644 --- a/umac/mlme/include/wlan_mlme_cmn.h +++ b/umac/mlme/include/wlan_mlme_cmn.h @@ -156,12 +156,15 @@ struct mlme_cm_ops { * struct mlme_vdev_mgr_ops - MLME VDEV mgr osif callbacks * @mlme_vdev_mgr_set_mac_addr_response: Callback to indicate set MAC address * response to osif + * @mlme_vdev_mgr_send_scan_done_complete_cb: Callback to indicate scan done + * complete to osif */ struct mlme_vdev_mgr_ops { #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE QDF_STATUS (*mlme_vdev_mgr_set_mac_addr_response)(uint8_t vdev_id, uint8_t resp_status); #endif + void (*mlme_vdev_mgr_send_scan_done_complete_cb)(uint8_t vdev_id); }; /** @@ -310,6 +313,8 @@ struct mlme_twt_ops { * @mlme_cm_ext_rso_stop_cb: callback to send rso stop to FW * @mlme_cm_ext_reassoc_req_cb: callback for reassoc request to * VDEV/PEER SM + * @mlme_psoc_ext_hdl_enable: to enable mlme ext param handler + * @mlme_psoc_ext_hdl_disable: to disable mlme ext param handler * @mlme_vdev_send_set_mac_addr: callback to send set MAC address * request to FW * @mlme_ext_get_acs_inprogress: callback to determine if ACS is @@ -385,6 +390,8 @@ struct mlme_ext_ops { QDF_STATUS (*mlme_cm_ext_reassoc_req_cb)( struct wlan_objmgr_vdev *vdev, struct wlan_cm_vdev_reassoc_req *req); + QDF_STATUS (*mlme_psoc_ext_hdl_enable)(struct wlan_objmgr_psoc *psoc); + QDF_STATUS (*mlme_psoc_ext_hdl_disable)(struct wlan_objmgr_psoc *psoc); #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE QDF_STATUS (*mlme_vdev_send_set_mac_addr)( struct qdf_mac_addr mac_addr, @@ -447,6 +454,22 @@ QDF_STATUS mlme_psoc_ops_ext_hdl_create(struct psoc_mlme_obj *psoc_mlme); */ QDF_STATUS mlme_psoc_ops_ext_hdl_destroy(struct psoc_mlme_obj *psoc_mlme); +/** + * mlme_psoc_ext_enable_cb() - to enable mlme ext param handler callback + * @psoc: psoc common object + * + * Return: QDF_STATUS + */ +QDF_STATUS mlme_psoc_ext_enable_cb(struct wlan_objmgr_psoc *psoc); + +/** + * mlme_psoc_ext_disable_cb() - to disable mlme ext param handler callback + * @psoc: psoc common object + * + * Return: QDF_STATUS + */ +QDF_STATUS mlme_psoc_ext_disable_cb(struct wlan_objmgr_psoc *psoc); + /** * mlme_pdev_ops_ext_hdl_create - Alloc PDEV mlme ext handle * @pdev_mlme: PDEV MLME comp object @@ -1059,6 +1082,14 @@ void mlme_set_osif_twt_cb(osif_twt_get_global_ops_cb twt_osif_ops); */ bool mlme_max_chan_switch_is_set(struct wlan_objmgr_psoc *psoc); +/** + * mlme_send_scan_done_complete_cb() - send scan done indication to upper layer + * @vdev_id: vdev id + * + * Return: none + */ +void mlme_send_scan_done_complete_cb(uint8_t vdev_id); + #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE /** * mlme_vdev_ops_send_set_mac_address() - Send set MAC address request to FW diff --git a/umac/mlme/mlme_objmgr/dispatcher/src/wlan_cmn_mlme_main.c b/umac/mlme/mlme_objmgr/dispatcher/src/wlan_cmn_mlme_main.c index 831c64d4b3..ccedddb21b 100644 --- a/umac/mlme/mlme_objmgr/dispatcher/src/wlan_cmn_mlme_main.c +++ b/umac/mlme/mlme_objmgr/dispatcher/src/wlan_cmn_mlme_main.c @@ -140,6 +140,26 @@ QDF_STATUS mlme_psoc_ops_ext_hdl_create(struct psoc_mlme_obj *psoc_mlme) return ret; } +QDF_STATUS mlme_psoc_ext_enable_cb(struct wlan_objmgr_psoc *psoc) +{ + QDF_STATUS ret = QDF_STATUS_SUCCESS; + + if (glbl_ops && glbl_ops->mlme_psoc_ext_hdl_enable) + ret = glbl_ops->mlme_psoc_ext_hdl_enable(psoc); + + return ret; +} + +QDF_STATUS mlme_psoc_ext_disable_cb(struct wlan_objmgr_psoc *psoc) +{ + QDF_STATUS ret = QDF_STATUS_SUCCESS; + + if (glbl_ops && glbl_ops->mlme_psoc_ext_hdl_disable) + ret = glbl_ops->mlme_psoc_ext_hdl_disable(psoc); + + return ret; +} + QDF_STATUS mlme_psoc_ops_ext_hdl_destroy(struct psoc_mlme_obj *psoc_mlme) { QDF_STATUS ret = QDF_STATUS_SUCCESS; @@ -674,6 +694,14 @@ void mlme_set_ops_register_cb(mlme_get_global_ops_cb ops_cb) glbl_ops_cb = ops_cb; } +void mlme_send_scan_done_complete_cb(uint8_t vdev_id) +{ + if (glbl_vdev_mgr_ops && + glbl_vdev_mgr_ops->mlme_vdev_mgr_send_scan_done_complete_cb) + glbl_vdev_mgr_ops->mlme_vdev_mgr_send_scan_done_complete_cb( + vdev_id); +} + bool mlme_max_chan_switch_is_set(struct wlan_objmgr_psoc *psoc) { struct psoc_mlme_obj *mlme_psoc_obj; diff --git a/umac/mlme/mlme_objmgr/dispatcher/src/wlan_vdev_mlme_main.c b/umac/mlme/mlme_objmgr/dispatcher/src/wlan_vdev_mlme_main.c index b29d11462b..8555ae45f8 100644 --- a/umac/mlme/mlme_objmgr/dispatcher/src/wlan_vdev_mlme_main.c +++ b/umac/mlme/mlme_objmgr/dispatcher/src/wlan_vdev_mlme_main.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 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 above @@ -230,13 +230,20 @@ QDF_STATUS wlan_mlme_psoc_enable(struct wlan_objmgr_psoc *psoc) QDF_STATUS status; struct wlan_lmac_if_mlme_tx_ops *tx_ops; + status = mlme_psoc_ext_enable_cb(psoc); + if (QDF_IS_STATUS_ERROR(status)) { + mlme_err("Failed to register enable mlme ext param handler cb"); + return status; + } + status = wlan_serialization_register_comp_info_cb (psoc, WLAN_UMAC_COMP_MLME, WLAN_SER_CMD_SCAN, mlme_scan_serialization_comp_info_cb); - if (status != QDF_STATUS_SUCCESS) { + if (QDF_IS_STATUS_ERROR(status)) { mlme_err("Serialize scan cmd register failed"); + mlme_psoc_ext_disable_cb(psoc); return status; } @@ -245,7 +252,7 @@ QDF_STATUS wlan_mlme_psoc_enable(struct wlan_objmgr_psoc *psoc) if (tx_ops && tx_ops->vdev_mlme_attach) tx_ops->vdev_mlme_attach(psoc); - return QDF_STATUS_SUCCESS; + return status; } QDF_STATUS wlan_mlme_psoc_disable(struct wlan_objmgr_psoc *psoc) @@ -253,21 +260,23 @@ QDF_STATUS wlan_mlme_psoc_disable(struct wlan_objmgr_psoc *psoc) QDF_STATUS status; struct wlan_lmac_if_mlme_tx_ops *tx_ops; - status = wlan_serialization_deregister_comp_info_cb - (psoc, - WLAN_UMAC_COMP_MLME, - WLAN_SER_CMD_SCAN); - if (status != QDF_STATUS_SUCCESS) { - mlme_err("Serialize scan cmd deregister failed"); - return status; - } - /* Unregister WMI events */ tx_ops = wlan_mlme_get_lmac_tx_ops(psoc); if (tx_ops && tx_ops->vdev_mlme_detach) tx_ops->vdev_mlme_detach(psoc); - return QDF_STATUS_SUCCESS; + status = wlan_serialization_deregister_comp_info_cb + (psoc, + WLAN_UMAC_COMP_MLME, + WLAN_SER_CMD_SCAN); + if (QDF_IS_STATUS_ERROR(status)) + mlme_err("Serialize scan cmd deregister failed"); + + status = mlme_psoc_ext_disable_cb(psoc); + if (QDF_IS_STATUS_ERROR(status)) + mlme_err("Failed to unregister enable mlme ext param hdl cb"); + + return status; } QDF_STATUS wlan_vdev_mlme_init(void) diff --git a/umac/scan/core/src/wlan_scan_manager.c b/umac/scan/core/src/wlan_scan_manager.c index c3bb9deed6..0af36a0b25 100644 --- a/umac/scan/core/src/wlan_scan_manager.c +++ b/umac/scan/core/src/wlan_scan_manager.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 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 @@ -607,8 +607,15 @@ static void scm_req_update_concurrency_params(struct wlan_objmgr_vdev *vdev, if (!req->scan_req.scan_f_passive) req->scan_req.dwell_time_active = scan_obj->scan_def.conc_active_dwell; - req->scan_req.dwell_time_passive = - scan_obj->scan_def.conc_passive_dwell; + /* + * Irrespective of any concurrency, if a scan request is + * triggered to get channel utilization for the current + * connected channel, passive scan dwell time should be + * MLME_GET_CHAN_STATS_PASSIVE_SCAN_TIME + */ + if (!req->scan_req.scan_f_pause_home_channel) + req->scan_req.dwell_time_passive = + scan_obj->scan_def.conc_passive_dwell; req->scan_req.max_rest_time = scan_obj->scan_def.conc_max_rest_time; req->scan_req.min_rest_time = @@ -797,7 +804,14 @@ static void scm_req_update_concurrency_params(struct wlan_objmgr_vdev *vdev, if (sta_active) { req->scan_req.dwell_time_active_6g = scan_obj->scan_def.active_dwell_time_6g_conc; - req->scan_req.dwell_time_passive_6g = + /* + * Irrespective of any concurrency, if a scan request is + * triggered to get channel utilization for the current + * connected channel, 6g passive scan dwell time should be + * MLME_GET_CHAN_STATS_WIDE_BAND_PASSIVE_SCAN_TIME + */ + if (!req->scan_req.scan_f_pause_home_channel) + req->scan_req.dwell_time_passive_6g = scan_obj->scan_def.passive_dwell_time_6g_conc; } } diff --git a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h index 3a116965bb..28663bafbe 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h +++ b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h @@ -1048,6 +1048,10 @@ enum scan_request_type { * @scan_f_2ghz: scan 2.4 GHz channels * @scan_f_5ghz: scan 5 GHz channels * @scan_f_wide_band: scan in 40 MHz or higher bandwidth + * @scan_f_pause_home_channel: To pause home channel in FW when scan channel is + * same as home channel + * @scan_f_report_cca_busy_for_each_20mhz: Allow FW to report CCA busy for each + * possible 20Mhz subbands of the wideband scan channel * @scan_flags: variable to read and set scan_f_* flags in one shot * can be used to dump all scan_f_* flags for debug * @scan_policy_high_accuracy: @@ -1074,7 +1078,6 @@ enum scan_request_type { * @hint_s_ssid: short SSID hints * @hint_bssid: BSSID hints */ - struct scan_req_params { uint32_t scan_id; uint32_t scan_req_id; @@ -1140,7 +1143,9 @@ struct scan_req_params { scan_f_forced:1, scan_f_2ghz:1, scan_f_5ghz:1, - scan_f_wide_band:1; + scan_f_wide_band:1, + scan_f_pause_home_channel:1, + scan_f_report_cca_busy_for_each_20mhz:1; }; uint32_t scan_flags; }; diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 108ca20e10..7621c4728e 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -5980,6 +5980,8 @@ typedef enum { VDEV_PARAM_SET_DISABLED_SCHED_MODES), VDEV_PARAM(vdev_param_set_sap_ps_with_twt, VDEV_PARAM_SET_SAP_PS_WITH_TWT), + VDEV_PARAM(vdev_param_chwidth_with_notify, + VDEV_PARAM_CHWIDTH_WITH_NOTIFY), vdev_param_max, } wmi_conv_vdev_param_id; @@ -6345,6 +6347,9 @@ typedef enum { #ifdef QCA_STANDALONE_SOUNDING_TRIGGER wmi_service_standalone_sound, #endif + wmi_service_cca_busy_info_for_each_20mhz, + wmi_service_vdev_param_chwidth_with_notify_support, + wmi_services_max, } wmi_conv_service_ids; #define WMI_SERVICE_UNAVAILABLE 0xFFFF diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index b8a72ca115..38a80235aa 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -3816,6 +3816,12 @@ static inline void copy_scan_event_cntrl_flags( if (param->scan_f_en_ie_allowlist_in_probe) cmd->scan_ctrl_flags |= WMI_SCAN_ENABLE_IE_WHTELIST_IN_PROBE_REQ; + if (param->scan_f_pause_home_channel) + cmd->scan_ctrl_flags |= + WMI_SCAN_FLAG_PAUSE_HOME_CHANNEL; + if (param->scan_f_report_cca_busy_for_each_20mhz) + cmd->scan_ctrl_flags |= + WMI_SCAN_FLAG_REPORT_CCA_BUSY_FOREACH_20MHZ; /* for adaptive scan mode using 3 bits (21 - 23 bits) */ WMI_SCAN_SET_DWELL_MODE(cmd->scan_ctrl_flags, @@ -22202,6 +22208,10 @@ static void populate_tlv_service(uint32_t *wmi_service) wmi_service[wmi_service_standalone_sound] = WMI_SERVICE_STANDALONE_SOUND; #endif + wmi_service[wmi_service_cca_busy_info_for_each_20mhz] = + WMI_SERVICE_CCA_BUSY_INFO_FOREACH_20MHZ; + wmi_service[wmi_service_vdev_param_chwidth_with_notify_support] = + WMI_SERVICE_VDEV_PARAM_CHWIDTH_WITH_NOTIFY_SUPPORT; } /**