Эх сурвалжийг харах

qcacld-3.0: Add provision to configure Association disallowed functionality

As part of MBO[MultiBand Operations], association disallowed functionality
is added.i.e. if driver receives probe response/beacon with MBO IE
with association disallowed subattribute present, STA stops connection
attempt with the particular BSS.

This code change addresses the following:
1) Adds provision to ignore/disable association disallowed functionality in
host driver. Apply this change to enable STA to act as testbed for AP
association disallowed test case.

2) Limit the assoc disallowed functionality in host driver only for connect
cases, i.e. limit this only when driver tries to join BSS
[MLM_WT_JOIN_BEACON_STATE] since similar functionality is in supplicant to
take care of scan results case and checks for the assoc disallowed
subattribute presence in probe responses.

Change-Id: I66c6f7f31ebdaad32d01ab8882935861ddb54f51
CRs-Fixed: 1067826
Selvaraj, Sridhar 8 жил өмнө
parent
commit
ac4fcf34be

+ 28 - 8
core/hdd/src/wlan_hdd_cfg80211.c

@@ -4057,16 +4057,16 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy,
 		if (access_policy == QCA_ACCESS_POLICY_DENY_UNLESS_LISTED) {
 			access_policy =
 				WLAN_HDD_VENDOR_IE_ACCESS_ALLOW_IF_LISTED;
-	} else {
+		} else {
 			access_policy = WLAN_HDD_VENDOR_IE_ACCESS_NONE;
-	}
+		}
 
-	hdd_info("calling sme_update_access_policy_vendor_ie");
-	status = sme_update_access_policy_vendor_ie(hdd_ctx->hHal,
-			adapter->sessionId, &vendor_ie[0],
-			access_policy);
-	if (QDF_STATUS_SUCCESS != status) {
-		hdd_info("Failed to set vendor ie and access policy.");
+		hdd_info("calling sme_update_access_policy_vendor_ie");
+		status = sme_update_access_policy_vendor_ie(hdd_ctx->hHal,
+				adapter->sessionId, &vendor_ie[0],
+				access_policy);
+		if (QDF_STATUS_SUCCESS != status) {
+			hdd_info("Failed to set vendor ie and access policy.");
 			return -EINVAL;
 		}
 	}
@@ -4140,6 +4140,26 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy,
 		}
 	}
 
+	if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_IGNORE_ASSOC_DISALLOWED]) {
+		uint8_t ignore_assoc_disallowed;
+
+		ignore_assoc_disallowed
+			= nla_get_u8(tb[
+			QCA_WLAN_VENDOR_ATTR_CONFIG_IGNORE_ASSOC_DISALLOWED]);
+		hdd_info("Set ignore_assoc_disallowed value - %d",
+					ignore_assoc_disallowed);
+		if ((ignore_assoc_disallowed <
+			QCA_IGNORE_ASSOC_DISALLOWED_DISABLE) ||
+			(ignore_assoc_disallowed >
+				QCA_IGNORE_ASSOC_DISALLOWED_ENABLE))
+			return -EPERM;
+
+		sme_update_session_param(hdd_ctx->hHal,
+					adapter->sessionId,
+					SIR_PARAM_IGNORE_ASSOC_DISALLOWED,
+					ignore_assoc_disallowed);
+	}
+
 	return ret_val;
 }
 

+ 17 - 0
core/hdd/src/wlan_hdd_cfg80211.h

@@ -2311,6 +2311,20 @@ enum qca_access_policy {
 	QCA_ACCESS_POLICY_DENY_UNLESS_LISTED,
 };
 
+/**
+ * enum qca_ignore_assoc_disallowed - Ignore assoc disallowed values
+ *
+ * The valid values for the ignore assoc disallowed
+ *
+ * @QCA_IGNORE_ASSOC_DISALLOWED_DISABLE: Disable ignore assoc disallowed
+ * @QCA_IGNORE_ASSOC_DISALLOWED_ENABLE: Enable ignore assoc disallowed
+ *
+ */
+enum qca_ignore_assoc_disallowed {
+	QCA_IGNORE_ASSOC_DISALLOWED_DISABLE,
+	QCA_IGNORE_ASSOC_DISALLOWED_ENABLE
+};
+
 /**
  * enum qca_wlan_vendor_config: wifi config attr
  *
@@ -2342,6 +2356,8 @@ enum qca_access_policy {
  *                                       parameters
  * @QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER: Unsigned 8bit length attribute to update
  *                                      power save config to turn off/on qpower
+ * @QCA_WLAN_VENDOR_ATTR_CONFIG_IGNORE_ASSOC_DISALLOWED: Ignore Assoc Disallowed
+ *                                                       [MBO]
  * @QCA_WLAN_VENDOR_ATTR_CONFIG_LAST: last config
  * @QCA_WLAN_VENDOR_ATTR_CONFIG_MAX: max config
  */
