qcacld-3.0: Fix LIM message posting API definition and usage

Currently lim_post_msg_api() and lim_post_msg_high_priority() are
defined to return a uint32_t status.  This is an artifact of many
generations of driver changes. These functions now return QDF_STATUS,
so update the signatures as well as all callers to properly expect
this return type. In addition remove the legacy wrapper function
pe_post_msg_api() since it is unused.

Change-Id: I00f991d64e3542336526e7ed2ca36e4112918cb7
CRs-Fixed: 2271548
This commit is contained in:
Jeff Johnson
2018-06-29 14:18:53 -07:00
committed by nshrivas
parent 2754593ec1
commit c9f4462ff3
5 changed files with 46 additions and 74 deletions

View File

@@ -115,7 +115,6 @@ void pe_register_tl_handle(tpAniSirGlobal pMac);
QDF_STATUS lim_start(tpAniSirGlobal pMac);
QDF_STATUS pe_start(tpAniSirGlobal pMac);
void pe_stop(tpAniSirGlobal pMac);
QDF_STATUS pe_post_msg_api(tpAniSirGlobal pMac, struct scheduler_msg *pMsg);
QDF_STATUS peProcessMsg(tpAniSirGlobal pMac, struct scheduler_msg *limMsg);
/**
@@ -159,10 +158,33 @@ void pe_register_callbacks_with_wma(tpAniSirGlobal pMac,
* This called upon reset/persona change etc
*/
extern void lim_cleanup(tpAniSirGlobal);
/* / Function to post messages to LIM thread */
extern uint32_t lim_post_msg_api(tpAniSirGlobal, struct scheduler_msg *);
uint32_t lim_post_msg_high_priority(tpAniSirGlobal mac,
struct scheduler_msg *msg);
/**
* lim_post_msg_api() - post normal priority PE message
* @mac: mac context
* @msg: message to be posted
*
* This function is called to post a message to the tail of the PE
* message queue to be processed in the MC Thread with normal
* priority.
*
* Return: QDF_STATUS_SUCCESS on success, other QDF_STATUS on error
*/
QDF_STATUS lim_post_msg_api(tpAniSirGlobal mac, struct scheduler_msg *msg);
/**
* lim_post_msg_high_priority() - post high priority PE message
* @mac: mac context
* @msg: message to be posted
*
* This function is called to post a message to the head of the PE
* message queue to be processed in the MC Thread with expedited
* priority.
*
* Return: QDF_STATUS_SUCCESS on success, other QDF_STATUS on error
*/
QDF_STATUS lim_post_msg_high_priority(tpAniSirGlobal mac,
struct scheduler_msg *msg);
/**
* Function to process messages posted to LIM thread

View File

@@ -1047,69 +1047,18 @@ void pe_free_msg(tpAniSirGlobal pMac, struct scheduler_msg *pMsg)
return;
}
/**
* lim_post_msg_api()
*
***FUNCTION:
* This function is called from other thread while posting a
* message to LIM message Queue gSirLimMsgQ.
*
***LOGIC:
* NA
*
***ASSUMPTIONS:
* NA
*
***NOTE:
* NA
*
* @param pMac - Pointer to Global MAC structure
* @param pMsg - Pointer to the message structure
* @return None
*/
uint32_t lim_post_msg_api(tpAniSirGlobal pMac, struct scheduler_msg *pMsg)
QDF_STATUS lim_post_msg_api(tpAniSirGlobal mac, struct scheduler_msg *msg)
{
return scheduler_post_msg(QDF_MODULE_ID_PE, pMsg);
return scheduler_post_msg(QDF_MODULE_ID_PE, msg);
}
} /*** end lim_post_msg_api() ***/
/**
* lim_post_msg_high_priority() - posts high priority pe message
* @mac: mac context
* @msg: message to be posted
*
* This function is used to post high priority pe message
*
* Return: returns value returned by vos_mq_post_message_by_priority
*/
uint32_t lim_post_msg_high_priority(tpAniSirGlobal mac,
struct scheduler_msg *msg)
QDF_STATUS lim_post_msg_high_priority(tpAniSirGlobal mac,
struct scheduler_msg *msg)
{
return scheduler_post_msg_by_priority(QDF_MODULE_ID_PE,
msg, true);
}
/*--------------------------------------------------------------------------
\brief pe_post_msg_api() - A wrapper function to post message to Voss msg queues
This function can be called by legacy code to post message to cds queues OR
legacy code may keep on invoking 'lim_post_msg_api' to post the message to cds queue
for dispatching it later.
\param pMac - Pointer to Global MAC structure
\param pMsg - Pointer to the message structure
\return uint32_t - TX_SUCCESS for success.
--------------------------------------------------------------------------*/
QDF_STATUS pe_post_msg_api(tpAniSirGlobal pMac, struct scheduler_msg *pMsg)
{
return (QDF_STATUS) lim_post_msg_api(pMac, pMsg);
}
/*--------------------------------------------------------------------------
\brief pe_process_messages() - Message Processor for PE
@@ -2017,9 +1966,10 @@ QDF_STATUS lim_update_short_slot(tpAniSirGlobal pMac,
}
void lim_send_heart_beat_timeout_ind(tpAniSirGlobal pMac, tpPESession psessionEntry)
void lim_send_heart_beat_timeout_ind(tpAniSirGlobal pMac,
tpPESession psessionEntry)
{
uint32_t statusCode;
QDF_STATUS status;
struct scheduler_msg msg = {0};
/* Prepare and post message to LIM Message Queue */
@@ -2028,11 +1978,11 @@ void lim_send_heart_beat_timeout_ind(tpAniSirGlobal pMac, tpPESession psessionEn
msg.bodyval = 0;
pe_err("Heartbeat failure from Fw");
statusCode = lim_post_msg_api(pMac, &msg);
status = lim_post_msg_api(pMac, &msg);
if (statusCode != QDF_STATUS_SUCCESS) {
if (status != QDF_STATUS_SUCCESS) {
pe_err("posting message: %X to LIM failed, reason: %d",
msg.type, statusCode);
msg.type, status);
}
}

