Parcourir la source

qcacld-3.0: Cleanup assoc disallowed related code

Cleanup legacy assoc disallowed related code
and take the params from connection manager.

Also update the connection manager config in
case of change of config in relation to
assoc disallowed.

Change-Id: I558b5b7f3b3c422d2882630d16e0f3dfd1898d09
CRs-Fixed: 2767490
gaurank kathpalia il y a 4 ans
Parent
commit
6cb80095fc

+ 2 - 4
core/hdd/src/wlan_hdd_cfg80211.c

@@ -8089,10 +8089,8 @@ static int hdd_config_ignore_assoc_disallowed(struct hdd_adapter *adapter,
 	    (ignore_assoc_disallowed > QCA_IGNORE_ASSOC_DISALLOWED_ENABLE))
 		return -EINVAL;
 
-	sme_update_session_param(hdd_ctx->mac_handle,
-				 adapter->vdev_id,
-				 SIR_PARAM_IGNORE_ASSOC_DISALLOWED,
-				 ignore_assoc_disallowed);
+	sme_set_check_assoc_disallowed(hdd_ctx->mac_handle,
+				       !ignore_assoc_disallowed);
 
 	return 0;
 }

+ 0 - 1
core/mac/inc/ani_global.h

@@ -773,7 +773,6 @@ struct mac_context {
 	uint32_t rx_packet_drop_counter;
 	enum auth_tx_ack_status auth_ack_status;
 	uint8_t user_configured_nss;
-	bool ignore_assoc_disallowed;
 	uint32_t peer_rssi;
 	uint32_t peer_txrate;
 	uint32_t peer_rxrate;

+ 0 - 2
core/mac/inc/sir_api.h

@@ -1840,11 +1840,9 @@ struct update_config {
 /*
  * enum sir_update_session_param_type - session param type
  * @SIR_PARAM_SSID_HIDDEN: ssidHidden parameter
- * @SIR_PARAM_IGNORE_ASSOC_DISALLOWED: ignore_assoc_disallowed parameter
  */
 enum sir_update_session_param_type {
 	SIR_PARAM_SSID_HIDDEN,
-	SIR_PARAM_IGNORE_ASSOC_DISALLOWED,
 };
 
 /*

+ 0 - 1
core/mac/src/pe/include/lim_session.h

@@ -522,7 +522,6 @@ struct pe_session {
 	uint16_t beacon_tx_rate;
 	uint8_t *access_policy_vendor_ie;
 	uint8_t access_policy;
-	bool ignore_assoc_disallowed;
 	bool send_p2p_conf_frame;
 	bool process_ho_fail;
 	/* Number of STAs that do not support ECSA capability */

+ 4 - 2
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -3008,6 +3008,7 @@ lim_check_and_announce_join_success(struct mac_context *mac_ctx,
 	uint32_t *noa2_duration_from_beacon = NULL;
 	uint32_t noa;
 	uint32_t total_num_noa_desc = 0;
+	bool check_assoc_disallowed;
 
 	qdf_mem_copy(current_ssid.ssId,
 		     session_entry->ssId.ssId, session_entry->ssId.length);
@@ -3089,13 +3090,14 @@ lim_check_and_announce_join_success(struct mac_context *mac_ctx,
 		session_entry->defaultAuthFailureTimeout = 0;
 	}
 
+	wlan_cm_get_check_assoc_disallowed(mac_ctx->psoc,
+					   &check_assoc_disallowed);
 
 	/*
 	 * Check if MBO Association disallowed subattr is present and post
 	 * failure status to LIM if present
 	 */
-	if (!session_entry->ignore_assoc_disallowed &&
-			beacon_probe_rsp->assoc_disallowed) {
+	if (check_assoc_disallowed && beacon_probe_rsp->assoc_disallowed) {
 		pe_err("Connection fails due to assoc disallowed reason(%d):"QDF_MAC_ADDR_FMT" PESessionID %d",
 				beacon_probe_rsp->assoc_disallowed_reason,
 				QDF_MAC_ADDR_REF(session_entry->bssId),

+ 0 - 3
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -3694,9 +3694,6 @@ static void __lim_process_sme_session_update(struct mac_context *mac_ctx,
 	case SIR_PARAM_SSID_HIDDEN:
 		lim_handle_update_ssid_hidden(mac_ctx, session, msg->param_val);
 		break;
-	case SIR_PARAM_IGNORE_ASSOC_DISALLOWED:
-		session->ignore_assoc_disallowed = msg->param_val;
-		break;
 	default:
 		pe_err("Unknown session param");
 		break;

+ 0 - 1
core/mac/src/pe/lim/lim_session.c

@@ -618,7 +618,6 @@ struct pe_session *pe_create_session(struct mac_context *mac,
 	lim_update_tdls_set_state_for_fw(session_ptr, true);
 	session_ptr->fWaitForProbeRsp = 0;
 	session_ptr->fIgnoreCapsChange = 0;
-	session_ptr->ignore_assoc_disallowed = mac->ignore_assoc_disallowed;
 	session_ptr->is_session_obss_color_collision_det_enabled =
 		mac->mlme_cfg->obss_ht40.obss_color_collision_offload_enabled;
 

+ 10 - 0
core/sme/inc/sme_api.h

@@ -2249,6 +2249,16 @@ QDF_STATUS sme_enable_disable_chanavoidind_event(mac_handle_t mac_handle,
 					uint8_t set_value);
 QDF_STATUS sme_set_default_scan_ie(mac_handle_t mac_handle, uint16_t session_id,
 				uint8_t *ie_data, uint16_t ie_len);
+/**
+ * sme_set_check_assoc_disallowed() - API to update assoc disallowed
+ * @mac_handle: Opaque handle to the global MAC context
+ * @check_assoc_disallowed: assoc disallowed check value
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS sme_set_check_assoc_disallowed(mac_handle_t mac_handle,
+					  bool check_assoc_disallowed);
+
 /**
  * sme_update_session_param() - API to update PE session param
  * @mac_handle: Opaque handle to the global MAC context

+ 17 - 3
core/sme/src/common/sme_api.c

@@ -5638,6 +5638,23 @@ QDF_STATUS sme_set_tx_power(mac_handle_t mac_handle, uint8_t sessionId,
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS sme_set_check_assoc_disallowed(mac_handle_t mac_handle,
+					  bool check_assoc_disallowed)
+{
+	struct mac_context *mac = MAC_CONTEXT(mac_handle);
+	QDF_STATUS status;
+
+	status = sme_acquire_global_lock(&mac->sme);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		sme_err("Failed to acquire sme lock; status: %d", status);
+		return status;
+	}
+	wlan_cm_set_check_assoc_disallowed(mac->psoc, check_assoc_disallowed);
+	sme_release_global_lock(&mac->sme);
+
+	return QDF_STATUS_SUCCESS;
+}
+
 QDF_STATUS sme_update_session_param(mac_handle_t mac_handle, uint8_t session_id,
 				    uint32_t param_type, uint32_t param_val)
 {
@@ -5657,9 +5674,6 @@ QDF_STATUS sme_update_session_param(mac_handle_t mac_handle, uint8_t session_id,
 			return status;
 		}
 
-		if (param_type == SIR_PARAM_IGNORE_ASSOC_DISALLOWED)
-			mac_ctx->ignore_assoc_disallowed = param_val;
-
 		if (!session->sessionActive)
 			QDF_ASSERT(0);
 

+ 0 - 73
core/sme/src/csr/csr_api_scan.c

@@ -2143,38 +2143,6 @@ static void csr_update_bss_with_fils_data(struct mac_context *mac_ctx,
 { }
 #endif
 
-/**
- * csr_is_assoc_disallowed() - Find if assoc disallowed
- * bit is set in AP's beacon or probe response
- * @mac_ctx: mac context
- * @scan_entry: scan entry
- *
- * Return: True if assoc disallowed is set else false
- */
-static bool csr_is_assoc_disallowed(struct mac_context *mac_ctx,
-				    struct scan_cache_entry *scan_entry)
-{
-	int ret;
-	tDot11fIEMBO_IE mbo_ie = {0};
-	uint8_t *mbo_oce;
-
-	mbo_oce = util_scan_entry_mbo_oce(scan_entry);
-
-	if (!mbo_oce)
-		return false;
-
-	ret = dot11f_unpack_ie_MBO_IE(mac_ctx, mbo_oce + SIR_MBO_ELEM_OFFSET,
-				      *(mbo_oce + 1) - SIR_MAC_MBO_OUI_SIZE,
-				      &mbo_ie, false);
-
-	if (DOT11F_FAILED(ret)) {
-		sme_err("unpack failed ret: 0x%x", ret);
-		return false;
-	}
-
-	return mbo_ie.assoc_disallowed.present;
-}
-
 #if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
 /**
  * csr_fill_single_pmk_ap_cap_from_scan_entry() - WAP3_SPMK VSIE from scan
@@ -2287,8 +2255,6 @@ static QDF_STATUS csr_fill_bss_from_scan_entry(struct mac_context *mac_ctx,
 			  MGMT_SUBTYPE_PROBE_RESP);
 	bss_desc->seq_ctrl = hdr->seqControl;
 	bss_desc->tsf_delta = scan_entry->tsf_delta;
-	bss_desc->assoc_disallowed = csr_is_assoc_disallowed(mac_ctx,
-							     scan_entry);
 	bss_desc->adaptive_11r_ap = scan_entry->adaptive_11r_ap;
 
 	bss_desc->mbo_oce_enabled_ap =
@@ -2358,42 +2324,6 @@ static QDF_STATUS csr_parse_scan_list(struct mac_context *mac_ctx,
 	return QDF_STATUS_SUCCESS;
 }
 
-/**
- * csr_remove_ap_with_assoc_disallowed() - Remove APs with assoc
- * disallowed bit set
- * @mac_ctx: mac context
- * @scan_list: candidate list for the connection
- *
- * Return: None
- */
-static void csr_remove_ap_with_assoc_disallowed(struct mac_context *mac_ctx,
-					     struct scan_result_list *scan_list)
-{
-	tListElem *cur_entry;
-	tListElem *next_entry;
-	struct tag_csrscan_result *scan_res;
-
-	if (!scan_list)
-		return;
-
-	cur_entry = csr_ll_peek_head(&scan_list->List, LL_ACCESS_NOLOCK);
-	while (cur_entry) {
-		scan_res = GET_BASE_ADDR(cur_entry, struct tag_csrscan_result,
-					 Link);
-		next_entry = csr_ll_next(&scan_list->List, cur_entry,
-					 LL_ACCESS_NOLOCK);
-
-		if (!mac_ctx->ignore_assoc_disallowed &&
-		    scan_res->Result.BssDescriptor.assoc_disallowed) {
-			csr_ll_remove_entry(&scan_list->List, cur_entry,
-					    LL_ACCESS_NOLOCK);
-			csr_free_scan_result_entry(mac_ctx, scan_res);
-		}
-		cur_entry = next_entry;
-		next_entry = NULL;
-	}
-}
-
 static void csr_get_pcl_chan_weigtage_for_sta(struct mac_context *mac_ctx,
 					struct pcl_freq_weight_list *pcl_lst)
 {
@@ -2488,9 +2418,6 @@ QDF_STATUS csr_scan_get_result(struct mac_context *mac_ctx,
 		/* Fail or No one wants the result. */
 		csr_scan_result_purge(mac_ctx, (tScanResultHandle) ret_list);
 	else {
-		if (scoring_required)
-			csr_remove_ap_with_assoc_disallowed(mac_ctx, ret_list);
-
 		if (!csr_ll_count(&ret_list->List)) {
 			/* This mean that there is no match */
 			csr_ll_close(&ret_list->List);