From 07a0dc20c79876d69abfcb63c02d3da4c11fc240 Mon Sep 17 00:00:00 2001 From: Yu Ouyang Date: Tue, 27 Feb 2024 19:06:17 +0800 Subject: [PATCH 01/13] qcacld-3.0: Fix compile error when SDIO enabled Fix compile error when SDIO enabled. Change-Id: Ifd52f2a4f9fb0c36a30bd4867674d13f5c45b912 CRs-Fixed: 3855278 --- components/target_if/ocb/src/target_if_ocb.c | 2 ++ core/dp/htt/htt_rx_hl.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/target_if/ocb/src/target_if_ocb.c b/components/target_if/ocb/src/target_if_ocb.c index c673a716e4..9b9895e201 100644 --- a/components/target_if/ocb/src/target_if_ocb.c +++ b/components/target_if/ocb/src/target_if_ocb.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2018, 2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2025 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 @@ -490,6 +491,7 @@ static int target_if_dcc_get_stats_resp(ol_scn_t scn, rc = 0; } else { target_if_fatal("No dcc_stats_indicate callback"); + response = NULL; rc = -EINVAL; } exit: diff --git a/core/dp/htt/htt_rx_hl.c b/core/dp/htt/htt_rx_hl.c index 9cb2047e3d..92a0c97cc7 100644 --- a/core/dp/htt/htt_rx_hl.c +++ b/core/dp/htt/htt_rx_hl.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2025 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 @@ -71,7 +72,7 @@ htt_set_checksum_result_hl(qdf_nbuf_t msdu, int is_udp = flag & HTT_RX_IND_HL_FLAG_UDP ? 1 : 0; qdf_nbuf_rx_cksum_t cksum = { - QDF_NBUF_RX_CKSUM_NONE, + QDF_NBUF_RX_CKSUM_ZERO, QDF_NBUF_RX_CKSUM_NONE, 0 }; @@ -90,7 +91,7 @@ htt_set_checksum_result_hl(qdf_nbuf_t msdu, cksum.l4_type = QDF_NBUF_RX_CKSUM_TCPIPV6; break; default: - cksum.l4_type = QDF_NBUF_RX_CKSUM_NONE; + cksum.l4_type = QDF_NBUF_RX_CKSUM_ZERO; break; } if (cksum.l4_type != (qdf_nbuf_l4_rx_cksum_type_t) From 1727d9b4d90aba0645bf15e8b13fa4bf947d1280 Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Fri, 28 Feb 2025 03:36:35 -0800 Subject: [PATCH 02/13] Release 2.0.9.23Y Release 2.0.9.23Y Change-Id: Ia52deb36b3a6fc81ccd908b935d37b1d0293073a 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 bf3848e757..06df17098e 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 9 -#define QWLAN_VERSION_EXTRA "X" +#define QWLAN_VERSION_EXTRA "Y" #define QWLAN_VERSION_BUILD 23 -#define QWLAN_VERSIONSTR "2.0.9.23X" +#define QWLAN_VERSIONSTR "2.0.9.23Y" #endif /* QWLAN_VERSION_H */ From 9ace08d70aa971ccbbadd4fb7f646823835a150e Mon Sep 17 00:00:00 2001 From: Mohammed Ahmed Date: Fri, 26 Apr 2024 13:18:46 -0700 Subject: [PATCH 03/13] qcacld-3.0: Update hdd APIs for kernel upgrade With kernel upgrade to 6.7, some APIs have changed. Fix this by updating the usage. Change-Id: I6130a6a834a5c47b841a927e4fef27890a41dc1a CRs-Fixed: 3799604 --- core/hdd/src/wlan_hdd_hostapd.c | 28 ++++++++++++++++++++++++++++ core/hdd/src/wlan_hdd_hostapd.h | 10 +++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 67274301e4..2a59bcaf86 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -7527,6 +7527,33 @@ static int __wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy, return status; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0) +/** + * wlan_hdd_cfg80211_change_beacon() - change beacon content in sap mode + * @wiphy: Pointer to wiphy + * @dev: Pointer to netdev + * @params: Pointer to ap update parameters + * + * Return: zero for success non-zero for failure + */ +int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy, + struct net_device *dev, + struct cfg80211_ap_update *params) +{ + int errno; + struct osif_vdev_sync *vdev_sync; + + errno = osif_vdev_sync_op_start(dev, &vdev_sync); + if (errno) + return errno; + + errno = __wlan_hdd_cfg80211_change_beacon(wiphy, dev, ¶ms->beacon); + + osif_vdev_sync_op_stop(vdev_sync); + + return errno; +} +#else /** * wlan_hdd_cfg80211_change_beacon() - change beacon content in sap mode * @wiphy: Pointer to wiphy @@ -7552,6 +7579,7 @@ int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy, return errno; } +#endif /** * hdd_sap_indicate_disconnect_for_sta() - Indicate disconnect indication diff --git a/core/hdd/src/wlan_hdd_hostapd.h b/core/hdd/src/wlan_hdd_hostapd.h index 13a9b1bbb4..28813fcbc1 100644 --- a/core/hdd/src/wlan_hdd_hostapd.h +++ b/core/hdd/src/wlan_hdd_hostapd.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022, 2025 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 @@ -326,11 +326,15 @@ int wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, int wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_ap_settings *params); - +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0) +int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy, + struct net_device *dev, + struct cfg80211_ap_update *params); +#else int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_beacon_data *params); - +#endif /** * hdd_is_peer_associated - is peer connected to softap * @adapter: pointer to softap adapter From 5c0209aa2014391effe5c64d4eb73ac00081f579 Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Sun, 2 Mar 2025 13:21:23 -0800 Subject: [PATCH 04/13] Release 2.0.9.23Z Release 2.0.9.23Z Change-Id: I15b964bcbdf6572fe2a4270a34ce0a8a4c73664d 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 06df17098e..af5af1114d 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 9 -#define QWLAN_VERSION_EXTRA "Y" +#define QWLAN_VERSION_EXTRA "Z" #define QWLAN_VERSION_BUILD 23 -#define QWLAN_VERSIONSTR "2.0.9.23Y" +#define QWLAN_VERSIONSTR "2.0.9.23Z" #endif /* QWLAN_VERSION_H */ From 6b60196165e94a418fda29297b9d51910aa7b849 Mon Sep 17 00:00:00 2001 From: Rahul Gusain Date: Thu, 8 Feb 2024 12:13:56 +0530 Subject: [PATCH 05/13] qcacld-3.0: Dynamically select Iface combination Currently, driver maintains interface combination static arrays for different configurations using some compilation feature flags. The use of compilation flags results in static configuration but if user wants to try different configuration, it requires new build. So, to allow dynamic selection for interface combination, defines INI values instead of compilation feature flags which help to set different configurations for the same build. Change-Id: Iad0c3d1aaa49c9ac2183b09bb089c7a54e82630a CRs-Fixed: 3734240 --- configs/config_to_feature.h | 16 -- core/hdd/inc/hdd_config.h | 132 ++++++++- core/hdd/inc/wlan_hdd_main.h | 22 +- core/hdd/src/wlan_hdd_cfg80211.c | 477 ++++++++++++++++++++++--------- core/hdd/src/wlan_hdd_main.c | 14 +- 5 files changed, 506 insertions(+), 155 deletions(-) diff --git a/configs/config_to_feature.h b/configs/config_to_feature.h index 667e11da93..1969824cea 100644 --- a/configs/config_to_feature.h +++ b/configs/config_to_feature.h @@ -1880,22 +1880,6 @@ #define WLAN_FEATURE_SAP_ACS_OPTIMIZE (1) #endif -#ifdef CONFIG_WLAN_FEATURE_NO_STA_SAP_CONCURRENCY -#define WLAN_FEATURE_NO_STA_SAP_CONCURRENCY (1) -#endif - -#ifdef CONFIG_WLAN_FEATURE_NO_STA_NAN_CONCURRENCY -#define WLAN_FEATURE_NO_STA_NAN_CONCURRENCY (1) -#endif - -#ifdef CONFIG_WLAN_FEATURE_NO_P2P_CONCURRENCY -#define WLAN_FEATURE_NO_P2P_CONCURRENCY (1) -#endif - -#ifdef CONFIG_WLAN_FEATURE_NO_SAP_NAN_CONCURRENCY -#define WLAN_FEATURE_NO_SAP_NAN_CONCURRENCY (1) -#endif - #ifdef CONFIG_VERBOSE_DEBUG #define ENABLE_VERBOSE_DEBUG (1) #endif diff --git a/core/hdd/inc/hdd_config.h b/core/hdd/inc/hdd_config.h index cb8c85830f..7fc253c07d 100644 --- a/core/hdd/inc/hdd_config.h +++ b/core/hdd/inc/hdd_config.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2025 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 @@ -1852,6 +1852,129 @@ enum host_log_level { #define CFG_DYNAMIC_MAC_ADDR_UPDATE_SUPPORTED_ALL #endif +/* + * + * g_no_p2p_concurrency - disable P2P concurrency + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini will not allow P2P iface to be included in the iface combinations. + * + * 0: enable P2P concurrency + * 1: disable P2P concurrency + * Related: None + * + * Supported Feature: IFACE combinations + * + * Usage: External + * + * + */ +#define CFG_NO_P2P_CONCURRENCY CFG_INI_BOOL( \ + "g_no_p2p_concurrency", \ + 0, \ + "This ini is used to disable P2P concurrency") + +/* + * + * g_no_sap_nan_concurrency - disable SAP-NAN concurrency + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini will not allow SAP-NAN Concurrency to be included in the + * iface combinations. + * + * 0: enable SAP-NAN concurrency + * 1: disable SAP-NAN concurrency + * Related: None + * + * Supported Feature: IFACE combinations + * + * Usage: External + * + * + */ +#define CFG_NO_SAP_NAN_CONCURRENCY CFG_INI_BOOL( \ + "g_no_sap_nan_concurrency", \ + 0, \ + "This ini is used to disable SAP-NAN concurrency") + +/* + * + * g_no_sta_nan_concurrency - disable STA-NAN concurrency + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini will not allow STA-NAN Concurrency to be included in the + * iface combinations. + * + * 0: enable STA-NAN concurrency + * 1: disable STA-NAN concurrency + * Related: None + * + * Supported Feature: IFACE combinations + * + * Usage: External + * + * + */ +#define CFG_NO_STA_NAN_CONCURRENCY CFG_INI_BOOL( \ + "g_no_sta_nan_concurrency", \ + 0, \ + "This ini is used to disable STA-NAN concurrency") +/* + * + * g_no_sta_sap_concurrency - disable STA-SAP concurrency + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini will not allow STA-SAP concurrency to be included in the + * iface combinations. + * + * 0: enable STA-SAP concurrency + * 1: disable STA-SAP concurrency + * Related: None + * + * Supported Feature: IFACE combinations + * + * Usage: External + * + * + */ +#define CFG_NO_STA_SAP_CONCURRENCY CFG_INI_BOOL( \ + "g_no_sta_sap_concurrency", \ + 0, \ + "This ini is used to disable STA-SAP concurrency") + +/* + * + * g_sta_sap_p2p_concurrency - enable STA-SAP-P2P concurrency + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini will not allow STA-SAP-P2P concurrency to be included in the + * iface combinations. + * + * 0: disable STA-SAP-P2P concurrency + * 1: enable STA-SAP-P2P concurrency + * Related: None + * + * Supported Feature: IFACE combinations + * + * Usage: External + * + * + */ +#define CFG_STA_SAP_P2P_CONCURRENCY CFG_INI_BOOL( \ + "g_sta_sap_p2p_concurrency", \ + 0, \ + "This ini is used to enable STA-SAP-P2P concurrency") + #define CFG_HDD_ALL \ CFG_DYNAMIC_MAC_ADDR_UPDATE_SUPPORTED_ALL \ CFG_ENABLE_PACKET_LOG_ALL \ @@ -1901,5 +2024,10 @@ enum host_log_level { CFG(CFG_SAR_CONVERSION) \ CFG(CFG_ENABLE_HOST_MODULE_LOG_LEVEL) \ SAR_SAFETY_FEATURE_ALL \ - CFG_CPU_CXPC_THRESHOLD_ALL + CFG_CPU_CXPC_THRESHOLD_ALL \ + CFG(CFG_NO_STA_SAP_CONCURRENCY) \ + CFG(CFG_NO_STA_NAN_CONCURRENCY) \ + CFG(CFG_NO_SAP_NAN_CONCURRENCY) \ + CFG(CFG_NO_P2P_CONCURRENCY) \ + CFG(CFG_STA_SAP_P2P_CONCURRENCY) #endif diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 1631c69314..19758cac6a 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2025 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 @@ -2021,6 +2021,7 @@ struct hdd_rtpm_tput_policy_context { * @hdd_dual_sta_policy: Concurrent STA policy configuration * @last_pagefault_ssr_time: Time when last recovery was triggered because of * @host wakeup from fw with reason as pagefault + * @combination: interface combination register to wiphy */ struct hdd_context { struct wlan_objmgr_psoc *psoc; @@ -2402,6 +2403,7 @@ struct hdd_context { uint8_t power_type; #endif qdf_time_t last_pagefault_ssr_time; + struct ieee80211_iface_combination *combination; }; /** @@ -5363,4 +5365,22 @@ static inline int hdd_set_suspend_mode(struct hdd_context *hdd_ctx) */ void hdd_update_multicast_list(struct wlan_objmgr_vdev *vdev); +/** + * wlan_hdd_alloc_iface_combination_mem() - This API will allocate memory for + * interface combinations + * @hdd_ctx: HDD context + * + * Return: 0 on success and -ENOMEM on failure + */ +int wlan_hdd_alloc_iface_combination_mem(struct hdd_context *hdd_ctx); + +/** + * wlan_hdd_free_iface_combination_mem() - This API will free memory for + * interface combinations + * @hdd_ctx: HDD context + * + * Return: none + */ +void wlan_hdd_free_iface_combination_mem(struct hdd_context *hdd_ctx); + #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 22a0ee0628..27a819555f 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2025 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 @@ -770,6 +770,14 @@ static struct ieee80211_iface_combination .beacon_int_min_gcd = 1, #endif }, + /* STA + P2P */ + { + .limits = wlan_hdd_sta_p2p_iface_limit, + .num_different_channels = 2, + .max_interfaces = 2, + .n_limits = ARRAY_SIZE(wlan_hdd_sta_p2p_iface_limit), + .beacon_int_infra_match = true, + }, /* STA + P2P + P2P */ { .limits = wlan_hdd_sta_p2p_iface_limit, @@ -834,103 +842,6 @@ static struct ieee80211_iface_combination #endif /* WLAN_FEATURE_NAN */ }; -/* 1 and 2 port concurrencies */ -static struct ieee80211_iface_combination - wlan_hdd_derived_combination[] = { - /* STA */ - { - .limits = wlan_hdd_sta_iface_limit, - .num_different_channels = 2, - .max_interfaces = 2, - .n_limits = ARRAY_SIZE(wlan_hdd_sta_iface_limit), - }, - /* AP */ - { - .limits = wlan_hdd_ap_iface_limit, - .num_different_channels = 2, - .max_interfaces = (QDF_MAX_NO_OF_SAP_MODE), - .n_limits = ARRAY_SIZE(wlan_hdd_ap_iface_limit), -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)) || \ - defined(CFG80211_BEACON_INTERVAL_BACKPORT) - .beacon_int_min_gcd = 1, -#endif - }, -#ifndef WLAN_FEATURE_NO_P2P_CONCURRENCY - /* P2P */ - { - .limits = wlan_hdd_p2p_iface_limit, - .num_different_channels = 2, - .max_interfaces = 2, - .n_limits = ARRAY_SIZE(wlan_hdd_p2p_iface_limit), - }, - - /* SAP + P2P */ - { - .limits = wlan_hdd_sap_p2p_iface_limit, - .num_different_channels = 2, - /* 1-SAP + 1-P2P */ - .max_interfaces = 2, - .n_limits = ARRAY_SIZE(wlan_hdd_sap_p2p_iface_limit), - .beacon_int_infra_match = true, - }, - /* P2P + P2P */ - { - .limits = wlan_hdd_p2p_p2p_iface_limit, - .num_different_channels = 2, - /* 2-P2P */ - .max_interfaces = 2, - .n_limits = ARRAY_SIZE(wlan_hdd_p2p_p2p_iface_limit), - .beacon_int_infra_match = true, - }, -#endif - /* STA + P2P */ - { - .limits = wlan_hdd_sta_p2p_iface_limit, - .num_different_channels = 2, - .max_interfaces = 2, - .n_limits = ARRAY_SIZE(wlan_hdd_sta_p2p_iface_limit), - .beacon_int_infra_match = true, - }, -#ifndef WLAN_FEATURE_NO_STA_SAP_CONCURRENCY - /* STA + SAP */ - { - .limits = wlan_hdd_sta_ap_iface_limit, - .num_different_channels = 2, - .max_interfaces = 2, - .n_limits = ARRAY_SIZE(wlan_hdd_sta_ap_iface_limit), - .beacon_int_infra_match = true, - }, -#endif /* WLAN_FEATURE_NO_STA_SAP_CONCURRENCY */ - /* Monitor */ - { - .limits = wlan_hdd_mon_iface_limit, - .max_interfaces = 2, - .num_different_channels = 2, - .n_limits = ARRAY_SIZE(wlan_hdd_mon_iface_limit), - }, -#if defined(WLAN_FEATURE_NAN) && \ - (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)) -#ifndef WLAN_FEATURE_NO_STA_NAN_CONCURRENCY - /* NAN + STA */ - { - .limits = wlan_hdd_sta_nan_iface_limit, - .max_interfaces = 2, - .num_different_channels = 2, - .n_limits = ARRAY_SIZE(wlan_hdd_sta_nan_iface_limit), - }, -#endif /* WLAN_FEATURE_NO_STA_NAN_CONCURRENCY */ -#ifndef WLAN_FEATURE_NO_SAP_NAN_CONCURRENCY - /* NAN + SAP */ - { - .limits = wlan_hdd_sap_nan_iface_limit, - .num_different_channels = 2, - .max_interfaces = 2, - .n_limits = ARRAY_SIZE(wlan_hdd_sap_nan_iface_limit), - .beacon_int_infra_match = true, - }, -#endif /* !WLAN_FEATURE_NO_SAP_NAN_CONCURRENCY */ -#endif /* WLAN_FEATURE_NAN */ -}; static struct cfg80211_ops wlan_hdd_cfg80211_ops; #ifdef WLAN_NL80211_TESTMODE @@ -19300,6 +19211,338 @@ static void wlan_hdd_set_mfp_optional(struct wiphy *wiphy) } #endif +/** + * wlan_hdd_iface_debug_string() - This API converts IFACE type to string + * @iface_type: interface type + * + * Return: name string + */ +static char *wlan_hdd_iface_debug_string(uint32_t iface_type) +{ + if (iface_type == BIT(NL80211_IFTYPE_STATION)) + return "STA"; + else if (iface_type == BIT(NL80211_IFTYPE_AP)) + return "SAP"; + else if (iface_type == (BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO))) + return "(P2P_CLI or P2P_GO)"; + else if (iface_type == BIT(NL80211_IFTYPE_P2P_CLIENT)) + return "P2P_CLIENT"; + else if (iface_type == BIT(NL80211_IFTYPE_P2P_GO)) + return "P2P_GO"; + else if (iface_type == BIT(NL80211_IFTYPE_NAN)) + return "NAN"; + else if (iface_type == BIT(NL80211_IFTYPE_MONITOR)) + return "MONITOR"; + + return "invalid iface"; +} + +#define IFACE_DUMP_SIZE 100 +/** + * wlan_hdd_dump_iface_combinations() - This API prints the IFACE combinations + * @num: number of combinations + * @combination: pointer to iface combination structure + * + * Return: void + */ +static void wlan_hdd_dump_iface_combinations(uint32_t num, + const struct ieee80211_iface_combination *combination) +{ + int i, j, k; + char buf[IFACE_DUMP_SIZE] = {0}; + uint8_t len = 0; + + hdd_debug("max combinations %d", num); + + for (i = 0; i < num; i++) { + for (j = 0; j < combination[i].n_limits; j++) { + for (k = 0; k < combination[i].limits[j].max; k++) { + if (combination[i].limits[j].types) + len += qdf_scnprintf(buf + len, + IFACE_DUMP_SIZE - len, + k == 0 && j == 0 ? "%s" : "+%s", + wlan_hdd_iface_debug_string( + combination[i].limits[j].types)); + } + } + + hdd_nofl_debug("iface combination[%d]: %s", i, buf); + len = 0; + } +} + +/** + * wlan_hdd_is_sta_sap_concurrency_present() - This API checks whether STA and + * SAP present in the interface combination + * @idx: index for interface combination array + * + * Return: true if STA and SAP interface is present otherwise false + */ +static bool wlan_hdd_is_sta_sap_concurrency_present(uint8_t idx) +{ + int j = 0; + bool sta_present = false; + bool sap_present = false; + + for (j = 0; j < wlan_hdd_iface_combination[idx].n_limits; j++) { + if (wlan_hdd_iface_combination[idx].limits[j].types == + BIT(NL80211_IFTYPE_STATION)) + sta_present = true; + else if (wlan_hdd_iface_combination[idx].limits[j].types == + BIT(NL80211_IFTYPE_AP)) + sap_present = true; + } + + return (sta_present && sap_present); +} + +/** + * wlan_hdd_is_sta_nan_concurrency_present() - This API checks whether STA and + * NAN present in the interface combination + * @idx: index for interface combination array + * + * Return: true if STA and NAN interface is present otherwise false + */ +static bool wlan_hdd_is_sta_nan_concurrency_present(uint8_t idx) +{ + int j = 0; + bool nan_present = false; + bool sta_present = false; + + for (j = 0; j < wlan_hdd_iface_combination[idx].n_limits; j++) { + if (wlan_hdd_iface_combination[idx].limits[j].types == + BIT(NL80211_IFTYPE_NAN)) + nan_present = true; + else if (wlan_hdd_iface_combination[idx].limits[j].types == + BIT(NL80211_IFTYPE_STATION)) + sta_present = true; + } + + return (nan_present && sta_present); +} + +/** + * wlan_hdd_is_sap_nan_concurrency_present() - This API checks whether SAP and + * NAN present in the interface combination + * @idx: index for interface combination array + * + * Return: true if SAP and NAN interface is present otherwise false + */ +static bool wlan_hdd_is_sap_nan_concurrency_present(uint8_t idx) +{ + int j = 0; + bool nan_present = false; + bool sap_present = false; + + for (j = 0; j < wlan_hdd_iface_combination[idx].n_limits; j++) { + if (wlan_hdd_iface_combination[idx].limits[j].types == + BIT(NL80211_IFTYPE_NAN)) + nan_present = true; + else if (wlan_hdd_iface_combination[idx].limits[j].types == + BIT(NL80211_IFTYPE_AP)) + sap_present = true; + } + + return (nan_present && sap_present); +} + +/** + * wlan_hdd_is_p2p_iface_present() - This API checks whether P2P present + * in the interface combination + * @idx: index for interface combination array + * + * Return: true if SAP interface is present otherwise false + */ +static bool wlan_hdd_is_p2p_iface_present(uint8_t idx) +{ + int j = 0; + bool p2p_present = false; + + for (j = 0; j < wlan_hdd_iface_combination[idx].n_limits; j++) { + if (wlan_hdd_iface_combination[idx].limits[j].types == + BIT(NL80211_IFTYPE_P2P_CLIENT) || + wlan_hdd_iface_combination[idx].limits[j].types == + BIT(NL80211_IFTYPE_P2P_GO) || + (wlan_hdd_iface_combination[idx].limits[j].types == + (BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO)))) + p2p_present = true; + } + + return p2p_present; +} + +/** + * wlan_hdd_is_sta_p2p_concurrency_present() - This API checks whether STA + P2P + * only present in the interface combination + * @idx: index for interface combination array + * + * Return: true if STA and P2P interface is present otherwise false + */ +static bool wlan_hdd_is_sta_p2p_concurrency_present(uint8_t idx) +{ + int j = 0; + bool p2p_present = false; + bool sta_present = false; + + if (wlan_hdd_iface_combination[idx].max_interfaces != 2) + return false; + + for (j = 0; j < wlan_hdd_iface_combination[idx].n_limits; j++) { + if (wlan_hdd_iface_combination[idx].limits[j].types == + (BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO))) + p2p_present = true; + else if (wlan_hdd_iface_combination[idx].limits[j].types == + BIT(NL80211_IFTYPE_STATION)) + sta_present = true; + } + + return (p2p_present && sta_present); +} + +/** + * wlan_hdd_is_p2p_concurrency_present() - This API checks whether P2P + * concurrency is present in the interface combination + * @sta_sap_p2p_concurrency: flag to check STA-SAP-P2P concurrency + * @idx: index for interface combination array + * + * This API will allow the P2P concurrencies with following exception: + * a) STA-P2P + * b) STA-SAP-P2P when g_sta_sap_p2p INI is enabled + * + * Return: true if P2P allowed otherwise false + */ +static bool wlan_hdd_is_p2p_concurrency_present(bool sta_sap_p2p_concurrency, + uint8_t idx) +{ + if (wlan_hdd_is_sta_p2p_concurrency_present(idx)) + return false; + + if (!wlan_hdd_is_p2p_iface_present(idx)) + return false; + + if (sta_sap_p2p_concurrency && + wlan_hdd_is_sta_sap_concurrency_present(idx)) + return false; + + return true; +} + +int wlan_hdd_alloc_iface_combination_mem(struct hdd_context *hdd_ctx) +{ + uint8_t num = ARRAY_SIZE(wlan_hdd_iface_combination); + + hdd_ctx->combination = + qdf_mem_malloc(num * sizeof(wlan_hdd_iface_combination)); + + if (!hdd_ctx->combination) + return -ENOMEM; + + return 0; +} + +void wlan_hdd_free_iface_combination_mem(struct hdd_context *hdd_ctx) +{ + if (hdd_ctx->combination) { + qdf_mem_free(hdd_ctx->combination); + hdd_ctx->combination = NULL; + } +} + +/** + * wlan_hdd_update_iface_combination() - This API updates interface combination + * @hdd_ctx: HDD context + * @wiphy: WIPHY structure pointer + * @allow_mcc_go_diff_bi: allow MCC go different beacon interval + * @enable_mcc: enable MCC feature + * + * Return: none + */ +static void wlan_hdd_update_iface_combination(struct hdd_context *hdd_ctx, + struct wiphy *wiphy, + uint8_t allow_mcc_go_diff_bi, + uint8_t enable_mcc) +{ + uint8_t i, j = 0; + bool dbs_one_by_one, dbs_two_by_two; + struct wlan_objmgr_psoc *psoc = hdd_ctx->psoc; + bool no_p2p_concurrency, no_sap_nan_concurrency, no_sta_sap_concurrency; + bool no_sta_nan_concurrency, sta_sap_p2p_concurrency; + uint8_t num; + QDF_STATUS status; + + if (!hdd_ctx->config->advertise_concurrent_operation) + return; + + status = ucfg_policy_mgr_get_dbs_hw_modes(psoc, &dbs_one_by_one, + &dbs_two_by_two); + + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("HW mode failure"); + return; + } + + no_p2p_concurrency = cfg_get(psoc, CFG_NO_P2P_CONCURRENCY); + no_sta_nan_concurrency = cfg_get(psoc, CFG_NO_STA_NAN_CONCURRENCY); + no_sap_nan_concurrency = cfg_get(psoc, CFG_NO_SAP_NAN_CONCURRENCY); + no_sta_sap_concurrency = cfg_get(psoc, CFG_NO_STA_SAP_CONCURRENCY); + sta_sap_p2p_concurrency = cfg_get(psoc, CFG_STA_SAP_P2P_CONCURRENCY); + + num = ARRAY_SIZE(wlan_hdd_iface_combination); + + for (i = 0; i < num; i++) { + /* Filter for non-DBS targets */ + if (!ucfg_policy_mgr_is_fw_supports_dbs(psoc) && + wlan_hdd_iface_combination[i].max_interfaces > 2) + continue; + + /* Filter for 1x1 DBS targets */ + if ((dbs_one_by_one && !dbs_two_by_two) && + wlan_hdd_iface_combination[i].max_interfaces > 2) + continue; + + /* + * remove P2P concurrencies with following exception: + * a) STA-P2P + * b) STA-SAP-P2P when g_sta_sap_p2p INI is enabled + */ + if (no_p2p_concurrency && + wlan_hdd_is_p2p_concurrency_present(sta_sap_p2p_concurrency, + i)) + continue; + + /* remove STA NAN concurrency */ + if (no_sta_nan_concurrency && + wlan_hdd_is_sta_nan_concurrency_present(i)) + continue; + + /* remove SAP NAN concurrency */ + if (no_sap_nan_concurrency && + wlan_hdd_is_sap_nan_concurrency_present(i)) + continue; + + /* remove STA SAP concurrency */ + if (no_sta_sap_concurrency && + wlan_hdd_is_sta_sap_concurrency_present(i)) + continue; + + hdd_ctx->combination[j] = wlan_hdd_iface_combination[i]; + + if (enable_mcc && !allow_mcc_go_diff_bi) + hdd_ctx->combination[j].beacon_int_infra_match = true; + + j++; + } + + wiphy->iface_combinations = hdd_ctx->combination; + + wiphy->n_iface_combinations = j; + + wlan_hdd_dump_iface_combinations(wiphy->n_iface_combinations, + wiphy->iface_combinations); +} /* * In this function, wiphy structure is updated after QDF * initialization. In wlan_hdd_cfg80211_init, only the @@ -19316,8 +19559,6 @@ void wlan_hdd_update_wiphy(struct hdd_context *hdd_ctx) uint8_t allow_mcc_go_diff_bi = 0, enable_mcc = 0; bool is_bigtk_supported; bool is_ocv_supported; - uint8_t iface_num; - bool dbs_one_by_one, dbs_two_by_two; if (!wiphy) { hdd_err("Invalid wiphy"); @@ -19368,40 +19609,8 @@ void wlan_hdd_update_wiphy(struct hdd_context *hdd_ctx) ucfg_mlme_get_mcc_feature(hdd_ctx->psoc, &enable_mcc)) hdd_err("can't get enable_mcc value, use default"); - if (hdd_ctx->config->advertise_concurrent_operation) { - if (enable_mcc) { - int i; - - for (i = 0; - i < ARRAY_SIZE(wlan_hdd_iface_combination); - i++) { - if (!allow_mcc_go_diff_bi) - wlan_hdd_iface_combination[i]. - beacon_int_infra_match = true; - } - } - - status = ucfg_policy_mgr_get_dbs_hw_modes(hdd_ctx->psoc, - &dbs_one_by_one, - &dbs_two_by_two); - - if (QDF_IS_STATUS_ERROR(status)) { - hdd_err("HW mode failure"); - return; - } - - if (!ucfg_policy_mgr_is_fw_supports_dbs(hdd_ctx->psoc) || - (dbs_one_by_one && !dbs_two_by_two)) { - wiphy->iface_combinations = - wlan_hdd_derived_combination; - iface_num = ARRAY_SIZE(wlan_hdd_derived_combination); - } else { - wiphy->iface_combinations = wlan_hdd_iface_combination; - iface_num = ARRAY_SIZE(wlan_hdd_iface_combination); - } - - wiphy->n_iface_combinations = iface_num; - } + wlan_hdd_update_iface_combination(hdd_ctx, wiphy, allow_mcc_go_diff_bi, + enable_mcc); mac_spoofing_enabled = ucfg_scan_is_mac_spoofing_enabled(hdd_ctx->psoc); if (mac_spoofing_enabled) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 83c026c1dc..c6a2c7b46b 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9988,6 +9988,8 @@ void hdd_wlan_exit(struct hdd_context *hdd_ctx) hdd_lpass_notify_stop(hdd_ctx); } + wlan_hdd_free_iface_combination_mem(hdd_ctx); + hdd_deinit_regulatory_update_event(hdd_ctx); hdd_exit_netlink_services(hdd_ctx); #ifdef FEATURE_WLAN_CH_AVOID @@ -16349,18 +16351,23 @@ int hdd_wlan_startup(struct hdd_context *hdd_ctx) hdd_driver_memdump_init(); hdd_dp_trace_init(hdd_ctx->config); + errno = wlan_hdd_alloc_iface_combination_mem(hdd_ctx); + if (errno) { + hdd_err("failed to alloc iface combination mem"); + goto memdump_deinit; + } errno = hdd_init_regulatory_update_event(hdd_ctx); if (errno) { hdd_err("Failed to initialize regulatory update event; errno:%d", errno); - goto memdump_deinit; + goto free_iface_comb; } errno = hdd_wlan_start_modules(hdd_ctx, false); if (errno) { hdd_err("Failed to start modules; errno:%d", errno); - goto memdump_deinit; + goto free_iface_comb; } if (hdd_get_conparam() == QDF_GLOBAL_EPPING_MODE) @@ -16420,6 +16427,9 @@ unregister_wiphy: stop_modules: hdd_wlan_stop_modules(hdd_ctx, false); +free_iface_comb: + wlan_hdd_free_iface_combination_mem(hdd_ctx); + memdump_deinit: hdd_driver_memdump_deinit(); osif_request_manager_deinit(); From 105f69020e92fe43a30df2bf477bf139c8741710 Mon Sep 17 00:00:00 2001 From: Rahul Gusain Date: Fri, 7 Feb 2025 13:27:57 +0530 Subject: [PATCH 06/13] qcacld-3.0: Don't advertise NAN if NAN INI disabled Currently, driver advertise NAN combinations in wiphy registration even if user disable the NAN INI. So, to fix this, add check NAN INI before registering to NAN interface mode and combination. Change-Id: I4847b23a0f5ecc5918e49a0ea9ab2e9df9ec0873 CRs-Fixed: 3995677 --- components/nan/core/src/nan_main.c | 15 +++++++++- components/nan/core/src/nan_main_i.h | 11 +++++-- components/nan/dispatcher/inc/nan_ucfg_api.h | 15 +++++++++- components/nan/dispatcher/src/nan_ucfg_api.c | 15 +++++----- core/hdd/src/wlan_hdd_cfg80211.c | 30 ++++++++++++++++++-- 5 files changed, 72 insertions(+), 14 deletions(-) diff --git a/components/nan/core/src/nan_main.c b/components/nan/core/src/nan_main.c index dbfe0e3897..723a58007c 100644 --- a/components/nan/core/src/nan_main.c +++ b/components/nan/core/src/nan_main.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2022, 2024-2025 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 @@ -1413,3 +1413,16 @@ bool wlan_nan_is_beamforming_supported(struct wlan_objmgr_psoc *psoc) { return ucfg_nan_is_beamforming_supported(psoc); } + +bool nan_is_allowed(struct wlan_objmgr_psoc *psoc) +{ + struct nan_psoc_priv_obj *psoc_nan_obj; + + psoc_nan_obj = nan_get_psoc_priv_obj(psoc); + if (!psoc_nan_obj) { + nan_err("psoc_nan_obj is null"); + return false; + } + + return psoc_nan_obj->cfg_param.enable; +} diff --git a/components/nan/core/src/nan_main_i.h b/components/nan/core/src/nan_main_i.h index d1b6cdbe0c..c684357609 100644 --- a/components/nan/core/src/nan_main_i.h +++ b/components/nan/core/src/nan_main_i.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021,2025 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 @@ -287,6 +287,13 @@ bool nan_is_disc_active(struct wlan_objmgr_psoc *psoc); QDF_STATUS nan_get_connection_info(struct wlan_objmgr_psoc *psoc, uint8_t *chan, uint8_t *mac_id); - +/** + * nan_is_allowed() - This API will check for NAN enable INI + * + * @psoc: pointer to PSOC object + * + * Return: true if NAN is allowed otherwise false + */ +bool nan_is_allowed(struct wlan_objmgr_psoc *psoc); #endif /* _WLAN_NAN_MAIN_I_H_ */ #endif /* WLAN_FEATURE_NAN */ diff --git a/components/nan/dispatcher/inc/nan_ucfg_api.h b/components/nan/dispatcher/inc/nan_ucfg_api.h index 3f4dd7bfd4..12ae427a03 100644 --- a/components/nan/dispatcher/inc/nan_ucfg_api.h +++ b/components/nan/dispatcher/inc/nan_ucfg_api.h @@ -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-2022, 2025 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 @@ -537,6 +537,14 @@ bool ucfg_get_disable_6g_nan(struct wlan_objmgr_psoc *psoc); */ bool ucfg_is_mlo_sta_nan_ndi_allowed(struct wlan_objmgr_psoc *psoc); +/** + * ucfg_nan_is_allowed() - This API is wrapper for function nan_is_allowed() + * + * @psoc: pointer to PSOC object + * + * Return: true if nan is allowed otherwise false + */ +bool ucfg_nan_is_allowed(struct wlan_objmgr_psoc *psoc); #else /* WLAN_FEATURE_NAN */ static inline @@ -679,5 +687,10 @@ ucfg_is_mlo_sta_nan_ndi_allowed(struct wlan_objmgr_psoc *psoc) { return false; } + +static inline bool ucfg_nan_is_allowed(struct wlan_objmgr_psoc *psoc) +{ + return false; +} #endif /* WLAN_FEATURE_NAN */ #endif /* _NAN_UCFG_API_H_ */ diff --git a/components/nan/dispatcher/src/nan_ucfg_api.c b/components/nan/dispatcher/src/nan_ucfg_api.c index a0dd5f0653..8b59a2d747 100644 --- a/components/nan/dispatcher/src/nan_ucfg_api.c +++ b/components/nan/dispatcher/src/nan_ucfg_api.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2025 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 @@ -1276,12 +1276,6 @@ bool ucfg_nan_is_beamforming_supported(struct wlan_objmgr_psoc *psoc) return psoc_nan_obj->nan_caps.ndi_txbf_supported; } -static inline bool -ucfg_is_nan_enabled(struct nan_psoc_priv_obj *psoc_nan_obj) -{ - return psoc_nan_obj->cfg_param.enable; -} - static inline bool ucfg_nan_is_vdev_creation_supp_by_fw(struct nan_psoc_priv_obj *psoc_nan_obj) { @@ -1353,7 +1347,7 @@ bool ucfg_nan_is_vdev_creation_allowed(struct wlan_objmgr_psoc *psoc) return false; } - if (!ucfg_is_nan_enabled(psoc_nan_obj)) { + if (!nan_is_allowed(psoc)) { nan_debug("NAN is not enabled"); return false; } @@ -1448,3 +1442,8 @@ bool ucfg_is_mlo_sta_nan_ndi_allowed(struct wlan_objmgr_psoc *psoc) { return wlan_is_mlo_sta_nan_ndi_allowed(psoc); } + +bool ucfg_nan_is_allowed(struct wlan_objmgr_psoc *psoc) +{ + return nan_is_allowed(psoc); +} diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 27a819555f..d1070c082d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -18893,8 +18893,6 @@ int wlan_hdd_cfg80211_init(struct device *dev, | BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_MONITOR); - wlan_hdd_set_nan_if_mode(wiphy); - /* * In case of static linked driver at the time of driver unload, * module exit doesn't happens. Module cleanup helps in cleaning @@ -19451,6 +19449,26 @@ void wlan_hdd_free_iface_combination_mem(struct hdd_context *hdd_ctx) } } +/** + * wlan_hdd_is_iface_nan() - This API checks whether NAN interface is present + * in the interface combination + * @idx: index for interface combination array + * + * Return: true if NAN interface is present otherwise false + */ +static bool wlan_hdd_is_iface_nan(uint8_t idx) +{ + uint8_t j; + + for (j = 0; j < wlan_hdd_iface_combination[idx].n_limits; j++) { + if (wlan_hdd_iface_combination[idx].limits[j].types == + BIT(NL80211_IFTYPE_NAN)) + return true; + } + + return false; +} + /** * wlan_hdd_update_iface_combination() - This API updates interface combination * @hdd_ctx: HDD context @@ -19472,6 +19490,7 @@ static void wlan_hdd_update_iface_combination(struct hdd_context *hdd_ctx, bool no_sta_nan_concurrency, sta_sap_p2p_concurrency; uint8_t num; QDF_STATUS status; + bool is_nan_allowed; if (!hdd_ctx->config->advertise_concurrent_operation) return; @@ -19491,6 +19510,9 @@ static void wlan_hdd_update_iface_combination(struct hdd_context *hdd_ctx, sta_sap_p2p_concurrency = cfg_get(psoc, CFG_STA_SAP_P2P_CONCURRENCY); num = ARRAY_SIZE(wlan_hdd_iface_combination); + is_nan_allowed = ucfg_nan_is_allowed(psoc); + if (is_nan_allowed) + wlan_hdd_set_nan_if_mode(wiphy); for (i = 0; i < num; i++) { /* Filter for non-DBS targets */ @@ -19513,6 +19535,10 @@ static void wlan_hdd_update_iface_combination(struct hdd_context *hdd_ctx, i)) continue; + /* remove NAN concurrency if NAN is not allowed */ + if (wlan_hdd_is_iface_nan(i) && !is_nan_allowed) + continue; + /* remove STA NAN concurrency */ if (no_sta_nan_concurrency && wlan_hdd_is_sta_nan_concurrency_present(i)) From 9c7da503452a4609a1b7e2a2a06c275c30b232c7 Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Tue, 18 Mar 2025 03:58:05 -0700 Subject: [PATCH 07/13] Release 2.0.9.24 Release 2.0.9.24 Change-Id: I1a980a6c0d43dc3d0e2e14b0e8e76b577ae76fd3 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 af5af1114d..97bc44fb1c 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 9 -#define QWLAN_VERSION_EXTRA "Z" -#define QWLAN_VERSION_BUILD 23 +#define QWLAN_VERSION_EXTRA "" +#define QWLAN_VERSION_BUILD 24 -#define QWLAN_VERSIONSTR "2.0.9.23Z" +#define QWLAN_VERSIONSTR "2.0.9.24" #endif /* QWLAN_VERSION_H */ From db495f70bb1726e276ae432503e50cbe011af77b Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Tue, 16 May 2023 10:31:57 +0530 Subject: [PATCH 08/13] qcacld-3.0: Fix the bandwidth switch while handling CSA WBW IE While handling CSA Wide BW IE to switch freq, driver update the PE session bandwidth and limit the switch to existing bandwidth. This result in failure while checking if new bandwidth is same as previous bandwidth and thus bandwidth change fails in this case. To fix do not update PE session while handling CSA Wide BW IE and do not limit the switch to 80 MHz. Also add current Bandwidth info in logs. Change-Id: Icb1f169b17f711df91fd10230d6fdfd9a3d30274 CRs-Fixed: 3498943 --- .../src/pe/lim/lim_send_sme_rsp_messages.c | 46 +++++++------------ core/mac/src/pe/lim/lim_utils.c | 8 ++-- 2 files changed, 21 insertions(+), 33 deletions(-) diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index 680f10d256..4ccb2824a5 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1600,10 +1600,8 @@ static QDF_STATUS lim_process_csa_wbw_ie(struct mac_context *mac_ctx, ap_new_ch_width = csa_params->new_ch_width + 1; - if (!csa_params->new_ch_freq_seg1 && !csa_params->new_ch_freq_seg2) { - pe_err("CSA wide BW IE has invalid center freq"); + if (!csa_params->new_ch_freq_seg1 && !csa_params->new_ch_freq_seg2) return QDF_STATUS_E_INVAL; - } csa_cent_freq = csa_params->csa_chan_freq; if (wlan_reg_is_6ghz_op_class(mac_ctx->pdev, @@ -1647,7 +1645,7 @@ static QDF_STATUS lim_process_csa_wbw_ie(struct mac_context *mac_ctx, csa_cent_freq1 = cent_freq1; break; default: - pe_err("CSA wide BW IE has wrong ch_width %d", ap_new_ch_width); + pe_debug("CSA wide BW IE has ch_width %d", ap_new_ch_width); return QDF_STATUS_E_INVAL; } @@ -1705,18 +1703,19 @@ static QDF_STATUS lim_process_csa_wbw_ie(struct mac_context *mac_ctx, } if (ap_new_ch_width > fw_vht_ch_wd) { - pe_debug("New BW is not supported, setting BW to %d", + pe_debug("New BW is not supported, downgrade BW to %d", fw_vht_ch_wd); ap_new_ch_width = fw_vht_ch_wd; - ch_params.ch_width = ap_new_ch_width; - wlan_reg_set_channel_params_for_freq(mac_ctx->pdev, - csa_params->csa_chan_freq, - 0, &ch_params); - ap_new_ch_width = ch_params.ch_width; - csa_params->new_ch_freq_seg1 = ch_params.center_freq_seg0; - csa_params->new_ch_freq_seg2 = ch_params.center_freq_seg1; } + ch_params.ch_width = ap_new_ch_width; + wlan_reg_set_channel_params_for_freq(mac_ctx->pdev, + csa_params->csa_chan_freq, + 0, &ch_params); + ap_new_ch_width = ch_params.ch_width; + csa_params->new_ch_freq_seg1 = ch_params.center_freq_seg0; + csa_params->new_ch_freq_seg2 = ch_params.center_freq_seg1; + session_entry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; @@ -1724,18 +1723,6 @@ static QDF_STATUS lim_process_csa_wbw_ie(struct mac_context *mac_ctx, chnl_switch_info->newCenterChanFreq0 = csa_params->new_ch_freq_seg1; chnl_switch_info->newCenterChanFreq1 = csa_params->new_ch_freq_seg2; - if (session_entry->ch_width == ap_new_ch_width) - goto prnt_log; - - if (session_entry->ch_width == CH_WIDTH_80MHZ) { - chnl_switch_info->newChanWidth = CH_WIDTH_80MHZ; - chnl_switch_info->newCenterChanFreq1 = 0; - } else { - session_entry->ch_width = ap_new_ch_width; - chnl_switch_info->newChanWidth = ap_new_ch_width; - } -prnt_log: - return QDF_STATUS_SUCCESS; } @@ -2035,13 +2022,12 @@ static void lim_handle_sta_csa_param(struct mac_context *mac_ctx, session_entry->htSupportedChannelWidthSet = true; } } - pe_debug("new ch %d freq %d width: %d freq0 %d freq1 %d ht width %d", - lim_ch_switch->primaryChannel, - lim_ch_switch->sw_target_freq, - lim_ch_switch->ch_width, - lim_ch_switch->ch_center_freq_seg0, + pe_debug("new ch %d: freq %d width: %d freq0 %d freq1 %d ht width %d, current freq %d: bw %d", + lim_ch_switch->primaryChannel, lim_ch_switch->sw_target_freq, + lim_ch_switch->ch_width, lim_ch_switch->ch_center_freq_seg0, lim_ch_switch->ch_center_freq_seg1, - lim_ch_switch->sec_ch_offset); + lim_ch_switch->sec_ch_offset, session_entry->curr_op_freq, + session_entry->ch_width); if (session_entry->curr_op_freq == csa_params->csa_chan_freq && session_entry->ch_width == lim_ch_switch->ch_width) { diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 3815038cf3..24ea59a08e 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -2166,9 +2166,11 @@ void lim_switch_primary_secondary_channel(struct mac_context *mac, mac->lim.gpchangeChannelData = NULL; /* Store the new primary and secondary channel in session entries if different */ - if (pe_session->curr_op_freq != new_channel_freq) { - pe_warn("freq: %d --> freq: %d", pe_session->curr_op_freq, - new_channel_freq); + if (pe_session->curr_op_freq != new_channel_freq || + pe_session->ch_width != ch_width) { + pe_warn("freq: %d[%d] --> freq: %d[%d]", + pe_session->curr_op_freq, pe_session->ch_width, + new_channel_freq, ch_width); pe_session->curr_op_freq = new_channel_freq; } if (pe_session->htSecondaryChannelOffset != From 444af2e70a59c928d5942f025e242b8e3170b437 Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Thu, 20 Mar 2025 08:01:19 -0700 Subject: [PATCH 09/13] Release 2.0.9.24A Release 2.0.9.24A Change-Id: I02294968e656f2cad7f8d8683819d63f3d9eedc2 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 97bc44fb1c..12660351f7 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 9 -#define QWLAN_VERSION_EXTRA "" +#define QWLAN_VERSION_EXTRA "A" #define QWLAN_VERSION_BUILD 24 -#define QWLAN_VERSIONSTR "2.0.9.24" +#define QWLAN_VERSIONSTR "2.0.9.24A" #endif /* QWLAN_VERSION_H */ From f1b9e643f065954bd3bf718774d9fa8c1e22e340 Mon Sep 17 00:00:00 2001 From: Aditya Kodukula Date: Wed, 8 Jan 2025 11:55:23 -0800 Subject: [PATCH 10/13] qcacld-3.0: Fix potential OOB memory access Currently in the wma_stats_ext_event_handler(), the buf_ptr is not pointing correctly to the event data received from FW. This is leading to an OOB memory access during qdf_mem_copy(). So, to avoid this issue correctly point the buf_ptr to the event data sent by the FW in the TLV. Change-Id: Iffa3e96a6a36eff5899a7a9a7febe0ebb9d7878f CRs-Fixed: 4011656 --- core/wma/src/wma_utils.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 7db68939dc..f86391eb6d 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2025 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 @@ -714,7 +714,6 @@ int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf, } stats_ext_info = param_buf->fixed_param; - buf_ptr = (uint8_t *)stats_ext_info; alloc_len = sizeof(tSirStatsExtEvent); alloc_len += stats_ext_info->data_len; @@ -731,7 +730,7 @@ int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf, if (!stats_ext_event) return -ENOMEM; - buf_ptr += sizeof(wmi_stats_ext_event_fixed_param) + WMI_TLV_HDR_SIZE; + buf_ptr = (uint8_t *)param_buf->data; stats_ext_event->vdev_id = stats_ext_info->vdev_id; stats_ext_event->event_data_len = stats_ext_info->data_len; @@ -781,7 +780,6 @@ int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf, } stats_ext_info = param_buf->fixed_param; - buf_ptr = (uint8_t *)stats_ext_info; alloc_len = sizeof(tSirStatsExtEvent); alloc_len += stats_ext_info->data_len; @@ -797,7 +795,7 @@ int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf, if (!stats_ext_event) return -ENOMEM; - buf_ptr += sizeof(wmi_stats_ext_event_fixed_param) + WMI_TLV_HDR_SIZE; + buf_ptr = (uint8_t *)param_buf->data; stats_ext_event->vdev_id = stats_ext_info->vdev_id; stats_ext_event->event_data_len = stats_ext_info->data_len; From 62c7d89f25f2d81d72ecf8fc651b0e02e02741de Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Thu, 27 Mar 2025 22:46:51 -0700 Subject: [PATCH 11/13] Release 2.0.9.24B Release 2.0.9.24B Change-Id: Ifb92e69201e53427b505e5842ab4f3987df8d27c 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 12660351f7..be41a46409 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 9 -#define QWLAN_VERSION_EXTRA "A" +#define QWLAN_VERSION_EXTRA "B" #define QWLAN_VERSION_BUILD 24 -#define QWLAN_VERSIONSTR "2.0.9.24A" +#define QWLAN_VERSIONSTR "2.0.9.24B" #endif /* QWLAN_VERSION_H */ From 4c13cafd2dcc7b0bd70e828502e4b4791f53e27c Mon Sep 17 00:00:00 2001 From: Aditya Kodukula Date: Mon, 5 Dec 2022 23:28:45 -0800 Subject: [PATCH 12/13] qcacld-3.0: Update ll_stats request pending flag properly In the current driver implementation, host honors LL_STATS request even in disconnected state. But in disconnected state, the ll_stats request pending flag is not updated properly, which results in allowing multiple LL_STATS requests being sent to FW. So, to avoid this issue, update the flag properly. Change-Id: I318455492dc69bd540044b593a405eacdf185ff1 CRs-Fixed: 3339867 --- core/hdd/inc/wlan_hdd_main.h | 2 +- core/hdd/src/wlan_hdd_main.c | 2 +- core/hdd/src/wlan_hdd_stats.c | 33 +++++++++++++++++++++------------ 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 19758cac6a..d007e8c5d2 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -819,10 +819,10 @@ struct hdd_stats { struct hdd_eapol_stats_s hdd_eapol_stats; struct hdd_dhcp_stats_s hdd_dhcp_stats; struct pmf_bcn_protect_stats bcn_protect_stats; + qdf_atomic_t is_ll_stats_req_pending; #ifdef FEATURE_CLUB_LL_STATS_AND_GET_STATION uint32_t sta_stats_cached_timestamp; - bool is_ll_stats_req_in_progress; #endif }; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c6a2c7b46b..a3526b77f3 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1762,7 +1762,6 @@ hdd_update_feature_cfg_club_get_sta_in_ll_stats_req( static void hdd_init_get_sta_in_ll_stats_config(struct hdd_adapter *adapter) { - adapter->hdd_stats.is_ll_stats_req_in_progress = false; adapter->hdd_stats.sta_stats_cached_timestamp = 0; } #else @@ -6307,6 +6306,7 @@ hdd_alloc_station_adapter(struct hdd_context *hdd_ctx, tSirMacAddr mac_addr, adapter->start_time = qdf_system_ticks(); adapter->last_time = adapter->start_time; + qdf_atomic_init(&adapter->hdd_stats.is_ll_stats_req_pending); hdd_init_get_sta_in_ll_stats_config(adapter); return adapter; diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 2e2a35fc15..adf2a17c4e 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -1911,6 +1911,18 @@ static void wlan_hdd_dealloc_ll_stats(void *priv) qdf_list_destroy(&ll_stats_priv->ll_stats_q); } +static QDF_STATUS +wlan_hdd_set_ll_stats_request_pending(struct hdd_adapter *adapter) +{ + if (qdf_atomic_read(&adapter->hdd_stats.is_ll_stats_req_pending)) { + hdd_nofl_debug("Previous ll_stats request is in progress"); + return QDF_STATUS_E_ALREADY; + } + + qdf_atomic_set(&adapter->hdd_stats.is_ll_stats_req_pending, 1); + return QDF_STATUS_SUCCESS; +} + #ifdef FEATURE_CLUB_LL_STATS_AND_GET_STATION /** * cache_station_stats_cb() - cache_station_stats_cb callback function @@ -1963,16 +1975,11 @@ wlan_hdd_set_station_stats_request_pending(struct hdd_adapter *adapter) if (!vdev) return QDF_STATUS_E_INVAL; - if (adapter->hdd_stats.is_ll_stats_req_in_progress) { - hdd_err("Previous ll_stats request is in progress"); - hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_STATS_ID); - return QDF_STATUS_E_ALREADY; - } - info.cookie = adapter; info.u.get_station_stats_cb = cache_station_stats_cb; info.vdev_id = adapter->vdev_id; info.pdev_id = wlan_objmgr_pdev_get_pdev_id(wlan_vdev_get_pdev(vdev)); + peer = wlan_objmgr_vdev_try_get_bsspeer(vdev, WLAN_OSIF_STATS_ID); if (!peer) { osif_err("peer is null"); @@ -1980,14 +1987,13 @@ wlan_hdd_set_station_stats_request_pending(struct hdd_adapter *adapter) return QDF_STATUS_E_INVAL; } - adapter->hdd_stats.is_ll_stats_req_in_progress = true; - qdf_mem_copy(info.peer_mac_addr, peer->macaddr, QDF_MAC_ADDR_SIZE); wlan_objmgr_peer_release_ref(peer, WLAN_OSIF_STATS_ID); ucfg_mc_cp_stats_set_pending_req(wlan_vdev_get_psoc(vdev), TYPE_STATION_STATS, &info); + hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_STATS_ID); return QDF_STATUS_SUCCESS; } @@ -2003,8 +2009,6 @@ wlan_hdd_reset_station_stats_request_pending(struct wlan_objmgr_psoc *psoc, if (!adapter->hdd_ctx->is_get_station_clubbed_in_ll_stats_req) return; - adapter->hdd_stats.is_ll_stats_req_in_progress = false; - status = ucfg_mc_cp_stats_get_pending_req(psoc, TYPE_STATION_STATS, &last_req); if (QDF_IS_STATUS_ERROR(status)) { @@ -2076,10 +2080,14 @@ static int wlan_hdd_send_ll_stats_req(struct hdd_adapter *adapter, hdd_enter_dev(adapter->dev); - status = wlan_hdd_set_station_stats_request_pending(adapter); - if (status == QDF_STATUS_E_ALREADY) + status = wlan_hdd_set_ll_stats_request_pending(adapter); + if (QDF_IS_STATUS_ERROR(status)) return qdf_status_to_os_return(status); + status = wlan_hdd_set_station_stats_request_pending(adapter); + if (QDF_IS_STATUS_ERROR(status)) + hdd_nofl_debug("Requesting LL_STATS only"); + /* * FW can send radio stats with multiple events and for the first event * host allocates memory in wma and processes the events, there is a @@ -2149,6 +2157,7 @@ static int wlan_hdd_send_ll_stats_req(struct hdd_adapter *adapter, } qdf_list_destroy(&priv->ll_stats_q); exit: + qdf_atomic_set(&adapter->hdd_stats.is_ll_stats_req_pending, 0); wlan_hdd_reset_station_stats_request_pending(hdd_ctx->psoc, adapter); hdd_exit(); osif_request_put(request); From 273922d7a7fc1625a2185977ec7d273cd35ae906 Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Mon, 7 Apr 2025 23:49:20 -0700 Subject: [PATCH 13/13] Release 2.0.9.24C Release 2.0.9.24C Change-Id: Ib956db6c1f80e1cc9ceb84485aa852b5266be113 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 be41a46409..f08959f406 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 9 -#define QWLAN_VERSION_EXTRA "B" +#define QWLAN_VERSION_EXTRA "C" #define QWLAN_VERSION_BUILD 24 -#define QWLAN_VERSIONSTR "2.0.9.24B" +#define QWLAN_VERSIONSTR "2.0.9.24C" #endif /* QWLAN_VERSION_H */