diff --git a/umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c b/umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c index 4ca1b3b1cc..f635b5eb9f 100644 --- a/umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c +++ b/umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c @@ -770,8 +770,8 @@ static int cm_calculate_bss_score(struct wlan_objmgr_psoc *psoc, if (!mlme_psoc_obj) return 0; - phy_config = &mlme_psoc_obj->phy_config; - score_config = &mlme_psoc_obj->score_config; + phy_config = &mlme_psoc_obj->psoc_cfg.phy_config; + score_config = &mlme_psoc_obj->psoc_cfg.score_config; weight_config = &score_config->weight_config; if (score_config->is_bssid_hint_priority && bssid_hint && @@ -1001,8 +1001,8 @@ void wlan_cm_calculate_bss_score(struct wlan_objmgr_pdev *pdev, if (!mlme_psoc_obj) return; - score_config = &mlme_psoc_obj->score_config; - config = &mlme_psoc_obj->phy_config; + score_config = &mlme_psoc_obj->psoc_cfg.score_config; + config = &mlme_psoc_obj->psoc_cfg.phy_config; mlme_nofl_debug("Self caps: HT %d VHT %d HE %d VHT_24Ghz %d BF cap %d bw_above_20_24ghz %d bw_above_20_5ghz %d 2.4G NSS %d 5G NSS %d", config->ht_cap, config->vht_cap, diff --git a/umac/mlme/connection_mgr/core/src/wlan_cm_main.h b/umac/mlme/connection_mgr/core/src/wlan_cm_main.h index 09f458c0ae..206e6ab6dc 100644 --- a/umac/mlme/connection_mgr/core/src/wlan_cm_main.h +++ b/umac/mlme/connection_mgr/core/src/wlan_cm_main.h @@ -159,6 +159,7 @@ struct cm_state_sm { * @scan_timer: timer for scan for ssid to get completed * @hw_mode_timer: timer for hw mode chane to get completed * @req: connect req from osif + * @rsn_ie: rsn_ie in connect req * @candidate_list: candidate list * @cur_candidate: current candidate */ @@ -168,6 +169,7 @@ struct cm_connect_req { qdf_timer_t scan_timer; qdf_timer_t hw_mode_timer; struct wlan_cm_connect_req req; + struct element_info rsn_ie; qdf_list_t candidate_list; struct scan_cache_node *cur_candidate; }; @@ -201,89 +203,19 @@ struct cm_req { }; /** - * struct connect_req_ies - connect req ies stored in vdev - * @additional_assoc_ie: assoc req additional IE to be appended to assoc req + * struct connect_ies - connect related ies stored in vdev, set by osif/user * @auth_ft_ies: auth ft ies received during preauth phase * @reassoc_ft_ies: reassoc ft ies received during reassoc phase * @cck_ie: cck ie for cck connection - * @forced_rsn_ie: set if force_rsne_override is set from the connect IE. This - * is used to store the invalid RSN IE from suplicant to enable testbed STA for - * cert cases. + * @discon_ie: disconnect ie to be sent in disassoc/deauth req */ -struct connect_req_ies { - struct element_info additional_assoc_ie; +struct connect_ies { struct element_info auth_ft_ies; struct element_info reassoc_ft_ies; +#ifdef FEATURE_WLAN_ESE struct element_info cck_ie; - struct element_info forced_rsn_ie; -}; - -#ifdef WLAN_FEATURE_FILS_SK -#define CM_FILS_MAX_HLP_DATA_LEN 2048 -#define MAX_KEK_LENGTH 64 -#define MAX_TK_LENGTH 32 -#define MAX_GTK_LENGTH 255 - -/** - * struct fils_connect_rsp_params - fils related connect rsp params - * @fils_pmk: fils pmk - * @fils_pmk_len: fils pmk length - * @fils_pmkid: fils pmkid - * @kek: kek - * @kek_len: kek length - * @tk: tk - * @tk_len: tk length - * @gtk: gtk - * @gtk_len: gtk length - * @dst_mac: dst mac - * @src_mac: src mac - * @hlp_data: hlp data - * @hlp_data_len: hlp data length - */ -struct fils_connect_rsp_params { - uint8_t *fils_pmk; - uint8_t fils_pmk_len; - uint8_t fils_pmkid[PMKID_LEN]; - uint8_t kek[MAX_KEK_LENGTH]; - uint8_t kek_len; - uint8_t tk[MAX_TK_LENGTH]; - uint8_t tk_len; - uint8_t gtk[MAX_GTK_LENGTH]; - uint8_t gtk_len; - struct qdf_mac_addr dst_mac; - struct qdf_mac_addr src_mac; - uint8_t hlp_data[CM_FILS_MAX_HLP_DATA_LEN]; - uint16_t hlp_data_len; -}; #endif - -/** - * struct connect_rsp_ies - connect rsp ies stored in vdev filled during connect - * @bcn_probe_rsp: beacon or probe rsp of connected AP - * @assoc_req: assoc req send during conenct - * @assoc_rsq: assoc rsp received during connection - * @ric_resp_ie: ric ie from assoc resp received during connection - * @fills_ie: fills connection ie received during connection - */ -struct connect_rsp_ies { - struct element_info bcn_probe_rsp; - struct element_info assoc_req; - struct element_info assoc_rsp; - struct element_info ric_resp_ie; -#ifdef WLAN_FEATURE_FILS_SK - struct fils_connect_rsp_params fils_ie; -#endif -}; - -/** - * struct disconnect_ies - disconnect ies stored in vdev filled during - * disconnect - * @peer_discon_ie: disconnect ie sent by peer to be sent to OSIF - * @self_discon_ie: disconnect ie to be sent in disassoc/deauth filled by OSIF - */ -struct disconnect_ies { - struct element_info peer_discon_ie; - struct element_info self_discon_ie; + struct element_info discon_ie; }; /** @@ -295,10 +227,8 @@ struct disconnect_ies { * @connect_count: connect count * @force_rsne_override: if QCA_WLAN_VENDOR_ATTR_CONFIG_RSN_IE is set by * framework - * @req_ie: request ies for connect - * @rsp_ie: connect resp ie - * @discon_ie: disconnect IE - * @fils_info: fils info for the connect req + * @req_ie: request ies for connect/disconnect set by osif/user separately from + * connect req */ struct cnx_mgr { struct wlan_objmgr_vdev *vdev; @@ -307,12 +237,7 @@ struct cnx_mgr { uint8_t disconnect_count; uint8_t connect_count; bool force_rsne_override; - struct connect_req_ies req_ie; - struct connect_rsp_ies rsp_ie; - struct disconnect_ies discon_ie; -#ifdef WLAN_FEATURE_FILS_SK - struct wlan_fils_con_info fils_info; -#endif + struct connect_ies req_ie; }; /** diff --git a/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_bss_score_param.h b/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_bss_score_param.h index 4b9a70aa24..88420324ac 100644 --- a/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_bss_score_param.h +++ b/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_bss_score_param.h @@ -68,14 +68,14 @@ struct weight_cfg { * @rssi_pref_5g_rssi_thresh: Beamforming caps weightage */ struct rssi_config_score { - uint32_t best_rssi_threshold; - uint32_t good_rssi_threshold; - uint32_t bad_rssi_threshold; - uint32_t good_rssi_pcnt; - uint32_t bad_rssi_pcnt; - uint32_t good_rssi_bucket_size; - uint32_t bad_rssi_bucket_size; - uint32_t rssi_pref_5g_rssi_thresh; + uint8_t best_rssi_threshold; + uint8_t good_rssi_threshold; + uint8_t bad_rssi_threshold; + uint8_t good_rssi_pcnt; + uint8_t bad_rssi_pcnt; + uint8_t good_rssi_bucket_size; + uint8_t bad_rssi_bucket_size; + uint8_t rssi_pref_5g_rssi_thresh; }; /** @@ -107,7 +107,7 @@ struct rssi_config_score { * BITS 24-31 :- SLOT_15 */ struct per_slot_score { - uint32_t num_slot; + uint8_t num_slot; uint32_t score_pcnt3_to_0; uint32_t score_pcnt7_to_4; uint32_t score_pcnt11_to_8; diff --git a/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_public_struct.h b/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_public_struct.h index 1fa5484fed..7af9425e88 100644 --- a/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_public_struct.h +++ b/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_public_struct.h @@ -49,6 +49,7 @@ struct wlan_cm_wep_key_params { * struct wlan_cm_connect_crypto_info - Crypto settings * @wpa_versions: indicates which, if any, WPA versions are enabled * (from enum nl80211_wpa_versions) + * @auth_type: Auth mode type * @group_cipher: group key cipher suite (or 0 if unset) * @n_ciphers_pairwise: number of AP supported unicast ciphers * @ciphers_pairwise: unicast key cipher suites @@ -57,6 +58,7 @@ struct wlan_cm_wep_key_params { * @wep_keys: static WEP keys, if not NULL points to an array of * MAX_WEP_KEYS WEP keys * @pmf_cap: Pmf capability + * @mgmt_ciphers: mgmt cipher */ struct wlan_cm_connect_crypto_info { uint32_t wpa_versions; @@ -68,8 +70,7 @@ struct wlan_cm_connect_crypto_info { wlan_crypto_key_mgmt akm_suites[WLAN_CM_MAX_NR_AKM_SUITES]; struct wlan_cm_wep_key_params wep_keys; enum wlan_pmf_cap pmf_cap; - uint32_t rsn_ie_len; - uint8_t *rsn_ie; + wlan_crypto_cipher_type mgmt_ciphers; }; #ifdef WLAN_FEATURE_FILS_SK @@ -133,7 +134,8 @@ enum wlan_cm_source { * @bssid_hint: bssid hint to connect * @chan_freq: channel of the AP * @crypto: crypto related info - * @connect_ie: connect IE additional assoc IE + * @assoc_ie:Additional assoc IE to be appended in assoc req + * (Include RSN/WPA/WAPI/WPS ies) * @ht_caps: ht capability * @ht_caps_mask: mask of valid ht caps * @vht_caps: vht capability @@ -149,7 +151,7 @@ struct wlan_cm_connect_req { struct qdf_mac_addr bssid_hint; uint32_t chan_freq; struct wlan_cm_connect_crypto_info crypto; - struct element_info connect_ie; + struct element_info assoc_ie; uint16_t ht_caps; uint16_t ht_caps_mask; uint32_t vht_caps; @@ -227,32 +229,94 @@ enum wlan_cm_connect_fail_reason { CM_GENERIC_FAILURE, }; +#ifdef WLAN_FEATURE_FILS_SK +#define CM_FILS_MAX_HLP_DATA_LEN 2048 +#define MAX_KEK_LENGTH 64 +#define MAX_TK_LENGTH 32 +#define MAX_GTK_LENGTH 255 + +/** + * struct fils_connect_rsp_params - fils related connect rsp params + * @fils_pmk: fils pmk + * @fils_pmk_len: fils pmk length + * @fils_pmkid: fils pmkid + * @kek: kek + * @kek_len: kek length + * @tk: tk + * @tk_len: tk length + * @gtk: gtk + * @gtk_len: gtk length + * @dst_mac: dst mac + * @src_mac: src mac + * @hlp_data: hlp data + * @hlp_data_len: hlp data length + */ +struct fils_connect_rsp_params { + uint8_t *fils_pmk; + uint8_t fils_pmk_len; + uint8_t fils_pmkid[PMKID_LEN]; + uint8_t kek[MAX_KEK_LENGTH]; + uint8_t kek_len; + uint8_t tk[MAX_TK_LENGTH]; + uint8_t tk_len; + uint8_t gtk[MAX_GTK_LENGTH]; + uint8_t gtk_len; + struct qdf_mac_addr dst_mac; + struct qdf_mac_addr src_mac; + uint8_t hlp_data[CM_FILS_MAX_HLP_DATA_LEN]; + uint16_t hlp_data_len; +}; +#endif + +/** + * struct connect_rsp_ies - connect rsp ies stored in vdev filled during connect + * @bcn_probe_rsp: beacon or probe rsp of connected AP + * @assoc_req: assoc req send during conenct + * @assoc_rsq: assoc rsp received during connection + * @ric_resp_ie: ric ie from assoc resp received during connection + * @fills_ie: fills connection ie received during connection + */ +struct wlan_connect_rsp_ies { + struct element_info bcn_probe_rsp; + struct element_info assoc_req; + struct element_info assoc_rsp; + struct element_info ric_resp_ie; +#ifdef WLAN_FEATURE_FILS_SK + struct fils_connect_rsp_params fils_ie; +#endif +}; + /** * struct wlan_cm_connect_rsp - connect resp from VDEV mgr and will be sent to * OSIF * @vdev_id: vdev id * @cm_id: Connect manager id * @connect_status: connect status success or failure - * @reason: connect fail reason + * @reason: connect fail reason, valid only in case of failure * @reason_code: protocol reason code of the connect failure - * @peer_macaddr: bssid of AP + * @aid: aid + * @connect_ies: connect related IE required by osif to send to kernel */ struct wlan_cm_connect_rsp { uint8_t vdev_id; uint8_t cm_id; uint8_t connect_status; enum wlan_cm_connect_fail_reason reason; - uint8_t failure_code; + uint8_t reason_code; uint8_t aid; + struct wlan_connect_rsp_ies connect_ies; }; + /** * struct wlan_cm_discon_rsp - disconnect resp from VDEV mgr and will be sent to * OSIF * @req: disconnect req sent to vdev mgr + * @ap_discon_ie: disconnect IE sent by AP */ struct wlan_cm_discon_rsp { struct wlan_cm_vdev_discon_req req; + struct element_info ap_discon_ie; }; #endif /* FEATURE_CM_ENABLE */ diff --git a/umac/mlme/include/wlan_psoc_mlme.h b/umac/mlme/include/wlan_psoc_mlme.h index d8a6eaed1c..1c48c66c9d 100644 --- a/umac/mlme/include/wlan_psoc_mlme.h +++ b/umac/mlme/include/wlan_psoc_mlme.h @@ -64,6 +64,16 @@ struct psoc_phy_config { bw_above_20_24ghz:1; }; +/** + * struct psoc_config - psoc level configs + * @score_config: BSS scoring related config + * @phy_config: Psoc Phy config + */ +struct psoc_config { + struct scoring_cfg score_config; + struct psoc_phy_config phy_config; +}; + /** * struct psoc_mlme_obj - PSoC MLME component object * @psoc: PSoC object @@ -71,8 +81,7 @@ struct psoc_phy_config { * @psoc_vdev_rt: PSoC Vdev response timer * @psoc_mlme_wakelock: Wakelock to prevent system going to suspend * @rnr_6ghz_cache: Cache of 6Ghz vap in RNR ie format - * @score_config: BSS scoring related config - * @phy_config: Psoc Phy config + * @psoc_cfg: Psoc level configs */ struct psoc_mlme_obj { struct wlan_objmgr_psoc *psoc; @@ -82,8 +91,7 @@ struct psoc_mlme_obj { struct psoc_mlme_wakelock psoc_mlme_wakelock; #endif struct wlan_6ghz_rnr_global_cache rnr_6ghz_cache; - struct scoring_cfg score_config; - struct psoc_phy_config phy_config; + struct psoc_config psoc_cfg; }; #endif diff --git a/umac/mlme/psoc_mgr/dispatcher/src/wlan_psoc_mlme_api.c b/umac/mlme/psoc_mgr/dispatcher/src/wlan_psoc_mlme_api.c index cbb60fdd8a..f64eb45380 100644 --- a/umac/mlme/psoc_mgr/dispatcher/src/wlan_psoc_mlme_api.c +++ b/umac/mlme/psoc_mgr/dispatcher/src/wlan_psoc_mlme_api.c @@ -73,7 +73,7 @@ void wlan_psoc_set_phy_config(struct wlan_objmgr_psoc *psoc, if (!mlme_psoc_obj) return; - config = &mlme_psoc_obj->phy_config; + config = &mlme_psoc_obj->psoc_cfg.phy_config; qdf_mem_copy(config, phy_config, sizeof(*config)); } @@ -87,7 +87,7 @@ static void mlme_init_cfg(struct wlan_objmgr_psoc *psoc) if (!mlme_psoc_obj) return; - wlan_cm_init_score_config(psoc, &mlme_psoc_obj->score_config); + wlan_cm_init_score_config(psoc, &mlme_psoc_obj->psoc_cfg.score_config); } QDF_STATUS mlme_psoc_open(struct wlan_objmgr_psoc *psoc)