diff --git a/Kbuild b/Kbuild index 7a30b7187ef6..d239ab8f7ae6 100644 --- a/Kbuild +++ b/Kbuild @@ -329,7 +329,6 @@ MAC_LIM_OBJS := $(MAC_SRC_DIR)/pe/lim/lim_aid_mgmt.o \ $(MAC_SRC_DIR)/pe/lim/lim_send_management_frames.o \ $(MAC_SRC_DIR)/pe/lim/lim_send_messages.o \ $(MAC_SRC_DIR)/pe/lim/lim_send_sme_rsp_messages.o \ - $(MAC_SRC_DIR)/pe/lim/lim_ser_des_utils.o \ $(MAC_SRC_DIR)/pe/lim/lim_session.o \ $(MAC_SRC_DIR)/pe/lim/lim_session_utils.o \ $(MAC_SRC_DIR)/pe/lim/lim_sme_req_utils.o \ diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index 54c05952d720..f59284bcc548 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -54,8 +54,7 @@ void lim_process_mlm_disassoc_cnf(struct mac_context *, uint32_t *); static void lim_process_mlm_deauth_ind(struct mac_context *, tLimMlmDeauthInd *); void lim_process_mlm_deauth_cnf(struct mac_context *, uint32_t *); void lim_process_mlm_purge_sta_ind(struct mac_context *, uint32_t *); -void lim_get_session_info(struct mac_context *mac, uint8_t *, uint8_t *, - uint16_t *); + /** * lim_process_mlm_rsp_messages() * diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 9976283b7646..b3a0b696fe8f 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -74,8 +74,6 @@ static bool __lim_process_sme_sys_ready_ind(struct mac_context *, uint32_t *); static bool __lim_process_sme_start_bss_req(struct mac_context *, struct scheduler_msg *pMsg); -static void __lim_process_sme_join_req(struct mac_context *, uint32_t *); -static void __lim_process_sme_reassoc_req(struct mac_context *, uint32_t *); static void __lim_process_sme_disassoc_req(struct mac_context *, uint32_t *); static void __lim_process_sme_disassoc_cnf(struct mac_context *, uint32_t *); static void __lim_process_sme_deauth_req(struct mac_context *, uint32_t *); @@ -330,40 +328,6 @@ static bool __lim_is_sme_assoc_cnf_valid(struct assoc_cnf *assoc_cnf) return true; } -/** - * __lim_get_sme_join_req_size_for_alloc() - * - ***FUNCTION: - * This function is called in various places to get IE length - * from tSirBssDescription structure - * number being scanned. - * - ***PARAMS: - * - ***LOGIC: - * - ***ASSUMPTIONS: - * NA - * - ***NOTE: - * NA - * - * @param pBssDescr - * @return Total IE length - */ - -static uint16_t __lim_get_sme_join_req_size_for_alloc(uint8_t *pBuf) -{ - uint16_t len = 0; - - if (!pBuf) - return len; - - pBuf += sizeof(uint16_t); - len = lim_get_u16(pBuf); - return len; -} - /** * __lim_is_defered_msg_for_learn() - message handling in SME learn state * @mac: Global MAC context @@ -1227,13 +1191,13 @@ static QDF_STATUS lim_send_ft_reassoc_req(struct pe_session *session, * Return: None */ static void -__lim_process_sme_join_req(struct mac_context *mac_ctx, uint32_t *msg_buf) +__lim_process_sme_join_req(struct mac_context *mac_ctx, void *msg_buf) { + struct join_req *in_req = msg_buf; struct join_req *sme_join_req = NULL; tLimMlmJoinReq *mlm_join_req; tSirResultCodes ret_code = eSIR_SME_SUCCESS; uint32_t val = 0; - uint16_t n_size; uint8_t session_id; struct pe_session *session = NULL; uint8_t sme_session_id = 0; @@ -1266,16 +1230,12 @@ __lim_process_sme_join_req(struct mac_context *mac_ctx, uint32_t *msg_buf) /* Global SME and LIM states are not defined yet for BT-AMP Support */ if (mac_ctx->lim.gLimSmeState == eLIM_SME_IDLE_STATE) { - n_size = __lim_get_sme_join_req_size_for_alloc((uint8_t *) - msg_buf); - - sme_join_req = qdf_mem_malloc(n_size); + sme_join_req = qdf_mem_malloc(in_req->length); if (!sme_join_req) { ret_code = eSIR_SME_RESOURCES_UNAVAILABLE; goto end; } - (void)qdf_mem_copy((void *)sme_join_req, (void *)msg_buf, - n_size); + qdf_mem_copy(sme_join_req, in_req, in_req->length); if (!lim_is_sme_join_req_valid(mac_ctx, sme_join_req)) { /* Received invalid eWNI_SME_JOIN_REQ */ @@ -1694,8 +1654,8 @@ __lim_process_sme_join_req(struct mac_context *mac_ctx, uint32_t *msg_buf) } end: - lim_get_session_info(mac_ctx, (uint8_t *) msg_buf, - &sme_session_id, &sme_transaction_id); + sme_session_id = in_req->sessionId; + sme_transaction_id = in_req->transactionId; if (sme_join_req) { qdf_mem_free(sme_join_req); @@ -1746,10 +1706,11 @@ uint8_t lim_get_max_tx_power(int8_t regMax, int8_t apTxPower, */ static void __lim_process_sme_reassoc_req(struct mac_context *mac_ctx, - uint32_t *msg_buf) + void *msg_buf) { uint16_t caps; uint32_t val; + struct join_req *in_req = msg_buf; struct join_req *reassoc_req; tLimMlmReassocReq *mlm_reassoc_req; tSirResultCodes ret_code = eSIR_SME_SUCCESS; @@ -1759,16 +1720,17 @@ static void __lim_process_sme_reassoc_req(struct mac_context *mac_ctx, uint16_t transaction_id; int8_t local_pwr_constraint = 0, reg_max = 0; uint32_t tele_bcn_en = 0; - uint16_t size; QDF_STATUS status; - size = __lim_get_sme_join_req_size_for_alloc((uint8_t *)msg_buf); - reassoc_req = qdf_mem_malloc(size); + sme_session_id = in_req->sessionId; + transaction_id = in_req->transactionId; + + reassoc_req = qdf_mem_malloc(in_req->length); if (!reassoc_req) { ret_code = eSIR_SME_RESOURCES_UNAVAILABLE; goto end; } - qdf_mem_copy(reassoc_req, msg_buf, size); + qdf_mem_copy(reassoc_req, in_req, in_req->length); if (!lim_is_sme_join_req_valid(mac_ctx, reassoc_req)) { /* @@ -1779,8 +1741,6 @@ static void __lim_process_sme_reassoc_req(struct mac_context *mac_ctx, ret_code = eSIR_SME_INVALID_PARAMETERS; goto end; } - lim_get_session_info(mac_ctx, (uint8_t *)msg_buf, - &sme_session_id, &transaction_id); session_entry = pe_find_session_by_bssid(mac_ctx, reassoc_req->bssDescription.bssId, @@ -2015,18 +1975,11 @@ end: if (session_entry) { /* * error occurred after we determined the session so extract - * session and transaction info from there + * session and transaction info from there, otherwise we'll + * use the values already extracted from the message */ sme_session_id = session_entry->smeSessionId; transaction_id = session_entry->transactionId; - } else { - /* - * error occurred before or during the time we determined - * the session so extract the session and transaction info - * from the message - */ - lim_get_session_info(mac_ctx, (uint8_t *) msg_buf, - &sme_session_id, &transaction_id); } /* * Send Reassoc failure response to host @@ -3206,11 +3159,9 @@ static void __lim_process_sme_addts_req(struct mac_context *mac, uint32_t *pMsgB return; } - lim_get_session_info(mac, (uint8_t *) pMsgBuf, &smesessionId, - &smetransactionId); - pSirAddts = (tpSirAddtsReq) pMsgBuf; - + smesessionId = pSirAddts->sessionId; + smetransactionId = pSirAddts->transactionId; pe_session = pe_find_session_by_bssid(mac, pSirAddts->bssid.bytes, &sessionId); if (pe_session == NULL) { @@ -3350,8 +3301,8 @@ static void __lim_process_sme_delts_req(struct mac_context *mac, uint32_t *pMsgB uint8_t smesessionId; uint16_t smetransactionId; - lim_get_session_info(mac, (uint8_t *) pMsgBuf, &smesessionId, - &smetransactionId); + smesessionId = pDeltsReq->sessionId; + smetransactionId = pDeltsReq->transactionId; pe_session = pe_find_session_by_bssid(mac, pDeltsReq->bssid.bytes, diff --git a/core/mac/src/pe/lim/lim_ser_des_utils.c b/core/mac/src/pe/lim/lim_ser_des_utils.c deleted file mode 100644 index 849e452553dd..000000000000 --- a/core/mac/src/pe/lim/lim_ser_des_utils.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2011-2019 The Linux Foundation. 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 - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * - * This file lim_ser_des_utils.cc contains the serializer/deserializer - * utility functions LIM uses while communicating with upper layer - * software entities - * Author: Chandra Modumudi - * Date: 10/20/02 - * History:- - * Date Modified by Modification Information - * -------------------------------------------------------------------- - */ - -#include "ani_system_defs.h" -#include "utils_api.h" -#include "lim_types.h" -#include "lim_utils.h" -#include "lim_ser_des_utils.h" - - -/**--------------------------------------------------------------- - \fn lim_get_session_info - \brief This function returns the sessionId and transactionId - \ of a message. This assumes that the message structure - \ is of format: - \ uint16_t messageType - \ uint16_t messageLength - \ uint8_t sessionId - \ uint16_t transactionId - \param mac - mac global structure - \param *pBuf - pointer to the message buffer - \param sessionId - returned session id value - \param transactionId - returned transaction ID value - \return None - ------------------------------------------------------------------*/ -void -lim_get_session_info(struct mac_context *mac, uint8_t *pBuf, uint8_t *sessionId, - uint16_t *transactionId) -{ - if (!pBuf) { - pe_err("NULL ptr received"); - return; - } - - pBuf += sizeof(uint16_t); /* skip message type */ - pBuf += sizeof(uint16_t); /* skip message length */ - - *sessionId = *pBuf; /* get sessionId */ - pBuf++; - *transactionId = lim_get_u16(pBuf); /* get transactionId */ - - return; -} diff --git a/core/mac/src/pe/lim/lim_ser_des_utils.h b/core/mac/src/pe/lim/lim_ser_des_utils.h index b05f5ef45d1a..488529a81bbc 100644 --- a/core/mac/src/pe/lim/lim_ser_des_utils.h +++ b/core/mac/src/pe/lim/lim_ser_des_utils.h @@ -37,9 +37,6 @@ #include "lim_types.h" #include "lim_prop_exts_utils.h" -void lim_get_session_info(struct mac_context *mac, uint8_t *, - uint8_t *, uint16_t *); - /* Byte String <--> uint16_t/uint32_t copy functions */ static inline void lim_copy_u16(uint8_t *ptr, uint16_t u16Val) {