All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/48] staging: rtl8188eu: Remove struct evt_priv and its uses
@ 2014-07-02 16:46 navin patidar
  2014-07-02 16:46 ` [PATCH 02/48] staging: rtl8188eu: Remove function c2h_evt_hdl() navin patidar
                   ` (47 more replies)
  0 siblings, 48 replies; 49+ messages in thread
From: navin patidar @ 2014-07-02 16:46 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, devel, linux-kernel, navin patidar

c2h_wk (work_struct) is naver scheduled to handle events,
so no use of keeping event data.
And also function rtw_hal_c2h_handler() responsible for handling c2h events,
is a dummy function.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_cmd.c      |   86 -------------------------
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c |    4 --
 drivers/staging/rtl8188eu/include/cmd_osdep.h |    1 -
 drivers/staging/rtl8188eu/include/drv_types.h |    1 -
 drivers/staging/rtl8188eu/include/rtw_cmd.h   |   14 ----
 drivers/staging/rtl8188eu/os_dep/os_intfs.c   |    8 ---
 6 files changed, 114 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index 310e916..293fda4 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -72,43 +72,6 @@ exit:
 	return res;
 }
 
-static void c2h_wk_callback(struct work_struct *work);
-
-int _rtw_init_evt_priv(struct evt_priv *pevtpriv)
-{
-	int 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;
-
-	INIT_WORK(&pevtpriv->c2h_wk, c2h_wk_callback);
-	pevtpriv->c2h_wk_alive = false;
-	pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN+1);
-
-
-	return res;
-}
-
-void rtw_free_evt_priv(struct evt_priv *pevtpriv)
-{
-
-	RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("+rtw_free_evt_priv\n"));
-
-	cancel_work_sync(&pevtpriv->c2h_wk);
-	while (pevtpriv->c2h_wk_alive)
-		msleep(10);
-
-	while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
-		void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
-		if (c2h != NULL && c2h != (void *)pevtpriv)
-			kfree(c2h);
-	}
-	RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("-rtw_free_evt_priv\n"));
-
-}
-
 void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
 {
 
@@ -175,13 +138,6 @@ u32 rtw_init_cmd_priv(struct 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_cmd_priv(struct cmd_priv *pcmdpriv)
 {
 	RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("rtw_free_cmd_priv\n"));
@@ -1877,48 +1833,6 @@ exit:
 	return ret;
 }
 
-static void c2h_wk_callback(struct work_struct *work)
-{
-	struct evt_priv *evtpriv = container_of(work, struct evt_priv, c2h_wk);
-	struct adapter *adapter = container_of(evtpriv, struct adapter, evtpriv);
-	struct c2h_evt_hdr *c2h_evt;
-	c2h_id_filter ccx_id_filter = rtw_hal_c2h_id_filter_ccx(adapter);
-
-	evtpriv->c2h_wk_alive = true;
-
-	while (!rtw_cbuf_empty(evtpriv->c2h_queue)) {
-		c2h_evt = (struct c2h_evt_hdr *)
-			rtw_cbuf_pop(evtpriv->c2h_queue);
-		if (c2h_evt != NULL)
-			/* This C2H event is read, clear it */
-			c2h_evt_clear(adapter);
-		else {
-			c2h_evt = (struct c2h_evt_hdr *)rtw_malloc(16);
-			/* This C2H event is not read, read & clear now */
-			if (c2h_evt != NULL &&
-			    c2h_evt_read(adapter, (u8 *)c2h_evt) != _SUCCESS)
-				continue;
-		}
-
-		/* Special pointer to trigger c2h_evt_clear only */
-		if ((void *)c2h_evt == (void *)evtpriv)
-			continue;
-
-		if (!c2h_evt_exist(c2h_evt)) {
-			kfree(c2h_evt);
-			continue;
-		}
-
-		if (ccx_id_filter(c2h_evt->id) == true) {
-			/* Handle CCX report here */
-			rtw_hal_c2h_handler(adapter, c2h_evt);
-			kfree(c2h_evt);
-		}
-	}
-
-	evtpriv->c2h_wk_alive = false;
-}
-
 u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
 {
 	struct drvextra_cmd_parm *pdrvextra_cmd;
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index c42d9fd..c4888b1 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -5461,7 +5461,6 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf)
 	u16 evt_sz;
 	uint	*peventbuf;
 	void (*event_callback)(struct adapter *dev, u8 *pbuf);
-	struct evt_priv *pevt_priv = &(padapter->evtpriv);
 
 	peventbuf = (uint *)pbuf;
 	evt_sz = (u16)(*peventbuf&0xffff);
@@ -5482,15 +5481,12 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf)
 		goto _abort_event_;
 	}
 
-	atomic_inc(&pevt_priv->event_seq);
-
 	peventbuf += 2;
 
 	if (peventbuf) {
 		event_callback = wlanevents[evt_code].event_callback;
 		event_callback(padapter, (u8 *)peventbuf);
 
-		pevt_priv->evt_done_cnt++;
 	}
 
 _abort_event_:
