diff options
Diffstat (limited to 'drivers/staging/rtl8723bs/core/rtw_cmd.c')
-rw-r--r-- | drivers/staging/rtl8723bs/core/rtw_cmd.c | 51 |
1 files changed, 15 insertions, 36 deletions
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index 91520ca3bbad..ecaa769f12e6 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -162,9 +162,9 @@ Caller and the rtw_cmd_thread can protect cmd_q by spin_lock. No irqsave is necessary. */ -sint _rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) +int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) { - sint res = _SUCCESS; + int res = 0; init_completion(&pcmdpriv->cmd_queue_comp); init_completion(&pcmdpriv->terminate_cmdthread_comp); @@ -177,8 +177,8 @@ sint _rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) pcmdpriv->cmd_allocated_buf = rtw_zmalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ); - if (pcmdpriv->cmd_allocated_buf == NULL) { - res = _FAIL; + if (!pcmdpriv->cmd_allocated_buf) { + res = -ENOMEM; goto exit; } @@ -186,8 +186,8 @@ sint _rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) pcmdpriv->rsp_allocated_buf = rtw_zmalloc(MAX_RSPSZ + 4); - if (pcmdpriv->rsp_allocated_buf == NULL) { - res = _FAIL; + if (!pcmdpriv->rsp_allocated_buf) { + res = -ENOMEM; goto exit; } @@ -201,10 +201,8 @@ exit: } static void c2h_wk_callback(_workitem *work); -sint _rtw_init_evt_priv(struct evt_priv *pevtpriv) +int rtw_init_evt_priv(struct evt_priv *pevtpriv) { - sint res = _SUCCESS; - /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ atomic_set(&pevtpriv->event_seq, 0); pevtpriv->evt_done_cnt = 0; @@ -212,8 +210,10 @@ sint _rtw_init_evt_priv(struct evt_priv *pevtpriv) _init_workitem(&pevtpriv->c2h_wk, c2h_wk_callback, NULL); pevtpriv->c2h_wk_alive = false; pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN+1); + if (!pevtpriv->c2h_queue) + return -ENOMEM; - return res; + return 0; } void _rtw_free_evt_priv(struct evt_priv *pevtpriv) @@ -256,7 +256,7 @@ ISR/Call-Back functions can't call this sub-function. */ -sint _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj) +int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj) { _irqL irqL; @@ -295,22 +295,6 @@ struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue) return obj; } -u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) -{ - u32 res; - - res = _rtw_init_cmd_priv(pcmdpriv); - return res; -} - -u32 rtw_init_evt_priv(struct evt_priv *pevtpriv) -{ - int res; - - res = _rtw_init_evt_priv(pevtpriv); - return res; -} - void rtw_free_evt_priv(struct evt_priv *pevtpriv) { RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("rtw_free_evt_priv\n")); @@ -347,7 +331,7 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) -u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) +int rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) { int res = _FAIL; struct adapter *padapter = pcmdpriv->padapter; @@ -735,12 +719,12 @@ exit: return res; } -u8 rtw_startbss_cmd(struct adapter *padapter, int flags) +int rtw_startbss_cmd(struct adapter *padapter, int flags) { struct cmd_obj *pcmd; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct submit_ctx sctx; - u8 res = _SUCCESS; + int res = _SUCCESS; if (flags & RTW_CMDF_DIRECTLY) { /* no need to enqueue, do the cmd hdl directly and free cmd parameter */ @@ -2007,11 +1991,6 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf) case CHECK_HIQ_WK_CID: rtw_chk_hi_queue_hdl(padapter); break; -#ifdef CONFIG_INTEL_WIDI - case INTEl_WIDI_WK_CID: - intel_widi_wk_hdl(padapter, pdrvextra_cmd->type, pdrvextra_cmd->pbuf); - break; -#endif /* CONFIG_INTEL_WIDI */ /* add for CONFIG_IEEE80211W, none 11w can use it */ case RESET_SECURITYPRIV: reset_securitypriv_hdl(padapter); @@ -2121,7 +2100,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) rtw_indicate_connect(padapter); } else { - pwlan = _rtw_alloc_network(pmlmepriv); + pwlan = rtw_alloc_network(pmlmepriv); spin_lock_bh(&(pmlmepriv->scanned_queue.lock)); if (pwlan == NULL) { pwlan = rtw_get_oldest_wlan_network(&pmlmepriv->scanned_queue); |