software/drivers/sd8887/src/wlan/mlan/mlan_sdio.c
/**
 *  @brief This function sends data to the card.
 *
 *  @param pmadapter A pointer to mlan_adapter structure
 *  @param pmbuf     A pointer to mlan_buffer (pmbuf->data_len should include SDIO header)
 *  @param port      Port
 *  @return          MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
 */
@brief This function sends data to the card.
@param pmadapter A pointer to mlan_adapter structure
@param pmbuf     A pointer to mlan_buffer (pmbuf->data_len should include SDIO header)
@param port      Port
@return          MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
@brief This function sends data to the card . @param pmadapter A pointer to mlan_adapter structure @param pmbuf A pointer to mlan_buffer ( pmbuf - > data_len should include SDIO header ) @param port Port @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
static mlan_status
wlan_write_data_sync(mlan_adapter *pmadapter, mlan_buffer *pmbuf, t_u32 port)
{
	t_u32 i = 0;
	pmlan_callbacks pcb = &pmadapter->callbacks;
	mlan_status ret = MLAN_STATUS_SUCCESS;
	ENTER();
	do {
		ret = pcb->moal_write_data_sync(pmadapter->pmoal_handle, pmbuf,
						port, 0);
		if (ret != MLAN_STATUS_SUCCESS) {
			i++;
			PRINTM(MERROR,
			       "host_to_card, write iomem (%d) failed: %d\n", i,
			       ret);
			if (MLAN_STATUS_SUCCESS !=
			    pcb->moal_write_reg(pmadapter->pmoal_handle,
						HOST_TO_CARD_EVENT_REG,
						HOST_TERM_CMD53)) {
				PRINTM(MERROR, "write CFG reg failed\n");
			}
			ret = MLAN_STATUS_FAILURE;
			if (i > MAX_WRITE_IOMEM_RETRY) {
				pmbuf->status_code = MLAN_ERROR_DATA_TX_FAIL;
				goto exit;
			}
		}
	} while (ret == MLAN_STATUS_FAILURE);
exit:
	LEAVE();
	return ret;
}
static mlan_status wlan_write_data_sync ( mlan_adapter * pmadapter , mlan_buffer * pmbuf , t_u32 port ) { t_u32 i = 0 ; pmlan_callbacks pcb = & pmadapter -> callbacks ; mlan_status ret = MLAN_STATUS_SUCCESS ; ENTER ( ) ; do { ret = pcb -> moal_write_data_sync ( pmadapter -> pmoal_handle , pmbuf , port , 0 ) ; if ( ret != MLAN_STATUS_SUCCESS ) { i ++ ; PRINTM ( MERROR , " \n " , i , ret ) ; if ( MLAN_STATUS_SUCCESS != pcb -> moal_write_reg ( pmadapter -> pmoal_handle , HOST_TO_CARD_EVENT_REG , HOST_TERM_CMD53 ) ) { PRINTM ( MERROR , " \n " ) ; } ret = MLAN_STATUS_FAILURE ; if ( i > MAX_WRITE_IOMEM_RETRY ) { pmbuf -> status_code = MLAN_ERROR_DATA_TX_FAIL ; goto exit ; } } } while ( ret == MLAN_STATUS_FAILURE ) ; exit : LEAVE ( ) ; return ret ; }
@brief This function sends data to the card.
@brief This function sends data to the card .