From 620e9cd325ac7b727b6f3580fede16802a150d00 Mon Sep 17 00:00:00 2001 From: Will Huang Date: Tue, 2 Nov 2021 14:01:03 +0800 Subject: [PATCH 1/3] qcacmn: Add QCA vendor attribute to configure ARP/NS offload feature Add a QCA vendor attribute QCA_WLAN_VENDOR_ATTR_CONFIG_ARP_NS_OFFLOAD to configure ARP/NS offload feature. Change-Id: I976ed866272c7c82ff12593339bd2d551af6741b CRs-Fixed: 3620322 --- os_if/linux/qca_vendor.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/os_if/linux/qca_vendor.h b/os_if/linux/qca_vendor.h index 2508e3ace88a..0e2568cda2b2 100644 --- a/os_if/linux/qca_vendor.h +++ b/os_if/linux/qca_vendor.h @@ -4823,6 +4823,19 @@ enum qca_wlan_vendor_attr_config { */ QCA_WLAN_VENDOR_ATTR_CONFIG_FT_OVER_DS = 80, + /* + * 8-bit unsigned value. This attribute can be used to configure the + * firmware to enable/disable ARP/NS offload feature. Possible values + * for this attribute are 0-Disable and 1-Enable. + * + * This attribute is only applicable for STA/P2P-Client interface, + * and is optional, default behavior is APR/NS offload Enable. + * + * This attribute can be set in disconncted and connected state, and + * will restore to default behavior if interface is closed. + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_ARP_NS_OFFLOAD = 81, + /* 8-bit unsigned value, whenever wifi calling (wfc) begin or end, * Userspace sends this information to driver/firmware to configure * wfc state. Driver/Firmware uses this information to From e5958f59298fec88a176a98ba43e31f7720ad16e Mon Sep 17 00:00:00 2001 From: Krupali Dhanvijay Date: Wed, 30 Aug 2023 16:58:22 +0530 Subject: [PATCH 2/3] qcacmn: Cleanup reg_cache_channel_state Cleanup reg_cache_channel_state and the related code with it. Also, changed the logic so as to compare channel freq instead of channel number in reg_modify_chan_list_for_cached_channels() Change-Id: I424b6886ed18f73bae0d2b36e36a9ddc1819688b CRs-Fixed: 2908016 --- .../regulatory/core/src/reg_build_chan_list.c | 6 +- umac/regulatory/core/src/reg_utils.c | 57 ------------------- umac/regulatory/core/src/reg_utils.h | 23 +------- .../dispatcher/inc/wlan_reg_ucfg_api.h | 22 +------ .../dispatcher/src/wlan_reg_ucfg_api.c | 16 +----- 5 files changed, 6 insertions(+), 118 deletions(-) diff --git a/umac/regulatory/core/src/reg_build_chan_list.c b/umac/regulatory/core/src/reg_build_chan_list.c index f6e70bd26ead..825d03469a52 100644 --- a/umac/regulatory/core/src/reg_build_chan_list.c +++ b/umac/regulatory/core/src/reg_build_chan_list.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-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 @@ -732,8 +732,8 @@ static void reg_modify_chan_list_for_cached_channels( if (pdev_priv_obj->disable_cached_channels) { for (i = 0; i < num_cache_channels; i++) for (j = 0; j < NUM_CHANNELS; j++) - if (cache_chan_list[i].chan_num == - chan_list[j].chan_num) { + if (cache_chan_list[i].center_freq == + chan_list[j].center_freq) { chan_list[j].state = CHANNEL_STATE_DISABLE; chan_list[j].chan_flags |= diff --git a/umac/regulatory/core/src/reg_utils.c b/umac/regulatory/core/src/reg_utils.c index 1438365da7d9..ca82b046b72d 100644 --- a/umac/regulatory/core/src/reg_utils.c +++ b/umac/regulatory/core/src/reg_utils.c @@ -686,63 +686,6 @@ QDF_STATUS reg_cache_channel_freq_state(struct wlan_objmgr_pdev *pdev, return QDF_STATUS_SUCCESS; } #endif /* CONFIG_CHAN_FREQ_API */ - -#ifdef CONFIG_CHAN_NUM_API -QDF_STATUS reg_cache_channel_state(struct wlan_objmgr_pdev *pdev, - uint32_t *channel_list, - uint32_t num_channels) -{ - struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj; - struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; - struct wlan_objmgr_psoc *psoc; - uint8_t i, j; - - pdev_priv_obj = reg_get_pdev_obj(pdev); - - if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) { - reg_err("pdev reg component is NULL"); - return QDF_STATUS_E_INVAL; - } - - psoc = wlan_pdev_get_psoc(pdev); - if (!psoc) { - reg_err("psoc is NULL"); - return QDF_STATUS_E_INVAL; - } - - psoc_priv_obj = reg_get_psoc_obj(psoc); - if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) { - reg_err("psoc reg component is NULL"); - return QDF_STATUS_E_INVAL; - } - if (pdev_priv_obj->num_cache_channels > 0) { - pdev_priv_obj->num_cache_channels = 0; - qdf_mem_zero(&pdev_priv_obj->cache_disable_chan_list, - sizeof(pdev_priv_obj->cache_disable_chan_list)); - } - - for (i = 0; i < num_channels; i++) { - for (j = 0; j < NUM_CHANNELS; j++) { - if (channel_list[i] == pdev_priv_obj-> - cur_chan_list[j].chan_num) { - pdev_priv_obj-> - cache_disable_chan_list[i].chan_num = - channel_list[i]; - pdev_priv_obj-> - cache_disable_chan_list[i].state = - pdev_priv_obj->cur_chan_list[j].state; - pdev_priv_obj-> - cache_disable_chan_list[i].chan_flags = - pdev_priv_obj-> - cur_chan_list[j].chan_flags; - } - } - } - pdev_priv_obj->num_cache_channels = num_channels; - - return QDF_STATUS_SUCCESS; -} -#endif /* CONFIG_CHAN_NUM_API */ #endif #ifdef CONFIG_REG_CLIENT diff --git a/umac/regulatory/core/src/reg_utils.h b/umac/regulatory/core/src/reg_utils.h index fdb8a834a28d..e151a8fd3b94 100644 --- a/umac/regulatory/core/src/reg_utils.h +++ b/umac/regulatory/core/src/reg_utils.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-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -175,27 +175,6 @@ QDF_STATUS reg_cache_channel_freq_state(struct wlan_objmgr_pdev *pdev, } #endif /* defined(DISABLE_CHANNEL_LIST) && defined(CONFIG_CHAN_FREQ_API) */ -#if defined(DISABLE_CHANNEL_LIST) && defined(CONFIG_CHAN_NUM_API) -/** - * reg_cache_channel_state() - Cache the current state of the channels - * @pdev: The physical dev to cache the channels for - * @channel_list: List of the channels for which states needs to be cached - * @num_channels: Number of channels in the list - * - */ -QDF_STATUS reg_cache_channel_state(struct wlan_objmgr_pdev *pdev, - uint32_t *channel_list, - uint32_t num_channels); -#else -static inline -QDF_STATUS reg_cache_channel_state(struct wlan_objmgr_pdev *pdev, - uint32_t *channel_list, - uint32_t num_channels) -{ - return QDF_STATUS_SUCCESS; -} -#endif /* defined (DISABLE_CHANNEL_LIST) && defined(CONFIG_CHAN_NUM_API) */ - #ifdef CONFIG_REG_CLIENT /** * reg_set_band() - Sets the band information for the PDEV diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h index eafd72b5ce19..2d8e636bcd28 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -61,27 +62,6 @@ QDF_STATUS ucfg_reg_get_band(struct wlan_objmgr_pdev *pdev, QDF_STATUS ucfg_reg_notify_sap_event(struct wlan_objmgr_pdev *pdev, bool sap_state); -/** - * ucfg_reg_cache_channel_state() - Cache the current state of the channles - * @pdev: The physical dev to cache the channels for - * @channel_list: List of the channels for which states needs to be cached - * @num_channels: Number of channels in the list - * - * Return: QDF_STATUS - */ -#if defined(DISABLE_CHANNEL_LIST) && defined(CONFIG_CHAN_NUM_API) -void ucfg_reg_cache_channel_state(struct wlan_objmgr_pdev *pdev, - uint32_t *channel_list, - uint32_t num_channels); -#else -static inline -void ucfg_reg_cache_channel_state(struct wlan_objmgr_pdev *pdev, - uint32_t *channel_list, - uint32_t num_channels) -{ -} -#endif /* CONFIG_CHAN_NUM_API */ - /** * ucfg_reg_cache_channel_freq_state() - Cache the current state of the * channels based on the channel center frequency. diff --git a/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c b/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c index b544dc0bd212..28dfc349a055 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -311,21 +312,6 @@ void ucfg_reg_cache_channel_freq_state(struct wlan_objmgr_pdev *pdev, } #endif /* CONFIG_CHAN_FREQ_API */ -#ifdef CONFIG_CHAN_NUM_API -/** - * ucfg_reg_cache_channel_state() - Cache the current state of the channles - * @pdev: The physical dev to cache the channels for - * @channel_list: List of the channels for which states needs to be cached - * @num_channels: Number of channels in the list - * - */ -void ucfg_reg_cache_channel_state(struct wlan_objmgr_pdev *pdev, - uint32_t *channel_list, uint32_t num_channels) -{ - reg_cache_channel_state(pdev, channel_list, num_channels); -} -#endif /* CONFIG_CHAN_NUM_API */ - void ucfg_reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev) { reg_restore_cached_channels(pdev); From ef3473af12b31ffa6b2bcecf66f78b01a25080f1 Mon Sep 17 00:00:00 2001 From: Krupali Dhanvijay Date: Mon, 28 Aug 2023 13:23:03 +0530 Subject: [PATCH 3/3] qcacmn: Update set_disable_channel_list cmd for 6 GHz channels Currently SET_DISABLE_CHANNEL_LIST command is used to disable legacy channels only. Update this command to accept frequency for all the bands along with the channel numbers from legacy (2.4 GHz/5 GHz) and update the channel state in secondary channel list also. Change-Id: Iecc9f73dca65900d82a2f2a044cb854cea58c638 CRs-Fixed: 3601253 --- .../regulatory/core/src/reg_build_chan_list.c | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/umac/regulatory/core/src/reg_build_chan_list.c b/umac/regulatory/core/src/reg_build_chan_list.c index 825d03469a52..6059b406d57b 100644 --- a/umac/regulatory/core/src/reg_build_chan_list.c +++ b/umac/regulatory/core/src/reg_build_chan_list.c @@ -722,7 +722,9 @@ static void reg_modify_chan_list_for_cached_channels( { uint32_t i, j; uint32_t num_cache_channels = pdev_priv_obj->num_cache_channels; - struct regulatory_channel *chan_list = pdev_priv_obj->cur_chan_list; + struct regulatory_channel *cur_chan_list = pdev_priv_obj->cur_chan_list; + struct regulatory_channel *sec_chan_list = + pdev_priv_obj->secondary_cur_chan_list; struct regulatory_channel *cache_chan_list = pdev_priv_obj->cache_disable_chan_list; @@ -730,15 +732,24 @@ static void reg_modify_chan_list_for_cached_channels( return; if (pdev_priv_obj->disable_cached_channels) { - for (i = 0; i < num_cache_channels; i++) - for (j = 0; j < NUM_CHANNELS; j++) + for (i = 0; i < num_cache_channels; i++) { + for (j = 0; j < NUM_CHANNELS; j++) { if (cache_chan_list[i].center_freq == - chan_list[j].center_freq) { - chan_list[j].state = + cur_chan_list[j].center_freq) { + cur_chan_list[j].state = CHANNEL_STATE_DISABLE; - chan_list[j].chan_flags |= + cur_chan_list[j].chan_flags |= REGULATORY_CHAN_DISABLED; } + if (cache_chan_list[i].center_freq == + sec_chan_list[j].center_freq) { + sec_chan_list[j].state = + CHANNEL_STATE_DISABLE; + sec_chan_list[j].chan_flags |= + REGULATORY_CHAN_DISABLED; + } + } + } } } #else @@ -1278,8 +1289,6 @@ void reg_compute_pdev_current_chan_list(struct wlan_regulatory_pdev_priv_obj reg_modify_chan_list_for_chan_144(pdev_priv_obj->cur_chan_list, pdev_priv_obj->en_chan_144); - reg_modify_chan_list_for_cached_channels(pdev_priv_obj); - reg_modify_chan_list_for_srd_channels(pdev_priv_obj->pdev_ptr, pdev_priv_obj->cur_chan_list); @@ -1292,6 +1301,8 @@ void reg_compute_pdev_current_chan_list(struct wlan_regulatory_pdev_priv_obj cur_chan_list); reg_populate_secondary_cur_chan_list(pdev_priv_obj); + + reg_modify_chan_list_for_cached_channels(pdev_priv_obj); } void reg_reset_reg_rules(struct reg_rule_info *reg_rules)