diff --git a/core/mac/src/pe/lim/lim_ft_preauth.c b/core/mac/src/pe/lim/lim_ft_preauth.c index 9a4d43e1ae70..b2c5b9ef0ad5 100644 --- a/core/mac/src/pe/lim/lim_ft_preauth.c +++ b/core/mac/src/pe/lim/lim_ft_preauth.c @@ -296,7 +296,7 @@ void lim_perform_ft_pre_auth(tpAniSirGlobal pMac, QDF_STATUS status, lim_send_auth_mgmt_frame(pMac, &authFrame, psessionEntry->ftPEContext.pFTPreAuthReq->preAuthbssId, - LIM_NO_WEP_IN_FC, psessionEntry, false); + LIM_NO_WEP_IN_FC, psessionEntry); return; diff --git a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c index 2bdcea069720..e382633e78d7 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c @@ -863,12 +863,12 @@ lim_process_assoc_rsp_frame(tpAniSirGlobal mac_ctx, lim_update_obss_scanparams(session_entry, &assoc_rsp->obss_scanparams); + lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_ROAM_ASSOC_COMP_EVENT, + session_entry, assoc_rsp->statusCode ? eSIR_FAILURE : + eSIR_SUCCESS, assoc_rsp->statusCode); + if (subtype == LIM_REASSOC) { pe_debug("Successfully Reassociated with BSS"); -#ifdef FEATURE_WLAN_DIAG_SUPPORT - lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_ROAM_ASSOC_COMP_EVENT, - session_entry, eSIR_SUCCESS, eSIR_SUCCESS); -#endif #ifdef FEATURE_WLAN_ESE if (assoc_rsp->tsmPresent) lim_update_ese_tsm(mac_ctx, session_entry, assoc_rsp); diff --git a/core/mac/src/pe/lim/lim_process_auth_frame.c b/core/mac/src/pe/lim/lim_process_auth_frame.c index a2a6b4dceee6..174c7bdb8989 100644 --- a/core/mac/src/pe/lim/lim_process_auth_frame.c +++ b/core/mac/src/pe/lim/lim_process_auth_frame.c @@ -141,7 +141,7 @@ static void lim_process_auth_shared_system_algo(tpAniSirGlobal mac_ctx, lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); return; } else { /* Create entry for this STA in pre-auth list */ @@ -188,7 +188,7 @@ static void lim_process_auth_shared_system_algo(tpAniSirGlobal mac_ctx, lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); lim_delete_pre_auth_node(mac_ctx, mac_hdr->sa); return; } @@ -219,7 +219,7 @@ static void lim_process_auth_shared_system_algo(tpAniSirGlobal mac_ctx, SIR_MAC_AUTH_CHALLENGE_LENGTH); lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); } } @@ -262,7 +262,7 @@ static void lim_process_auth_open_system_algo(tpAniSirGlobal mac_ctx, auth_frame->authStatusCode = eSIR_MAC_SUCCESS_STATUS; lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); } static void lim_process_auth_frame_type1(tpAniSirGlobal mac_ctx, @@ -423,7 +423,7 @@ static void lim_process_auth_frame_type1(tpAniSirGlobal mac_ctx, lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); return; } /* No Pre-auth context exists for the STA. */ @@ -442,7 +442,7 @@ static void lim_process_auth_frame_type1(tpAniSirGlobal mac_ctx, lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); return; } @@ -478,7 +478,7 @@ static void lim_process_auth_frame_type1(tpAniSirGlobal mac_ctx, eSIR_MAC_AUTH_ALGO_NOT_SUPPORTED_STATUS; lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); return; } } else { @@ -501,7 +501,7 @@ static void lim_process_auth_frame_type1(tpAniSirGlobal mac_ctx, lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); return; } } @@ -680,7 +680,7 @@ static void lim_process_auth_frame_type2(tpAniSirGlobal mac_ctx, eSIR_MAC_AUTH_ALGO_NOT_SUPPORTED_STATUS; lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); return; } if (rx_auth_frm_body->type != SIR_MAC_CHALLENGE_TEXT_EID) { @@ -711,7 +711,7 @@ static void lim_process_auth_frame_type2(tpAniSirGlobal mac_ctx, lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); lim_restore_from_auth_state(mac_ctx, eSIR_SME_INVALID_WEP_DEFAULT_KEY, eSIR_MAC_UNSPEC_FAILURE_REASON, @@ -751,7 +751,7 @@ static void lim_process_auth_frame_type2(tpAniSirGlobal mac_ctx, lim_send_auth_mgmt_frame(mac_ctx, (tpSirMacAuthFrameBody)encr_auth_frame, mac_hdr->sa, rx_auth_frm_body->length, - pe_session, false); + pe_session); qdf_mem_free(encr_auth_frame); return; } @@ -782,7 +782,7 @@ static void lim_process_auth_frame_type3(tpAniSirGlobal mac_ctx, eSIR_MAC_AUTH_FRAME_OUT_OF_SEQ_STATUS; lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); return; } @@ -806,7 +806,7 @@ static void lim_process_auth_frame_type3(tpAniSirGlobal mac_ctx, lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); return; } @@ -827,7 +827,7 @@ static void lim_process_auth_frame_type3(tpAniSirGlobal mac_ctx, eSIR_MAC_AUTH_FRAME_OUT_OF_SEQ_STATUS; lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); return; } @@ -848,7 +848,7 @@ static void lim_process_auth_frame_type3(tpAniSirGlobal mac_ctx, lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); /* Delete pre-auth context of STA */ lim_delete_pre_auth_node(mac_ctx, mac_hdr->sa); return; @@ -893,7 +893,7 @@ static void lim_process_auth_frame_type3(tpAniSirGlobal mac_ctx, eSIR_MAC_SUCCESS_STATUS; lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); return; } else { pe_warn("Challenge failure for peer "MAC_ADDRESS_STR, @@ -912,7 +912,7 @@ static void lim_process_auth_frame_type3(tpAniSirGlobal mac_ctx, eSIR_MAC_CHALLENGE_FAILURE_STATUS; lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); return; } } @@ -1192,7 +1192,7 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, GET_LIM_SYSTEM_ROLE(pe_session), mac_hdr->sa); lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); goto free; } @@ -1235,7 +1235,7 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, eSIR_MAC_CHALLENGE_FAILURE_STATUS; lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); goto free; } @@ -1262,7 +1262,7 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, eSIR_MAC_AUTH_FRAME_OUT_OF_SEQ_STATUS; lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); goto free; } /* Change the auth-response timeout */ @@ -1291,7 +1291,7 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); goto free; } @@ -1319,7 +1319,7 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, eSIR_MAC_CHALLENGE_FAILURE_STATUS; lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); goto free; } @@ -1342,7 +1342,7 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, lim_send_auth_mgmt_frame(mac_ctx, auth_frame, mac_hdr->sa, LIM_NO_WEP_IN_FC, - pe_session, false); + pe_session); goto free; } if ((sir_convert_auth_frame2_struct(mac_ctx, plainbody, diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c index c290d0976390..4b6e52a00167 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c @@ -1121,7 +1121,7 @@ static void lim_process_mlm_auth_req(tpAniSirGlobal mac_ctx, uint32_t *msg) mac_ctx->auth_ack_status = LIM_AUTH_ACK_NOT_RCD; lim_send_auth_mgmt_frame(mac_ctx, &auth_frame_body, mac_ctx->lim.gpLimMlmAuthReq->peerMacAddr, - LIM_NO_WEP_IN_FC, session, true); + LIM_NO_WEP_IN_FC, session); /* assign appropriate session_id to the timer object */ mac_ctx->lim.limTimers.gLimAuthFailureTimer.sessionId = session_id; @@ -2301,7 +2301,7 @@ static void lim_process_auth_retry_timer(tpAniSirGlobal mac_ctx) lim_send_auth_mgmt_frame(mac_ctx, &auth_frame, mac_ctx->lim.gpLimMlmAuthReq->peerMacAddr, - LIM_NO_WEP_IN_FC, session_entry, true); + LIM_NO_WEP_IN_FC, session_entry); } lim_deactivate_and_change_timer(mac_ctx, eLIM_AUTH_RETRY_TIMER); diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index 889a561c994a..a67608f3da50 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1598,6 +1598,41 @@ lim_send_delts_req_action_frame(tpAniSirGlobal pMac, } /* End lim_send_delts_req_action_frame. */ +/** + * lim_assoc_tx_complete_cnf()- Confirmation for assoc sent over the air + * @context: pointer to global mac + * @buf: buffer + * @tx_complete : Sent status + * @params; tx completion params + * + * Return: This returns QDF_STATUS + */ + +static QDF_STATUS lim_assoc_tx_complete_cnf(void *context, + qdf_nbuf_t buf, + uint32_t tx_complete, + void *params) +{ + uint16_t assoc_ack_status; + uint16_t reason_code; + tpAniSirGlobal mac_ctx = (tpAniSirGlobal)context; + + pe_debug("tx_complete= %d", tx_complete); + if (tx_complete) { + assoc_ack_status = ACKED; + reason_code = eSIR_SUCCESS; + } else { + assoc_ack_status = NOT_ACKED; + reason_code = eSIR_FAILURE; + } + if (buf) + qdf_nbuf_free(buf); + + lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_ASSOC_ACK_EVENT, + NULL, assoc_ack_status, reason_code); + return QDF_STATUS_SUCCESS; +} + /** * lim_send_assoc_req_mgmt_frame() - Send association request * @mac_ctx: Handle to MAC context @@ -2040,16 +2075,19 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, pe_debug("Sending Association Request length %d to ", bytes); qdf_status = - wma_tx_frame(mac_ctx, packet, + wma_tx_frameWithTxComplete(mac_ctx, packet, (uint16_t) (sizeof(tSirMacMgmtHdr) + payload), TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, 7, - lim_tx_complete, frame, tx_flag, sme_sessionid, 0); + lim_tx_complete, frame, lim_assoc_tx_complete_cnf, + tx_flag, sme_sessionid, false, 0); MTRACE(qdf_trace (QDF_MODULE_ID_PE, TRACE_CODE_TX_COMPLETE, pe_session->peSessionId, qdf_status)); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { pe_err("Failed to send Association Request (%X)!", qdf_status); + lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_ASSOC_ACK_EVENT, + pe_session, SENT_FAIL, eSIR_FAILURE); /* Pkt will be freed up by the callback */ } end: @@ -2076,19 +2114,28 @@ static QDF_STATUS lim_auth_tx_complete_cnf(void *context, void *params) { tpAniSirGlobal mac_ctx = (tpAniSirGlobal)context; + uint16_t auth_ack_status; + uint16_t reason_code; pe_debug("tx_complete= %d", tx_complete); if (tx_complete) { mac_ctx->auth_ack_status = LIM_AUTH_ACK_RCD_SUCCESS; + auth_ack_status = ACKED; + reason_code = eSIR_SUCCESS; /* 'Change' timer for future activations */ lim_deactivate_and_change_timer(mac_ctx, eLIM_AUTH_RETRY_TIMER); } else { mac_ctx->auth_ack_status = LIM_AUTH_ACK_RCD_FAILURE; + auth_ack_status = NOT_ACKED; + reason_code = eSIR_FAILURE; } if (buf) qdf_nbuf_free(buf); + lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_AUTH_ACK_EVENT, + NULL, auth_ack_status, reason_code); + return QDF_STATUS_SUCCESS; } @@ -2111,7 +2158,7 @@ lim_send_auth_mgmt_frame(tpAniSirGlobal mac_ctx, tpSirMacAuthFrameBody auth_frame, tSirMacAddr peer_addr, uint8_t wep_challenge_len, - tpPESession session, bool wait_for_ack) + tpPESession session) { uint8_t *frame, *body; uint32_t frame_len = 0, body_len = 0; @@ -2149,12 +2196,11 @@ lim_send_auth_mgmt_frame(tpAniSirGlobal mac_ctx, goto alloc_packet; } - pe_info("Sending Auth seq# %d status %d (%d) wait_for_ack %d to " + pe_info("Sending Auth seq# %d status %d (%d) to " MAC_ADDRESS_STR, auth_frame->authTransactionSeqNumber, auth_frame->authStatusCode, (auth_frame->authStatusCode == eSIR_MAC_SUCCESS_STATUS), - wait_for_ack, MAC_ADDR_ARRAY(peer_addr)); switch (auth_frame->authTransactionSeqNumber) { @@ -2389,33 +2435,22 @@ alloc_packet: MTRACE(qdf_trace(QDF_MODULE_ID_PE, TRACE_CODE_TX_MGMT, session->peSessionId, mac_hdr->fc.subType)); - if (wait_for_ack) { - mac_ctx->auth_ack_status = LIM_AUTH_ACK_NOT_RCD; - qdf_status = wma_tx_frameWithTxComplete(mac_ctx, packet, - (uint16_t)frame_len, - TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, - 7, lim_tx_complete, frame, - lim_auth_tx_complete_cnf, - tx_flag, sme_sessionid, false, 0); - MTRACE(qdf_trace(QDF_MODULE_ID_PE, TRACE_CODE_TX_COMPLETE, - session->peSessionId, qdf_status)); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - pe_err("*** Could not send Auth frame, retCode=%X ***", - qdf_status); - mac_ctx->auth_ack_status = LIM_AUTH_ACK_RCD_FAILURE; - /* Pkt will be freed up by the callback */ - } - } else { - /* Queue Authentication frame in high priority WQ */ - qdf_status = wma_tx_frame(mac_ctx, packet, (uint16_t) frame_len, - TXRX_FRM_802_11_MGMT, - ANI_TXDIR_TODS, 7, lim_tx_complete, - frame, tx_flag, sme_sessionid, 0); - MTRACE(qdf_trace(QDF_MODULE_ID_PE, TRACE_CODE_TX_COMPLETE, - session->peSessionId, qdf_status)); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) - pe_err("*** Could not send Auth frame, retCode=%X ***", - qdf_status); + mac_ctx->auth_ack_status = LIM_AUTH_ACK_NOT_RCD; + qdf_status = wma_tx_frameWithTxComplete(mac_ctx, packet, + (uint16_t)frame_len, + TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, + 7, lim_tx_complete, frame, + lim_auth_tx_complete_cnf, + tx_flag, sme_sessionid, false, 0); + MTRACE(qdf_trace(QDF_MODULE_ID_PE, TRACE_CODE_TX_COMPLETE, + session->peSessionId, qdf_status)); + if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { + pe_err("*** Could not send Auth frame, retCode=%X ***", + qdf_status); + mac_ctx->auth_ack_status = LIM_AUTH_ACK_RCD_FAILURE; + lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_AUTH_ACK_EVENT, + session, SENT_FAIL, eSIR_FAILURE); + /* Pkt will be freed up by the callback */ } return; } diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index e1b4bea66f5b..bc9f36be8019 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -481,7 +481,7 @@ tSirRetStatus lim_send_probe_req_mgmt_frame(tpAniSirGlobal, tSirMacSSid *, void lim_send_probe_rsp_mgmt_frame(tpAniSirGlobal, tSirMacAddr, tpAniSSID, short, uint8_t, tpPESession, uint8_t); void lim_send_auth_mgmt_frame(tpAniSirGlobal, tSirMacAuthFrameBody *, tSirMacAddr, - uint8_t, tpPESession, bool wait_for_ack); + uint8_t, tpPESession); void lim_send_assoc_req_mgmt_frame(tpAniSirGlobal, tLimMlmAssocReq *, tpPESession); #ifdef WLAN_FEATURE_HOST_ROAM void lim_send_reassoc_req_with_ft_ies_mgmt_frame(tpAniSirGlobal pMac, diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index d4630b0f7cd7..f94e9c5eeba0 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -508,7 +508,21 @@ bool lim_check_membership_user_position(tpAniSirGlobal pMac, uint32_t membership, uint32_t userPosition, uint8_t staId); -#ifdef FEATURE_WLAN_DIAG_SUPPORT +/** + * enum ack_status - Indicate TX status of ASSOC/AUTH + * @ACKED : Ack is received. + * @NOT_ACKED : No Ack received. + * @SENT_FAIL : Failure while sending. + * + * Indicate if driver is waiting for ACK status of assoc/auth or ACK received + * for ASSOC/AUTH OR NO ACK is received for the assoc/auth sent or assoc/auth + * sent failed. + */ +enum assoc_ack_status { + ACKED, + NOT_ACKED, + SENT_FAIL, +}; typedef enum { WLAN_PE_DIAG_SCAN_REQ_EVENT = 0, @@ -589,11 +603,18 @@ typedef enum { WLAN_PE_DIAG_AUTH_TIMEOUT, WLAN_PE_DIAG_DEAUTH_FRAME_EVENT, WLAN_PE_DIAG_DISASSOC_FRAME_EVENT, + WLAN_PE_DIAG_AUTH_ACK_EVENT, + WLAN_PE_DIAG_ASSOC_ACK_EVENT, } WLAN_PE_DIAG_EVENT_TYPE; +#ifdef FEATURE_WLAN_DIAG_SUPPORT void lim_diag_event_report(tpAniSirGlobal pMac, uint16_t eventType, tpPESession pSessionEntry, uint16_t status, uint16_t reasonCode); +#else +static inline void lim_diag_event_report(tpAniSirGlobal pMac, uint16_t + eventType, tpPESession pSessionEntry, uint16_t status, + uint16_t reasonCode) {} #endif /* FEATURE_WLAN_DIAG_SUPPORT */ void pe_set_resume_channel(tpAniSirGlobal pMac, uint16_t channel,