software/drivers/sd8887/src/wlan/mlan/mlan_sdio.c
/**
 *  @brief This function checks if the firmware is ready to accept
 *  command or not.
 *
 *  @param pmadapter  A pointer to mlan_adapter structure
 *  @param pollnum    Maximum polling number
 *  @return           MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
 */
@brief This function checks if the firmware is ready to accept
command or not.

@param pmadapter  A pointer to mlan_adapter structure
@param pollnum    Maximum polling number
@return           MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
@brief This function checks if the firmware is ready to accept command or not . @param pmadapter A pointer to mlan_adapter structure @param pollnum Maximum polling number @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
mlan_status
wlan_check_fw_status(mlan_adapter *pmadapter, t_u32 pollnum)
{
	mlan_status ret = MLAN_STATUS_SUCCESS;
	t_u16 firmwarestat = 0;
	t_u32 tries;
	ENTER();
	for (tries = 0; tries < pollnum; tries++) {
		ret = wlan_sdio_read_fw_status(pmadapter, &firmwarestat);
		if (MLAN_STATUS_SUCCESS != ret)
			continue;
		if (firmwarestat == FIRMWARE_READY) {
			ret = MLAN_STATUS_SUCCESS;
			break;
		} else {
			wlan_mdelay(pmadapter, 100);
			ret = MLAN_STATUS_FAILURE;
		}
	}
	if (ret != MLAN_STATUS_SUCCESS) {
		if (pollnum > 1)
			PRINTM(MERROR,
			       "Fail to poll firmware status: firmwarestat=0x%x\n",
			       firmwarestat);
		goto done;
	}
done:
	LEAVE();
	return ret;
}
mlan_status wlan_check_fw_status ( mlan_adapter * pmadapter , t_u32 pollnum ) { mlan_status ret = MLAN_STATUS_SUCCESS ; t_u16 firmwarestat = 0 ; t_u32 tries ; ENTER ( ) ; for ( tries = 0 ; tries < pollnum ; tries ++ ) { ret = wlan_sdio_read_fw_status ( pmadapter , & firmwarestat ) ; if ( MLAN_STATUS_SUCCESS != ret ) continue ; if ( firmwarestat == FIRMWARE_READY ) { ret = MLAN_STATUS_SUCCESS ; break ; } else { wlan_mdelay ( pmadapter , 100 ) ; ret = MLAN_STATUS_FAILURE ; } } if ( ret != MLAN_STATUS_SUCCESS ) { if ( pollnum > 1 ) PRINTM ( MERROR , " \n " , firmwarestat ) ; goto done ; } done : LEAVE ( ) ; return ret ; }
@brief This function checks if the firmware is ready to accept
  command or not.
@brief This function checks if the firmware is ready to accept command or not .
/* Wait for firmware initialization event */