diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index 671ae3c3b3a2..83d38f48f2ad 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -2097,7 +2097,8 @@ static bool policy_mgr_valid_sta_channel_check(struct wlan_objmgr_psoc *psoc, !sta_sap_scc_on_dfs_chan) || wlan_reg_is_passive_or_disable_for_freq( pm_ctx->pdev, sta_ch_freq) || - !policy_mgr_is_safe_channel(psoc, sta_ch_freq)) { + (!policy_mgr_sta_sap_scc_on_lte_coex_chan(psoc) && + !policy_mgr_is_safe_channel(psoc, sta_ch_freq))) { if (policy_mgr_is_hw_dbs_capable(psoc)) return true; else diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c index 654c4a41065e..1a3a04f492c5 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c @@ -2324,11 +2324,15 @@ policy_mgr_add_24g_to_pcl(uint32_t *pcl_freqs, uint8_t *pcl_weights, { uint32_t num_to_add, i; + if (*index >= NUM_CHANNELS || *index >= pcl_sz) + return; num_to_add = QDF_MIN((*index + chlist_24g_len), pcl_sz) - *index; - qdf_mem_copy(&pcl_freqs[*index], chlist_24g, - num_to_add * sizeof(*chlist_24g)); - for (i = *index; i < *index + num_to_add; i++) - pcl_weights[i] = weight; + for (i = 0; i < num_to_add; i++) { + if ((i + *index) >= NUM_CHANNELS || (i + *index) >= pcl_sz) + break; + pcl_weights[i + *index] = weight; + pcl_freqs[i + *index] = chlist_24g[i]; + } *index = i; policy_mgr_debug("Add 24g chlist len %d len %d index %d", diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c index f2569eb908cc..ee5f8a81b33e 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c @@ -36,6 +36,7 @@ #include "wlan_mlme_ucfg_api.h" #include "csr_neighbor_roam.h" #include "wlan_scan_api.h" +#include /** * first_connection_pcl_table - table which provides PCL for the @@ -733,6 +734,96 @@ policy_mgr_modify_pcl_based_on_indoor(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +/** + * policy_mgr_modify_sap_pcl_for_6G_channels() - filter out the + * 6GHz channels where SCC is not supported. + * @psoc: pointer to soc + * @pcl_list_org: channel list to filter out + * @weight_list_org: weight of channel list + * @pcl_len_org: length of channel list + * + * Return: QDF_STATUS + */ +static QDF_STATUS +policy_mgr_modify_sap_pcl_for_6G_channels(struct wlan_objmgr_psoc *psoc, + uint32_t *pcl_list_org, + uint8_t *weight_list_org, + uint32_t *pcl_len_org) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t pcl_list[NUM_CHANNELS]; + uint8_t weight_list[NUM_CHANNELS]; + uint32_t vdev_id = 0, pcl_len = 0, i; + struct wlan_objmgr_vdev *vdev; + qdf_freq_t sta_gc_freq = 0; + uint32_t ap_pwr_type_6g = 0; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + if (*pcl_len_org > NUM_CHANNELS) { + policy_mgr_err("Invalid PCL List Length %d", *pcl_len_org); + return QDF_STATUS_E_FAILURE; + } + + if (policy_mgr_mode_specific_connection_count(psoc, + PM_STA_MODE, NULL)) { + sta_gc_freq = + policy_mgr_mode_specific_get_channel(psoc, PM_STA_MODE); + vdev_id = policy_mgr_mode_specific_vdev_id(psoc, PM_STA_MODE); + } else if (policy_mgr_mode_specific_connection_count(psoc, + PM_P2P_CLIENT_MODE, + NULL)) { + sta_gc_freq = policy_mgr_mode_specific_get_channel( + psoc, PM_P2P_CLIENT_MODE); + vdev_id = policy_mgr_mode_specific_vdev_id(psoc, + PM_P2P_CLIENT_MODE); + } + + if (!sta_gc_freq || !WLAN_REG_IS_6GHZ_CHAN_FREQ(sta_gc_freq)) + return QDF_STATUS_SUCCESS; + + vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id, + WLAN_POLICY_MGR_ID); + if (!vdev) { + policy_mgr_err("vdev %d is not present", vdev_id); + return QDF_STATUS_E_FAILURE; + } + + /* If STA is present in 6GHz, STA+SAP SCC is allowed + * only on PSC channels in VLP mode. Therefore, remove + * all other 6GHz channels from the PCL list. + * + * VLP STA in PSC + SAP - Allowed + * VLP STA in non-PSC + SAP - Not allowed + * non-VLP STA + SAP - Not allowed + */ + ucfg_reg_get_cur_6g_ap_pwr_type(pm_ctx->pdev, &ap_pwr_type_6g); + policy_mgr_debug("STA power type : %d", ap_pwr_type_6g); + for (i = 0; i < *pcl_len_org; i++) { + if (WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_list_org[i])) { + if (ap_pwr_type_6g != REG_VERY_LOW_POWER_AP) + continue; + else if (!WLAN_REG_IS_6GHZ_PSC_CHAN_FREQ(pcl_list_org[i])) + continue; + } + pcl_list[pcl_len] = pcl_list_org[i]; + weight_list[pcl_len++] = weight_list_org[i]; + } + + qdf_mem_zero(pcl_list_org, *pcl_len_org * sizeof(*pcl_list_org)); + qdf_mem_zero(weight_list_org, *pcl_len_org * sizeof(*weight_list_org)); + qdf_mem_copy(pcl_list_org, pcl_list, pcl_len * sizeof(*pcl_list_org)); + qdf_mem_copy(weight_list_org, weight_list, pcl_len); + *pcl_len_org = pcl_len; + + wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID); + return QDF_STATUS_SUCCESS; +} + static QDF_STATUS policy_mgr_pcl_modification_for_sap( struct wlan_objmgr_psoc *psoc, uint32_t *pcl_channels, uint8_t *pcl_weight, @@ -793,6 +884,14 @@ static QDF_STATUS policy_mgr_pcl_modification_for_sap( } indoor_modified_pcl = true; + status = policy_mgr_modify_sap_pcl_for_6G_channels(psoc, + pcl_channels, + pcl_weight, len); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to modify pcl for 6G channels"); + return status; + } + modified_final_pcl = true; policy_mgr_debug(" %d %d %d %d %d", mandatory_modified_pcl, @@ -1031,6 +1130,8 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, policy_mgr_dump_channel_list(*len, pcl_channels, pcl_weight); + policy_mgr_debug("PCL before modification"); + policy_mgr_dump_channel_list(*len, pcl_channels, pcl_weight); policy_mgr_mode_specific_modification_on_pcl( psoc, pcl_channels, pcl_weight, len, mode); @@ -1041,6 +1142,10 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, policy_mgr_err("failed to get modified pcl based on DNBS"); return status; } + + policy_mgr_debug("PCL after modification"); + policy_mgr_dump_channel_list(*len, pcl_channels, pcl_weight); + return QDF_STATUS_SUCCESS; } diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index a5587a1a3845..401bd9c549e5 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -1468,6 +1468,16 @@ QDF_STATUS wlan_mlme_cfg_set_vht_max_mpdu_len(struct wlan_objmgr_psoc *psoc, uint8_t value); +/** + * wlan_mlme_cfg_get_ht_smps() - gets HT SM Power Save mode from cfg item + * @psoc: psoc context + * @value: data to be set + * + * Return: QDF_STATUS + */ +QDF_STATUS wlan_mlme_cfg_get_ht_smps(struct wlan_objmgr_psoc *psoc, + uint8_t *value); + /** * wlan_mlme_cfg_get_vht_chan_width() - gets vht supported channel width from * cfg item diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index bbf3c454e0c1..5906cf82d9d4 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -4262,4 +4262,24 @@ ucfg_mlme_is_sta_mon_conc_supported(struct wlan_objmgr_psoc *psoc) return wlan_mlme_is_sta_mon_conc_supported(psoc); } +static inline QDF_STATUS +ucfg_mlme_cfg_get_vht_ampdu_len_exp(struct wlan_objmgr_psoc *psoc, + uint8_t *value) +{ + return wlan_mlme_cfg_get_vht_ampdu_len_exp(psoc, value); +} + +static inline QDF_STATUS +ucfg_mlme_cfg_get_vht_max_mpdu_len(struct wlan_objmgr_psoc *psoc, + uint8_t *value) +{ + return wlan_mlme_cfg_get_vht_max_mpdu_len(psoc, value); +} + +static inline QDF_STATUS +ucfg_mlme_cfg_get_ht_smps(struct wlan_objmgr_psoc *psoc, + uint8_t *value) +{ + return wlan_mlme_cfg_get_ht_smps(psoc, value); +} #endif /* _WLAN_MLME_UCFG_API_H_ */ diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index ca69d7cfd051..dd930d969742 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -1314,6 +1314,48 @@ QDF_STATUS wlan_mlme_get_wmm_uapsd_vo_sus_intv(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS wlan_mlme_cfg_get_vht_ampdu_len_exp(struct wlan_objmgr_psoc *psoc, + uint8_t *value) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) + return QDF_STATUS_E_FAILURE; + + *value = mlme_obj->cfg.vht_caps.vht_cap_info.ampdu_len_exponent; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS wlan_mlme_cfg_get_vht_max_mpdu_len(struct wlan_objmgr_psoc *psoc, + uint8_t *value) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) + return QDF_STATUS_E_FAILURE; + + *value = mlme_obj->cfg.vht_caps.vht_cap_info.ampdu_len; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS wlan_mlme_cfg_get_ht_smps(struct wlan_objmgr_psoc *psoc, + uint8_t *value) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) + return QDF_STATUS_E_FAILURE; + + *value = mlme_obj->cfg.ht_caps.smps; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS wlan_mlme_get_wmm_dir_ac_vi(struct wlan_objmgr_psoc *psoc, uint8_t *value) { diff --git a/components/pkt_capture/core/inc/wlan_pkt_capture_priv.h b/components/pkt_capture/core/inc/wlan_pkt_capture_priv.h index 93ab1eac698b..820de82a18bd 100644 --- a/components/pkt_capture/core/inc/wlan_pkt_capture_priv.h +++ b/components/pkt_capture/core/inc/wlan_pkt_capture_priv.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-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 @@ -59,12 +59,12 @@ struct pkt_capture_cb_context { * @cb_ctx: pointer to packet capture mon callback context * @frame_filter: config filter set by vendor command * @cfg_params: packet capture config params - * @rx_avg_rssi: avg rssi of rx data packets * @ppdu_stats_q: list used for storing smu related ppdu stats * @lock_q: spinlock for ppdu_stats q * @tx_nss: nss of tx data packets received from ppdu stats * @last_freq: Last connected freq * @curr_freq: current connected freq + * @rx_vht_sgi: guard interval of vht rx packet */ struct pkt_capture_vdev_priv { struct wlan_objmgr_vdev *vdev; @@ -72,12 +72,12 @@ struct pkt_capture_vdev_priv { struct pkt_capture_cb_context *cb_ctx; struct pkt_capture_frame_filter frame_filter; struct pkt_capture_cfg cfg_params; - int32_t rx_avg_rssi; qdf_list_t ppdu_stats_q; qdf_spinlock_t lock_q; uint8_t tx_nss; qdf_freq_t last_freq; qdf_freq_t curr_freq; + uint8_t rx_vht_sgi; }; /** diff --git a/components/pkt_capture/core/src/wlan_pkt_capture_data_txrx.c b/components/pkt_capture/core/src/wlan_pkt_capture_data_txrx.c index e8c8682737c3..7170c423a6fc 100644 --- a/components/pkt_capture/core/src/wlan_pkt_capture_data_txrx.c +++ b/components/pkt_capture/core/src/wlan_pkt_capture_data_txrx.c @@ -687,6 +687,7 @@ static void pkt_capture_rx_get_phy_info(void *context, void *psoc, struct dp_soc *soc = psoc; hal_soc_handle_t hal_soc; struct wlan_objmgr_vdev *vdev = context; + struct pkt_capture_vdev_priv *vdev_priv; hal_soc = soc->hal_soc; preamble_type = hal_rx_msdu_start_get_pkt_type(rx_tlv_hdr); @@ -694,6 +695,7 @@ static void pkt_capture_rx_get_phy_info(void *context, void *psoc, bw = hal_rx_msdu_start_bw_get(rx_tlv_hdr); mcs = hal_rx_msdu_start_rate_mcs_get(rx_tlv_hdr); sgi = hal_rx_msdu_start_sgi_get(rx_tlv_hdr); + vdev_priv = pkt_capture_vdev_get_priv(vdev); switch (preamble_type) { case HAL_RX_PKT_TYPE_11A: @@ -712,6 +714,7 @@ static void pkt_capture_rx_get_phy_info(void *context, void *psoc, rx_status->ht_mcs = mcs; break; case HAL_RX_PKT_TYPE_11AC: + sgi = vdev_priv->rx_vht_sgi; rx_status->vht_flags = 1; rx_status->vht_flag_values3[0] = mcs << 0x4 | nss; bw = vdev->vdev_mlme.des_chan->ch_width; diff --git a/components/pkt_capture/dispatcher/inc/wlan_pkt_capture_public_structs.h b/components/pkt_capture/dispatcher/inc/wlan_pkt_capture_public_structs.h index f4e637ca1994..7607f9432d1e 100644 --- a/components/pkt_capture/dispatcher/inc/wlan_pkt_capture_public_structs.h +++ b/components/pkt_capture/dispatcher/inc/wlan_pkt_capture_public_structs.h @@ -83,7 +83,7 @@ struct mgmt_offload_event_params { struct smu_event_params { uint32_t vdev_id; - int32_t rx_avg_rssi; + uint8_t rx_vht_sgi; }; /** diff --git a/components/pkt_capture/dispatcher/src/wlan_pkt_capture_tgt_api.c b/components/pkt_capture/dispatcher/src/wlan_pkt_capture_tgt_api.c index 859fba623c13..1300b8aba176 100644 --- a/components/pkt_capture/dispatcher/src/wlan_pkt_capture_tgt_api.c +++ b/components/pkt_capture/dispatcher/src/wlan_pkt_capture_tgt_api.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * 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 @@ -222,7 +222,7 @@ tgt_pkt_capture_smu_event(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - vdev_priv->rx_avg_rssi = param->rx_avg_rssi; + vdev_priv->rx_vht_sgi = param->rx_vht_sgi; pkt_capture_vdev_put_ref(vdev); diff --git a/core/dp/txrx3.0/dp_fisa_rx.c b/core/dp/txrx3.0/dp_fisa_rx.c index 690962cb3d7d..83d48b50c989 100644 --- a/core/dp/txrx3.0/dp_fisa_rx.c +++ b/core/dp/txrx3.0/dp_fisa_rx.c @@ -1901,6 +1901,7 @@ QDF_STATUS dp_fisa_rx(struct dp_soc *soc, struct dp_vdev *vdev, struct dp_fisa_rx_sw_ft *fisa_flow; int fisa_ret; uint8_t rx_ctx_id = QDF_NBUF_CB_RX_CTX_ID(nbuf_list); + uint32_t tlv_reo_dest_ind; head_nbuf = nbuf_list; @@ -1929,6 +1930,17 @@ QDF_STATUS dp_fisa_rx(struct dp_soc *soc, struct dp_vdev *vdev, qdf_nbuf_push_head(head_nbuf, RX_PKT_TLVS_LEN + QDF_NBUF_CB_RX_PACKET_L3_HDR_PAD(head_nbuf)); + hal_rx_msdu_get_reo_destination_indication(soc->hal_soc, + (uint8_t *)qdf_nbuf_data(head_nbuf), + &tlv_reo_dest_ind); + /* Skip FISA aggregation and drop the frame if RDI is REO2TCL */ + if (qdf_unlikely(tlv_reo_dest_ind == REO_REMAP_TCL)) { + qdf_nbuf_free(head_nbuf); + head_nbuf = next_nbuf; + DP_STATS_INC(dp_fisa_rx_hdl, incorrect_rdi, 1); + continue; + } + /* Add new flow if the there is no ongoing flow */ fisa_flow = dp_rx_get_fisa_flow(dp_fisa_rx_hdl, vdev, head_nbuf); diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index e98a4fd686f2..d17093869a3e 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2020 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 * any purpose with or without fee is hereby granted, provided that the @@ -273,6 +274,17 @@ struct hdd_adapter *hdd_get_sta_connection_in_progress( */ void hdd_abort_ongoing_sta_connection(struct hdd_context *hdd_ctx); +/** + * hdd_abort_ongoing_sta_sae_connection() - Disconnect the sta for which the + * sae connection is in progress. + * @hdd_ctx: hdd context + * @adapter: pointer to the adapter + * + * Return: none + */ +void hdd_abort_ongoing_sta_sae_connection(struct hdd_context *hdd_ctx, + struct hdd_adapter *adapter); + /** * hdd_is_any_sta_connected() - check if any sta in connected state * @hdd_ctx: hdd context diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 7fd32192150a..e02c72eadb1e 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -460,6 +460,47 @@ void hdd_abort_ongoing_sta_connection(struct hdd_context *hdd_ctx) } } +void hdd_abort_ongoing_sta_sae_connection(struct hdd_context *hdd_ctx, + struct hdd_adapter *adapter) +{ + struct hdd_adapter *sta_adapter; + struct wlan_objmgr_vdev *vdev; + int32_t key_mgmt; + QDF_STATUS status; + + sta_adapter = hdd_get_sta_connection_in_progress(hdd_ctx); + if (!sta_adapter) { + hdd_err("sta_adapter is NULL"); + return; + } + + vdev = hdd_objmgr_get_vdev(adapter); + if (!vdev) { + hdd_err("vdev is NULL"); + return; + } + + key_mgmt = wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_KEY_MGMT); + hdd_objmgr_put_vdev(vdev); + + if (key_mgmt < 0) { + hdd_debug_rl("Invalid key_mgmt: %d", key_mgmt); + return; + } + + if (QDF_HAS_PARAM(key_mgmt, WLAN_CRYPTO_KEY_MGMT_SAE) || + QDF_HAS_PARAM(key_mgmt, WLAN_CRYPTO_KEY_MGMT_FT_SAE)) { + hdd_debug("Disconnecting STA on vdev: %d", + sta_adapter->vdev_id); + status = wlan_hdd_disconnect(sta_adapter, + eCSR_DISCONNECT_REASON_DEAUTH, + REASON_DISASSOC_NETWORK_LEAVING); + if (QDF_IS_STATUS_ERROR(status)) + hdd_err("wlan_hdd_disconnect failed, status: %d", + status); + } +} + bool hdd_is_any_sta_connected(struct hdd_context *hdd_ctx) { struct hdd_adapter *adapter = NULL, *next_adapter = NULL; diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index d1d8318f2802..075de779d2d5 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -5274,6 +5274,21 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, } } + /* + * For STA+SAP/GO concurrency support from GUI, In case if + * START AP/GO request comes just before the SAE authentication + * completion on STA, SAE AUTH REQ waits for START AP RSP and + * START AP RSP waits to complete SAE AUTH REQ. + * Driver completes START AP RSP only upon SAE AUTH REQ timeout(5 sec) + * as start ap will be in serialization pending queue, and SAE auth + * sequence cannot complete as hostap thread is blocked in start ap + * cfg80211 ops. + * To avoid above deadlock until SAE timeout, abort the SAE connection + * immediately and complete START AP/GO asap so that the upper layer + * can trigger a fresh connection after START AP/GO completion. + */ + hdd_abort_ongoing_sta_sae_connection(hdd_ctx, adapter); + mac_handle = hdd_ctx->mac_handle; sme_config = qdf_mem_malloc(sizeof(*sme_config)); @@ -6043,6 +6058,21 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, goto exit; } + /* + * For STA+SAP/GO concurrency support from GUI, In case if + * STOP AP/GO request comes just before the SAE authentication + * completion on STA, SAE AUTH REQ waits for STOP AP RSP and + * STOP AP RSP waits to complete SAE AUTH REQ. + * Driver completes STOP AP RSP only upon SAE AUTH REQ timeout(5 sec) + * as stop ap will be in serialization pending queue, and SAE auth + * sequence cannot complete as hostap thread is blocked in stop ap + * cfg80211 ops. + * To avoid above deadlock until SAE timeout, abort the SAE connection + * immediately and complete STOP AP/GO asap so that the upper layer + * can trigger a fresh connection after STOP AP/GO completion. + */ + hdd_abort_ongoing_sta_sae_connection(hdd_ctx, adapter); + /* Clear SOFTAP_INIT_DONE flag to mark stop_ap deinit. So that we do * not restart SAP after SSR as SAP is already stopped from user space. * This update is moved to start of this function to resolve stop_ap diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index b7f2353b28e8..6ff051ffb47d 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -201,6 +201,7 @@ #ifdef WLAN_FEATURE_DYNAMIC_RX_AGGREGATION #include #endif +#include #ifdef MODULE #ifdef WLAN_WEAR_CHIPSET @@ -2255,6 +2256,42 @@ static void hdd_extract_fw_version_info(struct hdd_context *hdd_ctx) #if defined(WLAN_FEATURE_11AX) && \ (defined(CFG80211_SBAND_IFTYPE_DATA_BACKPORT) || \ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))) + +#if defined(CONFIG_BAND_6GHZ) && (defined(IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START)) +static void hdd_update_wiphy_he_6ghz_capa(struct hdd_context *hdd_ctx) +{ + uint16_t he_6ghz_capa = 0; + uint8_t min_mpdu_start_spacing; + uint8_t max_ampdu_len_exp; + uint8_t max_mpdu_len; + uint8_t sm_pow_save; + + ucfg_mlme_get_ht_mpdu_density(hdd_ctx->psoc, &min_mpdu_start_spacing); + he_6ghz_capa |= FIELD_PREP(IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START, + min_mpdu_start_spacing); + + ucfg_mlme_cfg_get_vht_ampdu_len_exp(hdd_ctx->psoc, &max_ampdu_len_exp); + he_6ghz_capa |= FIELD_PREP(IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP, + max_ampdu_len_exp); + + ucfg_mlme_cfg_get_vht_max_mpdu_len(hdd_ctx->psoc, &max_mpdu_len); + he_6ghz_capa |= FIELD_PREP(IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN, + max_mpdu_len); + + ucfg_mlme_cfg_get_ht_smps(hdd_ctx->psoc, &sm_pow_save); + he_6ghz_capa |= FIELD_PREP(IEEE80211_HE_6GHZ_CAP_SM_PS, sm_pow_save); + + he_6ghz_capa |= IEEE80211_HE_6GHZ_CAP_RX_ANTPAT_CONS; + he_6ghz_capa |= IEEE80211_HE_6GHZ_CAP_TX_ANTPAT_CONS; + + hdd_ctx->iftype_data_6g->he_6ghz_capa.capa = he_6ghz_capa; +} +#else +static inline void hdd_update_wiphy_he_6ghz_capa(struct hdd_context *hdd_ctx) +{ +} +#endif + #if defined(CONFIG_BAND_6GHZ) && (defined(CFG80211_6GHZ_BAND_SUPPORTED) || \ (KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE)) static void @@ -2295,6 +2332,8 @@ hdd_update_wiphy_he_caps_6ghz(struct hdd_context *hdd_ctx, if (he_cap_cfg->twt_responder) mac_info_6g[0] |= IEEE80211_HE_MAC_CAP0_TWT_RES; + hdd_update_wiphy_he_6ghz_capa(hdd_ctx); + band_6g->iftype_data = hdd_ctx->iftype_data_6g; } #else @@ -9696,7 +9735,6 @@ void hdd_prevent_suspend_timeout(uint32_t timeout, uint32_t reason) QDF_STATUS hdd_set_sme_chan_list(struct hdd_context *hdd_ctx) { return sme_init_chan_list(hdd_ctx->mac_handle, - hdd_ctx->reg.alpha2, hdd_ctx->reg.cc_src); } diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 8f7b64080e47..bea3c20e9dc7 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 8 -#define QWLAN_VERSION_EXTRA "M" +#define QWLAN_VERSION_EXTRA "V" #define QWLAN_VERSION_BUILD 33 -#define QWLAN_VERSIONSTR "2.0.8.33M" +#define QWLAN_VERSIONSTR "2.0.8.33V" #endif /* QWLAN_VERSION_H */ diff --git a/core/mac/src/cfg/cfgUtil/dot11f.frms b/core/mac/src/cfg/cfgUtil/dot11f.frms index ac7ba3959c7a..a3bbbbbf6297 100644 --- a/core/mac/src/cfg/cfgUtil/dot11f.frms +++ b/core/mac/src/cfg/cfgUtil/dot11f.frms @@ -1,6 +1,7 @@ /* * Copyright (c) 2006-2007, 2014-2018, 2020-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 * any purpose with or without fee is hereby granted, provided that the @@ -3861,6 +3862,7 @@ FRAME AssocResponse // 7.2.3.5 OPTIE P2PAssocRes; OPTIE VHTCaps; OPTIE VHTOperation; + OPTIE OperatingMode; OPTIE ExtCap; OPTIE OBSSScanParameters; OPTIE QosMapSet; @@ -3950,6 +3952,7 @@ FRAME ReAssocResponse // 7.2.3.7 OPTIE P2PAssocRes; OPTIE VHTCaps; OPTIE VHTOperation; + OPTIE OperatingMode; OPTIE ExtCap; OPTIE OBSSScanParameters; OPTIE QosMapSet; diff --git a/core/mac/src/include/dot11f.h b/core/mac/src/include/dot11f.h index 5f89bd74caa9..7b0afc593596 100644 --- a/core/mac/src/include/dot11f.h +++ b/core/mac/src/include/dot11f.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-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 * any purpose with or without fee is hereby granted, provided that the @@ -26,7 +27,7 @@ * * * This file was automatically generated by 'framesc' - * Wed Sep 29 13:23:21 2021 from the following file(s): + * Mon May 30 20:50:39 2022 from the following file(s): * * dot11f.frms * @@ -10110,6 +10111,7 @@ typedef struct sDot11fAssocResponse{ tDot11fIEP2PAssocRes P2PAssocRes; tDot11fIEVHTCaps VHTCaps; tDot11fIEVHTOperation VHTOperation; + tDot11fIEOperatingMode OperatingMode; tDot11fIEExtCap ExtCap; tDot11fIEOBSSScanParameters OBSSScanParameters; tDot11fIEQosMapSet QosMapSet; @@ -11061,6 +11063,7 @@ typedef struct sDot11fReAssocResponse{ tDot11fIEP2PAssocRes P2PAssocRes; tDot11fIEVHTCaps VHTCaps; tDot11fIEVHTOperation VHTOperation; + tDot11fIEOperatingMode OperatingMode; tDot11fIEExtCap ExtCap; tDot11fIEOBSSScanParameters OBSSScanParameters; tDot11fIEQosMapSet QosMapSet; diff --git a/core/mac/src/include/parser_api.h b/core/mac/src/include/parser_api.h index ee86d543bfa5..bb67022d828c 100644 --- a/core/mac/src/include/parser_api.h +++ b/core/mac/src/include/parser_api.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. - * 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 @@ -471,6 +471,7 @@ typedef struct sSirAssocRsp { tDot11fIEVHTCaps VHTCaps; tDot11fIEVHTOperation VHTOperation; tDot11fIEExtCap ExtCap; + tDot11fIEOperatingMode oper_mode_ntf; struct qos_map_set QosMapSet; #ifdef WLAN_FEATURE_11W tDot11fIETimeoutInterval TimeoutInterval; diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 57f661db9fb5..e2f269c9f81a 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2011-2020 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 @@ -3410,30 +3410,30 @@ void lim_update_vhtcaps_assoc_resp(struct mac_context *mac_ctx, * lim_update_vht_oper_assoc_resp : Update VHT Operations in assoc response. * @mac_ctx Pointer to Global MAC structure * @pAddBssParams: parameters required for add bss params. + * @vht_caps: VHT CAP IE to update. * @vht_oper: VHT Operations to update. + * @ht_info: HT Info IE to update. * @pe_session : session entry. * * Return : void */ static void lim_update_vht_oper_assoc_resp(struct mac_context *mac_ctx, struct bss_params *pAddBssParams, - tDot11fIEVHTOperation *vht_oper, struct pe_session *pe_session) + tDot11fIEVHTCaps *vht_caps, tDot11fIEVHTOperation *vht_oper, + tDot11fIEHTInfo *ht_info, struct pe_session *pe_session) { - int16_t ccfs0 = vht_oper->chan_center_freq_seg0; - int16_t ccfs1 = vht_oper->chan_center_freq_seg1; - int16_t offset = abs((ccfs0 - ccfs1)); uint8_t ch_width; ch_width = pAddBssParams->ch_width; - if (vht_oper->chanWidth && pe_session->ch_width) { - ch_width = CH_WIDTH_80MHZ; - if (ccfs1 && offset == 8) - ch_width = CH_WIDTH_160MHZ; - else if (ccfs1 && offset > 16) - ch_width = CH_WIDTH_80P80MHZ; - } + + if (vht_oper->chanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ && + pe_session->ch_width) + ch_width = + lim_get_vht_ch_width(vht_caps, vht_oper, ht_info) + 1; + if (ch_width > pe_session->ch_width) ch_width = pe_session->ch_width; + pAddBssParams->ch_width = ch_width; pAddBssParams->staContext.ch_width = ch_width; } @@ -3529,11 +3529,34 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp lim_get_ht_capability(mac, eHT_SUPPORTED_CHANNEL_WIDTH_SET, pe_session); + lim_sta_add_bss_update_ht_parameter(bssDescription->chan_freq, &pAssocRsp->HTCaps, &pAssocRsp->HTInfo, chan_width_support, pAddBssParams); + /** + * in limExtractApCapability function intersection of FW + * advertised channel width and AP advertised channel + * width has been taken into account for calculating + * pe_session->ch_width + */ + + if (chan_width_support && + ((pAssocRsp->HTCaps.present && + pAssocRsp->HTCaps.supportedChannelWidthSet) || + (pBeaconStruct->HTCaps.present && + pBeaconStruct->HTCaps.supportedChannelWidthSet))) { + pAddBssParams->ch_width = + pe_session->ch_width; + pAddBssParams->staContext.ch_width = + pe_session->ch_width; + } else { + pAddBssParams->ch_width = CH_WIDTH_20MHZ; + pAddBssParams->staContext.ch_width = CH_WIDTH_20MHZ; + if (!vht_cap_info->enable_txbf_20mhz) + pAddBssParams->staContext.vhtTxBFCapable = 0; + } } if (pe_session->vhtCapability && (pAssocRsp->VHTCaps.present)) { @@ -3553,7 +3576,9 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp if (pAddBssParams->vhtCapable) { if (vht_oper) lim_update_vht_oper_assoc_resp(mac, pAddBssParams, - vht_oper, pe_session); + vht_caps, vht_oper, + &pAssocRsp->HTInfo, + pe_session); if (vht_caps) lim_update_vhtcaps_assoc_resp(mac, pAddBssParams, vht_caps, pe_session); @@ -3664,26 +3689,6 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp sta); } - /* - * in limExtractApCapability function intersection of FW - * advertised channel width and AP advertised channel - * width has been taken into account for calculating - * pe_session->ch_width - */ - if (chan_width_support && - ((pAssocRsp->HTCaps.supportedChannelWidthSet) || - (pBeaconStruct->HTCaps.supportedChannelWidthSet))) { - pAddBssParams->ch_width = - pe_session->ch_width; - pAddBssParams->staContext.ch_width = - pe_session->ch_width; - } else { - pAddBssParams->ch_width = CH_WIDTH_20MHZ; - sta_context->ch_width = CH_WIDTH_20MHZ; - if (!vht_cap_info->enable_txbf_20mhz) - sta_context->vhtTxBFCapable = 0; - } - pAddBssParams->staContext.mimoPS = (tSirMacHTMIMOPowerSaveState) pAssocRsp->HTCaps.mimoPowerSave; diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c index 09e65cfb444b..35840952fd01 100644 --- a/core/mac/src/pe/lim/lim_process_action_frame.c +++ b/core/mac/src/pe/lim/lim_process_action_frame.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-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 @@ -244,10 +244,7 @@ static void __lim_process_operating_mode_action_frame(struct mac_context *mac_ct uint32_t status; tpDphHashNode sta_ptr; uint16_t aid; - uint8_t oper_mode; - uint8_t cb_mode; uint8_t ch_bw = 0; - uint8_t skip_opmode_update = false; mac_hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info); body_ptr = WMA_GET_RX_MPDU_DATA(rx_pkt_info); @@ -287,87 +284,13 @@ static void __lim_process_operating_mode_action_frame(struct mac_context *mac_ct goto end; } - if (wlan_reg_is_24ghz_ch_freq(session->curr_op_freq)) - cb_mode = mac_ctx->roam.configParam.channelBondingMode24GHz; - else - cb_mode = mac_ctx->roam.configParam.channelBondingMode5GHz; - /* - * Do not update the channel bonding mode if channel bonding - * mode is disabled in INI. - */ - if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE == cb_mode) { - pe_debug("channel bonding disabled"); - goto update_nss; - } + lim_update_nss(mac_ctx, sta_ptr, + operating_mode_frm->OperatingMode.rxNSS, + session); - if (sta_ptr->htSupportedChannelWidthSet) { - if (WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ < - sta_ptr->vhtSupportedChannelWidthSet) - oper_mode = eHT_CHANNEL_WIDTH_160MHZ; - else - oper_mode = sta_ptr->vhtSupportedChannelWidthSet + 1; - } else { - oper_mode = eHT_CHANNEL_WIDTH_20MHZ; - } - - if ((oper_mode == eHT_CHANNEL_WIDTH_80MHZ) && - (operating_mode_frm->OperatingMode.chanWidth > - eHT_CHANNEL_WIDTH_80MHZ)) - skip_opmode_update = true; - - if (!skip_opmode_update && (oper_mode != - operating_mode_frm->OperatingMode.chanWidth)) { - uint32_t fw_vht_ch_wd = wma_get_vht_ch_width(); - - pe_debug("received Chanwidth: %d", - operating_mode_frm->OperatingMode.chanWidth); - - pe_debug(" MAC: %0x:%0x:%0x:%0x:%0x:%0x", - mac_hdr->sa[0], mac_hdr->sa[1], mac_hdr->sa[2], - mac_hdr->sa[3], mac_hdr->sa[4], mac_hdr->sa[5]); - - if (operating_mode_frm->OperatingMode.chanWidth >= - eHT_CHANNEL_WIDTH_160MHZ - && (fw_vht_ch_wd >= eHT_CHANNEL_WIDTH_160MHZ)) { - sta_ptr->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ; - sta_ptr->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; - ch_bw = eHT_CHANNEL_WIDTH_160MHZ; - } else if (operating_mode_frm->OperatingMode.chanWidth >= - eHT_CHANNEL_WIDTH_80MHZ) { - sta_ptr->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; - sta_ptr->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; - ch_bw = eHT_CHANNEL_WIDTH_80MHZ; - } else if (operating_mode_frm->OperatingMode.chanWidth == - eHT_CHANNEL_WIDTH_40MHZ) { - sta_ptr->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; - sta_ptr->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; - ch_bw = eHT_CHANNEL_WIDTH_40MHZ; - } else if (operating_mode_frm->OperatingMode.chanWidth == - eHT_CHANNEL_WIDTH_20MHZ) { - sta_ptr->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; - sta_ptr->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_20MHZ; - ch_bw = eHT_CHANNEL_WIDTH_20MHZ; - } - lim_check_vht_op_mode_change(mac_ctx, session, ch_bw, - mac_hdr->sa); - } - -update_nss: - if (sta_ptr->vhtSupportedRxNss != - (operating_mode_frm->OperatingMode.rxNSS + 1)) { - sta_ptr->vhtSupportedRxNss = - operating_mode_frm->OperatingMode.rxNSS + 1; - lim_set_nss_change(mac_ctx, session, sta_ptr->vhtSupportedRxNss, - mac_hdr->sa); - } + lim_update_channel_width(mac_ctx, sta_ptr, session, + operating_mode_frm->OperatingMode.chanWidth, + &ch_bw); end: qdf_mem_free(operating_mode_frm); diff --git a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c index 1e024f023c73..ab6c8639ab72 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved. - * 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 @@ -139,6 +139,7 @@ void lim_update_assoc_sta_datas(struct mac_context *mac_ctx, tDot11fIEVHTCaps *vht_caps = NULL; tDot11fIEhe_cap *he_cap = NULL; struct bss_description *bss_desc = NULL; + tDot11fIEVHTOperation *vht_oper = NULL; lim_get_phy_mode(mac_ctx, &phy_mode, session_entry); sta_ds->staType = STA_ENTRY_SELF; @@ -155,10 +156,13 @@ void lim_update_assoc_sta_datas(struct mac_context *mac_ctx, lim_update_stads_htcap(mac_ctx, sta_ds, assoc_rsp, session_entry); - if (assoc_rsp->VHTCaps.present) + if (assoc_rsp->VHTCaps.present) { vht_caps = &assoc_rsp->VHTCaps; - else if (assoc_rsp->vendor_vht_ie.VHTCaps.present) + vht_oper = &assoc_rsp->VHTOperation; + } else if (assoc_rsp->vendor_vht_ie.VHTCaps.present) { vht_caps = &assoc_rsp->vendor_vht_ie.VHTCaps; + vht_oper = &assoc_rsp->vendor_vht_ie.VHTOperation; + } if (session_entry->vhtCapability && (vht_caps && vht_caps->present)) { sta_ds->mlmStaContext.vhtCapability = @@ -171,13 +175,16 @@ void lim_update_assoc_sta_datas(struct mac_context *mac_ctx, */ sta_ds->htMaxRxAMpduFactor = vht_caps->maxAMPDULenExp; if (session_entry->htSupportedChannelWidthSet) { - if (assoc_rsp->VHTOperation.present) + if (vht_oper && vht_oper->present) sta_ds->vhtSupportedChannelWidthSet = - assoc_rsp->VHTOperation.chanWidth; + lim_get_vht_ch_width(vht_caps, + vht_oper, + &assoc_rsp->HTInfo); else sta_ds->vhtSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; + WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; } + sta_ds->vht_mcs_10_11_supp = 0; if (mac_ctx->mlme_cfg->vht_caps.vht_cap_info. vht_mcs_10_11_supp && @@ -289,6 +296,13 @@ void lim_update_assoc_sta_datas(struct mac_context *mac_ctx, if (session_entry->limRmfEnabled) sta_ds->rmfEnabled = 1; #endif + if (session_entry->vhtCapability && assoc_rsp->oper_mode_ntf.present) { + /** + * OMN IE is present in the Assoc response, but the channel + * width/Rx NSS update will happen through the peer_assoc cmd. + */ + pe_debug("OMN IE is present in the assoc response frame"); + } } /** diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 3e20732b7174..acb1ee398587 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-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 @@ -205,6 +205,7 @@ static void populate_dot11f_tdls_offchannel_params( uint8_t nss_2g; uint8_t nss_5g; qdf_freq_t ch_freq; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; numChans = mac->mlme_cfg->reg.valid_channel_list_num; @@ -270,13 +271,14 @@ static void populate_dot11f_tdls_offchannel_params( break; } + wlan_reg_read_current_country(mac->psoc, reg_cc); op_class = wlan_reg_dmn_get_opclass_from_channel( - mac->scan.countryCodeCurrent, + reg_cc, wlan_reg_freq_to_chan(mac->pdev, pe_session->curr_op_freq), chanOffset); pe_debug("countryCodeCurrent: %s, curr_op_freq: %d, htSecondaryChannelOffset: %d, chanOffset: %d op class: %d", - mac->scan.countryCodeCurrent, + reg_cc, pe_session->curr_op_freq, pe_session->htSecondaryChannelOffset, chanOffset, op_class); diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index ea07afe0a7cb..d9d92767aed6 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -4288,6 +4288,7 @@ lim_send_extended_chan_switch_action_frame(struct mac_context *mac_ctx, uint8_t vdev_id = 0; uint8_t ch_spacing; tLimWiderBWChannelSwitchInfo *wide_bw_ie; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; if (!session_entry) { pe_err("Session entry is NULL!!!"); @@ -4306,9 +4307,9 @@ lim_send_extended_chan_switch_action_frame(struct mac_context *mac_ctx, frm.ext_chan_switch_ann_action.new_channel = new_channel; frm.ext_chan_switch_ann_action.switch_count = count; + wlan_reg_read_current_country(mac_ctx->psoc, reg_cc); ch_spacing = wlan_reg_dmn_get_chanwidth_from_opclass( - mac_ctx->scan.countryCodeCurrent, new_channel, - new_op_class); + reg_cc, new_channel, new_op_class); if ((ch_spacing == 80) || (ch_spacing == 160)) { wide_bw_ie = &session_entry->gLimWiderBWChannelSwitch; diff --git a/core/mac/src/pe/lim/lim_send_messages.c b/core/mac/src/pe/lim/lim_send_messages.c index 5b7c3a96832a..8958e8c4b1b8 100644 --- a/core/mac/src/pe/lim/lim_send_messages.c +++ b/core/mac/src/pe/lim/lim_send_messages.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2011-2020 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 * any purpose with or without fee is hereby granted, provided that the @@ -477,6 +478,7 @@ QDF_STATUS lim_send_ht40_obss_scanind(struct mac_context *mac_ctx, uint32_t channelnum, chan_freq; struct scheduler_msg msg = {0}; uint8_t channel24gnum, count; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; ht40_obss_scanind = qdf_mem_malloc(sizeof(struct obss_ht40_scanind)); if (!ht40_obss_scanind) @@ -485,6 +487,7 @@ QDF_STATUS lim_send_ht40_obss_scanind(struct mac_context *mac_ctx, "OBSS Scan Indication bssid " QDF_MAC_ADDR_FMT, QDF_MAC_ADDR_REF(session->bssId)); + wlan_reg_read_current_country(mac_ctx->psoc, reg_cc); ht40_obss_scanind->cmd = HT40_OBSS_SCAN_PARAM_START; ht40_obss_scanind->scan_type = eSIR_ACTIVE_SCAN; ht40_obss_scanind->obss_passive_dwelltime = @@ -503,7 +506,7 @@ QDF_STATUS lim_send_ht40_obss_scanind(struct mac_context *mac_ctx, session->obss_ht40_scanparam.obss_activity_threshold; ht40_obss_scanind->current_operatingclass = wlan_reg_dmn_get_opclass_from_channel( - mac_ctx->scan.countryCodeCurrent, + reg_cc, wlan_reg_freq_to_chan( mac_ctx->pdev, session->curr_op_freq), session->ch_width); diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 1922b487c16a..6124376906d6 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -3765,10 +3765,41 @@ static void lim_ht_switch_chnl_req(struct pe_session *session) } } +uint8_t lim_get_cb_mode_for_freq(struct mac_context *mac, + struct pe_session *session, + qdf_freq_t chan_freq) +{ + uint8_t cb_mode = mac->roam.configParam.channelBondingMode5GHz; + + if (WLAN_REG_IS_24GHZ_CH_FREQ(chan_freq)) { + if (session->force_24ghz_in_ht20) { + cb_mode = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; + pe_debug_rl("vdev %d force 20 Mhz in 2.4 GHz", + session->vdev_id); + } else { + cb_mode = mac->roam.configParam.channelBondingMode24GHz; + } + } + + return cb_mode; +} + void lim_update_sta_run_time_ht_switch_chnl_params(struct mac_context *mac, tDot11fIEHTInfo *pHTInfo, struct pe_session *pe_session) { + uint8_t cb_mode; + + cb_mode = lim_get_cb_mode_for_freq(mac, pe_session, + pe_session->curr_op_freq); + + /* If self capability is set to '20Mhz only', then do not change the CB mode. */ + if (cb_mode == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) { + pe_debug_rl("self_cb_mode 0 for freq %d", + pe_session->curr_op_freq); + return; + } + /* If self capability is set to '20Mhz only', then do not change the CB mode. */ if (!lim_get_ht_capability (mac, eHT_SUPPORTED_CHANNEL_WIDTH_SET, pe_session)) @@ -9301,3 +9332,127 @@ QDF_STATUS lim_pre_vdev_start(struct mac_context *mac, return lim_set_ch_phy_mode(mlme_obj->vdev, session->dot11mode); } + +void lim_update_nss(struct mac_context *mac_ctx, tpDphHashNode sta_ds, + uint8_t rx_nss, struct pe_session *session) +{ + if (sta_ds->vhtSupportedRxNss != (rx_nss + 1)) { + if (session->nss_forced_1x1) { + pe_debug("Not Updating NSS for special AP"); + return; + } + sta_ds->vhtSupportedRxNss = rx_nss + 1; + lim_set_nss_change(mac_ctx, session, + sta_ds->vhtSupportedRxNss, + sta_ds->staAddr); + } +} + +bool lim_update_channel_width(struct mac_context *mac_ctx, + tpDphHashNode sta_ptr, + struct pe_session *session, + uint8_t ch_width, uint8_t *new_ch_width) +{ + uint8_t cb_mode, oper_mode; + uint32_t fw_vht_ch_wd; + + cb_mode = lim_get_cb_mode_for_freq(mac_ctx, session, + session->curr_op_freq); + /* + * Do not update the channel bonding mode if channel bonding + * mode is disabled in INI. + */ + if (cb_mode == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) { + pe_debug("channel bonding disabled"); + return false; + } + + if (sta_ptr->htSupportedChannelWidthSet) { + if (sta_ptr->vhtSupportedChannelWidthSet > + WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) + oper_mode = eHT_CHANNEL_WIDTH_160MHZ; + else + oper_mode = sta_ptr->vhtSupportedChannelWidthSet + 1; + } else { + oper_mode = eHT_CHANNEL_WIDTH_20MHZ; + } + + if (((oper_mode == eHT_CHANNEL_WIDTH_80MHZ) && + (ch_width > eHT_CHANNEL_WIDTH_80MHZ)) || + (oper_mode == ch_width)) + return false; + + fw_vht_ch_wd = wma_get_vht_ch_width(); + + pe_debug("ChannelWidth - Current : %d, New: %d mac : " QDF_MAC_ADDR_FMT, + oper_mode, ch_width, QDF_MAC_ADDR_REF(sta_ptr->staAddr)); + + if (ch_width >= eHT_CHANNEL_WIDTH_160MHZ && + (fw_vht_ch_wd >= eHT_CHANNEL_WIDTH_160MHZ)) { + sta_ptr->vhtSupportedChannelWidthSet = + WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ; + sta_ptr->htSupportedChannelWidthSet = + eHT_CHANNEL_WIDTH_40MHZ; + *new_ch_width = eHT_CHANNEL_WIDTH_160MHZ; + } else if (ch_width >= eHT_CHANNEL_WIDTH_80MHZ) { + sta_ptr->vhtSupportedChannelWidthSet = + WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; + sta_ptr->htSupportedChannelWidthSet = + eHT_CHANNEL_WIDTH_40MHZ; + *new_ch_width = eHT_CHANNEL_WIDTH_80MHZ; + } else if (ch_width == eHT_CHANNEL_WIDTH_40MHZ) { + sta_ptr->vhtSupportedChannelWidthSet = + WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; + sta_ptr->htSupportedChannelWidthSet = + eHT_CHANNEL_WIDTH_40MHZ; + *new_ch_width = eHT_CHANNEL_WIDTH_40MHZ; + } else if (ch_width == eHT_CHANNEL_WIDTH_20MHZ) { + sta_ptr->vhtSupportedChannelWidthSet = + WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; + sta_ptr->htSupportedChannelWidthSet = + eHT_CHANNEL_WIDTH_20MHZ; + *new_ch_width = eHT_CHANNEL_WIDTH_20MHZ; + } + + lim_check_vht_op_mode_change(mac_ctx, session, *new_ch_width, + sta_ptr->staAddr); + return true; +} + +uint8_t lim_get_vht_ch_width(tDot11fIEVHTCaps *vht_cap, + tDot11fIEVHTOperation *vht_op, + tDot11fIEHTInfo *ht_info) +{ + uint8_t ccfs0, ccfs1, offset; + uint8_t ch_width; + + ccfs0 = vht_op->chan_center_freq_seg0; + ccfs1 = vht_op->chan_center_freq_seg1; + ch_width = vht_op->chanWidth; + + if (ch_width > WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ) { + pe_err("Invalid ch width in vht operation IE %d", ch_width); + return WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; + } + + if (vht_cap->vht_extended_nss_bw_cap && + vht_cap->extended_nss_bw_supp && ht_info && ht_info->present) + ccfs1 = ht_info->chan_center_freq_seg2; + + /* According to new VHTOP IE definition, vht ch_width will + * be 1 for 80MHz, 160MHz and 80+80MHz. + * + * To get the correct operation ch_width, find center + * frequency difference. + */ + if (ch_width == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ && ccfs1) { + offset = abs(ccfs0 - ccfs1); + + if (offset == 8) + ch_width = WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ; + else if (offset > 16) + ch_width = WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ; + } + pe_debug("The VHT Operation channel width is %d", ch_width); + return ch_width; +} diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index b97bb75871da..a78655dbad4b 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -327,6 +327,18 @@ void lim_decide_sta_protection_on_assoc(struct mac_context *mac, tpSchBeaconStruct pBeaconStruct, struct pe_session *pe_session); +/** + * lim_get_cb_mode_for_freq() - Get cb mode depending on the freq + * @mac: pointer to Global MAC structure + * @pe_session: pe session + * @chan_freq: Freq to get cb mode for + * + * Return: cb mode allowed for the freq + */ +uint8_t lim_get_cb_mode_for_freq(struct mac_context *mac, + struct pe_session *session, + qdf_freq_t chan_freq); + /** * lim_update_sta_run_time_ht_switch_chnl_params() - Process change in HT * bandwidth @@ -2261,4 +2273,49 @@ static inline void lim_process_sae_msg(struct mac_context *mac, void *body); {} #endif +/** + * lim_update_nss() - Function to update NSS + * @mac_ctx: pointer to Global Mac structure + * @sta_ds: pointer to tpDphHashNode + * @rx_nss: Rx NSS in operating mode notification + * @session: pointer to pe_session + * + * function to update NSS + * + * Return: None + */ +void lim_update_nss(struct mac_context *mac_ctx, tpDphHashNode sta_ds, + uint8_t rx_nss, struct pe_session *session); + +/** + * lim_update_channel_width() - Function to update channel width + * @mac_ctx: pointer to Global Mac structure + * @sta_ptr: pointer to tpDphHashNode + * @session: pointer to pe_session + * @ch_width: Channel width in operating mode notification + * @new_ch_width: Final channel bandwifdth + * + * function to update channel width + * + * Return: Success or Failure + */ +bool lim_update_channel_width(struct mac_context *mac_ctx, + tpDphHashNode sta_ptr, + struct pe_session *session, + uint8_t ch_width, + uint8_t *new_ch_width); + +/** + * lim_get_vht_ch_width() - Function to get the VHT + * operating channel width based on frequency params + * + * @vht_cap: Pointer to VHT Caps IE. + * @vht_op: Pointer to VHT Operation IE. + * @ht_info: Pointer to HT Info IE. + * + * Return: VHT channel width + */ +uint8_t lim_get_vht_ch_width(tDot11fIEVHTCaps *vht_cap, + tDot11fIEVHTOperation *vht_op, + tDot11fIEHTInfo *ht_info); #endif /* __LIM_UTILS_H */ diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index fc0dffe910e5..e8201f66e67f 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -241,36 +241,6 @@ ap_beacon_process(struct mac_context *mac_ctx, uint8_t *rx_pkt_info, /* -------------------------------------------------------------------- */ -/** - * get_operating_channel_width() - Get operating channel width - * @stads - station entry. - * - * This function returns the operating channel width based on - * the supported channel width entry. - * - * Return: tSirMacHTChannelWidth on success - */ -static tSirMacHTChannelWidth get_operating_channel_width(tpDphHashNode stads) -{ - tSirMacHTChannelWidth ch_width = eHT_CHANNEL_WIDTH_20MHZ; - - if (stads->vhtSupportedChannelWidthSet == - WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ) - ch_width = eHT_CHANNEL_WIDTH_160MHZ; - else if (stads->vhtSupportedChannelWidthSet == - WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ) - ch_width = eHT_CHANNEL_WIDTH_160MHZ; - else if (stads->vhtSupportedChannelWidthSet == - WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) - ch_width = eHT_CHANNEL_WIDTH_80MHZ; - else if (stads->htSupportedChannelWidthSet) - ch_width = eHT_CHANNEL_WIDTH_40MHZ; - else - ch_width = eHT_CHANNEL_WIDTH_20MHZ; - - return ch_width; -} - /* * sch_bcn_process_sta() - Process the received beacon frame for sta * @mac_ctx: mac_ctx @@ -415,35 +385,6 @@ sch_bcn_process_sta(struct mac_context *mac_ctx, return true; } -/** - * update_nss() - Function to update NSS - * @mac_ctx: pointer to Global Mac structure - * @sta_ds: pointer to tpDphHashNode - * @beacon: pointer to tpSchBeaconStruct - * @session_entry: pointer to struct pe_session * - * @mgmt_hdr: pointer to tpSirMacMgmtHdr - * - * function to update NSS - * - * Return: none - */ -static void update_nss(struct mac_context *mac_ctx, tpDphHashNode sta_ds, - tpSchBeaconStruct beacon, struct pe_session *session_entry, - tpSirMacMgmtHdr mgmt_hdr) -{ - if (sta_ds->vhtSupportedRxNss != (beacon->OperatingMode.rxNSS + 1)) { - if (session_entry->nss_forced_1x1) { - pe_debug("Not Updating NSS for special AP"); - return; - } - sta_ds->vhtSupportedRxNss = - beacon->OperatingMode.rxNSS + 1; - lim_set_nss_change(mac_ctx, session_entry, - sta_ds->vhtSupportedRxNss, - mgmt_hdr->sa); - } -} - #ifdef WLAN_FEATURE_11AX_BSS_COLOR static void sch_bcn_update_he_ies(struct mac_context *mac_ctx, tpDphHashNode sta_ds, @@ -499,7 +440,7 @@ sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds, bool skip_opmode_update = false; uint8_t oper_mode; uint32_t fw_vht_ch_wd = wma_get_vht_ch_width(); - uint8_t ch_width = 0; + uint8_t ch_width = 0, ch_bw; /* * Ignore opmode change during channel change The opmode will be updated @@ -511,72 +452,10 @@ sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds, } if (session->vhtCapability && bcn->OperatingMode.present) { - update_nss(mac_ctx, sta_ds, bcn, session, mac_hdr); - oper_mode = get_operating_channel_width(sta_ds); - if ((oper_mode == eHT_CHANNEL_WIDTH_80MHZ) && - (bcn->OperatingMode.chanWidth > eHT_CHANNEL_WIDTH_80MHZ)) - skip_opmode_update = true; - - if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE == cb_mode) { - /* - * if channel bonding is disabled from INI do not - * update the chan width - */ - pe_debug_rl("CB disabled skip bw update: old[%d] new[%d]", - oper_mode, - bcn->OperatingMode.chanWidth); - return; - } - - if (!skip_opmode_update && - ((oper_mode != bcn->OperatingMode.chanWidth) || - (sta_ds->vhtSupportedRxNss != - (bcn->OperatingMode.rxNSS + 1)))) { - pe_debug("received OpMode Chanwidth %d", - bcn->OperatingMode.chanWidth); - pe_debug("MAC - %0x:%0x:%0x:%0x:%0x:%0x", - mac_hdr->sa[0], mac_hdr->sa[1], - mac_hdr->sa[2], mac_hdr->sa[3], - mac_hdr->sa[4], mac_hdr->sa[5]); - - if ((bcn->OperatingMode.chanWidth >= - eHT_CHANNEL_WIDTH_160MHZ) && - (fw_vht_ch_wd > eHT_CHANNEL_WIDTH_80MHZ)) { - pe_debug("Updating the CH Width to 160MHz"); - sta_ds->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ; - sta_ds->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; - ch_width = eHT_CHANNEL_WIDTH_160MHZ; - } else if (bcn->OperatingMode.chanWidth >= - eHT_CHANNEL_WIDTH_80MHZ) { - pe_debug("Updating the CH Width to 80MHz"); - sta_ds->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; - sta_ds->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; - ch_width = eHT_CHANNEL_WIDTH_80MHZ; - } else if (bcn->OperatingMode.chanWidth == - eHT_CHANNEL_WIDTH_40MHZ) { - pe_debug("Updating the CH Width to 40MHz"); - sta_ds->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; - sta_ds->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; - ch_width = eHT_CHANNEL_WIDTH_40MHZ; - } else if (bcn->OperatingMode.chanWidth == - eHT_CHANNEL_WIDTH_20MHZ) { - pe_debug("Updating the CH Width to 20MHz"); - sta_ds->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; - sta_ds->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_20MHZ; - ch_width = eHT_CHANNEL_WIDTH_20MHZ; - } - lim_check_vht_op_mode_change(mac_ctx, session, - ch_width, mac_hdr->sa); - update_nss(mac_ctx, sta_ds, bcn, session, mac_hdr); - } + lim_update_nss(mac_ctx, sta_ds, bcn->OperatingMode.rxNSS, + session); + lim_update_channel_width(mac_ctx, sta_ds, session, + bcn->OperatingMode.chanWidth, &ch_bw); return; } @@ -658,14 +537,8 @@ sch_bcn_process_sta_opmode(struct mac_context *mac_ctx, uint16_t aid; uint8_t cb_mode; - if (wlan_reg_is_24ghz_ch_freq(session->curr_op_freq)) { - if (session->force_24ghz_in_ht20) - cb_mode = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; - else - cb_mode = - mac_ctx->roam.configParam.channelBondingMode24GHz; - } else - cb_mode = mac_ctx->roam.configParam.channelBondingMode5GHz; + cb_mode = lim_get_cb_mode_for_freq(mac_ctx, session, + session->curr_op_freq); /* check for VHT capability */ sta = dph_lookup_hash_entry(mac_ctx, pMh->sa, &aid, &session->dph.dphHashTable); diff --git a/core/mac/src/sys/legacy/src/utils/src/dot11f.c b/core/mac/src/sys/legacy/src/utils/src/dot11f.c index 721bb54919b0..ec2f7ff8be51 100644 --- a/core/mac/src/sys/legacy/src/utils/src/dot11f.c +++ b/core/mac/src/sys/legacy/src/utils/src/dot11f.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-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 * any purpose with or without fee is hereby granted, provided that the @@ -24,7 +25,7 @@ * * * This file was automatically generated by 'framesc' - * Wed Sep 29 13:23:21 2021 from the following file(s): + * Mon May 30 20:50:39 2022 from the following file(s): * * dot11f.frms * @@ -10202,6 +10203,10 @@ static const tIEDefn IES_AssocResponse[] = { offsetof(tDot11fIEVHTOperation, present), 0, "VHTOperation", 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTOPERATION, 0, 0, }, + { offsetof(tDot11fAssocResponse, OperatingMode), + offsetof(tDot11fIEOperatingMode, present), 0, "OperatingMode", + 0, 3, 3, SigIeOperatingMode, {0, 0, 0, 0, 0}, + 0, DOT11F_EID_OPERATINGMODE, 0, 0, }, { offsetof(tDot11fAssocResponse, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap", 0, 3, 17, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, 0, }, @@ -12055,6 +12060,10 @@ static const tIEDefn IES_ReAssocResponse[] = { offsetof(tDot11fIEVHTOperation, present), 0, "VHTOperation", 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTOPERATION, 0, 0, }, + { offsetof(tDot11fReAssocResponse, OperatingMode), + offsetof(tDot11fIEOperatingMode, present), 0, "OperatingMode", + 0, 3, 3, SigIeOperatingMode, {0, 0, 0, 0, 0}, + 0, DOT11F_EID_OPERATINGMODE, 0, 0, }, { offsetof(tDot11fReAssocResponse, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap", 0, 3, 17, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, 0, }, diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index 7577ecb44541..213c8d74a92c 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. - * 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 @@ -185,6 +185,7 @@ void populate_dot_11_f_ext_chann_switch_ann(struct mac_context *mac_ptr, uint32_t sw_target_freq; uint8_t primary_channel; enum phy_ch_width ch_width; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; ch_width = session_entry->gLimChannelSwitch.ch_width; ch_offset = session_entry->gLimChannelSwitch.sec_ch_offset; @@ -201,8 +202,9 @@ void populate_dot_11_f_ext_chann_switch_ann(struct mac_context *mac_ptr, session_entry->gLimChannelSwitch.switchCount; dot_11_ptr->present = 1; + wlan_reg_read_current_country(mac_ptr->psoc, reg_cc); pe_debug("country:%s chan:%d freq %d width:%d reg:%d off:%d", - mac_ptr->scan.countryCodeCurrent, + reg_cc, session_entry->gLimChannelSwitch.primaryChannel, sw_target_freq, session_entry->gLimChannelSwitch.ch_width, @@ -913,7 +915,7 @@ populate_dot11f_ht_caps(struct mac_context *mac, { qdf_size_t ncfglen; QDF_STATUS nSirStatus; - uint8_t disable_high_ht_mcs_2x2 = 0; + uint8_t disable_high_ht_mcs_2x2 = 0, cb_mode; struct ch_params ch_params = {0}; tSirMacTxBFCapabilityInfo *pTxBFCapabilityInfo; @@ -943,10 +945,11 @@ populate_dot11f_ht_caps(struct mac_context *mac, pDot11f->shortGI20MHz = ht_cap_info->short_gi_20_mhz; pDot11f->shortGI40MHz = ht_cap_info->short_gi_40_mhz; } else { + cb_mode = lim_get_cb_mode_for_freq(mac, pe_session, + pe_session->curr_op_freq); if (WLAN_REG_IS_24GHZ_CH_FREQ(pe_session->curr_op_freq) && LIM_IS_STA_ROLE(pe_session) && - WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != - mac->roam.configParam.channelBondingMode24GHz) { + cb_mode != WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) { pDot11f->supportedChannelWidthSet = 1; ch_params.ch_width = CH_WIDTH_40MHZ; wlan_reg_set_channel_params_for_freq( @@ -3512,6 +3515,10 @@ sir_convert_assoc_resp_frame2_struct(struct mac_context *mac, ext_cap->fine_time_meas_responder); } + if (ar->OperatingMode.present) { + qdf_mem_copy(&pAssocRsp->oper_mode_ntf, &ar->OperatingMode, + sizeof(tDot11fIEOperatingMode)); + } if (ar->QosMapSet.present) { pAssocRsp->QosMapSet.present = 1; convert_qos_mapset_frame(mac, &pAssocRsp->QosMapSet, @@ -6518,6 +6525,7 @@ QDF_STATUS populate_dot11f_twt_extended_caps(struct mac_context *mac_ctx, dot11f->num_bytes = DOT11F_IE_EXTCAP_MAX_LEN; p_ext_cap = (struct s_ext_cap *)dot11f->bytes; + dot11f->present = 1; if (pe_session->opmode == QDF_STA_MODE) p_ext_cap->twt_requestor_support = @@ -6530,6 +6538,10 @@ QDF_STATUS populate_dot11f_twt_extended_caps(struct mac_context *mac_ctx, mac_ctx->mlme_cfg->twt_cfg.res_flag; dot11f->num_bytes = lim_compute_ext_cap_ie_length(dot11f); + if (!dot11f->num_bytes) { + dot11f->present = 0; + pe_debug("ext ie length become 0, disable the ext caps"); + } return QDF_STATUS_SUCCESS; } @@ -6545,6 +6557,7 @@ QDF_STATUS populate_dot11f_btm_extended_caps(struct mac_context *mac_ctx, pe_debug("enter"); dot11f->num_bytes = DOT11F_IE_EXTCAP_MAX_LEN; p_ext_cap = (struct s_ext_cap *)dot11f->bytes; + dot11f->present = 1; status = cm_akm_roam_allowed(mac_ctx, pe_session->vdev_id); if (QDF_IS_STATUS_ERROR(status)) { @@ -6553,6 +6566,10 @@ QDF_STATUS populate_dot11f_btm_extended_caps(struct mac_context *mac_ctx, } dot11f->num_bytes = lim_compute_ext_cap_ie_length(dot11f); + if (!dot11f->num_bytes) { + dot11f->present = 0; + pe_debug("ext ie length become 0, disable the ext caps"); + } return QDF_STATUS_SUCCESS; } diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 72da90d303ef..d4b648198485 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -274,7 +274,6 @@ typedef struct sCsrChnPower_ { typedef struct tagCsr11dinfo { sCsrChannel Channels; - uint8_t countryCode[REG_ALPHA2_LEN + 1]; /* max power channel list */ sCsrChnPower ChnPower[CFG_VALID_CHANNEL_LIST_LEN]; } tCsr11dinfo; diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index b06016c19949..89415d42b2bf 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2011-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 @@ -399,8 +399,6 @@ struct csr_scanstruct { tDblLinkList channelPowerInfoList5G; uint32_t nLastAgeTimeOut; uint32_t nAgingCountDown; - uint8_t countryCodeDefault[REG_ALPHA2_LEN + 1]; - uint8_t countryCodeCurrent[REG_ALPHA2_LEN + 1]; uint8_t countryCode11d[REG_ALPHA2_LEN + 1]; v_REGDOMAIN_t domainIdDefault; /* default regulatory domain */ v_REGDOMAIN_t domainIdCurrent; /* current regulatory domain */ @@ -895,7 +893,7 @@ QDF_STATUS csr_change_default_config_param(struct mac_context *mac, struct csr_config_params *pParam); QDF_STATUS csr_msg_processor(struct mac_context *mac, void *msg_buf); QDF_STATUS csr_open(struct mac_context *mac); -QDF_STATUS csr_init_chan_list(struct mac_context *mac, uint8_t *alpha2); +QDF_STATUS csr_init_chan_list(struct mac_context *mac); QDF_STATUS csr_close(struct mac_context *mac); QDF_STATUS csr_start(struct mac_context *mac); QDF_STATUS csr_stop(struct mac_context *mac); diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 6386522603a3..863dfd5bc45e 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 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 * any purpose with or without fee is hereby granted, provided that the @@ -256,8 +257,7 @@ enum { Function declarations and documenation ------------------------------------------------------------------------*/ QDF_STATUS sme_open(mac_handle_t mac_handle); -QDF_STATUS sme_init_chan_list(mac_handle_t mac_handle, uint8_t *alpha2, - enum country_src cc_src); +QDF_STATUS sme_init_chan_list(mac_handle_t mac_handle, enum country_src cc_src); QDF_STATUS sme_close(mac_handle_t mac_handle); QDF_STATUS sme_start(mac_handle_t mac_handle); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index c6e3757eec5f..73941cf9f2f6 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -861,8 +861,7 @@ QDF_STATUS sme_open(mac_handle_t mac_handle) /* * sme_init_chan_list, triggers channel setup based on country code. */ -QDF_STATUS sme_init_chan_list(mac_handle_t mac_handle, uint8_t *alpha2, - enum country_src cc_src) +QDF_STATUS sme_init_chan_list(mac_handle_t mac_handle, enum country_src cc_src) { struct mac_context *pmac = MAC_CONTEXT(mac_handle); @@ -871,7 +870,7 @@ QDF_STATUS sme_init_chan_list(mac_handle_t mac_handle, uint8_t *alpha2, pmac->mlme_cfg->gen.enabled_11d = false; } - return csr_init_chan_list(pmac, alpha2); + return csr_init_chan_list(pmac); } /* @@ -13090,7 +13089,9 @@ void sme_get_opclass(mac_handle_t mac_handle, uint8_t channel, uint8_t bw_offset, uint8_t *opclass) { struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle); + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; + wlan_reg_read_current_country(mac_ctx->psoc, reg_cc); /* redgm opclass table contains opclass for 40MHz low primary, * 40MHz high primary and 20MHz. No support for 80MHz yet. So * first we will check if bit for 40MHz is set and if so find @@ -13100,21 +13101,17 @@ void sme_get_opclass(mac_handle_t mac_handle, uint8_t channel, */ if (bw_offset & (1 << BW_40_OFFSET_BIT)) { *opclass = wlan_reg_dmn_get_opclass_from_channel( - mac_ctx->scan.countryCodeCurrent, - channel, BW40_LOW_PRIMARY); + reg_cc, channel, BW40_LOW_PRIMARY); if (!(*opclass)) { *opclass = wlan_reg_dmn_get_opclass_from_channel( - mac_ctx->scan.countryCodeCurrent, - channel, BW40_HIGH_PRIMARY); + reg_cc, channel, BW40_HIGH_PRIMARY); } } else if (bw_offset & (1 << BW_20_OFFSET_BIT)) { *opclass = wlan_reg_dmn_get_opclass_from_channel( - mac_ctx->scan.countryCodeCurrent, - channel, BW20); + reg_cc, channel, BW20); } else { *opclass = wlan_reg_dmn_get_opclass_from_channel( - mac_ctx->scan.countryCodeCurrent, - channel, BWALL); + reg_cc, channel, BWALL); } } #endif diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 9aa6882b0864..341758495b38 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -637,23 +637,19 @@ QDF_STATUS csr_open(struct mac_context *mac) return status; } -QDF_STATUS csr_init_chan_list(struct mac_context *mac, uint8_t *alpha2) +QDF_STATUS csr_init_chan_list(struct mac_context *mac) { QDF_STATUS status; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; - mac->scan.countryCodeDefault[0] = alpha2[0]; - mac->scan.countryCodeDefault[1] = alpha2[1]; - mac->scan.countryCodeDefault[2] = alpha2[2]; - - sme_debug("init time country code %.2s", mac->scan.countryCodeDefault); + wlan_reg_read_current_country(mac->psoc, reg_cc); + sme_debug("init time country code %.2s", reg_cc); mac->scan.domainIdDefault = 0; mac->scan.domainIdCurrent = 0; - qdf_mem_copy(mac->scan.countryCodeCurrent, - mac->scan.countryCodeDefault, REG_ALPHA2_LEN + 1); qdf_mem_copy(mac->scan.countryCodeElected, - mac->scan.countryCodeDefault, REG_ALPHA2_LEN + 1); + reg_cc, REG_ALPHA2_LEN + 1); status = csr_get_channel_and_power_list(mac); return status; @@ -665,8 +661,6 @@ QDF_STATUS csr_set_channels(struct mac_context *mac, QDF_STATUS status = QDF_STATUS_SUCCESS; uint8_t index = 0; - qdf_mem_copy(pParam->Csr11dinfo.countryCode, - mac->scan.countryCodeCurrent, REG_ALPHA2_LEN + 1); for (index = 0; index < mac->scan.base_channels.numChannels; index++) { pParam->Csr11dinfo.Channels.channel_freq_list[index] = @@ -2796,8 +2790,7 @@ QDF_STATUS csr_apply_channel_and_power_list(struct mac_context *mac) csr_save_channel_power_for_band(mac, false); csr_save_channel_power_for_band(mac, true); csr_apply_channel_power_info_to_fw(mac, - &mac->scan.base_channels, - mac->scan.countryCodeCurrent); + &mac->scan.base_channels); csr_init_operating_classes(mac); return status; @@ -2829,17 +2822,6 @@ static QDF_STATUS csr_init11d_info(struct mac_context *mac, tCsr11dinfo *ps11din } /* legacy maintenance */ - qdf_mem_copy(mac->scan.countryCodeDefault, ps11dinfo->countryCode, - REG_ALPHA2_LEN + 1); - - /* Tush: at csropen get this initialized with default, - * during csr reset if this already set with some value - * no need initilaize with default again - */ - if (0 == mac->scan.countryCodeCurrent[0]) { - qdf_mem_copy(mac->scan.countryCodeCurrent, - ps11dinfo->countryCode, REG_ALPHA2_LEN + 1); - } /* need to add the max power channel list */ pChanInfo = qdf_mem_malloc(sizeof(tSirMacChanInfo) * @@ -2881,9 +2863,7 @@ static QDF_STATUS csr_init11d_info(struct mac_context *mac, tCsr11dinfo *ps11din */ csr_apply_channel_power_info_to_fw(mac, &mac->scan. - base_channels, - mac->scan. - countryCodeCurrent); + base_channels); } } return status; @@ -15050,6 +15030,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, uint8_t programmed_country[REG_ALPHA2_LEN + 1]; enum reg_6g_ap_type power_type_6g; bool ctry_code_match; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; if (!pSession) { sme_err("session %d not found", sessionId); @@ -15136,8 +15117,9 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, qdf_mem_copy(&csr_join_req->self_mac_addr, &pSession->self_mac_addr, sizeof(tSirMacAddr)); + wlan_reg_read_current_country(mac->psoc, reg_cc); sme_nofl_info("vdev-%d: Connecting to %.*s " QDF_MAC_ADDR_FMT - " rssi: %d freq: %d akm %d cipher: uc %d mc %d, CC: %c%c", + " rssi: %d freq: %d akm %d cipher: uc %d mc %d, CC: %s", sessionId, csr_join_req->ssId.length, csr_join_req->ssId.ssId, QDF_MAC_ADDR_REF(pBssDescription->bssId), @@ -15145,8 +15127,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, pProfile->negotiatedAuthType, pProfile->negotiatedUCEncryptionType, pProfile->negotiatedMCEncryptionType, - mac->scan.countryCodeCurrent[0], - mac->scan.countryCodeCurrent[1]); + reg_cc); wlan_rec_conn_info(sessionId, DEBUG_CONN_CONNECTING, pBssDescription->bssId, pProfile->negotiatedAuthType, @@ -20311,10 +20292,10 @@ static void csr_init_operating_classes(struct mac_context *mac) uint8_t swap = 0; uint8_t numClasses = 0; uint8_t opClasses[REG_MAX_SUPP_OPER_CLASSES] = {0,}; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; - sme_debug("Current Country = %c%c", - mac->scan.countryCodeCurrent[0], - mac->scan.countryCodeCurrent[1]); + wlan_reg_read_current_country(mac->psoc, reg_cc); + sme_debug("Current Country = %s", reg_cc); csr_update_op_class_array(mac, opClasses, &mac->scan.base_channels, "20MHz", &i); diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index e98e39512c71..8ba4ef61b6a1 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -566,8 +566,7 @@ void csr_apply_power2_current(struct mac_context *mac) } void csr_apply_channel_power_info_to_fw(struct mac_context *mac_ctx, - struct csr_channel *ch_lst, - uint8_t *countryCode) + struct csr_channel *ch_lst) { int i; uint8_t num_ch = 0; @@ -598,6 +597,7 @@ static void csr_diag_reset_country_information(struct mac_context *mac) host_log_802_11d_pkt_type *p11dLog; int Index; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; WLAN_HOST_DIAG_LOG_ALLOC(p11dLog, host_log_802_11d_pkt_type, LOG_WLAN_80211D_C); @@ -605,7 +605,8 @@ static void csr_diag_reset_country_information(struct mac_context *mac) return; p11dLog->eventId = WLAN_80211D_EVENT_RESET; - qdf_mem_copy(p11dLog->countryCode, mac->scan.countryCodeCurrent, 3); + wlan_reg_read_current_country(mac->psoc, reg_cc); + qdf_mem_copy(p11dLog->countryCode, reg_cc, 3); p11dLog->numChannel = mac->scan.base_channels.numChannels; if (p11dLog->numChannel <= HOST_LOG_MAX_NUM_CHANNEL) { for (Index = 0; @@ -640,8 +641,7 @@ void csr_apply_channel_power_info_wrapper(struct mac_context *mac) csr_save_channel_power_for_band(mac, false); csr_save_channel_power_for_band(mac, true); /* apply the channel list, power settings, and the country code. */ - csr_apply_channel_power_info_to_fw(mac, - &mac->scan.base_channels, mac->scan.countryCodeCurrent); + csr_apply_channel_power_info_to_fw(mac, &mac->scan.base_channels); /* clear the 11d channel list */ qdf_mem_zero(&mac->scan.channels11d, sizeof(mac->scan.channels11d)); } @@ -846,6 +846,7 @@ bool csr_learn_11dcountry_information(struct mac_context *mac, v_REGDOMAIN_t domainId; tDot11fBeaconIEs *pIesLocal = pIes; bool useVoting = false; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; if ((!pSirBssDesc) && (!pIes)) useVoting = true; @@ -877,10 +878,11 @@ bool csr_learn_11dcountry_information(struct mac_context *mac, else pCountryCodeSelected = mac->scan.countryCodeElected; - if (qdf_mem_cmp(pCountryCodeSelected, mac->scan.countryCodeCurrent, + wlan_reg_read_current_country(mac->psoc, reg_cc); + if (qdf_mem_cmp(pCountryCodeSelected, reg_cc, CDS_COUNTRY_CODE_LEN) == 0) { qdf_mem_copy(mac->scan.countryCode11d, - mac->scan.countryCodeCurrent, + reg_cc, CDS_COUNTRY_CODE_LEN); goto free_ie; } diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index d9f9d701cc4c..e900f6e5d6c3 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/core/sme/src/csr/csr_inside_api.h @@ -337,8 +337,7 @@ uint32_t csr_translate_to_wni_cfg_dot11_mode(struct mac_context *mac, enum csr_cfgdot11mode csrDot11Mode); void csr_save_channel_power_for_band(struct mac_context *mac, bool fPopulate5GBand); void csr_apply_channel_power_info_to_fw(struct mac_context *mac, - struct csr_channel *pChannelList, - uint8_t *countryCode); + struct csr_channel *pChannelList); void csr_apply_power2_current(struct mac_context *mac); /* return a bool to indicate whether roaming completed or continue. */