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

Commit 2469b2bb authored by sheenam monga's avatar sheenam monga Committed by Sheenam Monga
Browse files

qcacld-3.0: Abort MLME connect timers upon NB disconnect request

When the connect request is pending on MLME and NB disconnect comes,
driver will wait for previous connect finish to process the disconnect
request. This delay the disconnect and may cause framework ANR.
Add code to fire the timeout event of active timers in various MLME
state. This will abort the connect request and get disconnect done fast.

Change-Id: I19cc03108c966c8f1efc0a554dfc59123dfe37f1
CRs-Fixed: 3026311
parent 09446aaf
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 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
@@ -247,7 +248,8 @@ enum eWniMsgTypes {
				SIR_SME_MSG_TYPES_BEGIN + 161,
	eWNI_SME_MONITOR_MODE_VDEV_UP = SIR_SME_MSG_TYPES_BEGIN + 162,
	eWNI_SME_UPDATE_SESSION_EDCA_TXQ_PARAMS = SIR_SME_MSG_TYPES_BEGIN + 163,
	eWNI_SME_MSG_TYPES_END = SIR_SME_MSG_TYPES_BEGIN + 164
	eWNI_SME_ABORT_CONN_TIMER = SIR_SME_MSG_TYPES_BEGIN + 164,
	eWNI_SME_MSG_TYPES_END = SIR_SME_MSG_TYPES_BEGIN + 165
};

typedef struct sAniCfgTxRateCtrs {
+4 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 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
@@ -2130,6 +2131,9 @@ static void lim_process_messages(struct mac_context *mac_ctx,
		break;
	case SIR_LIM_PROCESS_DEFERRED_QUEUE:
		break;
	case eWNI_SME_ABORT_CONN_TIMER:
		lim_deactivate_timers_for_vdev(mac_ctx, msg->bodyval);
		break;
	default:
		qdf_mem_free((void *)msg->bodyptr);
		msg->bodyptr = NULL;
+2 −8
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 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
@@ -88,14 +89,7 @@ static void lim_fill_status_code(uint8_t frame_type,
	}
}

/**
 * lim_process_sae_auth_timeout() - This function is called to process sae
 * auth timeout
 * @mac_ctx: Pointer to Global MAC structure
 *
 * @Return: None
 */
static void lim_process_sae_auth_timeout(struct mac_context *mac_ctx)
void lim_process_sae_auth_timeout(struct mac_context *mac_ctx)
{
	struct pe_session *session;
	enum wlan_status_code proto_status_code;
+10 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 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
@@ -1241,6 +1242,15 @@ void lim_process_auth_failure_timeout(struct mac_context *mac_ctx);
void lim_process_assoc_failure_timeout(struct mac_context *mac_ctx,
				       uint32_t msg_type);

/**
 * lim_process_sae_auth_timeout() - This function is called to process sae
 * auth timeout
 * @mac_ctx: Pointer to Global MAC structure
 *
 * @Return: None
 */
void lim_process_sae_auth_timeout(struct mac_context *mac_ctx);

/**
 * lim_send_frame() - API to send frame
 * @mac_ctx Pointer to Global MAC structure
+62 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 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
@@ -553,6 +554,67 @@ void lim_deactivate_timers(struct mac_context *mac_ctx)
	tx_timer_deactivate(&lim_timer->sae_auth_timer);
}

void lim_deactivate_timers_for_vdev(struct mac_context *mac_ctx,
				    uint8_t vdev_id)
{
	tLimTimers *lim_timer = &mac_ctx->lim.lim_timers;
	struct pe_session *pe_session;

	pe_session = pe_find_session_by_vdev_id(mac_ctx, vdev_id);
	if (!pe_session) {
		pe_err("pe session invalid for vdev %d", vdev_id);
		return;
	}
	pe_debug("pe limMlmState %s vdev %d",
		 lim_mlm_state_str(pe_session->limMlmState),
		 vdev_id);
	switch (pe_session->limMlmState) {
	case eLIM_MLM_WT_JOIN_BEACON_STATE:
		if (tx_timer_running(
				&lim_timer->gLimJoinFailureTimer)) {
			pe_debug("Trigger Join failure timeout for vdev %d",
				 vdev_id);
			tx_timer_deactivate(
				&lim_timer->gLimJoinFailureTimer);
			lim_process_join_failure_timeout(mac_ctx);
		}
		break;
	case eLIM_MLM_WT_AUTH_FRAME2_STATE:
	case eLIM_MLM_WT_AUTH_FRAME4_STATE:
		if (tx_timer_running(
				&lim_timer->gLimAuthFailureTimer)) {
			pe_debug("Trigger Auth failure timeout for vdev %d",
				 vdev_id);
			tx_timer_deactivate(
				&lim_timer->gLimAuthFailureTimer);
			lim_process_auth_failure_timeout(mac_ctx);
		}
		break;
	case eLIM_MLM_WT_ASSOC_RSP_STATE:
		if (tx_timer_running(
				&lim_timer->gLimAssocFailureTimer)) {
			pe_debug("Trigger Assoc failure timeout for vdev %d",
				 vdev_id);
			tx_timer_deactivate(
				&lim_timer->gLimAssocFailureTimer);
			lim_process_assoc_failure_timeout(mac_ctx,
							  LIM_ASSOC);
		}
		break;
	case eLIM_MLM_WT_SAE_AUTH_STATE:
		if (tx_timer_running(&lim_timer->sae_auth_timer)) {
			pe_debug("Trigger SAE Auth failure timeout for vdev %d",
				 vdev_id);
			tx_timer_deactivate(
				&lim_timer->sae_auth_timer);
			lim_process_sae_auth_timeout(mac_ctx);
		}
		break;
	default:
		return;
	}
}


/**
 * lim_cleanup_mlm() - This function is called to cleanup
Loading