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

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

wlan: Add changes to handle SAE status

propagation from qcacld-3.0 to prima.

After SAE auth completion, supplicant informs status to driver.
Add changes to handle SAE status that comes through vendor
command QCA_NL80211_VENDOR_SUBCMD_EXTERNAL_AUTH using attribute
QCA_ATTR_EXTERNAL_AUTH_STATUS.

Change-Id: I474cfe9ea049e684837133479f8b6697fef1f189
CRs-Fixed: 2531077
parent 626f8655
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -6465,4 +6465,17 @@ struct sir_sae_info {
    tSirMacSSid ssid;
};

/**
 * struct sir_sae_msg - SAE msg used for message posting
 * @message_type: message type
 * @length: message length
 * @session_id: SME session id
 * @sae_status: SAE status, 0: Success, Non-zero: Failure.
 */
struct sir_sae_msg {
    uint16_t message_type;
    uint16_t length;
    uint16_t session_id;
    uint8_t sae_status;
};
#endif /* __SIR_API_H */
+1 −0
Original line number Diff line number Diff line
@@ -403,6 +403,7 @@ enum eWniMsgTypes
    eWNI_SME_STA_DEL_BA_REQ,
    eWNI_SME_TRIGGER_SAE,
    eWNI_SME_SEND_MGMT_FRAME_TX,
    eWNI_SME_SEND_SAE_MSG,
    eWNI_SME_MSG_TYPES_END
};

+67 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@
#include "vos_types.h"
#include "vos_packet.h"
#include "vos_memory.h"
#include "limSecurityUtils.h"

/* This value corresponds to 500 ms */
#define MAX_PROBEREQ_TIME 50
@@ -92,8 +93,69 @@

#define CHECK_BIT(value, mask)    ((value) & (1 << (mask)))

#define IEEE80211_STATUS_SUCCESS            0

void limLogSessionStates(tpAniSirGlobal pMac);

#ifdef WLAN_FEATURE_SAE
/**
 * lim_process_sae_msg() - Process SAE message
 * @mac: Global MAC pointer
 * @body: Buffer pointer
 *
 * Return: None
 */
static void lim_process_sae_msg(tpAniSirGlobal mac, struct sir_sae_msg *body)
{
    struct sir_sae_msg *sae_msg = body;
    tpPESession session;

    if (!sae_msg) {
        limLog(mac, LOGE, FL("SAE msg is NULL"));
        return;
    }

    session = pe_find_session_by_sme_session_id(mac, sae_msg->session_id);
    if (session == NULL) {
        limLog(mac, LOGE, FL("SAE:Unable to find session"));
        return;
    }

    if (session->pePersona != VOS_STA_MODE) {
        limLog(mac, LOGE, FL("SAE:Not supported in this mode %d"),
               session->pePersona);
        return;
    }

    limLog(mac, LOG1, FL("SAE:status %d limMlmState %d pePersona %d"),
           sae_msg->sae_status, session->limMlmState,
           session->pePersona);
    switch (session->limMlmState) {
    case eLIM_MLM_WT_SAE_AUTH_STATE:
        /* SAE authentication is completed. Restore from auth state */
        if (tx_timer_running(&mac->lim.limTimers.sae_auth_timer))
            limDeactivateAndChangeTimer(mac, eLIM_AUTH_SAE_TIMER);
        /* success */
        if (sae_msg->sae_status == IEEE80211_STATUS_SUCCESS)
            limRestoreFromAuthState(mac, eSIR_SME_SUCCESS,
                                    eSIR_MAC_SUCCESS_STATUS, session);
        else
            limRestoreFromAuthState(mac, eSIR_SME_AUTH_REFUSED,
                                    eSIR_MAC_UNSPEC_FAILURE_STATUS, session);
       break;
    default:
       /* SAE msg is received in unexpected state */
       limLog(mac, LOGE, FL("received SAE msg in state %X"),
              session->limMlmState);
       limPrintMlmState(mac, LOGE, session->limMlmState);
       break;
    }
}
#else
static void lim_process_sae_msg(tpAniSirGlobal mac, struct sir_sae_msg *body)
{}
#endif

/** -------------------------------------------------------------
\fn defMsgDecision
\brief The function decides whether to defer a message or not in limProcessMessage function
@@ -2560,6 +2622,11 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
    case eWNI_SME_STA_DEL_BA_REQ:
        limStaDelBASession(pMac);
        break;
    case eWNI_SME_SEND_SAE_MSG:
        lim_process_sae_msg(pMac, limMsg->bodyptr);
        vos_mem_free((v_VOID_t*)limMsg->bodyptr);
        limMsg->bodyptr = NULL;
        break;
    default:
        vos_mem_free((v_VOID_t*)limMsg->bodyptr);
        limMsg->bodyptr = NULL;
+8 −4
Original line number Diff line number Diff line
@@ -518,9 +518,13 @@ limRestoreFromAuthState(tpAniSirGlobal pMac, tSirResultCodes resultCode, tANI_U1
     * retry is needed also cancel the auth rety timer
     */
    pMac->authAckStatus = LIM_AUTH_ACK_RCD_SUCCESS;
    // 'Change' timer for future activations
    /* Auth retry and AUth failure timers are not started for SAE
     * Change' timer for future activations
     */
    if (tx_timer_running(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer))
        limDeactivateAndChangeTimer(pMac, eLIM_AUTH_RETRY_TIMER);
    // 'Change' timer for future activations
    /* Change' timer for future activations */
    if (tx_timer_running(&pMac->lim.limTimers.gLimAuthFailureTimer))
        limDeactivateAndChangeTimer(pMac, eLIM_AUTH_FAIL_TIMER);

    #if 0
+19 −0
Original line number Diff line number Diff line
@@ -4127,4 +4127,23 @@ VOS_STATUS sme_process_msg_callback(tHalHandle hal, vos_msg_t *msg);
eHalStatus sme_send_mgmt_tx(tHalHandle hal, uint8_t session_id,
                                const uint8_t *buf, uint32_t len);

#ifdef WLAN_FEATURE_SAE
/**
 * sme_handle_sae_msg() - Sends SAE message received from supplicant
 * @hal: The handle returned by mac_open
 * @session_id: session id
 * @sae_status: status of SAE authentication
 *
 * Return: HAL_STATUS
 */
eHalStatus sme_handle_sae_msg(tHalHandle hal, uint8_t session_id,
                              uint8_t sae_status);
#else
static inline eHalStatus sme_handle_sae_msg(tHalHandle hal, uint8_t session_id,
                                            uint8_t sae_status)
{
	return eHAL_STATUS_SUCCESS;
}
#endif

#endif //#if !defined( __SME_API_H )
Loading