diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index a5127b7fce..8ab3786f59 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -331,6 +331,7 @@ static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc, gen->debug_packet_log = cfg_get(psoc, CFG_ENABLE_DEBUG_PACKET_LOG); gen->enable_deauth_to_disassoc_map = cfg_get(psoc, CFG_ENABLE_DEAUTH_TO_DISASSOC_MAP); + gen->wls_6ghz_capable = cfg_get(psoc, CFG_WLS_6GHZ_CAPABLE); mlme_init_pmf_cfg(psoc, gen); mlme_init_lpass_support_cfg(psoc, gen); diff --git a/components/mlme/dispatcher/inc/cfg_mlme_generic.h b/components/mlme/dispatcher/inc/cfg_mlme_generic.h index ed362fa07b..6bf57972b4 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_generic.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_generic.h @@ -760,6 +760,27 @@ 0, 0x52, 0x49, CFG_VALUE_OR_DEFAULT, \ "Bit mask to retry Auth and full connection on assoc timeout to same AP for SAE connection") +/* + * + * + * wls_6ghz_capable - WiFi Location Service(WLS) is 6Ghz capable + * @Min: 0 (WLS 6Ghz non-capable) + * @Max: 1 (WLS 6Ghz capable) + * @Default: 0 (WLS 6Ghz non-capable) + * + * Related: None + * + * Supported Feature: General + * + * Usage: Internal + * + * + */ +#define CFG_WLS_6GHZ_CAPABLE CFG_INI_BOOL( \ + "wls_6ghz_capable", \ + 0, \ + "WiFi Location Service(WLS) is 6Ghz capable or not") + #define CFG_GENERIC_ALL \ CFG(CFG_ENABLE_DEBUG_PACKET_LOG) \ CFG(CFG_PMF_SA_QUERY_MAX_RETRIES) \ @@ -791,5 +812,6 @@ CFG(CFG_BMISS_SKIP_FULL_SCAN) \ CFG(CFG_ENABLE_RING_BUFFER) \ CFG(CFG_DFS_CHAN_AGEOUT_TIME) \ - CFG(CFG_SAE_CONNECION_RETRIES) + CFG(CFG_SAE_CONNECION_RETRIES) \ + CFG(CFG_WLS_6GHZ_CAPABLE) #endif /* __CFG_MLME_GENERIC_H */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index 0cd9785a94..4b6ec023fb 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -319,6 +319,17 @@ QDF_STATUS wlan_mlme_get_crash_inject(struct wlan_objmgr_psoc *psoc, QDF_STATUS wlan_mlme_get_lpass_support(struct wlan_objmgr_psoc *psoc, bool *lpass_support); +/** + * wlan_mlme_get_wls_6ghz_cap() - Get the wifi location service(WLS) + * 6ghz capability + * @psoc: pointer to psoc object + * @wls_6ghz_capable: Pointer to the variable from caller + * + * Return: void + */ +void wlan_mlme_get_wls_6ghz_cap(struct wlan_objmgr_psoc *psoc, + bool *wls_6ghz_capable); + /** * wlan_mlme_get_self_recovery() - Get the self recovery config * @psoc: pointer to psoc object diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 0a2f63ae27..495eced9aa 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1110,6 +1110,7 @@ struct wlan_mlme_chainmask { * @peer_create_conf_support: Peer create confirmation command support * @dual_sta_roam_fw_support: Firmware support for dual sta roaming feature * @sae_connect_retries: sae connect retry bitmask + * @wls_6ghz_capable: wifi location service(WLS) is 6ghz capable */ struct wlan_mlme_generic { uint32_t band_capability; @@ -1151,6 +1152,7 @@ struct wlan_mlme_generic { bool peer_create_conf_support; bool dual_sta_roam_fw_support; uint32_t sae_connect_retries; + bool wls_6ghz_capable; }; /* diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 3b4fc97f2b..dba9f54693 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -325,6 +325,21 @@ QDF_STATUS ucfg_mlme_get_lpass_support(struct wlan_objmgr_psoc *psoc, return wlan_mlme_get_lpass_support(psoc, lpass_support); } +/** + * ucfg_mlme_get_wls_6ghz_cap() - Get the WiFi Location Service(WLS) + * 6ghz capability + * @psoc: pointer to psoc object + * @wls_6ghz_capable: Pointer to the variable from caller + * + * Return: void + */ +static inline +void ucfg_mlme_get_wls_6ghz_cap(struct wlan_objmgr_psoc *psoc, + bool *wls_6ghz_capable) +{ + wlan_mlme_get_wls_6ghz_cap(psoc, wls_6ghz_capable); +} + /** * ucfg_mlme_get_self_recovery() - Get the self recovery config * @psoc: pointer to psoc object diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index dbac0bf6d8..77341d89ce 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -285,6 +285,19 @@ QDF_STATUS wlan_mlme_get_lpass_support(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +void wlan_mlme_get_wls_6ghz_cap(struct wlan_objmgr_psoc *psoc, + bool *wls_6ghz_capable) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) { + *wls_6ghz_capable = cfg_default(CFG_WLS_6GHZ_CAPABLE); + return; + } + *wls_6ghz_capable = mlme_obj->cfg.gen.wls_6ghz_capable; +} + QDF_STATUS wlan_mlme_get_self_recovery(struct wlan_objmgr_psoc *psoc, bool *self_recovery) { diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 3423da75b4..141adbf08a 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -88,7 +88,7 @@ static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data, uint32_t chan_id; uint32_t *chan_freq_list, chan_freq_len; struct svc_channel_info *chan_info; - bool lpass_support; + bool lpass_support, wls_6ghz_capable = false; QDF_STATUS status; if (!data) { @@ -116,7 +116,7 @@ static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data, hdd_err("Failed to get LPASS support config"); return -EIO; } - + ucfg_mlme_get_wls_6ghz_cap(hdd_ctx->psoc, &wls_6ghz_capable); if (hdd_ctx->lpss_support && lpass_support) data->lpss_support = 1; else @@ -130,17 +130,24 @@ static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data, chan_freq_len = WLAN_SVC_MAX_NUM_CHAN; sme_get_cfg_valid_channels(chan_freq_list, &chan_freq_len); - data->numChannels = chan_freq_len; + data->numChannels = 0; + for (i = 0; i < chan_freq_len; i++) { + if (!wls_6ghz_capable && + wlan_reg_is_6ghz_chan_freq(chan_freq_list[i])) + continue; - for (i = 0; i < data->numChannels; i++) { - chan_info = &data->channel_info[i]; - data->channel_list[i] = - wlan_reg_freq_to_chan(hdd_ctx->pdev, chan_freq_list[i]); - chan_id = data->channel_list[i]; + chan_id = wlan_reg_freq_to_chan(hdd_ctx->pdev, + chan_freq_list[i]); + if (!chan_id) + continue; + + chan_info = &data->channel_info[data->numChannels]; + data->channel_list[data->numChannels] = chan_id; chan_info->chan_id = chan_id; wlan_hdd_get_channel_info(hdd_ctx, chan_info, chan_freq_list[i]); + data->numChannels++; } qdf_mem_free(chan_freq_list);