Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87554f42 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge f140d010 on remote branch

Change-Id: I9b4f8fec98083c207406163b092d9e8675b9f4e8
parents 1dc26c68 f140d010
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2022-2024 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
@@ -202,6 +202,8 @@ struct wlan_cm_roam_vendor_btm_params {
 *                   floor in dB
 * @bg_rssi_threshold: Value of rssi threshold to trigger roaming
 *                     after background scan.
 * @num_allowed_authmode: Number of allowerd authmode
 * @allowed_authmode: List of allowed authmode other than connected
 */
struct ap_profile {
	uint32_t flags;
@@ -213,6 +215,8 @@ struct ap_profile {
	uint32_t rsn_mcastmgmtcipherset;
	uint32_t rssi_abs_thresh;
	uint8_t bg_rssi_threshold;
	uint32_t num_allowed_authmode;
	uint32_t allowed_authmode[WLAN_CRYPTO_AUTH_MAX];
};

/**
@@ -261,6 +265,14 @@ struct ap_profile {
 * @rssi_scoring: RSSI scoring information.
 * @esp_qbss_scoring: ESP/QBSS scoring percentage information
 * @oce_wan_scoring: OCE WAN metrics percentage information
 * @security_weightage: Security(WPA/WPA2/WPA3) weightage out of
 * total score in %
 * @security_index_score: Security scoring percentage information.
 *                BITS 0-7 :- It contains scoring percentage of WPA security
 *                BITS 8-15  :- It contains scoring percentage of WPA2 security
 *                BITS 16-23 :- It contains scoring percentage of WPA3 security
 *                BITS 24-31 :- reserved
 *                The value of each index must be 0-100
 */
struct scoring_param {
	uint32_t disable_bitmap;
@@ -288,6 +300,8 @@ struct scoring_param {
	struct rssi_config_score rssi_scoring;
	struct per_slot_score esp_qbss_scoring;
	struct per_slot_score oce_wan_scoring;
	int32_t security_weightage;
	uint32_t security_index_score;
};

/**
+76 −6
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2022-2024 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
@@ -2497,9 +2497,11 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle,
	wmi_roam_score_delta_param *score_delta_param;
	wmi_roam_cnd_min_rssi_param *min_rssi_param;
	enum roam_trigger_reason trig_reason;
	uint32_t *authmode_list;
	int i;

	len = sizeof(wmi_roam_ap_profile_fixed_param) + sizeof(wmi_ap_profile);
	len += sizeof(*score_param);
	len += sizeof(*score_param) + WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE;

	if (!wmi_service_enabled(wmi_handle,
			wmi_service_configure_roam_trigger_param_support)) {
@@ -2507,7 +2509,18 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle,
		len += NUM_OF_ROAM_TRIGGERS * sizeof(*score_delta_param);
		len += WMI_TLV_HDR_SIZE;
		len += NUM_OF_ROAM_MIN_RSSI * sizeof(*min_rssi_param);
	} else {
		len += 2 * WMI_TLV_HDR_SIZE;
	}

	if (ap_profile->profile.num_allowed_authmode) {
		len += WMI_TLV_HDR_SIZE;
		len += ap_profile->profile.num_allowed_authmode *
						sizeof(uint32_t);
	} else {
		len += WMI_TLV_HDR_SIZE;
	}

	buf = wmi_buf_alloc(wmi_handle, len);
	if (!buf)
		return QDF_STATUS_E_NOMEM;
@@ -2564,6 +2577,8 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle,
	score_param->bw_weightage_pcnt = ap_profile->param.bw_weightage;
	score_param->band_weightage_pcnt = ap_profile->param.band_weightage;
	score_param->nss_weightage_pcnt = ap_profile->param.nss_weightage;
	score_param->security_weightage_pcnt =
				ap_profile->param.security_weightage;
	score_param->esp_qbss_weightage_pcnt =
			ap_profile->param.esp_qbss_weightage;
	score_param->beamforming_weightage_pcnt =
@@ -2580,7 +2595,7 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle,
	score_param->sae_pk_ap_weightage_pcnt =
				ap_profile->param.sae_pk_ap_weightage;

	wmi_debug("Score params weightage: disable_bitmap %x rssi %d ht %d vht %d he %d BW %d band %d NSS %d ESP %d BF %d PCL %d OCE WAN %d APTX %d roam score algo %d subnet id %d sae-pk %d",
	wmi_debug("Score params weightage: disable_bitmap %x rssi %d ht %d vht %d he %d BW %d band %d NSS %d ESP %d BF %d PCL %d OCE WAN %d APTX %d roam score algo %d subnet id %d sae-pk %d security %d",
		 score_param->disable_bitmap, score_param->rssi_weightage_pcnt,
		 score_param->ht_weightage_pcnt,
		 score_param->vht_weightage_pcnt,
@@ -2594,18 +2609,22 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle,
		 score_param->oce_ap_tx_pwr_weightage_pcnt,
		 score_param->vendor_roam_score_algorithm_id,
		 score_param->oce_ap_subnet_id_weightage_pcnt,
		 score_param->sae_pk_ap_weightage_pcnt);
		 score_param->sae_pk_ap_weightage_pcnt,
		 score_param->security_weightage_pcnt);

	score_param->bw_scoring.score_pcnt = ap_profile->param.bw_index_score;
	score_param->band_scoring.score_pcnt =
			ap_profile->param.band_index_score;
	score_param->nss_scoring.score_pcnt =
			ap_profile->param.nss_index_score;
	score_param->security_scoring.score_pcnt =
			ap_profile->param.security_index_score;

	wmi_debug("bw_index_score %x band_index_score %x nss_index_score %x",
	wmi_debug("bw_index_score %x band_index_score %x nss_index_score %x security_index_score %x",
		  score_param->bw_scoring.score_pcnt,
		  score_param->band_scoring.score_pcnt,
		  score_param->nss_scoring.score_pcnt);
		  score_param->nss_scoring.score_pcnt,
		  score_param->security_scoring.score_pcnt);

	score_param->rssi_scoring.best_rssi_threshold =
		(-1) * ap_profile->param.rssi_scoring.best_rssi_threshold;
@@ -2751,7 +2770,58 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle,
			convert_roam_trigger_reason(trig_reason);
		min_rssi_param->candidate_min_rssi =
			ap_profile->min_rssi_params[MIN_RSSI_2G_TO_5G_ROAM].min_rssi;

		buf_ptr += sizeof(*min_rssi_param);
	} else {
		/* set zero TLV's for roam_score_delta_param_list */
		WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
			       WMITLV_GET_STRUCT_TLVLEN(0));
		buf_ptr += WMI_TLV_HDR_SIZE;

		/* set zero TLV's for roam_cnd_min_rssi_param_list */
		WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
			       WMITLV_GET_STRUCT_TLVLEN(0));
		buf_ptr += WMI_TLV_HDR_SIZE;
	}

	/* set zero TLV's for roam_cnd_vendor_scoring_param */
	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
		       WMITLV_GET_STRUCT_TLVLEN(0));
	buf_ptr += WMI_TLV_HDR_SIZE;

	/* set zero TLV's for owe_ap_profile */
	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
		       WMITLV_GET_STRUCT_TLVLEN(0));
	buf_ptr += WMI_TLV_HDR_SIZE;

	/* List of Allowed authmode other than the connected akm */
	if (ap_profile->profile.num_allowed_authmode) {
		WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32,
			       (ap_profile->profile.num_allowed_authmode *
			       sizeof(uint32_t)));

		buf_ptr += WMI_TLV_HDR_SIZE;

		authmode_list = (uint32_t *)buf_ptr;
		for (i = 0; i < ap_profile->profile.num_allowed_authmode; i++)
			authmode_list[i] =
				ap_profile->profile.allowed_authmode[i];

		wmi_debug("[Allowed Authmode]: num_allowed_authmode: %d",
			  ap_profile->profile.num_allowed_authmode);
		QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
				   authmode_list,
				   ap_profile->profile.num_allowed_authmode *
				   sizeof(uint32_t));
		buf_ptr += ap_profile->profile.num_allowed_authmode *
			   sizeof(uint32_t);
	} else {
		/* set zero TLV's for allowed_authmode */
		WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
			       WMITLV_GET_STRUCT_TLVLEN(0));
		buf_ptr += WMI_TLV_HDR_SIZE;
	}

	wmi_mtrace(WMI_ROAM_AP_PROFILE, NO_SESSION, 0);
	status = wmi_unified_cmd_send(wmi_handle, buf,
				      len, WMI_ROAM_AP_PROFILE);
