|
@@ -27,7 +27,7 @@ No irqsave is necessary.
|
|
|
|
|
|
int rtw_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);
|
|
|
|
|
|
_rtw_init_queue(&(pcmdpriv->cmd_queue));
|
|
@@ -122,7 +122,7 @@ u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
|
|
|
res = _rtw_enqueue_cmd(&pcmdpriv->cmd_queue, cmd_obj);
|
|
|
|
|
|
if (res == _SUCCESS)
|
|
|
- up(&pcmdpriv->cmd_queue_sema);
|
|
|
+ complete(&pcmdpriv->cmd_queue_comp);
|
|
|
|
|
|
exit:
|
|
|
|
|
@@ -167,7 +167,7 @@ int rtw_cmd_thread(void *context)
|
|
|
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("start r871x rtw_cmd_thread !!!!\n"));
|
|
|
|
|
|
while (1) {
|
|
|
- if (_rtw_down_sema(&pcmdpriv->cmd_queue_sema) == _FAIL)
|
|
|
+ if (wait_for_completion_interruptible(&pcmdpriv->cmd_queue_comp))
|
|
|
break;
|
|
|
|
|
|
if (padapter->bDriverStopped ||
|