diff --git a/umac/wifi_pos/inc/wifi_pos_api.h b/umac/wifi_pos/inc/wifi_pos_api.h index 72665e1b7ddf..1c0bc25c3f0e 100644 --- a/umac/wifi_pos/inc/wifi_pos_api.h +++ b/umac/wifi_pos/inc/wifi_pos_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 The Linux Foundation. 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 @@ -330,6 +330,16 @@ uint32_t ucfg_wifi_pos_get_ftm_cap(struct wlan_objmgr_psoc *psoc); */ void ucfg_wifi_pos_set_ftm_cap(struct wlan_objmgr_psoc *psoc, uint32_t val); +/** + * ucfg_wifi_pos_set_oem_6g_supported: API to set oem target 6g enabled/disabled + * @psoc: psoc object + * @val: value to set + * + * Return: None + */ +void ucfg_wifi_pos_set_oem_6g_supported(struct wlan_objmgr_psoc *psoc, + bool val); + /** * wifi_pos_get_app_pid: returns oem app pid. * @psoc: pointer to psoc object diff --git a/umac/wifi_pos/src/wifi_pos_main.c b/umac/wifi_pos/src/wifi_pos_main.c index d36c657413ae..e619d2de8ae6 100644 --- a/umac/wifi_pos/src/wifi_pos_main.c +++ b/umac/wifi_pos/src/wifi_pos_main.c @@ -762,10 +762,13 @@ static void wifi_pos_pdev_iterator(struct wlan_objmgr_psoc *psoc, void *obj, void *arg) { QDF_STATUS status; - uint8_t i, num_channels, size; + uint8_t i, num_channels, size, valid_ch = 0; struct wlan_objmgr_pdev *pdev = obj; struct wifi_pos_driver_caps *caps = arg; struct channel_power *ch_list; + bool oem_6g_support_disable; + struct wifi_pos_psoc_priv_obj *wifi_pos_obj = + wifi_pos_get_psoc_priv_obj(psoc); size = QDF_MAX(OEM_CAP_MAX_NUM_CHANNELS, NUM_CHANNELS); ch_list = qdf_mem_malloc(size * sizeof(*ch_list)); @@ -783,9 +786,17 @@ static void wifi_pos_pdev_iterator(struct wlan_objmgr_psoc *psoc, if (num_channels > OEM_CAP_MAX_NUM_CHANNELS) num_channels = OEM_CAP_MAX_NUM_CHANNELS; - for (i = 0; i < num_channels; i++) - caps->channel_list[i] = ch_list[i].chan_num; - caps->num_channels = num_channels; + qdf_spin_lock_bh(&wifi_pos_obj->wifi_pos_lock); + oem_6g_support_disable = wifi_pos_obj->oem_6g_support_disable; + qdf_spin_unlock_bh(&wifi_pos_obj->wifi_pos_lock); + + for (i = 0; i < num_channels; i++) { + if (oem_6g_support_disable && + WLAN_REG_IS_6GHZ_CHAN_FREQ(ch_list[i].center_freq)) + continue; + caps->channel_list[valid_ch++] = ch_list[i].chan_num; + } + caps->num_channels = valid_ch; qdf_mem_free(ch_list); } diff --git a/umac/wifi_pos/src/wifi_pos_ucfg.c b/umac/wifi_pos/src/wifi_pos_ucfg.c index ba6fa8441de6..4241c58d14e3 100644 --- a/umac/wifi_pos/src/wifi_pos_ucfg.c +++ b/umac/wifi_pos/src/wifi_pos_ucfg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, 2020 The Linux Foundation. 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 @@ -101,3 +101,17 @@ void ucfg_wifi_pos_set_ftm_cap(struct wlan_objmgr_psoc *psoc, uint32_t val) qdf_spin_unlock_bh(&wifi_pos_psoc->wifi_pos_lock); } +void ucfg_wifi_pos_set_oem_6g_supported(struct wlan_objmgr_psoc *psoc, + bool val) +{ + struct wifi_pos_psoc_priv_obj *wifi_pos_psoc = + wifi_pos_get_psoc_priv_obj(psoc); + if (!wifi_pos_psoc) { + wifi_pos_alert("unable to get wifi_pos psoc obj"); + return; + } + + qdf_spin_lock_bh(&wifi_pos_psoc->wifi_pos_lock); + wifi_pos_psoc->oem_6g_support_disable = val; + qdf_spin_unlock_bh(&wifi_pos_psoc->wifi_pos_lock); +} diff --git a/umac/wifi_pos/src/wifi_pos_utils_i.h b/umac/wifi_pos/src/wifi_pos_utils_i.h index c94269b51e56..cff0352532b2 100644 --- a/umac/wifi_pos/src/wifi_pos_utils_i.h +++ b/umac/wifi_pos/src/wifi_pos_utils_i.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 The Linux Foundation. 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 @@ -301,6 +301,7 @@ struct wifi_pos_dma_rings_cfg { * @dma_buf_pool: DMA buffer pools maintained at host: this will be 2-D array * where with num_rows = number of rings num_elements in each row = ring depth * @wifi_pos_lock: lock to access wifi pos priv object + * @oem_6g_support_disable: oem target 6ghz support is disabled if set * @wifi_pos_req_handler: function pointer to handle TLV or non-TLV * @wifi_pos_send_rsp: function pointer to send msg to userspace APP * @@ -338,6 +339,7 @@ struct wifi_pos_psoc_priv_obj { struct wifi_pos_dma_buf_info **dma_buf_pool; qdf_spinlock_t wifi_pos_lock; + bool oem_6g_support_disable; QDF_STATUS (*wifi_pos_req_handler)(struct wlan_objmgr_psoc *psoc, struct wifi_pos_req_msg *req); void (*wifi_pos_send_rsp)(uint32_t, uint32_t, uint32_t, uint8_t *);