software/drivers/sd8887/src/wlan/mlan/mlan_sdio.c
/**
 *  @brief This function polls the card status register.
 *
 *  @param pmadapter  A pointer to mlan_adapter structure
 *  @param bits       the bit mask
 *  @return           MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
 */
@brief This function polls the card status register.
@param pmadapter  A pointer to mlan_adapter structure
@param bits       the bit mask
@return           MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
@brief This function polls the card status register . @param pmadapter A pointer to mlan_adapter structure @param bits the bit mask @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
static mlan_status
wlan_sdio_poll_card_status(mlan_adapter *pmadapter, t_u8 bits)
{
	pmlan_callbacks pcb = &pmadapter->callbacks;
	t_u32 tries;
	t_u32 cs = 0;
	ENTER();
	for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
		if (pcb->moal_read_reg(pmadapter->pmoal_handle,
				       CARD_TO_HOST_EVENT_REG,
				       &cs) != MLAN_STATUS_SUCCESS)
			break;
		else if ((cs & bits) == bits) {
			LEAVE();
			return MLAN_STATUS_SUCCESS;
		}
		wlan_udelay(pmadapter, 10);
	}
	PRINTM(MERROR,
	       "wlan_sdio_poll_card_status failed, tries = %d, cs = 0x%x\n",
	       tries, cs);
	LEAVE();
	return MLAN_STATUS_FAILURE;
}
static mlan_status wlan_sdio_poll_card_status ( mlan_adapter * pmadapter , t_u8 bits ) { pmlan_callbacks pcb = & pmadapter -> callbacks ; t_u32 tries ; t_u32 cs = 0 ; ENTER ( ) ; for ( tries = 0 ; tries < MAX_POLL_TRIES ; tries ++ ) { if ( pcb -> moal_read_reg ( pmadapter -> pmoal_handle , CARD_TO_HOST_EVENT_REG , & cs ) != MLAN_STATUS_SUCCESS ) break ; else if ( ( cs & bits ) == bits ) { LEAVE ( ) ; return MLAN_STATUS_SUCCESS ; } wlan_udelay ( pmadapter , 10 ) ; } PRINTM ( MERROR , " \n " , tries , cs ) ; LEAVE ( ) ; return MLAN_STATUS_FAILURE ; }
@brief This function polls the card status register.
@brief This function polls the card status register .