diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index a283dfd3c622..66f4ef140432 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2018-2020 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 @@ -382,6 +382,28 @@ mlme_init_lpass_support_cfg(struct wlan_objmgr_psoc *psoc, } #endif +#ifdef CONFIG_BAND_6GHZ +/** + * mlme_init_standard_6ghz_conn_policy() - initialize standard 6GHz + * policy connection flag + * @psoc: Pointer to PSOC + * @gen: pointer to generic CFG items + * + * Return: None + */ +static void mlme_init_standard_6ghz_conn_policy(struct wlan_objmgr_psoc *psoc, + struct wlan_mlme_generic *gen) +{ + gen->std_6ghz_conn_policy = + cfg_get(psoc, CFG_6GHZ_STANDARD_CONNECTION_POLICY); +} +#else +static void mlme_init_standard_6ghz_conn_policy(struct wlan_objmgr_psoc *psoc, + struct wlan_mlme_generic *gen) +{ +} +#endif + /** * mlme_init_mgmt_hw_tx_retry_count_cfg() - initialize mgmt hw tx retry count * @psoc: Pointer to PSOC @@ -490,6 +512,7 @@ static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_MONITOR_MODE_CONCURRENCY); gen->tx_retry_multiplier = cfg_get(psoc, CFG_TX_RETRY_MULTIPLIER); mlme_init_mgmt_hw_tx_retry_count_cfg(psoc, gen); + mlme_init_standard_6ghz_conn_policy(psoc, gen); } static void mlme_init_edca_ani_cfg(struct wlan_objmgr_psoc *psoc, diff --git a/components/mlme/dispatcher/inc/cfg_mlme_generic.h b/components/mlme/dispatcher/inc/cfg_mlme_generic.h index 4e2d58d26744..c255039a09be 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_generic.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_generic.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-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 @@ -167,6 +167,29 @@ enum monitor_mode_concurrency { 1, \ "rf test mode Enable Flag") +#ifdef CONFIG_BAND_6GHZ +/* + * standard_6ghz_connection_policy - Enable 6 GHz standard connection policy + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to set standard 6 GHz policies where STA will be + * allowed to scan and connect to any 6 GHz AP. + * + * Related: None + * + * Supported Feature: STA + */ +#define CFG_6GHZ_STANDARD_CONNECTION_POLICY CFG_INI_BOOL( \ + "standard_6ghz_connection_policy", \ + 1, \ + "6ghz standard 6 GHZ connection policy") +#define CFG_6GHZ_STD_CONN_POLICY CFG(CFG_6GHZ_STANDARD_CONNECTION_POLICY) +#else +#define CFG_6GHZ_STD_CONN_POLICY +#endif + /* * * BandCapability - Preferred band (0: 2.4G, 5G, and 6G, @@ -949,5 +972,6 @@ enum monitor_mode_concurrency { CFG(CFG_WLS_6GHZ_CAPABLE) \ CFG(CFG_MONITOR_MODE_CONCURRENCY)\ CFG(CFG_TX_RETRY_MULTIPLIER) \ - CFG(CFG_MGMT_FRAME_HW_TX_RETRY_COUNT) + CFG(CFG_MGMT_FRAME_HW_TX_RETRY_COUNT) \ + CFG_6GHZ_STD_CONN_POLICY #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 1bf5978842d5..a5587a1a3845 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -2194,6 +2194,29 @@ wlan_mlme_get_sta_miracast_mcc_rest_time(struct wlan_objmgr_psoc *psoc, QDF_STATUS wlan_mlme_get_sap_mcc_chnl_avoid(struct wlan_objmgr_psoc *psoc, uint8_t *value); + +#ifdef CONFIG_BAND_6GHZ +/** + * wlan_mlme_is_standard_6ghz_conn_policy_enabled() - Get the 6 GHz standard + * connection policy flag + * @psoc: psoc context + * @value: Enable/Disable value ptr. + * + * Return: QDF_STATUS + */ +QDF_STATUS +wlan_mlme_is_standard_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc, + bool *value); +#else +static inline QDF_STATUS +wlan_mlme_is_standard_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + *value = false; + return QDF_STATUS_SUCCESS; +} +#endif + /** * wlan_mlme_get_mcc_bcast_prob_resp() - Get broadcast probe rsp in MCC * diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 19ce7447dad7..12d2f7de3c15 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2018-2020 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 @@ -1252,6 +1252,7 @@ enum mlme_cfg_frame_type { * @ocv_support: FW supports OCV or not * @tx_retry_multiplier: TX xretry extension parameter * @mgmt_hw_tx_retry_count: MGMT HW tx retry count for frames + * @std_6ghz_conn_policy: 6GHz standard connection policy */ struct wlan_mlme_generic { uint32_t band_capability; @@ -1298,6 +1299,9 @@ struct wlan_mlme_generic { bool ocv_support; uint32_t tx_retry_multiplier; uint8_t mgmt_hw_tx_retry_count[CFG_FRAME_TYPE_MAX]; +#ifdef CONFIG_BAND_6GHZ + bool std_6ghz_conn_policy; +#endif }; /* diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 8a6e74c896cb..bbf3c454e0c1 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2018-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 @@ -2694,6 +2694,23 @@ ucfg_mlme_set_rf_test_mode_enabled(struct wlan_objmgr_psoc *psoc, bool value) return wlan_mlme_set_rf_test_mode_enabled(psoc, value); } +/** + * ucfg_mlme_is_standard_6ghz_conn_policy_enabled() - Get 6ghz standard + * connection policy flag + * @psoc: pointer to psoc object + * @value: pointer to hold the value of flag + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline QDF_STATUS +ucfg_mlme_is_standard_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + return wlan_mlme_is_standard_6ghz_conn_policy_enabled(psoc, value); +} + /** * ucfg_mlme_get_opr_rate() - Get operational rate set * @psoc: pointer to vdev object diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index 2dc3b418de18..ca69d7cfd051 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -2775,6 +2775,23 @@ wlan_mlme_set_rf_test_mode_enabled(struct wlan_objmgr_psoc *psoc, bool value) return QDF_STATUS_SUCCESS; } +#ifdef CONFIG_BAND_6GHZ +QDF_STATUS +wlan_mlme_is_standard_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc, + bool *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.gen.std_6ghz_conn_policy; + + return QDF_STATUS_SUCCESS; +} +#endif + QDF_STATUS wlan_mlme_cfg_set_vht_chan_width(struct wlan_objmgr_psoc *psoc, uint8_t value) { diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 1bc03e75936e..e7ec3a87528c 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -169,7 +169,8 @@ #define g_mode_rates_size (12) #define a_mode_rates_size (8) - +#define DRIVER_DISCONNECT_REASON_INDEX \ + QCA_NL80211_VENDOR_SUBCMD_DRIVER_DISCONNECT_REASON_INDEX /** * rtt_is_initiator - Macro to check if the bitmap has any RTT roles set * @bitmap: The bitmap to be checked @@ -1700,6 +1701,10 @@ static const struct nl80211_vendor_cmd_info wlan_hdd_cfg80211_vendor_events[] = .vendor_id = QCA_NL80211_VENDOR_ID, .subcmd = QCA_NL80211_VENDOR_SUBCMD_UPDATE_STA_INFO, }, + [QCA_NL80211_VENDOR_SUBCMD_DRIVER_DISCONNECT_REASON_INDEX] = { + .vendor_id = QCA_NL80211_VENDOR_ID, + .subcmd = QCA_NL80211_VENDOR_SUBCMD_DRIVER_DISCONNECT_REASON, + }, #ifdef WLAN_SUPPORT_TWT FEATURE_TWT_VENDOR_EVENTS #endif @@ -22146,6 +22151,9 @@ wlan_hdd_cfg80211_indicate_disconnect(struct hdd_adapter *adapter, uint16_t disconnect_ies_len) { enum ieee80211_reasoncode ieee80211_reason; + struct sk_buff *vendor_event; + int flags; + struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); ieee80211_reason = wlan_hdd_get_cfg80211_disconnect_reason(adapter, reason); @@ -22155,6 +22163,26 @@ wlan_hdd_cfg80211_indicate_disconnect(struct hdd_adapter *adapter, adapter->last_disconnect_reason, hdd_qca_reason_to_str(adapter->last_disconnect_reason), locally_generated); + + flags = cds_get_gfp_flags(); + vendor_event = + cfg80211_vendor_event_alloc( + hdd_ctx->wiphy, &(adapter->wdev), NLMSG_HDRLEN + + sizeof(adapter->last_disconnect_reason) + + NLMSG_HDRLEN, DRIVER_DISCONNECT_REASON_INDEX, flags); + if (!vendor_event) { + hdd_err("cfg80211_vendor_event_alloc failed"); + return; + } + + if (nla_put_u32(vendor_event, DISCONNECT_REASON, + adapter->last_disconnect_reason)) { + hdd_err("DISCONNECT_REASON put fail"); + kfree_skb(vendor_event); + goto send_disconnect; + } + cfg80211_vendor_event(vendor_event, flags); +send_disconnect: cfg80211_disconnected(adapter->dev, ieee80211_reason, disconnect_ies, disconnect_ies_len, locally_generated, GFP_KERNEL); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 1c010f73e6df..68cdfec4e54a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-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 @@ -7242,12 +7242,13 @@ static void hdd_close_pre_cac_adapter(struct hdd_context *hdd_ctx) SAP_PRE_CAC_IFNAME); if (!pre_cac_adapter) return; + hdd_ctx->sap_pre_cac_work.fn = NULL; + hdd_ctx->sap_pre_cac_work.arg = NULL; errno = osif_vdev_sync_trans_start_wait(pre_cac_adapter->dev, &vdev_sync); if (errno) return; - osif_vdev_sync_unregister(pre_cac_adapter->dev); osif_vdev_sync_wait_for_ops(vdev_sync); @@ -7475,7 +7476,7 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx, sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(adapter); if (!wlan_sap_is_pre_cac_context(sap_ctx) && (hdd_ctx->sap_pre_cac_work.fn)) - cds_flush_work(&hdd_ctx->sap_pre_cac_work); + qdf_flush_work(&hdd_ctx->sap_pre_cac_work); hdd_close_pre_cac_adapter(hdd_ctx); @@ -7652,7 +7653,7 @@ QDF_STATUS hdd_stop_all_adapters(struct hdd_context *hdd_ctx) hdd_enter(); if (hdd_ctx->sap_pre_cac_work.fn) - cds_flush_work(&hdd_ctx->sap_pre_cac_work); + qdf_flush_work(&hdd_ctx->sap_pre_cac_work); hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter, NET_DEV_HOLD_STOP_ALL_ADAPTERS) { @@ -14303,6 +14304,7 @@ static int hdd_features_init(struct hdd_context *hdd_ctx) mac_handle_t mac_handle; bool b_cts2self, is_imps_enabled; bool rf_test_mode; + bool std_6ghz_conn_policy; hdd_enter(); @@ -14401,6 +14403,17 @@ static int hdd_features_init(struct hdd_context *hdd_ctx) wlan_cm_set_6ghz_key_mgmt_mask(hdd_ctx->psoc, ALLOWED_KEYMGMT_6G_MASK); } + + status = ucfg_mlme_is_standard_6ghz_conn_policy_enabled(hdd_ctx->psoc, + &std_6ghz_conn_policy); + + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Get 6ghz standard connection policy failed"); + return QDF_STATUS_E_FAILURE; + } + if (std_6ghz_conn_policy) + wlan_cm_set_standard_6ghz_conn_policy(hdd_ctx->psoc, true); + hdd_thermal_stats_cmd_init(hdd_ctx); sme_set_cal_failure_event_cb(hdd_ctx->mac_handle, hdd_cal_fail_send_event); @@ -18156,6 +18169,7 @@ void hdd_clean_up_pre_cac_interface(struct hdd_context *hdd_ctx) uint8_t vdev_id; QDF_STATUS status; struct hdd_adapter *precac_adapter; + struct sap_context *sap_ctx; status = wlan_sap_get_pre_cac_vdev_id(hdd_ctx->mac_handle, &vdev_id); if (QDF_IS_STATUS_ERROR(status)) { @@ -18169,6 +18183,13 @@ void hdd_clean_up_pre_cac_interface(struct hdd_context *hdd_ctx) return; } + sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(precac_adapter); + if (wlan_sap_is_pre_cac_context(sap_ctx) && + hdd_ctx->sap_pre_cac_work.fn) { + hdd_debug("pre_cac_work already scheduled"); + return; + } + qdf_create_work(0, &hdd_ctx->sap_pre_cac_work, wlan_hdd_sap_pre_cac_failure, (void *)precac_adapter); diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index d947d31a71d0..4743ce81ba2a 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -960,8 +960,8 @@ int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) if (adapter->device_mode == QDF_SAP_MODE && wlan_sap_is_pre_cac_active(hdd_ctx->mac_handle)) { - hdd_clean_up_interface(hdd_ctx, adapter); hdd_clean_up_pre_cac_interface(hdd_ctx); + hdd_clean_up_interface(hdd_ctx, adapter); } else if (wlan_hdd_is_session_type_monitor( adapter->device_mode) && ucfg_pkt_capture_get_mode(hdd_ctx->psoc) != diff --git a/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c b/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c index 7eb6d637e1e1..4230c92baaaa 100644 --- a/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c +++ b/core/hdd/src/wlan_hdd_sap_cond_chan_switch.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 @@ -255,7 +256,7 @@ static int __wlan_hdd_request_pre_cac(struct hdd_context *hdd_ctx, if (pre_cac_adapter) { /* Flush existing pre_cac work */ if (hdd_ctx->sap_pre_cac_work.fn) - cds_flush_work(&hdd_ctx->sap_pre_cac_work); + qdf_flush_work(&hdd_ctx->sap_pre_cac_work); } else { if (policy_mgr_get_connection_count(hdd_ctx->psoc) > 1) { hdd_err("pre cac not allowed in concurrency"); diff --git a/core/hdd/src/wlan_hdd_sta_info.h b/core/hdd/src/wlan_hdd_sta_info.h index 20d0152e89b0..1412688a5b73 100644 --- a/core/hdd/src/wlan_hdd_sta_info.h +++ b/core/hdd/src/wlan_hdd_sta_info.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2019-2020 The Linux Foundation. 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 @@ -38,6 +39,9 @@ /* Opaque handle for abstraction */ #define hdd_sta_info_entry qdf_list_node_t +#define DISCONNECT_REASON \ + QCA_WLAN_VENDOR_ATTR_GET_STATION_INFO_DRIVER_DISCONNECT_REASON + /** * struct dhcp_phase - Per Peer DHCP Phases * @DHCP_PHASE_ACK: upon receiving DHCP_ACK/NAK message in REQUEST phase or diff --git a/core/hdd/src/wlan_hdd_station_info.c b/core/hdd/src/wlan_hdd_station_info.c index b948e7ad2b45..ca95b647404b 100644 --- a/core/hdd/src/wlan_hdd_station_info.c +++ b/core/hdd/src/wlan_hdd_station_info.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-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 @@ -135,8 +135,6 @@ QCA_WLAN_VENDOR_ATTR_GET_STATION_INFO_REMOTE_RX_RETRY_COUNT #define REMOTE_RX_BC_MC_COUNT \ QCA_WLAN_VENDOR_ATTR_GET_STATION_INFO_REMOTE_RX_BC_MC_COUNT -#define DISCONNECT_REASON \ - QCA_WLAN_VENDOR_ATTR_GET_STATION_INFO_DRIVER_DISCONNECT_REASON #define BEACON_IES \ QCA_WLAN_VENDOR_ATTR_GET_STATION_INFO_BEACON_IES #define ASSOC_REQ_IES \ diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index aea31a5f4d54..63f733f4ccf7 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 "R" +#define QWLAN_VERSION_EXTRA "X" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "2.0.8.32R" +#define QWLAN_VERSIONSTR "2.0.8.32X" #endif /* QWLAN_VERSION_H */ diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c index d39211873c14..dca2042b2874 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-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 @@ -2298,14 +2298,20 @@ void lim_process_assoc_req_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_in */ sta_ds = dph_lookup_hash_entry(mac_ctx, hdr->sa, &assoc_id, &session->dph.dphHashTable); - if (sta_ds) { + if (sta_ds && !sta_ds->rmfEnabled) { + /** + * Drop only retries for non-PMF assoc requests. + * For PMF case: + * a) Before key installation - Drop assoc request + * b) After key installation - Send SA query + */ if (hdr->fc.retry > 0) { pe_err("STA is initiating Assoc Req after ACK lost. Do not process sessionid: %d sys sub_type=%d for role=%d from: " QDF_MAC_ADDR_FMT, session->peSessionId, sub_type, GET_LIM_SYSTEM_ROLE(session), QDF_MAC_ADDR_REF(hdr->sa)); return; - } else if (!sta_ds->rmfEnabled && (sub_type == LIM_REASSOC)) { + } else if (sub_type == LIM_REASSOC) { /* * SAP should send reassoc response with reject code * to avoid IOT issues. as per the specification SAP @@ -2319,7 +2325,7 @@ void lim_process_assoc_req_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_in sub_type, sta_ds, session, false); pe_err("Rejecting reassoc req from STA"); return; - } else if (!sta_ds->rmfEnabled) { + } else { /* * Do this only for non PMF case. * STA might have missed the assoc response, so it is @@ -2336,16 +2342,16 @@ void lim_process_assoc_req_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_in session->limSystemRole, QDF_MAC_ADDR_REF(hdr->sa)); return; - } else if (sta_ds->rmfEnabled && !sta_ds->is_key_installed) { - /* When PMF enabled, SA Query will be triggered - * unexpectly if duplicated assoc_req received - - * 1) after pre_auth node deleted and - * 2) before key installed. - * Here drop such duplicated assoc_req frame. - */ - pe_err("Drop duplicate assoc_req before 4-way HS"); - return; } + } else if (sta_ds && sta_ds->rmfEnabled && !sta_ds->is_key_installed) { + /* When PMF enabled, SA Query will be triggered + * unexpectly if duplicated assoc_req received - + * 1) after pre_auth node deleted and + * 2) before key installed. + * Here drop such duplicated assoc_req frame. + */ + pe_err("Drop duplicate assoc_req before 4-way HS"); + return; } status = lim_check_sta_in_pe_entries(mac_ctx, hdr, session->peSessionId, diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c index 68196860b5d6..6234e3a2e836 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.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 @@ -356,6 +356,11 @@ lim_post_join_set_link_state_callback(struct mac_context *mac, uint32_t vdev_id, tLimMlmJoinCnf mlm_join_cnf; struct pe_session *session_entry; + /* + * Allow defered messages after peer create response + */ + SET_LIM_PROCESS_DEFD_MESGS(mac, true); + session_entry = pe_find_session_by_vdev_id(mac, vdev_id); if (!session_entry) { pe_err("vdev_id:%d PE session is NULL", vdev_id); @@ -406,13 +411,22 @@ static void lim_process_mlm_post_join_suspend_link(struct mac_context *mac_ctx, struct pe_session *session) { + QDF_STATUS status; + lim_deactivate_and_change_timer(mac_ctx, eLIM_JOIN_FAIL_TIMER); /* assign appropriate sessionId to the timer object */ mac_ctx->lim.lim_timers.gLimJoinFailureTimer.sessionId = session->peSessionId; - wma_add_bss_peer_sta(session->vdev_id, session->bssId, true); + /* + * Defer msgs to LIM till peer create confirm event is received + */ + SET_LIM_PROCESS_DEFD_MESGS(mac_ctx, false); + status = wma_add_bss_peer_sta(session->vdev_id, session->bssId, true); + if (status == QDF_STATUS_E_RESOURCES) + SET_LIM_PROCESS_DEFD_MESGS(mac_ctx, true); + } /** diff --git a/core/mac/src/pe/sch/sch_beacon_gen.c b/core/mac/src/pe/sch/sch_beacon_gen.c index a1f9c02da179..0e9c6ae048fb 100644 --- a/core/mac/src/pe/sch/sch_beacon_gen.c +++ b/core/mac/src/pe/sch/sch_beacon_gen.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 @@ -216,6 +216,30 @@ static void sch_get_csa_ecsa_count_offset(uint8_t *ie, uint32_t ie_len, } } +static void +populate_channel_switch_ann(struct mac_context *mac_ctx, + tDot11fBeacon2 *bcn, + struct pe_session *pe_session) +{ + populate_dot11f_chan_switch_ann(mac_ctx, &bcn->ChanSwitchAnn, + pe_session); + pe_debug("csa: mode:%d chan:%d count:%d", + bcn->ChanSwitchAnn.switchMode, + bcn->ChanSwitchAnn.newChannel, + bcn->ChanSwitchAnn.switchCount); + + if (!pe_session->dfsIncludeChanWrapperIe) + return; + + populate_dot11f_chan_switch_wrapper(mac_ctx, + &bcn->ChannelSwitchWrapper, + pe_session); + pe_debug("wrapper: width:%d f0:%d f1:%d", + bcn->ChannelSwitchWrapper.WiderBWChanSwitchAnn.newChanWidth, + bcn->ChannelSwitchWrapper.WiderBWChanSwitchAnn.newCenterChanFreq0, + bcn->ChannelSwitchWrapper.WiderBWChanSwitchAnn.newCenterChanFreq1); +} + /** * sch_set_fixed_beacon_fields() - sets the fixed params in beacon frame * @mac_ctx: mac global context @@ -367,15 +391,12 @@ sch_set_fixed_beacon_fields(struct mac_context *mac_ctx, struct pe_session *sess ext_csa->new_reg_class, ext_csa->new_channel, ext_csa->switch_count); - } else { - populate_dot11f_chan_switch_ann(mac_ctx, - &bcn_2->ChanSwitchAnn, - session); - pe_debug("csa: mode:%d chan:%d count:%d", - bcn_2->ChanSwitchAnn.switchMode, - bcn_2->ChanSwitchAnn.newChannel, - bcn_2->ChanSwitchAnn.switchCount); } + + if (session->lim_non_ecsa_cap_num && + WLAN_REG_IS_24GHZ_CH_FREQ(session->curr_op_freq) && + !is_6ghz_chsw) + populate_channel_switch_ann(mac_ctx, bcn_2, session); } populate_dot11_supp_operating_classes(mac_ctx, @@ -390,55 +411,10 @@ sch_set_fixed_beacon_fields(struct mac_context *mac_ctx, struct pe_session *sess &bcn_2->PowerConstraints); populate_dot11f_tpc_report(mac_ctx, &bcn_2->TPCReport, session); /* Need to insert channel switch announcement here */ - if ((LIM_IS_AP_ROLE(session) - || LIM_IS_P2P_DEVICE_GO(session)) - && session->dfsIncludeChanSwIe == true) { - /* - * Channel switch announcement only if radar is detected - * and SAP has instructed to announce channel switch IEs - * in beacon and probe responses - */ - if (!is_6ghz_chsw) { - populate_dot11f_chan_switch_ann - (mac_ctx, &bcn_2->ChanSwitchAnn, - session); - pe_debug("csa: mode:%d chan:%d count:%d", - bcn_2->ChanSwitchAnn.switchMode, - bcn_2->ChanSwitchAnn.newChannel, - bcn_2->ChanSwitchAnn.switchCount); - } - /* - * TODO: depending the CB mode, extended channel switch - * announcement need to be called - */ - /* - populate_dot11f_ext_chan_switch_ann(mac_ctx, - &bcn_2->ExtChanSwitchAnn, session); - */ - /* - * TODO: If in 11AC mode, wider bw channel switch - * announcement needs to be called - */ - /* - populate_dot11f_wider_bw_chan_switch_ann(mac_ctx, - &bcn_2->WiderBWChanSwitchAnn, session); - */ - /* - * Populate the Channel Switch Wrapper Element if - * SAP operates in 40/80 Mhz Channel Width. - */ - if (true == session->dfsIncludeChanWrapperIe) { - populate_dot11f_chan_switch_wrapper(mac_ctx, - &bcn_2->ChannelSwitchWrapper, session); - pe_debug("wrapper: width:%d f0:%d f1:%d", - bcn_2->ChannelSwitchWrapper. - WiderBWChanSwitchAnn.newChanWidth, - bcn_2->ChannelSwitchWrapper. - WiderBWChanSwitchAnn.newCenterChanFreq0, - bcn_2->ChannelSwitchWrapper. - WiderBWChanSwitchAnn.newCenterChanFreq1 - ); - } + if ((LIM_IS_AP_ROLE(session) || + LIM_IS_P2P_DEVICE_GO(session)) && + session->dfsIncludeChanSwIe && !is_6ghz_chsw) { + populate_channel_switch_ann(mac_ctx, bcn_2, session); } } if (mac_ctx->rrm.rrmConfig.sap_rrm_enabled) diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index f0f92e08802a..73d883382974 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-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 @@ -1924,6 +1924,7 @@ wma_create_sta_mode_bss_peer(tp_wma_handle wma, if (!mac) { wma_err("vdev%d: Mac context is null", vdev_id); + status = QDF_STATUS_E_RESOURCES; return status; } @@ -5339,6 +5340,7 @@ QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid, wma = cds_get_context(QDF_MODULE_ID_WMA); if (!wma) { wma_err("Invalid wma"); + status = QDF_STATUS_E_RESOURCES; goto err; } diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index dbe8e0275ca2..b48b2729e9ae 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-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 @@ -9323,27 +9323,97 @@ QDF_STATUS wma_send_set_pcl_cmd(tp_wma_handle wma_handle, } msg->chan_weights.saved_num_chan = wma_handle->saved_chan.num_channels; + status = policy_mgr_get_valid_chan_weights(wma_handle->psoc, (struct policy_mgr_pcl_chan_weights *)&msg->chan_weights, PM_STA_MODE); + if (QDF_IS_STATUS_ERROR(status)) { + wma_err("Error in creating weighed pcl"); + return status; + } for (i = 0; i < msg->chan_weights.saved_num_chan; i++) { msg->chan_weights.weighed_valid_list[i] = wma_map_pcl_weights( msg->chan_weights.weighed_valid_list[i]); - /* Dont allow roaming on 2G when 5G_ONLY configured */ + + if (msg->band_mask == + (BIT(REG_BAND_2G) | BIT(REG_BAND_5G) | BIT(REG_BAND_6G))) + continue; + + /* + * Dont allow roaming on 5G/6G band if only 2G band configured + * as supported roam band mask + */ + if (((wma_handle->bandcapability == BAND_2G) || + (msg->band_mask == BIT(REG_BAND_2G))) && + !WLAN_REG_IS_24GHZ_CH_FREQ( + msg->chan_weights.saved_chan_list[i])) { + msg->chan_weights.weighed_valid_list[i] = + WEIGHT_OF_DISALLOWED_CHANNELS; + continue; + } + + /* + * Dont allow roaming on 2G/6G band if only 5G band configured + * as supported roam band mask + */ if (((wma_handle->bandcapability == BAND_5G) || (msg->band_mask == BIT(REG_BAND_5G))) && + !WLAN_REG_IS_5GHZ_CH_FREQ( + msg->chan_weights.saved_chan_list[i])) { + msg->chan_weights.weighed_valid_list[i] = + WEIGHT_OF_DISALLOWED_CHANNELS; + continue; + } + + /* + * Dont allow roaming on 2G/5G band if only 6G band configured + * as supported roam band mask + */ + if (msg->band_mask == BIT(REG_BAND_6G) && + !WLAN_REG_IS_6GHZ_CHAN_FREQ( + msg->chan_weights.saved_chan_list[i])) { + msg->chan_weights.weighed_valid_list[i] = + WEIGHT_OF_DISALLOWED_CHANNELS; + continue; + } + + /* + * Dont allow roaming on 6G band if only 2G + 5G band configured + * as supported roam band mask. + */ + if (msg->band_mask == (BIT(REG_BAND_2G) | BIT(REG_BAND_5G)) && + (WLAN_REG_IS_6GHZ_CHAN_FREQ( + msg->chan_weights.saved_chan_list[i]))) { + msg->chan_weights.weighed_valid_list[i] = + WEIGHT_OF_DISALLOWED_CHANNELS; + continue; + } + + /* + * Dont allow roaming on 2G band if only 5G + 6G band configured + * as supported roam band mask. + */ + if (msg->band_mask == (BIT(REG_BAND_5G) | BIT(REG_BAND_6G)) && (WLAN_REG_IS_24GHZ_CH_FREQ( msg->chan_weights.saved_chan_list[i]))) { msg->chan_weights.weighed_valid_list[i] = WEIGHT_OF_DISALLOWED_CHANNELS; + continue; } - if (msg->band_mask == BIT(REG_BAND_2G) && - !WLAN_REG_IS_24GHZ_CH_FREQ( - msg->chan_weights.saved_chan_list[i])) + + /* + * Dont allow roaming on 5G band if only 2G + 6G band configured + * as supported roam band mask. + */ + if (msg->band_mask == (BIT(REG_BAND_2G) | BIT(REG_BAND_6G)) && + (WLAN_REG_IS_5GHZ_CH_FREQ( + msg->chan_weights.saved_chan_list[i]))) { msg->chan_weights.weighed_valid_list[i] = WEIGHT_OF_DISALLOWED_CHANNELS; + continue; + } is_channel_allowed = policy_mgr_is_sta_chan_valid_for_connect_and_roam( @@ -9354,10 +9424,6 @@ QDF_STATUS wma_send_set_pcl_cmd(tp_wma_handle wma_handle, WEIGHT_OF_DISALLOWED_CHANNELS; } - if (!QDF_IS_STATUS_SUCCESS(status)) { - wma_err("Error in creating weighed pcl"); - return status; - } wma_debug("Dump channel list send to wmi"); policy_mgr_dump_channel_list(msg->chan_weights.saved_num_chan, msg->chan_weights.saved_chan_list,