@@ -2396,6 +2412,7 @@ enum qca_wlan_vendor_config {
 	QCA_WLAN_VENDOR_ATTR_CONFIG_IFINDEX,
 	/* Unsigned 8-bit, for setting qpower dynamically */
 	QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER = 25,
+	QCA_WLAN_VENDOR_ATTR_CONFIG_IGNORE_ASSOC_DISALLOWED = 26,
 	/* keep last */
 	QCA_WLAN_VENDOR_ATTR_CONFIG_LAST,
 	QCA_WLAN_VENDOR_ATTR_CONFIG_MAX =

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

@@ -2506,9 +2506,11 @@ typedef struct sSirUpdateAPWPSIEsReq {
 /*
  * 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,
 };
 
 /*

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

@@ -484,6 +484,7 @@ typedef struct sPESession       /* Added to Support BT-AMP */
 	uint8_t beacon_tx_rate;
 	uint8_t *access_policy_vendor_ie;
 	uint8_t access_policy;
+	bool ignore_assoc_disallowed;
 } tPESession, *tpPESession;
 
 /*-------------------------------------------------------------------------

+ 25 - 0
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -3191,6 +3191,31 @@ lim_check_and_announce_join_success(tpAniSirGlobal mac_ctx,
 		session_entry->defaultAuthFailureTimeout = 0;
 	}
 
+
+	/*
+	 * 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) {
+		lim_log(mac_ctx, LOGW,
+				FL("Connection fails due to assoc disallowed reason(%d):%pM PESessionID %d"),
+				beacon_probe_rsp->assoc_disallowed_reason,
+				session_entry->bssId,
+				session_entry->peSessionId);
+		mlm_join_cnf.resultCode = eSIR_SME_ASSOC_REFUSED;
+		mlm_join_cnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS;
+		session_entry->limMlmState = eLIM_MLM_IDLE_STATE;
+		mlm_join_cnf.sessionId = session_entry->peSessionId;
+		if (session_entry->pLimMlmJoinReq) {
+			qdf_mem_free(session_entry->pLimMlmJoinReq);
+			session_entry->pLimMlmJoinReq = NULL;
+		}
+		lim_post_sme_message(mac_ctx, LIM_MLM_JOIN_CNF,
+				(uint32_t *) &mlm_join_cnf);
+		return;
+	}
+
 	/* Update Beacon Interval at CFG database */
 
 	if (beacon_probe_rsp->HTCaps.present)

+ 0 - 9
core/mac/src/pe/lim/lim_process_beacon_frame.c

@@ -106,15 +106,6 @@ lim_process_beacon_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info,
 		return;
 	}
 
-	if (bcn_ptr->assoc_disallowed) {
-		lim_log(mac_ctx, LOG1,
-				FL("Association disallowed in AP "MAC_ADDRESS_STR " Reason code %d"),
-				MAC_ADDR_ARRAY(mac_hdr->sa),
-				bcn_ptr->assoc_disallowed_reason);
-		qdf_mem_free(bcn_ptr);
-		return;
-	}
-
 	/*
 	 * during scanning, when any session is active, and
 	 * beacon/Pr belongs to one of the session, fill up the

+ 0 - 18
core/mac/src/pe/lim/lim_process_probe_rsp_frame.c

@@ -171,15 +171,6 @@ lim_process_probe_rsp_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_Packet_info,
 		return;
 	}
 
-	if (probe_rsp->assoc_disallowed) {
-		lim_log(mac_ctx, LOG1,
-			FL("Association disallowed by AP "MAC_ADDRESS_STR " Reason code %d"),
-				MAC_ADDR_ARRAY(header->bssId),
-				probe_rsp->assoc_disallowed_reason);
-		qdf_mem_free(probe_rsp);
-		return;
-	}
-
 	lim_check_and_add_bss_description(mac_ctx, probe_rsp,
 			  rx_Packet_info, false, true);
 	/* To Support BT-AMP */
@@ -404,15 +395,6 @@ lim_process_probe_rsp_frame_no_session(tpAniSirGlobal mac_ctx,
 		return;
 	}
 
-	if (probe_rsp->assoc_disallowed) {
-		lim_log(mac_ctx, LOG1,
-			FL("Association disallowed by AP "MAC_ADDRESS_STR " Reason code %d"),
-				MAC_ADDR_ARRAY(header->bssId),
-				probe_rsp->assoc_disallowed_reason);
-		qdf_mem_free(probe_rsp);
-		return;
-	}
-
 	lim_log(mac_ctx, LOG2, FL("Save this probe rsp in LFR cache"));
 	lim_check_and_add_bss_description(mac_ctx, probe_rsp,
 		  rx_packet_info, false, true);

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

@@ -4256,6 +4256,9 @@ static void __lim_process_sme_session_update(tpAniSirGlobal 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:
 		lim_log(mac_ctx, LOGE, FL("Unknown session param"));
 		break;