本文整理汇总了C++中OSDRV_CALLBACKS::deviceSuspendHandler方法的典型用法代码示例。如果您正苦于以下问题:C++ OSDRV_CALLBACKS::deviceSuspendHandler方法的具体用法?C++ OSDRV_CALLBACKS::deviceSuspendHandler怎么用?C++ OSDRV_CALLBACKS::deviceSuspendHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OSDRV_CALLBACKS
的用法示例。
在下文中一共展示了OSDRV_CALLBACKS::deviceSuspendHandler方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hifDeviceSuspend
static int hifDeviceSuspend(struct device *dev)
{
struct sdio_func *func = dev_to_sdio_func(dev);
A_STATUS status = A_OK;
HIF_DEVICE *device;
device = getHifDevice(func);
if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) {
status = osdrvCallbacks.deviceSuspendHandler(device->claimedContext);
}
if (status == A_OK) {
int oldresetvalue = reset_sdio_on_unload;
reset_sdio_on_unload = 1;
hifDisableFunc(device, func);
reset_sdio_on_unload = oldresetvalue;
device->is_suspend = TRUE;
} else if (status == A_EBUSY) {
A_INT32 cnt = 10;
A_UINT8 host_int_status;
do {
while (atomic_read(&device->irqHandling)) {
/* wait until irq handler finished all the jobs */
schedule_timeout(HZ/10);
}
/* check if there is any pending irq due to force done */
host_int_status = 0;
status = HIFReadWrite(device, HOST_INT_STATUS_ADDRESS,
(A_UINT8 *)&host_int_status, sizeof(host_int_status),
HIF_RD_SYNC_BYTE_INC, NULL);
host_int_status = A_SUCCESS(status) ? (host_int_status & (1 << 0)) : 0;
if (host_int_status) {
schedule(); /* schedule for next dsrHandler */
}
} while (host_int_status && --cnt > 0);
if (host_int_status && cnt == 0) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
("AR6000: %s(), Unable clear up pending IRQ before the system suspended\n",
__FUNCTION__));
}
#if 1
status = A_OK; /* assume that sdio host controller will take care the power of wifi chip */
#else
return -EBUSY; /* Return -EBUSY if customer use all android patch of mmc stack provided by us */
#endif
}
return A_SUCCESS(status) ? 0 : status;
}
示例2: hifDeviceSuspend
static int hifDeviceSuspend(struct device *dev)
{
struct sdio_func *func = dev_to_sdio_func(dev);
A_STATUS status = A_OK;
HIF_DEVICE *device;
device = getHifDevice(func);
if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) {
status = osdrvCallbacks.deviceSuspendHandler(device->claimedContext);
}
if (status == A_OK) {
hifDisableFunc(device, func);
device->is_suspend = TRUE;
} else if (status == A_EBUSY) {
status = A_OK; /* assume that sdio host controller will take care the power of wifi chip */
}
return A_SUCCESS(status) ? 0 : status;
}
示例3: HIFDoDeviceSuspend
int HIFDoDeviceSuspend(HIF_DEVICE *device)
{
A_STATUS status = A_OK;
if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) {
status = osdrvCallbacks.deviceSuspendHandler(device->claimedContext);
}
if (status == A_OK) {
/* Waiting for all pending request */
if (!IS_ERR(device->async_task)) {
init_completion(&device->async_completion);
device->async_shutdown = 1;
up(&device->sem_async);
wait_for_completion(&device->async_completion);
device->async_task = NULL;
}
device->is_suspend = TRUE;
} else if (status == A_EBUSY) {
return -EBUSY; /* Return -1 if customer use all android patch of mmc stack provided by us */
}
return A_SUCCESS(status) ? 0 : status;
}