diff --git a/drivers/staging/rtl8188eu/include/cmd_osdep.h b/drivers/staging/rtl8188eu/include/cmd_osdep.h
index 5a8465e..7a93e1d 100644
--- a/drivers/staging/rtl8188eu/include/cmd_osdep.h
+++ b/drivers/staging/rtl8188eu/include/cmd_osdep.h
@@ -24,7 +24,6 @@
 #include <drv_types.h>
 
 extern int _rtw_init_cmd_priv(struct cmd_priv *pcmdpriv);
-extern int _rtw_init_evt_priv(struct evt_priv *pevtpriv);
 extern void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv);
 extern int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj);
 extern struct cmd_obj	*_rtw_dequeue_cmd(struct __queue *queue);
diff --git a/drivers/staging/rtl8188eu/include/drv_types.h b/drivers/staging/rtl8188eu/include/drv_types.h
index fdf2c79..8f42d48 100644
--- a/drivers/staging/rtl8188eu/include/drv_types.h
+++ b/drivers/staging/rtl8188eu/include/drv_types.h
@@ -189,7 +189,6 @@ struct adapter {
 	struct	mlme_priv mlmepriv;
 	struct	mlme_ext_priv mlmeextpriv;
 	struct	cmd_priv	cmdpriv;
-	struct	evt_priv	evtpriv;
 	struct	xmit_priv	xmitpriv;
 	struct	recv_priv	recvpriv;
 	struct	sta_priv	stapriv;
diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h
index d7fbff2..7a70f02 100644
--- a/drivers/staging/rtl8188eu/include/rtw_cmd.h
+++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h
@@ -64,17 +64,6 @@ struct cmd_priv {
 	struct adapter *padapter;
 };
 
-struct	evt_priv {
-	struct work_struct c2h_wk;
-	bool c2h_wk_alive;
-	struct rtw_cbuf *c2h_queue;
-	#define C2H_QUEUE_MAX_LEN 10
-	atomic_t event_seq;
-	u8	*evt_buf;	/* shall be non-paged, and 4 bytes aligned */
-	u8	*evt_allocated_buf;
-	u32	evt_done_cnt;
-};
-
 #define init_h2fwcmd_w_parm_no_rsp(pcmd, pparm, code) \
 do {\
 	INIT_LIST_HEAD(&pcmd->list);\
@@ -103,10 +92,7 @@ int rtw_cmd_thread(void *context);
 u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv);
 void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv);
 
