本文整理汇总了C++中sdio_release_host函数的典型用法代码示例。如果您正苦于以下问题:C++ sdio_release_host函数的具体用法?C++ sdio_release_host怎么用?C++ sdio_release_host使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sdio_release_host函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mwifiex_read_data_sync
/*
* This function reads multiple data from SDIO card memory.
*/
static int mwifiex_read_data_sync(struct mwifiex_adapter *adapter, u8 *buffer,
u32 len, u32 port, u8 claim)
{
struct sdio_mmc_card *card = adapter->card;
int ret;
u8 blk_mode = (port & MWIFIEX_SDIO_BYTE_MODE_MASK) ? BYTE_MODE
: BLOCK_MODE;
u32 blk_size = (blk_mode == BLOCK_MODE) ? MWIFIEX_SDIO_BLOCK_SIZE : 1;
u32 blk_cnt = (blk_mode == BLOCK_MODE) ? (len / MWIFIEX_SDIO_BLOCK_SIZE)
: len;
u32 ioport = (port & MWIFIEX_SDIO_IO_PORT_MASK);
if (claim)
sdio_claim_host(card->func);
ret = sdio_readsb(card->func, buffer, ioport, blk_cnt * blk_size);
if (claim)
sdio_release_host(card->func);
return ret;
}
示例2: ssb_sdio_read32
static u32 ssb_sdio_read32(struct ssb_device *dev, u16 offset)
{
struct ssb_bus *bus = dev->bus;
u32 val = 0xffffffff;
int error = 0;
sdio_claim_host(bus->host_sdio);
if (unlikely(ssb_sdio_switch_core(bus, dev)))
goto out;
offset |= bus->sdio_sbaddr & 0xffff;
offset &= SBSDIO_SB_OFT_ADDR_MASK;
offset |= SBSDIO_SB_ACCESS_2_4B_FLAG; /* */
val = sdio_readl(bus->host_sdio, offset, &error);
if (error) {
dev_dbg(ssb_sdio_dev(bus), "%04X:%04X > %08x, error %d\n",
bus->sdio_sbaddr >> 16, offset, val, error);
}
out:
sdio_release_host(bus->host_sdio);
return val;
}
示例3: sdio_free_irq
void sdio_free_irq(struct dvobj_priv *dvobj)
{
PSDIO_DATA psdio_data;
struct sdio_func *func;
int err;
if (dvobj->irq_alloc) {
psdio_data = &dvobj->intf_data;
func = psdio_data->func;
if (func) {
sdio_claim_host(func);
err = sdio_release_irq(func);
if (err)
{
DBG_871X("%s: sdio_release_irq FAIL(%d)!\n", __func__, err);
}
sdio_release_host(func);
}
dvobj->irq_alloc = 0;
}
}
示例4: sd_cmd52_write
/*
* Return:
* 0 Success
* others Fail
*/
s32 sd_cmd52_write(PSDIO_DATA psdio, u32 addr, u32 cnt, u8 *pdata)
{
int err, i;
struct sdio_func *func;
bool claim_needed;
_func_enter_;
err = 0;
func = psdio->func;
claim_needed = rtw_sdio_claim_host_needed(func);
if (claim_needed)
sdio_claim_host(func);
err = _sd_cmd52_write(psdio, addr, cnt, pdata);
if (claim_needed)
sdio_release_host(func);
_func_exit_;
return err;
}
示例5: woal_read_data_sync
/**
* @brief This function reads multiple bytes from card memory
*
* @param handle A Pointer to the moal_handle structure
* @param pmbuf Pointer to mlan_buffer structure
* @param port Port
* @param timeout Time out value
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
woal_read_data_sync(moal_handle * handle, mlan_buffer * pmbuf, t_u32 port,
t_u32 timeout)
{
mlan_status ret = MLAN_STATUS_FAILURE;
t_u8 *buffer = (t_u8 *) (pmbuf->pbuf + pmbuf->data_offset);
t_u8 blkmode =
(port & MLAN_SDIO_BYTE_MODE_MASK) ? BYTE_MODE : BLOCK_MODE;
t_u32 blksz = (blkmode == BLOCK_MODE) ? MLAN_SDIO_BLOCK_SIZE : 1;
t_u32 blkcnt =
(blkmode ==
BLOCK_MODE) ? (pmbuf->data_len /
MLAN_SDIO_BLOCK_SIZE) : pmbuf->data_len;
t_u32 ioport = (port & MLAN_SDIO_IO_PORT_MASK);
int status = 0;
if (pmbuf->use_count > 1)
return woal_sdio_rw_mb(handle, pmbuf, port, MFALSE);
#ifdef SDIO_MMC_DEBUG
handle->cmd53r = 1;
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)
sdio_claim_host(((struct sdio_mmc_card *)handle->card)->func);
#endif
status = sdio_readsb(((struct sdio_mmc_card *)handle->card)->func,
buffer, ioport, blkcnt * blksz);
if (!status) {
ret = MLAN_STATUS_SUCCESS;
} else {
PRINTM(MERROR, "cmd53 read error=%d\n", status);
woal_dump_sdio_reg(handle);
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)
sdio_release_host(((struct sdio_mmc_card *)handle->card)->func);
#endif
#ifdef SDIO_MMC_DEBUG
handle->cmd53r = 2;
#endif
return ret;
}
示例6: if_sdio_disable
static int if_sdio_disable(struct iwm_priv *iwm)
{
struct iwm_sdio_priv *hw = iwm_to_if_sdio(iwm);
int ret;
sdio_claim_host(hw->func);
sdio_writeb(hw->func, 0, IWM_SDIO_INTR_ENABLE_ADDR, &ret);
if (ret < 0)
IWM_WARN(iwm, "Couldn't disable INTR: %d\n", ret);
sdio_release_irq(hw->func);
sdio_disable_func(hw->func);
sdio_release_host(hw->func);
iwm_sdio_rx_free(hw);
iwm_reset(iwm);
IWM_DBG_SDIO(iwm, INFO, "IWM SDIO disable\n");
return 0;
}
示例7: wl12xx_sdio_power_off
static int wl12xx_sdio_power_off(struct wl12xx_sdio_glue *glue)
{
int ret;
struct sdio_func *func = dev_to_sdio_func(glue->dev);
struct mmc_card *card = func->card;
sdio_claim_host(func);
sdio_disable_func(func);
sdio_release_host(func);
/* Power off the card manually in case it wasn't powered off above */
ret = 0;
mmc_power_save_host(card->host);
if (ret < 0)
goto out;
/* Let runtime PM know the card is powered off */
pm_runtime_put_sync(&card->dev);
out:
return ret;
}
示例8: i2400ms_rx_setup
/*
* Setup SDIO RX
*
* Hooks up the IRQ handler and then enables IRQs.
*/
int i2400ms_rx_setup(struct i2400ms *i2400ms)
{
int result;
struct sdio_func *func = i2400ms->func;
struct device *dev = &func->dev;
struct i2400m *i2400m = &i2400ms->i2400m;
d_fnstart(5, dev, "(i2400ms %p)\n", i2400ms);
init_waitqueue_head(&i2400ms->bm_wfa_wq);
spin_lock(&i2400m->rx_lock);
i2400ms->bm_wait_result = -EINPROGRESS;
/*
* Before we are about to enable the RX interrupt, make sure
* bm_ack_size is cleared to -EINPROGRESS which indicates
* no RX interrupt happened yet or the previous interrupt
* has been handled, we are ready to take the new interrupt
*/
i2400ms->bm_ack_size = -EINPROGRESS;
spin_unlock(&i2400m->rx_lock);
sdio_claim_host(func);
result = sdio_claim_irq(func, i2400ms_irq);
if (result < 0) {
dev_err(dev, "Cannot claim IRQ: %d\n", result);
goto error_irq_claim;
}
result = 0;
sdio_writeb(func, 1, I2400MS_INTR_ENABLE_ADDR, &result);
if (result < 0) {
sdio_release_irq(func);
dev_err(dev, "Failed to enable interrupts %d\n", result);
}
error_irq_claim:
sdio_release_host(func);
d_fnend(5, dev, "(i2400ms %p) = %d\n", i2400ms, result);
return result;
}
示例9: wl1271_sdio_power_off
static int wl1271_sdio_power_off(struct wl1271 *wl)
{
struct sdio_func *func = wl_to_func(wl);
int ret;
sdio_disable_func(func);
sdio_release_host(func);
/* Power off the card manually, even if runtime PM is enabled. */
ret = mmc_power_save_host(func->card->host);
if (ret < 0) {
printk (KERN_ERR "%s:mmc_power_save_host: %d\n", __func__, ret );
return ret;
}
/* If enabled, let runtime PM know the card is powered off */
if (pm_runtime_enabled(&func->dev))
ret = pm_runtime_put_sync(&func->dev);
printk (KERN_ERR "%s: %d\n", __func__, ret );
return ret;
}
示例10: mtk_sdio_remove
static void
mtk_sdio_remove (
struct sdio_func *func
)
{
//printk(KERN_INFO DRV_NAME"mtk_sdio_remove()\n");
#if CFG_DBG_GPIO_PINS
//printk(KERN_INFO "[%s] deinit debug gpio \n", __FUNCTION__);
debug_gpio_deinit();
#endif
ASSERT(func);
//printk(KERN_INFO DRV_NAME"pfWlanRemove done\n");
pfWlanRemove();
sdio_claim_host(func);
sdio_disable_func(func);
//printk(KERN_INFO DRV_NAME"sdio_disable_func() done\n");
sdio_release_host(func);
//printk(KERN_INFO DRV_NAME"mtk_sdio_remove() done\n");
}
示例11: sd_f0_read8
u8 sd_f0_read8(PSDIO_DATA psdio, u32 addr, s32 *err)
{
u8 v;
struct sdio_func *func;
bool claim_needed;
_func_enter_;
func = psdio->func;
claim_needed = rtw_sdio_claim_host_needed(func);
if (claim_needed)
sdio_claim_host(func);
v = sdio_f0_readb(func, addr, err);
if (claim_needed)
sdio_release_host(func);
if (err && *err)
DBG_871X(KERN_ERR "%s: FAIL!(%d) addr=0x%05x\n", __func__, *err, addr);
_func_exit_;
return v;
}
示例12: sif_set_clock
void sif_set_clock(struct sdio_func *func, int clk)
{
struct mmc_host *host = NULL;
struct mmc_card *card = NULL;
card = func->card;
host = card->host;
sdio_claim_host(func);
//currently only set clock
host->ios.clock = clk * 1000000;
esp_dbg(ESP_SHOW, "%s clock is %u\n", __func__, host->ios.clock);
if (host->ios.clock > host->f_max) {
host->ios.clock = host->f_max;
}
host->ops->set_ios(host, &host->ios);
mdelay(2);
sdio_release_host(func);
}
示例13: woal_read_data_sync
/**
* @brief This function reads multiple bytes from card memory
*
* @param handle A Pointer to the moal_handle structure
* @param pmbuf Pointer to mlan_buffer structure
* @param port Port
* @param timeout Time out value
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
woal_read_data_sync(moal_handle * handle, mlan_buffer * pmbuf, t_u32 port,
t_u32 timeout)
{
mlan_status ret = MLAN_STATUS_FAILURE;
t_u8 *buffer = (t_u8 *) (pmbuf->pbuf + pmbuf->data_offset);
t_u8 blkmode = (port & MLAN_SDIO_BYTE_MODE_MASK) ? BYTE_MODE : BLOCK_MODE;
t_u32 blksz = (blkmode == BLOCK_MODE) ? MLAN_SDIO_BLOCK_SIZE : 1;
t_u32 blkcnt =
(blkmode ==
BLOCK_MODE) ? (pmbuf->data_len /
MLAN_SDIO_BLOCK_SIZE) : pmbuf->data_len;
t_u32 ioport = (port & MLAN_SDIO_IO_PORT_MASK);
sdio_claim_host(((struct sdio_mmc_card *) handle->card)->func);
if (!sdio_readsb
(((struct sdio_mmc_card *) handle->card)->func, buffer, ioport,
blkcnt * blksz))
ret = MLAN_STATUS_SUCCESS;
sdio_release_host(((struct sdio_mmc_card *) handle->card)->func);
return ret;
}
示例14: mtk_sdio_interrupt
static INT32 mtk_sdio_interrupt(MTK_WCN_HIF_SDIO_CLTCTX cltCtx)
{
P_GLUE_INFO_T prGlueInfo = NULL;
INT32 ret = 0;
struct sdio_func* func;
func = hif_sdio_ctx_to_func_wapper(cltCtx);
sdio_release_host(func);
prGlueInfo = mtk_wcn_hif_sdio_get_drvdata(cltCtx);
ASSERT(prGlueInfo);
if (!prGlueInfo) {
//printk(KERN_INFO DRV_NAME"No glue info in mtk_sdio_interrupt()\n");
return (-HIF_SDIO_ERR_FAIL);
}
if (prGlueInfo->u4Flag & GLUE_FLAG_HALT) {
//printk(KERN_INFO DRV_NAME"GLUE_FLAG_HALT skip INT\n");
ret = mtk_wcn_hif_sdio_writel(cltCtx, MCR_WHLPCR, WHLPCR_INT_EN_CLR);
return ret;
}
ret = mtk_wcn_hif_sdio_writel(cltCtx, MCR_WHLPCR, WHLPCR_INT_EN_CLR);
set_bit (GLUE_FLAG_INT_BIT, &prGlueInfo->u4Flag);
/* when we got sdio interrupt, we wake up the tx servie thread*/
wake_up_interruptible(&prGlueInfo->waitq);
sdio_claim_host(func);
return ret;
}
示例15: hw_get_mac_address
/* get MAC address from device */
void hw_get_mac_address(void *data)
{
struct net_adapter *adapter = (struct net_adapter *)data;
struct hw_private_packet req;
int nResult = 0;
int retry = 3;
req.id0 = 'W';
req.id1 = 'P';
req.code = HwCodeMacRequest;
req.value = 0;
do {
if (adapter == NULL)
break;
sdio_claim_host(adapter->func);
nResult = sd_send(adapter, (u_char *)&req,
sizeof(struct hw_private_packet));
sdio_release_host(adapter->func);
if (nResult != STATUS_SUCCESS)
dump_debug("hw_get_mac_address: sd_send fail!!");
msleep(300);
retry--;
/*in case we dont get MAC we need
to release power lock and probe finsh */
if (!retry) {
adapter->download_complete = TRUE;
wake_up_interruptible(&adapter->download_event);
msleep(100);
}
} while ((!adapter->mac_ready) && (!adapter->halted) && retry);
adapter->pdata->g_cfg->powerup_done = true ;
dump_debug("MAC thread exit");
return;
}