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

Commit 626f8655 authored by Abhinav Kumar's avatar Abhinav Kumar
Browse files

wlan: Add SAE auth timer

propagation from qcacld-3.0 to prima

Add changes related to SAE auth timer to handle SAE authentication.
Start SAE auth timer of duration LIM_AUTH_SAE_TIMER_MS when driver
wants to trigger SAE authentication. If SAE authentication is not
completed in LIM_AUTH_SAE_TIMER_MS, then report failure to
supplicant.

Change-Id: I09bc0e365b9e5e352d927972ba31e3ca4d0cf493
CRs-Fixed: 2533723
parent d5eacfa2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -244,6 +244,8 @@ typedef struct sLimTimers
     */
    TX_TIMER           gLimActiveToPassiveChannelTimer;
    TX_TIMER           g_lim_ap_ecsa_timer;
    /* SAE authentication related timer */
    TX_TIMER           sae_auth_timer;
//********************TIMER SECTION ENDS**************************************************
// ALL THE FIELDS BELOW THIS CAN BE ZEROED OUT in limInitialize
//****************************************************************************************
+1 −0
Original line number Diff line number Diff line
@@ -927,6 +927,7 @@ struct sir_mgmt_msg {
#define SIR_LIM_REASSOC_MBB_RSP_TIMEOUT   (SIR_LIM_TIMEOUT_MSG_START + 0x2A)
#endif

#define SIR_LIM_AUTH_SAE_TIMEOUT            (SIR_LIM_TIMEOUT_MSG_START + 0x2B)
#define SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE (SIR_LIM_TIMEOUT_MSG_START + 0x2C)
#define SIR_LIM_AUTH_RETRY_TIMEOUT            (SIR_LIM_TIMEOUT_MSG_START + 0x2D)
#define SIR_LIM_SAP_ECSA_TIMEOUT            (SIR_LIM_TIMEOUT_MSG_START + 0x2E)
+1 −0
Original line number Diff line number Diff line
@@ -2028,6 +2028,7 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
#ifdef WLAN_FEATURE_LFR_MBB
        case SIR_LIM_PREAUTH_MBB_RSP_TIMEOUT:
        case SIR_LIM_REASSOC_MBB_RSP_TIMEOUT:
        case SIR_LIM_AUTH_SAE_TIMEOUT:
#endif
            // These timeout messages are handled by MLM sub module

+56 −1
Original line number Diff line number Diff line
@@ -100,6 +100,49 @@ limSetChannel(tpAniSirGlobal pMac, tANI_U8 channel, tANI_U8 secChannelOffset, tP
#define IS_MLM_SCAN_REQ_BACKGROUND_SCAN_AGGRESSIVE(pMac)    (pMac->lim.gpLimMlmScanReq->backgroundScanMode == eSIR_AGGRESSIVE_BACKGROUND_SCAN)
#define IS_MLM_SCAN_REQ_BACKGROUND_SCAN_NORMAL(pMac)        (pMac->lim.gpLimMlmScanReq->backgroundScanMode == eSIR_NORMAL_BACKGROUND_SCAN)

 /**
 * 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(tpAniSirGlobal mac_ctx)
{
    tpPESession session;

    session = peFindSessionBySessionId(mac_ctx,
                            mac_ctx->lim.limTimers.sae_auth_timer.sessionId);
    if (session == NULL) {
        limLog(mac_ctx, LOGE,
               FL("Session does not exist for given session id"));
        return;
    }

    limLog(mac_ctx, LOG1,
           FL("SAE auth timeout sessionid %d mlmstate %X SmeState %X"),
           session->peSessionId, session->limMlmState, session->limSmeState);

    switch (session->limMlmState) {
    case eLIM_MLM_WT_SAE_AUTH_STATE:
        /*
         * SAE authentication is not completed. Restore from
         * auth state.
         */
        if (session->pePersona == VOS_STA_MODE)
            limRestoreFromAuthState(mac_ctx, eSIR_SME_AUTH_TIMEOUT_RESULT_CODE,
                                    eSIR_MAC_UNSPEC_FAILURE_REASON, session);
        break;
    default:
        /* SAE authentication is timed out in unexpected state */
        limLog(mac_ctx, LOGE,
               FL("received unexpected SAE auth timeout in state %X"),
                  session->limMlmState);
        limPrintMlmState(mac_ctx, LOGE, session->limMlmState);
	break;
     }
}

/**
 * limProcessMlmReqMessages()
 *
@@ -180,6 +223,9 @@ limProcessMlmReqMessages(tpAniSirGlobal pMac, tpSirMsgQ Msg)
        case LIM_MLM_ADDBA_REQ:             limProcessMlmAddBAReq( pMac, Msg->bodyptr ); break;
        case LIM_MLM_ADDBA_RSP:             limProcessMlmAddBARsp( pMac, Msg->bodyptr ); break;
        case LIM_MLM_DELBA_REQ:             limProcessMlmDelBAReq( pMac, Msg->bodyptr ); break;
        case SIR_LIM_AUTH_SAE_TIMEOUT:
            lim_process_sae_auth_timeout(pMac);
            break;
        case LIM_MLM_TSPEC_REQ:                 
        default:
            break;
@@ -2506,7 +2552,7 @@ static VOS_STATUS lim_process_mlm_auth_req_sae(tpAniSirGlobal mac_ctx,

        if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg))
        {
                limLog(mac_ctx, LOGE, "%s failed to post msg to self ",
                limLog(mac_ctx, LOGE, FL("%s failed to post msg to self "),
                       __func__);
                vos_mem_free((void *)sae_info);
                status = VOS_STATUS_E_FAILURE;
@@ -2517,6 +2563,15 @@ static VOS_STATUS lim_process_mlm_auth_req_sae(tpAniSirGlobal mac_ctx,
        MTRACE(macTrace(mac_ctx, TRACE_CODE_MLM_STATE, session->peSessionId,
                        session->limMlmState));

        mac_ctx->lim.limTimers.sae_auth_timer.sessionId = session->peSessionId;
        /* Activate SAE auth timer */
        MTRACE(macTrace(mac_ctx, TRACE_CODE_TIMER_ACTIVATE,
                        session->peSessionId, eLIM_AUTH_SAE_TIMER));
        if (tx_timer_activate(&mac_ctx->lim.limTimers.sae_auth_timer)
            != TX_SUCCESS) {
            limLog(mac_ctx, LOGE, FL("could not start Auth SAE timer"));
        }

        return status;
}
#else
+34 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2017, 2019 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
@@ -56,6 +56,11 @@
#define LIM_JOIN_PROBE_REQ_TIMER_MS              200
#define LIM_AUTH_RETRY_TIMER_MS              60

/*
 * SAE auth timer of 5secs. This is required for duration of entire SAE
 * authentication.
 */
#define LIM_AUTH_SAE_TIMER_MS 5000

//default beacon interval value used in HB timer interval calculation
#define LIM_HB_TIMER_BEACON_INTERVAL             100
@@ -431,6 +436,18 @@ limCreateTimers(tpAniSirGlobal pMac)
            goto err_timer;
        }

       /*
        * SAE auth timer of 5secs. This is required for duration of entire SAE
        * authentication.
        */
       if ((tx_timer_create(&pMac->lim.limTimers.sae_auth_timer,
             "SAE AUTH Timer", limTimerHandler, SIR_LIM_AUTH_SAE_TIMEOUT,
             SYS_MS_TO_TICKS(LIM_AUTH_SAE_TIMER_MS), 0, TX_NO_ACTIVATE)) !=
             TX_SUCCESS) {
           limLog(pMac, LOGP, FL("could not create SAE AUTH Timer"));
           goto err_timer;
       }

        if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
                      &cfgValue) != eSIR_SUCCESS)
        {
@@ -784,6 +801,7 @@ limCreateTimers(tpAniSirGlobal pMac)
        tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer);
        tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer);
        tx_timer_delete(&pMac->lim.limTimers.g_lim_ap_ecsa_timer);
        tx_timer_delete(&pMac->lim.limTimers.sae_auth_timer);

        if(NULL != pMac->lim.gLimPreAuthTimerTable.pTable)
        {
@@ -1935,6 +1953,21 @@ limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId)
                limLog(pMac, LOGE, FL("Unable to change g_lim_ap_ecsa_timer timer"));
        }

    case eLIM_AUTH_SAE_TIMER:
        if (tx_timer_deactivate(&pMac->lim.limTimers.sae_auth_timer)
            != TX_SUCCESS) {
            limLog(pMac, LOGP, FL("Unable to deactivate SAE auth timer"));
            return;
        }
        /* Change timer to reactivate it in future */
        val = SYS_MS_TO_TICKS(LIM_AUTH_SAE_TIMER_MS);
        if (tx_timer_change(&pMac->lim.limTimers.sae_auth_timer,
            val, 0) != TX_SUCCESS) {
            limLog(pMac, LOGP, FL("unable to change SAE auth timer"));
            return;
        }
        break;

        break;
     default:
            // Invalid timerId. Log error
Loading