+11 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2022-2024 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
@@ -1607,7 +1607,16 @@ static bool dp_fisa_aggregation_should_stop(
				 HAL_RX_TLV_GET_TCP_OFFSET(rx_tlv_hdr);
	uint32_t cumulative_ip_len_delta = hal_cumulative_ip_len -
					   fisa_flow->hal_cumultive_ip_len;
	bool ip_csum_err = hal_rx_attn_ip_cksum_fail_get(rx_tlv_hdr);
	bool tcp_udp_csum_er = hal_rx_attn_tcp_udp_cksum_fail_get(rx_tlv_hdr);

	/**
	 * If l3/l4 checksum validation failed for MSDU, then data
	 * is not trust worthy to build aggregated skb, so do not
	 * allow for aggregation. And also in aggregated case it
	 * is job of driver to make sure checksum is valid before
	 * computing partial checksum for final aggregated skb.
	 *
	 * kernel network panic if UDP data length < 12 bytes get aggregated,
	 * no solid conclusion currently, as a SW WAR, only allow UDP
	 * aggregation if UDP data length >= 16 bytes.
@@ -1620,6 +1629,7 @@ static bool dp_fisa_aggregation_should_stop(
	 * otherwise, current fisa flow aggregation should be stopped.
	 */
	if (fisa_flow->do_not_aggregate ||
	    (ip_csum_err || tcp_udp_csum_er) ||
	    msdu_len < (l4_hdr_offset + FISA_MIN_L4_AND_DATA_LEN) ||
	    hal_cumulative_ip_len <= fisa_flow->hal_cumultive_ip_len ||
	    cumulative_ip_len_delta > FISA_MAX_SINGLE_CUMULATIVE_IP_LEN ||
+254 −66
Original line number Diff line number Diff line
@@ -17123,6 +17123,17 @@ static void wlan_hdd_cfg80211_set_dfs_offload_feature(struct wiphy *wiphy)
}
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))
static void wlan_hdd_set_mfp_optional(struct wiphy *wiphy)
{
	wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_MFP_OPTIONAL);
}
#else
static void wlan_hdd_set_mfp_optional(struct wiphy *wiphy)
{
}
#endif
#ifdef WLAN_FEATURE_DSRC
static void wlan_hdd_get_num_dsrc_ch_and_len(struct hdd_config *hdd_cfg,
					     int *num_ch, int *ch_len)
