software/drivers/sd8887/src/wlan/mlan/mlan_cmdevt.c
/**
 *  @brief This function gets a free command node if available in
 *              command free queue.
 *
 *  @param pmadapter        A pointer to mlan_adapter structure
 *
 *  @return cmd_ctrl_node   A pointer to cmd_ctrl_node structure or MNULL
 */
@brief This function gets a free command node if available in
command free queue.

@param pmadapter        A pointer to mlan_adapter structure

@return cmd_ctrl_node   A pointer to cmd_ctrl_node structure or MNULL
@brief This function gets a free command node if available in command free queue . @param pmadapter A pointer to mlan_adapter structure @return cmd_ctrl_node A pointer to cmd_ctrl_node structure or MNULL
static cmd_ctrl_node *
wlan_get_cmd_node(mlan_adapter *pmadapter)
{
	cmd_ctrl_node *pcmd_node;
	ENTER();
	if (pmadapter == MNULL) {
		LEAVE();
		return MNULL;
	}
	wlan_request_cmd_lock(pmadapter);
	if (util_peek_list(pmadapter->pmoal_handle, &pmadapter->cmd_free_q,
			   MNULL, MNULL)) {
		pcmd_node =
			(cmd_ctrl_node *)util_dequeue_list(pmadapter->
							   pmoal_handle,
							   &pmadapter->
							   cmd_free_q, MNULL,
							   MNULL);
	} else {
		PRINTM(MERROR,
		       "GET_CMD_NODE: cmd_ctrl_node is not available\n");
		pcmd_node = MNULL;
	}
	wlan_release_cmd_lock(pmadapter);
	LEAVE();
	return pcmd_node;
}
static cmd_ctrl_node * wlan_get_cmd_node ( mlan_adapter * pmadapter ) { cmd_ctrl_node * pcmd_node ; ENTER ( ) ; if ( pmadapter == MNULL ) { LEAVE ( ) ; return MNULL ; } wlan_request_cmd_lock ( pmadapter ) ; if ( util_peek_list ( pmadapter -> pmoal_handle , & pmadapter -> cmd_free_q , MNULL , MNULL ) ) { pcmd_node = ( cmd_ctrl_node * ) util_dequeue_list ( pmadapter -> pmoal_handle , & pmadapter -> cmd_free_q , MNULL , MNULL ) ; } else { PRINTM ( MERROR , " \n " ) ; pcmd_node = MNULL ; } wlan_release_cmd_lock ( pmadapter ) ; LEAVE ( ) ; return pcmd_node ; }
@brief This function gets a free command node if available in
              command free queue.
@brief This function gets a free command node if available in command free queue .