void r8712_stop_drv_threads(struct _adapter *padapter)
{
/*Below is to terminate r8712_cmd_thread & event_thread...*/
- up(&padapter->cmdpriv.cmd_queue_sema);
+ complete(&padapter->cmdpriv.cmd_queue_comp);
if (padapter->cmdThread)
_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema);
padapter->cmdpriv.cmd_seq = 1;
static sint _init_cmd_priv(struct cmd_priv *pcmdpriv)
{
- sema_init(&(pcmdpriv->cmd_queue_sema), 0);
+ init_completion(&pcmdpriv->cmd_queue_comp);
sema_init(&(pcmdpriv->terminate_cmdthread_sema), 0);
_init_queue(&(pcmdpriv->cmd_queue));
if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag)
return _FAIL;
res = _enqueue_cmd(&pcmdpriv->cmd_queue, obj);
- up(&pcmdpriv->cmd_queue_sema);
+ complete(&pcmdpriv->cmd_queue_comp);
return res;
}
spin_lock_irqsave(&queue->lock, irqL);
list_add_tail(&obj->list, &queue->queue);
spin_unlock_irqrestore(&queue->lock, irqL);
- up(&pcmdpriv->cmd_queue_sema);
+ complete(&pcmdpriv->cmd_queue_comp);
return _SUCCESS;
}
};
struct cmd_priv {
- struct semaphore cmd_queue_sema;
+ struct completion cmd_queue_comp;
struct semaphore terminate_cmdthread_sema;
struct __queue cmd_queue;
u8 cmd_seq;
pwrpriv->cpwm = (preportpwrstate->state) & 0xf;
if (pwrpriv->cpwm >= PS_STATE_S2) {
if (pwrpriv->alives & CMD_ALIVE)
- up(&(pcmdpriv->cmd_queue_sema));
+ complete(&(pcmdpriv->cmd_queue_comp));
}
pwrpriv->cpwm_tog = (preportpwrstate->state) & 0x80;
up(&pwrpriv->lock);