@@ -17344,6 +17355,19 @@ wlan_hdd_update_akm_suit_info(struct wiphy *wiphy)
}
#endif
#ifdef CFG80211_MULTI_AKM_CONNECT_SUPPORT
static void
wlan_hdd_update_max_connect_akm(struct wiphy *wiphy)
{
	wiphy->max_num_akms_connect = WLAN_CM_MAX_CONNECT_AKMS;
}
#else
static void
wlan_hdd_update_max_connect_akm(struct wiphy *wiphy)
{
}
#endif
/*
 * FUNCTION: wlan_hdd_cfg80211_init
 * This function is called by hdd_wlan_startup()
@@ -17473,6 +17497,9 @@ int wlan_hdd_cfg80211_init(struct device *dev,
	hdd_add_channel_switch_support(&wiphy->flags);
	wiphy->max_num_csa_counters = WLAN_HDD_MAX_NUM_CSA_COUNTERS;
	wlan_hdd_update_max_connect_akm(wiphy);
	wlan_hdd_cfg80211_action_frame_randomization_init(wiphy);
	wlan_hdd_set_nan_supported_bands(wiphy);
@@ -17792,6 +17819,8 @@ void wlan_hdd_update_wiphy(struct hdd_context *hdd_ctx)
	mac_spoofing_enabled = ucfg_scan_is_mac_spoofing_enabled(hdd_ctx->psoc);
	if (mac_spoofing_enabled)
		wlan_hdd_cfg80211_scan_randomization_init(wiphy);
	wlan_hdd_set_mfp_optional(wiphy);
}
/**
@@ -20477,12 +20506,136 @@ static bool wlan_hdd_is_akm_suite_fils(uint32_t key_mgmt)
	case WLAN_AKM_SUITE_FILS_SHA384:
	case WLAN_AKM_SUITE_FT_FILS_SHA256:
	case WLAN_AKM_SUITE_FT_FILS_SHA384:
		hdd_debug("Fils AKM : %x", key_mgmt);
		return true;
	default:
		return false;
	}
}
#ifdef CFG80211_MULTI_AKM_CONNECT_SUPPORT
/**
 * hdd_populate_crypto_akm_type() - populate akm type for crypto
 * @vdev: pointed to vdev obmgr
 * @req: connect req
 *
 * set the crypto akm type for corresponding akm type received
 * from NL
 *
 * Return: None
 */
