Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20334b5e authored by navin patidar's avatar navin patidar Committed by Greg Kroah-Hartman
Browse files

staging: rtl8188eu: Remove struct evt_priv and its uses



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: default avatarnavin patidar <navin.patidar@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2454e79a
Loading
Loading
Loading
Loading
+0 −86
Original line number Diff line number Diff line
@@ -72,43 +72,6 @@ int _rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
	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 @@ static s32 c2h_evt_hdl(struct adapter *adapter, struct c2h_evt_hdr *c2h_evt, c2h
	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;
+0 −4
Original line number Diff line number Diff line
@@ -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_:
+0 −1
Original line number Diff line number Diff line
@@ -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);
+0 −1
Original line number Diff line number Diff line
@@ -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;
+0 −14
Original line number Diff line number Diff line
@@ -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,
Loading