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

Commit 646ce320 authored by Abhinav Kumar's avatar Abhinav Kumar Committed by Gerrit - the friendly Code Review server
Browse files

qcacld-3.0: Add BSSID to reject rssi list in assoc reject

Scenario:
1. Turn on STA and try connect with a PMF capable AP.
2. Configure te AP to reject assoc everytime, with status
   code as ASSOC TRY AGAIN.

Issue with DUT:
STA would try again after the time t, which the AP has
specified in the assoc rsp frame, and if the AP sends
the assoc rsp fail continuosly with reason code try again,
then the active command timeout may happen as the
active command to connect would be stuck.

Observation:
Active command timeout happens, because the AP sends
the assoc rsp with the reason code try again and time
after every attempt.

Expectation:
The AP should be added to RSSI reject list, keeping RSSI
as 0, and retry delay as the time specified by AP, which would
result in connection attempt to that AP after the timeout, also
the STA would then continue with the other candidates.

Fix:
Fill the retry delay as the timeout value AP has given, RSSI as
0, and add the BSSID to the reject list, and continue connect
with other BSSIDs

Change-Id: If6155906a586539b3edef3e25bcad4f1e77159c3
CRs-Fixed: 2453875
parent adc4c4a3
Loading
Loading
Loading
Loading
+0 −4
Original line number Original line Diff line number Diff line
@@ -470,10 +470,6 @@ typedef struct sPESession /* Added to Support BT-AMP */
	/* Fast Transition (FT) */
	/* Fast Transition (FT) */
	tftPEContext ftPEContext;
	tftPEContext ftPEContext;
	bool isNonRoamReassoc;
	bool isNonRoamReassoc;
#ifdef WLAN_FEATURE_11W
	qdf_mc_timer_t pmfComebackTimer;
	tComebackTimerInfo pmfComebackTimerInfo;
#endif /* WLAN_FEATURE_11W */
	uint8_t  is_key_installed;
	uint8_t  is_key_installed;
	/* timer for resetting protection fileds at regular intervals */
	/* timer for resetting protection fileds at regular intervals */
	qdf_mc_timer_t protection_fields_reset_timer;
	qdf_mc_timer_t protection_fields_reset_timer;
+0 −3
Original line number Original line Diff line number Diff line
@@ -717,9 +717,6 @@ static void pe_shutdown_notifier_cb(void *ctx)
			if (LIM_IS_AP_ROLE(session))
			if (LIM_IS_AP_ROLE(session))
				qdf_mc_timer_stop(&session->
				qdf_mc_timer_stop(&session->
						 protection_fields_reset_timer);
						 protection_fields_reset_timer);
#ifdef WLAN_FEATURE_11W
			qdf_mc_timer_stop(&session->pmfComebackTimer);
#endif
		}
		}
	}
	}
}
}
+55 −67
Original line number Original line Diff line number Diff line
@@ -478,6 +478,47 @@ static void lim_stop_reassoc_retry_timer(tpAniSirGlobal mac_ctx)
	lim_deactivate_and_change_timer(mac_ctx, eLIM_REASSOC_FAIL_TIMER);
	lim_deactivate_and_change_timer(mac_ctx, eLIM_REASSOC_FAIL_TIMER);
}
}


#ifdef WLAN_FEATURE_11W
static void lim_handle_assoc_reject_status(tpAniSirGlobal mac_ctx,
					   tpPESession session_entry,
					   tpSirAssocRsp assoc_rsp,
					   tSirMacAddr source_addr)
{
	struct sir_rssi_disallow_lst ap_info = {{0}};
	uint32_t timeout_value =
		assoc_rsp->TimeoutInterval.timeoutValue;

	if (!(session_entry->limRmfEnabled &&
	    assoc_rsp->statusCode == eSIR_MAC_TRY_AGAIN_LATER &&
	    (assoc_rsp->TimeoutInterval.present &&
	    (assoc_rsp->TimeoutInterval.timeoutType ==
	     SIR_MAC_TI_TYPE_ASSOC_COMEBACK))))
		return;

	/*
	 * Add to rssi reject list, which takes care of retry
	 * delay too. Fill the RSSI as 0, so the only param
	 * which will allow the bssid to connect is retry delay.
	 */
	ap_info.retry_delay = timeout_value;
	qdf_mem_copy(ap_info.bssid.bytes, source_addr,
		     QDF_MAC_ADDR_SIZE);
	ap_info.expected_rssi = LIM_MIN_RSSI;
	lim_assoc_rej_add_to_rssi_based_reject_list(mac_ctx,
						    &ap_info);

	pe_debug("ASSOC res with eSIR_MAC_TRY_AGAIN_LATER recvd. Add to time reject list(rssi reject in mac_ctx %d",
		 timeout_value);
}
#else
static void lim_handle_assoc_reject_status(tpAniSirGlobal mac_ctx,
					   tpPESession session_entry,
					   tpSirAssocRsp assoc_rsp,
					   tSirMacAddr source_addr)
{
}
#endif

/**
/**
 * lim_process_assoc_rsp_frame() - Processes assoc response
 * lim_process_assoc_rsp_frame() - Processes assoc response
 * @mac_ctx: Pointer to Global MAC structure
 * @mac_ctx: Pointer to Global MAC structure
@@ -711,19 +752,23 @@ lim_process_assoc_rsp_frame(tpAniSirGlobal mac_ctx,
	else
	else
		lim_stop_reassoc_retry_timer(mac_ctx);
		lim_stop_reassoc_retry_timer(mac_ctx);


	lim_handle_assoc_reject_status(mac_ctx, session_entry, assoc_rsp,
				       hdr->sa);

	if (eSIR_MAC_XS_FRAME_LOSS_POOR_CHANNEL_RSSI_STATUS ==
	if (eSIR_MAC_XS_FRAME_LOSS_POOR_CHANNEL_RSSI_STATUS ==
	   assoc_rsp->statusCode &&
	   assoc_rsp->statusCode &&
	    assoc_rsp->rssi_assoc_rej.present)
	    assoc_rsp->rssi_assoc_rej.present) {
		struct sir_rssi_disallow_lst ap_info = {{0}};

		ap_info.retry_delay = assoc_rsp->rssi_assoc_rej.retry_delay *
							QDF_MC_TIMER_TO_MS_UNIT;
		qdf_mem_copy(ap_info.bssid.bytes, hdr->sa, QDF_MAC_ADDR_SIZE);
		ap_info.expected_rssi = assoc_rsp->rssi_assoc_rej.delta_rssi +
					WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info);
		lim_assoc_rej_add_to_rssi_based_reject_list(mac_ctx,
		lim_assoc_rej_add_to_rssi_based_reject_list(mac_ctx,
			&assoc_rsp->rssi_assoc_rej, hdr->sa,
							    &ap_info);
			WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info));
	}

	if (assoc_rsp->statusCode != eSIR_MAC_SUCCESS_STATUS) {
	if (assoc_rsp->statusCode != eSIR_MAC_SUCCESS_STATUS
#ifdef WLAN_FEATURE_11W
		&& (!session_entry->limRmfEnabled ||
			assoc_rsp->statusCode != eSIR_MAC_TRY_AGAIN_LATER)
#endif
	    ) {
		/*
		/*
		 *Re/Association response was received
		 *Re/Association response was received
		 * either with failure code.
		 * either with failure code.
@@ -779,63 +824,6 @@ lim_process_assoc_rsp_frame(tpAniSirGlobal mac_ctx,
	 * NOTE: for BTAMP case, it is being handled in
	 * NOTE: for BTAMP case, it is being handled in
	 * lim_process_mlm_assoc_req
	 * lim_process_mlm_assoc_req
	 */
	 */
#ifdef WLAN_FEATURE_11W
	if (session_entry->limRmfEnabled &&
		assoc_rsp->statusCode == eSIR_MAC_TRY_AGAIN_LATER) {
		if (assoc_rsp->TimeoutInterval.present &&
		(assoc_rsp->TimeoutInterval.timeoutType ==
			SIR_MAC_TI_TYPE_ASSOC_COMEBACK)) {
			uint16_t timeout_value =
				assoc_rsp->TimeoutInterval.timeoutValue;
			if (timeout_value < 10) {
				/*
				 * if this value is less than 10 then our timer
				 * will fail to start and due to this we will
				 * never re-attempt. Better modify the timer
				 * value here.
				 */
				timeout_value = 10;
			}
			pe_debug("ASSOC res with eSIR_MAC_TRY_AGAIN_LATER recvd.Starting timer to wait timeout: %d",
				timeout_value);
			if (QDF_STATUS_SUCCESS !=
				qdf_mc_timer_start(
					&session_entry->pmfComebackTimer,
					timeout_value)) {
				pe_err("Failed to start comeback timer");

				assoc_cnf.resultCode = eSIR_SME_ASSOC_REFUSED;
				assoc_cnf.protStatusCode =
					eSIR_MAC_UNSPEC_FAILURE_STATUS;

				/*
				 * Delete Pre-auth context for the
				 * associated BSS
				 */
				if (lim_search_pre_auth_list(mac_ctx, hdr->sa))
					lim_delete_pre_auth_node(mac_ctx,
						hdr->sa);

				goto assocReject;
			}
		} else {
			pe_warn("ASSOC resp with try again event recvd, but try again time interval IE is wrong");

			assoc_cnf.resultCode = eSIR_SME_ASSOC_REFUSED;
			assoc_cnf.protStatusCode =
				eSIR_MAC_UNSPEC_FAILURE_STATUS;

			/* Delete Pre-auth context for the associated BSS */
			if (lim_search_pre_auth_list(mac_ctx, hdr->sa))
				lim_delete_pre_auth_node(mac_ctx, hdr->sa);

			goto assocReject;
		}
		qdf_mem_free(beacon);
		qdf_mem_free(assoc_rsp);
		return;
	}