static void
hdd_populate_crypto_akm_type(struct wlan_objmgr_vdev *vdev,
			     const struct cfg80211_connect_params *req)
{
	QDF_STATUS status;
	uint32_t i = 0;
	uint32_t set_val = 0;
	wlan_crypto_key_mgmt akm;
	if (req->crypto.n_connect_akm_suites) {
		for (i = 0; i < req->crypto.n_connect_akm_suites &&
		     i < WLAN_CM_MAX_CONNECT_AKMS; i++) {
			akm = osif_nl_to_crypto_akm_type(
					req->crypto.connect_akm_suites[i]);
			HDD_SET_BIT(set_val, akm);
		}
		status = wlan_crypto_set_vdev_param(vdev,
						    WLAN_CRYPTO_PARAM_KEY_MGMT,
						    set_val);
		if (QDF_IS_STATUS_ERROR(status))
			hdd_err("Failed to set akm type %0x to crypto",
				set_val);
		status = wlan_crypto_set_vdev_param(
				vdev, WLAN_CRYPTO_PARAM_ORIG_KEY_MGMT, set_val);
		if (QDF_IS_STATUS_ERROR(status))
			hdd_err("Failed to set original akm type %0x to crypto",
				set_val);
	} else {
		set_val = 0;
		/* Reset to none */
		HDD_SET_BIT(set_val, WLAN_CRYPTO_KEY_MGMT_NONE);
		wlan_crypto_set_vdev_param(vdev,
					   WLAN_CRYPTO_PARAM_KEY_MGMT,
					   set_val);
		wlan_crypto_set_vdev_param(vdev,
					   WLAN_CRYPTO_PARAM_ORIG_KEY_MGMT,
					   set_val);
	}
}
static int
hdd_get_num_akm_suites(const struct cfg80211_connect_params *req)
{
	return req->crypto.n_connect_akm_suites;
}
static uint32_t*
hdd_get_akm_suites(const struct cfg80211_connect_params *req)
{
	return (uint32_t *)req->crypto.connect_akm_suites;
}
#else
static void
hdd_populate_crypto_akm_type(struct wlan_objmgr_vdev *vdev,
			     const struct cfg80211_connect_params *req)
{
	QDF_STATUS status;
	uint32_t i = 0;
	uint32_t set_val = 0;
	wlan_crypto_key_mgmt akm;
	if (req->crypto.n_akm_suites) {
		for (i = 0; i < req->crypto.n_akm_suites &&
		     i < NL80211_MAX_NR_AKM_SUITES; i++) {
			akm = osif_nl_to_crypto_akm_type(
					req->crypto.akm_suites[i]);
			HDD_SET_BIT(set_val, akm);
		}
		status = wlan_crypto_set_vdev_param(vdev,
						    WLAN_CRYPTO_PARAM_KEY_MGMT,
						    set_val);
		if (QDF_IS_STATUS_ERROR(status))
			hdd_err("Failed to set akm type %0x to crypto",
				set_val);
		status = wlan_crypto_set_vdev_param(vdev,
						    WLAN_CRYPTO_PARAM_ORIG_KEY_MGMT,
						    set_val);
		if (QDF_IS_STATUS_ERROR(status))
			hdd_err("Failed to set original akm type %0x to crypto",
				set_val);
	} else {
		set_val = 0;
		/* Reset to none */
		HDD_SET_BIT(set_val, WLAN_CRYPTO_KEY_MGMT_NONE);
		wlan_crypto_set_vdev_param(vdev,
					   WLAN_CRYPTO_PARAM_KEY_MGMT,
					   set_val);
		wlan_crypto_set_vdev_param(vdev,
					   WLAN_CRYPTO_PARAM_ORIG_KEY_MGMT,
					   set_val);
	}
}
static int
hdd_get_num_akm_suites(const struct cfg80211_connect_params *req)
{
	return req->crypto.n_akm_suites;
}
static uint32_t*
hdd_get_akm_suites(const struct cfg80211_connect_params *req)
{
	return (uint32_t *)req->crypto.akm_suites;
}
#endif
static bool wlan_hdd_is_conn_type_fils(struct cfg80211_connect_params *req)
{
	enum nl80211_auth_type auth_type = req->auth_type;
@@ -20490,11 +20643,15 @@ static bool wlan_hdd_is_conn_type_fils(struct cfg80211_connect_params *req)
	 * Below n_akm_suites is defined as int in the kernel, even though it
	 * is supposed to be unsigned.
	 */
	int num_akm_suites = req->crypto.n_akm_suites;
	uint32_t key_mgmt = req->crypto.akm_suites[0];
	int num_akm_suites;
	uint32_t *akm_suites;
	uint8_t i;
	enum eAniAuthType fils_auth_type =
		wlan_hdd_get_fils_auth_type(req->auth_type);
	num_akm_suites = hdd_get_num_akm_suites(req);
	akm_suites = hdd_get_akm_suites(req);
	if (num_akm_suites <= 0)
		return false;
@@ -20505,14 +20662,15 @@ static bool wlan_hdd_is_conn_type_fils(struct cfg80211_connect_params *req)
	    (fils_auth_type == eSIR_DONOT_USE_AUTH_TYPE))
		return false;
	if (!wlan_hdd_is_akm_suite_fils(key_mgmt))
		return false;
	hdd_debug("Fils Auth %d AKM %d", fils_auth_type, key_mgmt);
	for (i = 0; i < num_akm_suites; i++) {
		if (!wlan_hdd_is_akm_suite_fils(akm_suites[i]))
			continue;
		return true;
	}
	return false;
}
#else
static bool hdd_validate_fils_info_ptr(struct csr_roam_profile *roam_profile)
{
@@ -20859,59 +21017,70 @@ static void hdd_populate_crypto_auth_type(struct wlan_objmgr_vdev *vdev,
}
/**
 * hdd_populate_crypto_akm_type() - populate akm type for crypto
 * hdd_populate_crypto_cipher_type() - populate cipher type for crypto
 * @vdev: pointed to vdev obmgr
 * @akm_type: legacy akm_type
 * @req: Pointer to security parameters
 * @cipher_param_type: param type, UCAST/MCAST
 *
 * set the crypto akm type for corresponding akm type received
 * set the crypto cipher type for corresponding cipher type received
 * from NL
 *
 * Return: None
 */
static void hdd_populate_crypto_akm_type(struct wlan_objmgr_vdev *vdev,
					 u32 key_mgmt)
static void
hdd_populate_crypto_cipher_type(struct wlan_objmgr_vdev *vdev,
				struct cfg80211_connect_params *req,
				wlan_crypto_param_type cipher_param_type)
{
	QDF_STATUS status;
	uint32_t set_val = 0;
	wlan_crypto_key_mgmt crypto_akm_type =
			osif_nl_to_crypto_akm_type(key_mgmt);
	uint32_t i = 0;
	wlan_crypto_cipher_type cipher = WLAN_CRYPTO_CIPHER_NONE;
	HDD_SET_BIT(set_val, crypto_akm_type);
	switch (cipher_param_type) {
	case WLAN_CRYPTO_PARAM_UCAST_CIPHER:
		for (i = 0; i < req->crypto.n_ciphers_pairwise &&
		     i < NL80211_MAX_NR_CIPHER_SUITES; i++) {
			cipher =
			osif_nl_to_crypto_cipher_type(req->crypto.ciphers_pairwise[i]);
			HDD_SET_BIT(set_val, cipher);
		}
		status = wlan_crypto_set_vdev_param(vdev,
					    WLAN_CRYPTO_PARAM_KEY_MGMT,
						    cipher_param_type,
						    set_val);
		if (QDF_IS_STATUS_ERROR(status))
		hdd_err("Failed to set akm type %0x to crypto component",
			set_val);
}
/**
 * hdd_populate_crypto_cipher_type() - populate cipher type for crypto
 * @cipher: legacy cipher type
 * @vdev: pointed to vdev obmgr
 * @cipher_param_type: param type, UCST/MCAST
 *
 * set the crypto cipher type for corresponding cipher type received
 * from NL
 *
 * Return: None
 */
static void hdd_populate_crypto_cipher_type(u32 cipher,
					    struct wlan_objmgr_vdev *vdev,
					    wlan_crypto_param_type
					    cipher_param_type)
{
	QDF_STATUS status;
	uint32_t set_val = 0;
	wlan_crypto_cipher_type crypto_cipher_type =
			osif_nl_to_crypto_cipher_type(cipher);
			hdd_debug("Failed to set cipher params %d type %0x to crypto",
				  cipher_param_type, set_val);
		break;
	case WLAN_CRYPTO_PARAM_MCAST_CIPHER:
		cipher =
			osif_nl_to_crypto_cipher_type(req->crypto.cipher_group);
	HDD_SET_BIT(set_val, crypto_cipher_type);
	status = wlan_crypto_set_vdev_param(vdev, cipher_param_type, set_val);
		HDD_SET_BIT(set_val, cipher);
		status = wlan_crypto_set_vdev_param(vdev, cipher_param_type,
						    set_val);
		if (QDF_IS_STATUS_ERROR(status))
			hdd_debug("Failed to set cipher params %d type %0x to crypto",
				  cipher_param_type, set_val);
		break;
	default:
		hdd_err("Neither of Pairwise/Groupwise cipher");
		break;
	}
}
static inline
uint8_t hdd_get_rsn_cap_mfp(enum nl80211_mfp mfp_state)
{
	switch (mfp_state) {
	case NL80211_MFP_REQUIRED:
		return RSN_CAP_MFP_REQUIRED;
	case NL80211_MFP_OPTIONAL:
		return RSN_CAP_MFP_CAPABLE;
	default:
		return RSN_CAP_MFP_DISABLED;
	}
}
/**
@@ -20931,18 +21100,12 @@ static void hdd_populate_crypto_params(struct wlan_objmgr_vdev *vdev,
	/* Resetting the RSN caps for every connection */
	wlan_crypto_set_vdev_param(vdev, WLAN_CRYPTO_PARAM_RSN_CAP, set_val);
	if (req->crypto.n_akm_suites) {
		hdd_populate_crypto_akm_type(vdev, req->crypto.akm_suites[0]);
	} else {
		/* Reset to none */
		HDD_SET_BIT(set_val, WLAN_CRYPTO_KEY_MGMT_NONE);
		wlan_crypto_set_vdev_param(vdev,
					    WLAN_CRYPTO_PARAM_KEY_MGMT,
					    set_val);
	}
	/* Fill AKM suites */
	hdd_populate_crypto_akm_type(vdev, req);
	/* Fill pairwise cipher suites */
	if (req->crypto.n_ciphers_pairwise) {
		hdd_populate_crypto_cipher_type(req->crypto.ciphers_pairwise[0],
						vdev,
		hdd_populate_crypto_cipher_type(vdev, req,
						WLAN_CRYPTO_PARAM_UCAST_CIPHER);
	} else {
		set_val = 0;
@@ -20952,9 +21115,10 @@ static void hdd_populate_crypto_params(struct wlan_objmgr_vdev *vdev,
					   WLAN_CRYPTO_PARAM_UCAST_CIPHER,
					   set_val);
	}
	/* Fill group cipher suites */
	if (req->crypto.cipher_group) {
		hdd_populate_crypto_cipher_type(req->crypto.cipher_group,
						vdev,
		hdd_populate_crypto_cipher_type(vdev, req,
						WLAN_CRYPTO_PARAM_MCAST_CIPHER);
	} else {
		set_val = 0;
@@ -20965,6 +21129,25 @@ static void hdd_populate_crypto_params(struct wlan_objmgr_vdev *vdev,
					   set_val);
	}
	if (req->mfp) {
		QDF_STATUS status;
		set_val = (uint32_t)hdd_get_rsn_cap_mfp(req->mfp);
		status = wlan_crypto_set_vdev_param(
						vdev,
						WLAN_CRYPTO_PARAM_ORIG_RSN_CAP,
						set_val);
		if (QDF_IS_STATUS_ERROR(status))
			hdd_debug("Failed to set original RSN caps %d to crypto",
				  set_val);
	} else {
		set_val = 0;
		/* Reset to none */
		wlan_crypto_set_vdev_param(vdev, WLAN_CRYPTO_PARAM_ORIG_RSN_CAP,
					   set_val);
	}
	hdd_populate_crypto_auth_type(vdev, req);
	wlan_crypto_free_vdev_key(vdev);
}
@@ -21848,13 +22031,18 @@ static inline void hdd_dump_connect_req(struct hdd_adapter *adapter,
					struct cfg80211_connect_params *req)
{
	uint32_t i;
	uint32_t num_akm_suites;
	uint32_t *akm_suites;
	num_akm_suites = hdd_get_num_akm_suites(req);
	akm_suites = hdd_get_akm_suites(req);
	hdd_nofl_debug("cfg80211_connect req for %s(vdevid-%d): mode %d freq %d SSID %.*s auth type %d WPA ver %d n_akm %d n_cipher %d grp_cipher %x mfp %d freq hint %d",
		       ndev->name, adapter->vdev_id, adapter->device_mode,
		       req->channel ? req->channel->center_freq : 0,
		       (int)req->ssid_len, req->ssid, req->auth_type,
		       req->crypto.wpa_versions,
		       req->crypto.n_akm_suites, req->crypto.n_ciphers_pairwise,
		       num_akm_suites, req->crypto.n_ciphers_pairwise,
		       req->crypto.cipher_group, req->mfp,
		       req->channel_hint ? req->channel_hint->center_freq : 0);
	if (req->bssid)
@@ -21865,8 +22053,8 @@ static inline void hdd_dump_connect_req(struct hdd_adapter *adapter,
				QDF_MAC_ADDR_REF(req->bssid_hint));
	hdd_dump_prev_bssid(req);
	for (i = 0; i < req->crypto.n_akm_suites; i++)
		hdd_nofl_debug("akm[%d] = %x", i, req->crypto.akm_suites[i]);
	for (i = 0; i < num_akm_suites; i++)
		hdd_nofl_debug("akm[%d] = %x", i, akm_suites[i]);
	for (i = 0; i < req->crypto.n_ciphers_pairwise; i++)
		hdd_nofl_debug("cipher_pairwise[%d] = %x", i,
+5 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
 * Copyright (c) 2024 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
@@ -207,6 +208,10 @@ extern const struct nla_policy wlan_hdd_wisa_cmd_policy[
#define USE_CFG80211_DEL_STA_V2
#endif

#ifdef CFG80211_MULTI_AKM_CONNECT_SUPPORT
#define WLAN_CM_MAX_CONNECT_AKMS 5
#endif

/**
 * enum eDFS_CAC_STATUS: CAC status
 *
Loading