-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);
 
 enum rtw_drvextra_cmd_id {
 	NONE_WK_CID,
diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index aac9473..f331aae 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -852,12 +852,6 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
 
 	padapter->cmdpriv.padapter = padapter;
 
-	if ((rtw_init_evt_priv(&padapter->evtpriv)) == _FAIL) {
-		RT_TRACE(_module_os_intfs_c_, _drv_err_, ("\n Can't init evt_priv\n"));
-		ret8 = _FAIL;
-		goto exit;
-	}
-
 	if (rtw_init_mlme_priv(padapter) == _FAIL) {
 		RT_TRACE(_module_os_intfs_c_, _drv_err_, ("\n Can't init mlme_priv\n"));
 		ret8 = _FAIL;
@@ -940,8 +934,6 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
 
 	rtw_free_cmd_priv(&padapter->cmdpriv);
 
-	rtw_free_evt_priv(&padapter->evtpriv);
-
 	rtw_free_mlme_priv(&padapter->mlmepriv);
 	_rtw_free_xmit_priv(&padapter->xmitpriv);
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2014-07-09 19:01 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-02 16:46 [PATCH 01/48] staging: rtl8188eu: Remove struct evt_priv and its uses navin patidar
2014-07-02 16:46 ` [PATCH 02/48] staging: rtl8188eu: Remove function c2h_evt_hdl() navin patidar
2014-07-02 16:46 ` [PATCH 03/48] staging: rtl8188eu: Remove unused function c2h_evt_read() navin patidar
2014-07-02 16:47 ` [PATCH 04/48] staging: rtl8188eu: Remove unused function c2h_evt_clear() navin patidar
2014-07-02 16:47 ` [PATCH 05/48] staging: rtl8188eu: Remove dummy function rtw_hal_c2h_handler() navin patidar
2014-07-02 16:47 ` [PATCH 06/48] staging: rtl8188eu: Remove unused function rtw_hal_c2h_id_filter_ccx() navin patidar
2014-07-02 16:47 ` [PATCH 07/48] staging: rtl8188eu: rtw_cmd.h: Remove unused macro and structure navin patidar
2014-07-02 16:47 ` [PATCH 08/48] staging: rtl8188eu: Remove unused function rtw_getrttbl_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 09/48] staging: rtl8188eu: Remove unused function rtw_c2h_wk_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 10/48] staging: rtl8188eu: Remove unused function rtw_setbasicrate_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 11/48] staging: rtl8188eu: Remove unused function rtw_setphy_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 12/48] staging: rtl8188eu: Remove unused function rtw_setbbreg_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 13/48] staging: rtl8188eu: Remove unused function rtw_getbbreg_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 14/48] staging: rtl8188eu: Remove unused function rtw_[set,get]rfreg_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 15/48] staging: rtl8188eu: Remove unused function rtw_setrttbl_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 16/48] staging: rtl8188eu: Remove unused function rtw_set_ch_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 17/48] staging: rtl8188eu: Remove unused function rtw_set_csa_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 18/48] staging: rtl8188eu: Remove dummy function rtw_tdls_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 19/48] staging: rtl8188eu: Remove unused function rtw_setassocsta_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 20/48] staging: rtl8188eu: Remove unused function rtw_setstandby_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 21/48] staging: rtl8188eu: Remove unused function rtw_createbss_cmd_ex() navin patidar
2014-07-02 16:47 ` [PATCH 22/48] staging: rtl8188eu: rtw_cmd.h: Remove unused function declaration navin patidar
2014-07-02 16:47 ` [PATCH 23/48] staging: rtl8188eu: rtw_cmd.h: Remove unused macros navin patidar
2014-07-02 16:47 ` [PATCH 24/48] staging: rtl8188eu: rtw_cmd.h: Remove unused structures navin patidar
2014-07-02 16:47 ` [PATCH 25/48] staging: rtl8188eu: Remove unused function rtw_cmd_clr_isr() navin patidar
2014-07-02 16:47 ` [PATCH 26/48] staging: rtl8188eu: rtw_cmd.h: Remove struct [join,create]bss_parm navin patidar
2014-07-02 16:47 ` [PATCH 27/48] staging: rtl8188eu: rtw_cmd.h: Remove struct Tx_Beacon_param navin patidar
2014-07-02 16:47 ` [PATCH 28/48] staging: rtl8188eu: Remove header file cmd_osdep.h navin patidar
2014-07-02 16:47 ` [PATCH 29/48] staging: rtl8188eu: Remove wrapper function power_saving_wk_hdl() navin patidar
2014-07-02 16:47 ` [PATCH 30/48] staging: rtl8188eu: Rename _rtw_init_cmd_priv() to rtw_init_cmd_priv() navin patidar
2014-07-02 16:47 ` [PATCH 31/48] staging: rtl8188eu: Rename _rtw_free_cmd_priv() to rtw_free_cmd_priv() navin patidar
2014-07-02 16:47 ` [PATCH 32/48] staging: rtl8188eu: Rename _rtw_dequeue_cmd() to rtw_dequeue_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 33/48] staging: rtl8188eu: Remove unused member rsp_cnt from struct cmd_priv navin patidar
2014-07-02 16:47 ` [PATCH 34/48] staging: rtl8188eu: Remove unused member cmd_issued_cnt " navin patidar
2014-07-02 16:47 ` [PATCH 35/48] staging: rtl8188eu: Remove unused member cmd_done_cnt " navin patidar
2014-07-02 16:47 ` [PATCH 36/48] staging: rtl8188eu: Remove unused members rsp_[allocated,]_buf " navin patidar
2014-07-02 16:47 ` [PATCH 37/48] staging: rtl8188eu: Remove members cmd_[allocated,]_buf " navin patidar
2014-07-02 16:47 ` [PATCH 38/48] staging: rtl8188eu: Remove function rtw_getbbrfreg_cmdrsp_callback() navin patidar
2014-07-02 16:47 ` [PATCH 39/48] staging: rtl8188eu: Remove function rtw_setdatarate_cmd() navin patidar
2014-07-02 16:47 ` [PATCH 40/48] staging: rtl8188eu: rtw_[cmd, mlme_ext].h: Remove unused command codes navin patidar
2014-07-02 16:47 ` [PATCH 41/48] staging: rtl8188eu: rtw_cmd.h: Remove unused structures navin patidar
2014-07-02 16:47 ` [PATCH 42/48] staging: rtl8188eu: Remove command _TDLS and its handler navin patidar
2014-07-02 16:47 ` [PATCH 43/48] staging: rtl8188eu: Remove command _SetChannelSwitch " navin patidar
2014-07-02 16:47 ` [PATCH 44/48] staging: rtl8188eu: Remove command _LedBlink " navin patidar
2014-07-02 16:47 ` [PATCH 45/48] staging: rtl8188eu: Remove command _Set_H2C_MSG " navin patidar
2014-07-02 16:47 ` [PATCH 46/48] staging: rtl8188eu: rtw_cmd.h: Remove unused structures navin patidar
2014-07-02 16:47 ` [PATCH 47/48] staging: rtl8188eu: Remove cmd_seq from struct cmd_priv navin patidar
2014-07-02 16:47 ` [PATCH 48/48] staging: rtl8188eu: Remove dummy function rtw_free_cmd_priv() navin patidar
2014-07-09 19:05 ` [PATCH 01/48] staging: rtl8188eu: Remove struct evt_priv and its uses Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.