#endif
	if (!lim_is_roam_synch_in_progress(session_entry)) {
	if (!lim_is_roam_synch_in_progress(session_entry)) {
		if (lim_set_link_state
		if (lim_set_link_state
			(mac_ctx, eSIR_LINK_POSTASSOC_STATE,
			(mac_ctx, eSIR_LINK_POSTASSOC_STATE,
+0 −13
Original line number Original line Diff line number Diff line
@@ -1244,19 +1244,6 @@ static void lim_process_mlm_assoc_req(tpAniSirGlobal mac_ctx, uint32_t *msg_buf)
	/* map the session entry pointer to the AssocFailureTimer */
	/* map the session entry pointer to the AssocFailureTimer */
	mac_ctx->lim.limTimers.gLimAssocFailureTimer.sessionId =
	mac_ctx->lim.limTimers.gLimAssocFailureTimer.sessionId =
		mlm_assoc_req->sessionId;
		mlm_assoc_req->sessionId;
#ifdef WLAN_FEATURE_11W
	/*
	 * Store current MLM state in case ASSOC response returns with
	 * TRY_AGAIN_LATER return code.
	 */
	if (session_entry->limRmfEnabled) {
		session_entry->pmfComebackTimerInfo.limPrevMlmState =
			session_entry->limPrevMlmState;
		session_entry->pmfComebackTimerInfo.limMlmState =
			session_entry->limMlmState;
	}
#endif /* WLAN_FEATURE_11W */

	session_entry->limPrevMlmState = session_entry->limMlmState;
	session_entry->limPrevMlmState = session_entry->limMlmState;
	session_entry->limMlmState = eLIM_MLM_WT_ASSOC_RSP_STATE;
	session_entry->limMlmState = eLIM_MLM_WT_ASSOC_RSP_STATE;
	MTRACE(mac_trace(mac_ctx, TRACE_CODE_MLM_STATE,
	MTRACE(mac_trace(mac_ctx, TRACE_CODE_MLM_STATE,
+0 −24
Original line number Original line Diff line number Diff line
@@ -433,30 +433,6 @@ static void lim_send_mlm_assoc_req(tpAniSirGlobal mac_ctx,
		(uint32_t *) assoc_req);
		(uint32_t *) assoc_req);
}
}


#ifdef WLAN_FEATURE_11W
/**
 * lim_pmf_comeback_timer_callback() -PMF callback handler
 * @context: Timer context
 *
 * This function is called to processes the PMF comeback
 * callback
 *
 * Return: None
 */
void lim_pmf_comeback_timer_callback(void *context)
{
	tComebackTimerInfo *info = (tComebackTimerInfo *) context;
	tpAniSirGlobal mac_ctx = info->pMac;
	tpPESession psessionEntry = &mac_ctx->lim.gpSession[info->sessionID];

	pe_err("comeback later timer expired. sending MLM ASSOC req");
	/* set MLM state such that ASSOC REQ packet will be sent out */
	psessionEntry->limPrevMlmState = info->limPrevMlmState;
	psessionEntry->limMlmState = info->limMlmState;
	lim_send_mlm_assoc_req(mac_ctx, psessionEntry);
}
#endif /* WLAN_FEATURE_11W */

/**
/**
 * lim_process_mlm_auth_cnf()-Process Auth confirmation
 * lim_process_mlm_auth_cnf()-Process Auth confirmation
 * @mac_ctx:  Pointer to Global MAC structure
 * @mac_ctx:  Pointer to Global MAC structure
Loading