mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
qcacld-3.0: Add changes to trigger SAE in supplicant
Add following changes as part of this
1. Add framework to trigger SAE using cfg80211
2. Add changes to send sae info from LIM to HDD layer.
Change-Id: Ia87088dc46ea3f75d05f42e20594dd79a97aff11
CRs-Fixed: 2029357
This commit is contained in:
parent
3e47c63ff2
commit
b38ab51a09
8 changed files with 169 additions and 3 deletions
|
|
@ -7698,4 +7698,20 @@ struct sir_limit_off_chan {
|
|||
uint32_t rest_time;
|
||||
bool skip_dfs_chans;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sae_info - SAE info used for commit/confirm messages
|
||||
* @msg_type: Message type
|
||||
* @msg_len: length of message
|
||||
* @vdev_id: vdev id
|
||||
* @peer_mac_addr: peer MAC address
|
||||
* @ssid: SSID
|
||||
*/
|
||||
struct sir_sae_info {
|
||||
uint16_t msg_type;
|
||||
uint16_t msg_len;
|
||||
uint32_t vdev_id;
|
||||
struct qdf_mac_addr peer_mac_addr;
|
||||
tSirMacSSid ssid;
|
||||
};
|
||||
#endif /* __SIR_API_H */
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
|
|
@ -246,6 +246,7 @@ enum eWniMsgTypes {
|
|||
eWNI_SME_UPDATE_CONFIG,
|
||||
eWNI_SME_BT_ACTIVITY_INFO_IND,
|
||||
eWNI_SME_SET_HE_BSS_COLOR,
|
||||
eWNI_SME_TRIGGER_SAE,
|
||||
eWNI_SME_MSG_TYPES_END
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
|
|
@ -166,6 +166,7 @@ typedef enum eLimMlmStates {
|
|||
eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE,
|
||||
eLIM_MLM_WT_FT_REASSOC_RSP_STATE,
|
||||
eLIM_MLM_P2P_LISTEN_STATE,
|
||||
eLIM_MLM_WT_SAE_AUTH_STATE,
|
||||
} tLimMlmStates;
|
||||
|
||||
/* 11h channel quiet states */
|
||||
|
|
|
|||
|
|
@ -1015,6 +1015,75 @@ static bool lim_is_preauth_ctx_exists(tpAniSirGlobal mac_ctx,
|
|||
return fl;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_SAE
|
||||
/**
|
||||
* lim_process_mlm_auth_req_sae() - Handle SAE authentication
|
||||
* @mac_ctx: global MAC context
|
||||
* @session: PE session entry
|
||||
*
|
||||
* This function is called by lim_process_mlm_auth_req to handle SAE
|
||||
* authentication.
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS lim_process_mlm_auth_req_sae(tpAniSirGlobal mac_ctx,
|
||||
tpPESession session)
|
||||
{
|
||||
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
|
||||
struct sir_sae_info *sae_info;
|
||||
struct scheduler_msg msg = {0};
|
||||
|
||||
sae_info = qdf_mem_malloc(sizeof(*sae_info));
|
||||
if (sae_info == NULL) {
|
||||
pe_err("Memory allocation failed");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
sae_info->msg_type = eWNI_SME_TRIGGER_SAE;
|
||||
sae_info->msg_len = sizeof(*sae_info);
|
||||
sae_info->vdev_id = session->smeSessionId;
|
||||
|
||||
qdf_mem_copy(sae_info->peer_mac_addr.bytes,
|
||||
session->bssId,
|
||||
QDF_MAC_ADDR_SIZE);
|
||||
|
||||
sae_info->ssid.length = session->ssId.length;
|
||||
qdf_mem_copy(sae_info->ssid.ssId,
|
||||
session->ssId.ssId,
|
||||
session->ssId.length);
|
||||
|
||||
pe_debug("vdev_id %d ssid %.*s "MAC_ADDRESS_STR"",
|
||||
sae_info->vdev_id,
|
||||
sae_info->ssid.length,
|
||||
sae_info->ssid.ssId,
|
||||
MAC_ADDR_ARRAY(sae_info->peer_mac_addr.bytes));
|
||||
|
||||
msg.type = eWNI_SME_TRIGGER_SAE;
|
||||
msg.bodyptr = sae_info;
|
||||
msg.bodyval = 0;
|
||||
|
||||
qdf_status = mac_ctx->lim.sme_msg_callback(mac_ctx, &msg);
|
||||
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
|
||||
pe_err("SAE failed for AUTH frame");
|
||||
qdf_mem_free(sae_info);
|
||||
return qdf_status;
|
||||
}
|
||||
session->limMlmState = eLIM_MLM_WT_SAE_AUTH_STATE;
|
||||
|
||||
MTRACE(mac_trace(mac_ctx, TRACE_CODE_MLM_STATE, session->peSessionId,
|
||||
session->limMlmState));
|
||||
|
||||
return qdf_status;
|
||||
}
|
||||
#else
|
||||
static QDF_STATUS lim_process_mlm_auth_req_sae(tpAniSirGlobal mac_ctx,
|
||||
tpPESession session)
|
||||
{
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* lim_process_mlm_auth_req() - process lim auth request
|
||||
*
|
||||
|
|
@ -1102,7 +1171,19 @@ static void lim_process_mlm_auth_req(tpAniSirGlobal mac_ctx, uint32_t *msg)
|
|||
mac_ctx->lim.gpLimMlmAuthReq->peerMacAddr);
|
||||
|
||||
session->limPrevMlmState = session->limMlmState;
|
||||
session->limMlmState = eLIM_MLM_WT_AUTH_FRAME2_STATE;
|
||||
|
||||
if (mac_ctx->lim.gpLimMlmAuthReq->authType == eSIR_AUTH_TYPE_SAE) {
|
||||
if (lim_process_mlm_auth_req_sae(mac_ctx, session) !=
|
||||
QDF_STATUS_SUCCESS) {
|
||||
mlm_auth_cnf.resultCode = eSIR_SME_INVALID_PARAMETERS;
|
||||
goto end;
|
||||
} else {
|
||||
pe_debug("lim_process_mlm_auth_req_sae is successful");
|
||||
return;
|
||||
}
|
||||
} else
|
||||
session->limMlmState = eLIM_MLM_WT_AUTH_FRAME2_STATE;
|
||||
|
||||
MTRACE(mac_trace(mac_ctx, TRACE_CODE_MLM_STATE, session->peSessionId,
|
||||
session->limMlmState));
|
||||
|
||||
|
|
|
|||
|
|
@ -401,6 +401,7 @@ uint8_t *mac_trace_get_sme_msg_string(uint16_t sme_msg)
|
|||
CASE_RETURN_STRING(eWNI_SME_GET_PEER_INFO_IND);
|
||||
CASE_RETURN_STRING(eWNI_SME_GET_PEER_INFO_EXT_IND);
|
||||
CASE_RETURN_STRING(eWNI_SME_RSO_CMD_STATUS_IND);
|
||||
CASE_RETURN_STRING(eWNI_SME_TRIGGER_SAE);
|
||||
CASE_RETURN_STRING(eWNI_SME_MSG_TYPES_END);
|
||||
default:
|
||||
return (uint8_t *) "UNKNOWN";
|
||||
|
|
|
|||
|
|
@ -535,6 +535,7 @@ typedef enum {
|
|||
eCSR_ROAM_NAPI_OFF,
|
||||
eCSR_ROAM_CHANNEL_COMPLETE_IND,
|
||||
eCSR_ROAM_CAC_COMPLETE_IND,
|
||||
eCSR_ROAM_SAE_COMPUTE,
|
||||
} eRoamCmdStatus;
|
||||
|
||||
/* comment inside indicates what roaming callback gets */
|
||||
|
|
@ -1533,6 +1534,9 @@ struct csr_roam_info {
|
|||
int rssi;
|
||||
int tx_rate;
|
||||
int rx_rate;
|
||||
#ifdef WLAN_FEATURE_SAE
|
||||
struct sir_sae_info *sae_info;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct tagCsrFreqScanInfo {
|
||||
|
|
|
|||
|
|
@ -115,6 +115,61 @@
|
|||
/* Static Type declarations */
|
||||
static struct csr_roam_session csr_roam_roam_session[CSR_ROAM_SESSION_MAX];
|
||||
|
||||
#ifdef WLAN_FEATURE_SAE
|
||||
/**
|
||||
* csr_sae_callback - Update SAE info to CSR roam session
|
||||
* @mac_ctx: MAC context
|
||||
* @msg_ptr: pointer to SAE message
|
||||
*
|
||||
* API to update SAE info to roam csr session
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS csr_sae_callback(tpAniSirGlobal mac_ctx,
|
||||
tSirSmeRsp *msg_ptr)
|
||||
{
|
||||
struct csr_roam_info *roam_info;
|
||||
uint32_t session_id;
|
||||
struct sir_sae_info *sae_info;
|
||||
|
||||
sae_info = (struct sir_sae_info *) msg_ptr;
|
||||
if (!sae_info) {
|
||||
sme_err("SAE info is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
sme_debug("vdev_id %d "MAC_ADDRESS_STR"",
|
||||
sae_info->vdev_id,
|
||||
MAC_ADDR_ARRAY(sae_info->peer_mac_addr.bytes));
|
||||
|
||||
session_id = sae_info->vdev_id;
|
||||
if (session_id == CSR_SESSION_ID_INVALID)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
roam_info = qdf_mem_malloc(sizeof(*roam_info));
|
||||
if (!roam_info) {
|
||||
sme_err("qdf_mem_malloc failed for SAE");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
roam_info->sae_info = sae_info;
|
||||
|
||||
csr_roam_call_callback(mac_ctx, session_id, roam_info,
|
||||
0, eCSR_ROAM_SAE_COMPUTE,
|
||||
eCSR_ROAM_RESULT_NONE);
|
||||
qdf_mem_free(roam_info);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#else
|
||||
static inline QDF_STATUS csr_sae_callback(tpAniSirGlobal mac_ctx,
|
||||
tSirSmeRsp *msg_ptr)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
|
||||
int diag_auth_type_from_csr_type(eCsrAuthType authType)
|
||||
{
|
||||
|
|
@ -10296,6 +10351,11 @@ void csr_roaming_state_msg_processor(tpAniSirGlobal pMac, void *pMsgBuf)
|
|||
sme_err("pGetRssiReq->rssiCallback is NULL");
|
||||
}
|
||||
break;
|
||||
case eWNI_SME_TRIGGER_SAE:
|
||||
sme_debug("Invoke SAE callback");
|
||||
csr_sae_callback(pMac, pSmeRsp);
|
||||
break;
|
||||
|
||||
default:
|
||||
sme_debug("Unexpected message type: %d[0x%X] received in substate %s",
|
||||
pSmeRsp->messageType, pSmeRsp->messageType,
|
||||
|
|
@ -12305,6 +12365,7 @@ void csr_roam_check_for_link_status_change(tpAniSirGlobal pMac,
|
|||
sme_debug("Handoff Req from self");
|
||||
csr_neighbor_roam_handoff_req_hdlr(pMac, pSirMsg);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
} /* end switch on message type */
|
||||
|
|
|
|||
|
|
@ -302,6 +302,7 @@ const char *get_e_roam_cmd_status_str(eRoamCmdStatus val)
|
|||
CASE_RETURN_STR(eCSR_ROAM_ABORT);
|
||||
CASE_RETURN_STR(eCSR_ROAM_NAPI_OFF);
|
||||
CASE_RETURN_STR(eCSR_ROAM_CHANNEL_COMPLETE_IND);
|
||||
CASE_RETURN_STR(eCSR_ROAM_SAE_COMPUTE);
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue