mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-10 15:39:38 +00:00
rtl8188eu: Remove CONFIG_EVENT_THREAD_MODE
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
e136a7d492
commit
4c042ff344
3 changed files with 9 additions and 158 deletions
114
core/rtw_cmd.c
114
core/rtw_cmd.c
|
@ -90,8 +90,6 @@ sint _rtw_init_evt_priv(struct evt_priv *pevtpriv)
|
|||
{
|
||||
sint res=_SUCCESS;
|
||||
|
||||
;
|
||||
|
||||
#ifdef CONFIG_H2CLBK
|
||||
_rtw_init_sema(&(pevtpriv->lbkevt_done), 0);
|
||||
pevtpriv->lbkevt_limit = 0;
|
||||
|
@ -103,50 +101,19 @@ sint _rtw_init_evt_priv(struct evt_priv *pevtpriv)
|
|||
ATOMIC_SET(&pevtpriv->event_seq, 0);
|
||||
pevtpriv->evt_done_cnt = 0;
|
||||
|
||||
#ifdef CONFIG_EVENT_THREAD_MODE
|
||||
|
||||
_rtw_init_sema(&(pevtpriv->evt_notify), 0);
|
||||
_rtw_init_sema(&(pevtpriv->terminate_evtthread_sema), 0);
|
||||
|
||||
pevtpriv->evt_allocated_buf = rtw_zmalloc(MAX_EVTSZ + 4);
|
||||
if (pevtpriv->evt_allocated_buf == NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
pevtpriv->evt_buf = pevtpriv->evt_allocated_buf + 4 - ((unsigned int)(pevtpriv->evt_allocated_buf) & 3);
|
||||
|
||||
_rtw_init_queue(&(pevtpriv->evt_queue));
|
||||
|
||||
exit:
|
||||
|
||||
#endif /* end of CONFIG_EVENT_THREAD_MODE */
|
||||
|
||||
#ifdef CONFIG_C2H_WK
|
||||
_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);
|
||||
#endif
|
||||
|
||||
;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void _rtw_free_evt_priv (struct evt_priv *pevtpriv)
|
||||
{
|
||||
;
|
||||
|
||||
RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("+_rtw_free_evt_priv \n"));
|
||||
|
||||
#ifdef CONFIG_EVENT_THREAD_MODE
|
||||
_rtw_free_sema(&(pevtpriv->evt_notify));
|
||||
_rtw_free_sema(&(pevtpriv->terminate_evtthread_sema));
|
||||
|
||||
|
||||
if (pevtpriv->evt_allocated_buf)
|
||||
rtw_mfree(pevtpriv->evt_allocated_buf, MAX_EVTSZ + 4);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_C2H_WK
|
||||
_cancel_workitem_sync(&pevtpriv->c2h_wk);
|
||||
while(pevtpriv->c2h_wk_alive)
|
||||
|
@ -532,87 +499,6 @@ post_process:
|
|||
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_EVENT_THREAD_MODE
|
||||
u32 rtw_enqueue_evt(struct evt_priv *pevtpriv, struct evt_obj *obj)
|
||||
{
|
||||
_irqL irqL;
|
||||
int res;
|
||||
_queue *queue = &pevtpriv->evt_queue;
|
||||
|
||||
;
|
||||
|
||||
res = _SUCCESS;
|
||||
|
||||
if (obj == NULL) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
spin_lock_bh(&queue->lock);
|
||||
|
||||
rtw_list_insert_tail(&obj->list, &queue->queue);
|
||||
|
||||
spin_unlock_bh(&queue->lock);
|
||||
|
||||
/* rtw_evt_notify_isr(pevtpriv); */
|
||||
|
||||
exit:
|
||||
|
||||
;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
struct evt_obj *rtw_dequeue_evt(_queue *queue)
|
||||
{
|
||||
_irqL irqL;
|
||||
struct evt_obj *pevtobj;
|
||||
|
||||
;
|
||||
|
||||
spin_lock_bh(&queue->lock);
|
||||
|
||||
if (rtw_is_list_empty(&(queue->queue)))
|
||||
pevtobj = NULL;
|
||||
else
|
||||
{
|
||||
pevtobj = LIST_CONTAINOR(get_next(&(queue->queue)), struct evt_obj, list);
|
||||
rtw_list_delete(&pevtobj->list);
|
||||
}
|
||||
|
||||
spin_unlock_bh(&queue->lock);
|
||||
|
||||
;
|
||||
|
||||
return pevtobj;
|
||||
}
|
||||
|
||||
void rtw_free_evt_obj(struct evt_obj *pevtobj)
|
||||
{
|
||||
;
|
||||
|
||||
if(pevtobj->parmbuf)
|
||||
rtw_mfree((unsigned char*)pevtobj->parmbuf, pevtobj->evtsz);
|
||||
|
||||
rtw_mfree((unsigned char*)pevtobj, sizeof(struct evt_obj));
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
void rtw_evt_notify_isr(struct evt_priv *pevtpriv)
|
||||
{
|
||||
;
|
||||
pevtpriv->evt_done_cnt++;
|
||||
_rtw_up_sema(&(pevtpriv->evt_notify));
|
||||
;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
u8 rtw_setstandby_cmd(unsigned char *adapter)
|
||||
*/
|
||||
u8 rtw_setstandby_cmd(struct adapter *padapter, uint action)
|
||||
{
|
||||
struct cmd_obj* ph2c;
|
||||
|
|
|
@ -69,23 +69,7 @@
|
|||
struct adapter *padapter;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_EVENT_THREAD_MODE
|
||||
struct evt_obj {
|
||||
u16 evtcode;
|
||||
u8 res;
|
||||
u8 *parmbuf;
|
||||
u32 evtsz;
|
||||
_list list;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct evt_priv {
|
||||
#ifdef CONFIG_EVENT_THREAD_MODE
|
||||
_sema evt_notify;
|
||||
_sema terminate_evtthread_sema;
|
||||
_queue evt_queue;
|
||||
#endif
|
||||
|
||||
#define CONFIG_C2H_WK
|
||||
#ifdef CONFIG_C2H_WK
|
||||
_workitem c2h_wk;
|
||||
|
@ -125,26 +109,20 @@ struct c2h_evt_hdr {
|
|||
|
||||
#define c2h_evt_exist(c2h_evt) ((c2h_evt)->id || (c2h_evt)->plen)
|
||||
|
||||
extern u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj);
|
||||
extern struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv);
|
||||
extern void rtw_free_cmd_obj(struct cmd_obj *pcmd);
|
||||
|
||||
#ifdef CONFIG_EVENT_THREAD_MODE
|
||||
extern u32 rtw_enqueue_evt(struct evt_priv *pevtpriv, struct evt_obj *obj);
|
||||
extern struct evt_obj *rtw_dequeue_evt(_queue *queue);
|
||||
extern void rtw_free_evt_obj(struct evt_obj *pcmd);
|
||||
#endif
|
||||
u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj);
|
||||
struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv);
|
||||
void rtw_free_cmd_obj(struct cmd_obj *pcmd);
|
||||
|
||||
void rtw_stop_cmd_thread(struct adapter *adapter);
|
||||
thread_return rtw_cmd_thread(thread_context context);
|
||||
|
||||
extern u32 rtw_init_cmd_priv (struct cmd_priv *pcmdpriv);
|
||||
extern void rtw_free_cmd_priv (struct cmd_priv *pcmdpriv);
|
||||
u32 rtw_init_cmd_priv (struct cmd_priv *pcmdpriv);
|
||||
void rtw_free_cmd_priv (struct cmd_priv *pcmdpriv);
|
||||
|
||||
extern u32 rtw_init_evt_priv (struct evt_priv *pevtpriv);
|
||||
extern void rtw_free_evt_priv (struct evt_priv *pevtpriv);
|
||||
extern void rtw_cmd_clr_isr(struct cmd_priv *pcmdpriv);
|
||||
extern void rtw_evt_notify_isr(struct evt_priv *pevtpriv);
|
||||
u32 rtw_init_evt_priv (struct evt_priv *pevtpriv);
|
||||
void rtw_free_evt_priv (struct evt_priv *pevtpriv);
|
||||
void rtw_cmd_clr_isr(struct cmd_priv *pcmdpriv);
|
||||
void rtw_evt_notify_isr(struct evt_priv *pevtpriv);
|
||||
#ifdef CONFIG_P2P
|
||||
u8 p2p_protocol_wk_cmd(struct adapter*padapter, int intCmdType );
|
||||
#endif //CONFIG_P2P
|
||||
|
|
|
@ -639,12 +639,6 @@ u32 rtw_start_drv_threads(struct adapter *padapter)
|
|||
else
|
||||
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); /* wait for cmd_thread to run */
|
||||
|
||||
#ifdef CONFIG_EVENT_THREAD_MODE
|
||||
padapter->evtThread = kthread_run(event_thread, padapter, "RTW_EVENT_THREAD");
|
||||
if(IS_ERR(padapter->evtThread))
|
||||
_status = _FAIL;
|
||||
#endif
|
||||
|
||||
rtw_hal_start_thread(padapter);
|
||||
return _status;
|
||||
|
||||
|
@ -684,13 +678,6 @@ void rtw_stop_drv_threads (struct adapter *padapter)
|
|||
|
||||
rtw_stop_cmd_thread(padapter);
|
||||
|
||||
#ifdef CONFIG_EVENT_THREAD_MODE
|
||||
_rtw_up_sema(&padapter->evtpriv.evt_notify);
|
||||
if(padapter->evtThread){
|
||||
_rtw_down_sema(&padapter->evtpriv.terminate_evtthread_sema);
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_hal_stop_thread(padapter);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue