software/drivers/sd8887/src/wlan/mlinux/moal_sdio_mmc.c
/**
 *  @brief This function registers the device
 *
 *  @param handle  A pointer to moal_handle structure
 *  @return         MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
 */
@brief This function registers the device
@param handle  A pointer to moal_handle structure
@return         MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
@brief This function registers the device @param handle A pointer to moal_handle structure @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
mlan_status
woal_register_dev(moal_handle *handle)
{
	int ret = MLAN_STATUS_SUCCESS;
	struct sdio_mmc_card *card = handle->card;
	struct sdio_func *func;
	ENTER();
	GPIO_PORT_INIT();
	GPIO_PORT_TO_HIGH();
	func = card->func;
	sdio_claim_host(func);
#ifdef SDIO_OOB_IRQ
	ret = mrvl_sdio_claim_irq(func, woal_sdio_interrupt);
#else
	ret = sdio_claim_irq(func, woal_sdio_interrupt);
#endif
	if (ret) {
		PRINTM(MFATAL, "sdio_claim_irq failed: ret=%d\n", ret);
		goto release_host;
	}
	ret = sdio_set_block_size(card->func, MLAN_SDIO_BLOCK_SIZE);
	if (ret) {
		PRINTM(MERROR,
		       "sdio_set_block_seize(): cannot set SDIO block size\n");
		ret = MLAN_STATUS_FAILURE;
		goto release_irq;
	}
	sdio_release_host(func);
	sdio_set_drvdata(func, card);
	handle->hotplug_device = &func->dev;
	LEAVE();
	return MLAN_STATUS_SUCCESS;
release_irq:
#ifdef SDIO_OOB_IRQ
	mrvl_sdio_release_irq(func);
#else
	sdio_release_irq(func);
#endif
release_host:
	sdio_release_host(func);
	handle->card = NULL;
	LEAVE();
	return MLAN_STATUS_FAILURE;
}
mlan_status woal_register_dev ( moal_handle * handle ) { int ret = MLAN_STATUS_SUCCESS ; struct sdio_mmc_card * card = handle -> card ; struct sdio_func * func ; ENTER ( ) ; GPIO_PORT_INIT ( ) ; GPIO_PORT_TO_HIGH ( ) ; func = card -> func ; sdio_claim_host ( func ) ; #ifdef SDIO_OOB_IRQ ret = mrvl_sdio_claim_irq ( func , woal_sdio_interrupt ) ; #else ret = sdio_claim_irq ( func , woal_sdio_interrupt ) ; #endif if ( ret ) { PRINTM ( MFATAL , " \n " , ret ) ; goto release_host ; } ret = sdio_set_block_size ( card -> func , MLAN_SDIO_BLOCK_SIZE ) ; if ( ret ) { PRINTM ( MERROR , " \n " ) ; ret = MLAN_STATUS_FAILURE ; goto release_irq ; } sdio_release_host ( func ) ; sdio_set_drvdata ( func , card ) ; handle -> hotplug_device = & func -> dev ; LEAVE ( ) ; return MLAN_STATUS_SUCCESS ; release_irq : #ifdef SDIO_OOB_IRQ mrvl_sdio_release_irq ( func ) ; #else sdio_release_irq ( func ) ; #endif release_host : sdio_release_host ( func ) ; handle -> card = NULL ; LEAVE ( ) ; return MLAN_STATUS_FAILURE ; }
@brief This function registers the device
  @param handle  A pointer to moal_handle structure
  @return         MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
@brief This function registers the device @param handle A pointer to moal_handle structure @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
/* Request the SDIO IRQ */ /* Set block size */