View File

@@ -130,7 +130,7 @@ void lim_set_cfg_protection(tpAniSirGlobal pMac, tpPESession pesessionEntry)
void lim_handle_param_update(tpAniSirGlobal pMac, eUpdateIEsType cfgId)
{
struct scheduler_msg msg = { 0 };
uint32_t status;
QDF_STATUS status;
pe_debug("Handling CFG parameter id %X update", cfgId);
@@ -140,7 +140,7 @@ void lim_handle_param_update(tpAniSirGlobal pMac, eUpdateIEsType cfgId)
msg.type = SIR_LIM_UPDATE_BEACON;
status = lim_post_msg_api(pMac, &msg);
if (status != TX_SUCCESS)
if (status != QDF_STATUS_SUCCESS)
pe_err("Failed lim_post_msg_api %u", status);
break;
}

View File

@@ -382,7 +382,7 @@ err_timer:
void lim_timer_handler(void *pMacGlobal, uint32_t param)
{
uint32_t statusCode;
QDF_STATUS status;
struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
@@ -392,10 +392,10 @@ void lim_timer_handler(void *pMacGlobal, uint32_t param)
msg.bodyptr = NULL;
msg.bodyval = 0;
statusCode = lim_post_msg_high_priority(pMac, &msg);
if (statusCode != QDF_STATUS_SUCCESS)
status = lim_post_msg_high_priority(pMac, &msg);
if (status != QDF_STATUS_SUCCESS)
pe_err("posting message: %X to LIM failed, reason: %d",
msg.type, statusCode);
msg.type, status);
} /****** end lim_timer_handler() ******/
/**

View File

@@ -152,7 +152,7 @@ sys_bbt_process_message_core(tpAniSirGlobal mac_ctx, struct scheduler_msg *msg,
}
/* Post the message to PE Queue */
ret = (QDF_STATUS) lim_post_msg_api(mac_ctx, msg);
ret = lim_post_msg_api(mac_ctx, msg);
if (ret != QDF_STATUS_SUCCESS) {
pe_err("posting to LIM2 failed, ret %d\n", ret);
goto fail;
@@ -162,7 +162,7 @@ sys_bbt_process_message_core(tpAniSirGlobal mac_ctx, struct scheduler_msg *msg,
} else if (type == SIR_MAC_DATA_FRAME) {
pe_debug("IAPP Frame...");
/* Post the message to PE Queue */
ret = (QDF_STATUS) lim_post_msg_api(mac_ctx, msg);
ret = lim_post_msg_api(mac_ctx, msg);
if (ret != QDF_STATUS_SUCCESS) {
pe_err("posting to LIM2 failed, ret: %d", ret);
goto fail;