File leap.patch of Package rtl8821ce

diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/core/rtw_mlme.c  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_mlme.c
---  rtl8821ce-git20180902-1/core/rtw_mlme.c	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_mlme.c	2018-01-06 19:48:16.000000000 +0100
@@ -29,15 +29,15 @@
 {
 	struct	mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-	rtw_init_timer(&(pmlmepriv->assoc_timer), padapter, rtw_join_timeout_handler);
-	rtw_init_timer(&(pmlmepriv->scan_to_timer), padapter, rtw_scan_timeout_handler);
+	rtw_init_timer(&(pmlmepriv->assoc_timer), padapter, rtw_join_timeout_handler, padapter);
+	rtw_init_timer(&(pmlmepriv->scan_to_timer), padapter, rtw_scan_timeout_handler, padapter);
 
 #ifdef CONFIG_DFS_MASTER
 	rtw_init_timer(&(pmlmepriv->dfs_master_timer), padapter, rtw_dfs_master_timer_hdl, padapter);
 #endif
 
 #ifdef CONFIG_SET_SCAN_DENY_TIMER
-	rtw_init_timer(&(pmlmepriv->set_scan_deny_timer), padapter, rtw_set_scan_deny_timer_hdl);
+	rtw_init_timer(&(pmlmepriv->set_scan_deny_timer), padapter, rtw_set_scan_deny_timer_hdl, padapter);
 #endif
 
 #ifdef RTK_DMP_PLATFORM
@@ -2701,10 +2701,11 @@
 /*
 * rtw_join_timeout_handler - Timeout/failure handler for CMD JoinBss
 */
-void rtw_join_timeout(struct mlme_priv *pmlmepriv)
+void rtw_join_timeout_handler(void *ctx)
 {
-	_adapter *adapter = container_of(pmlmepriv, _adapter, mlmepriv);
+	_adapter *adapter = (_adapter *)ctx;
 	_irqL irqL;
+	struct	mlme_priv *pmlmepriv = &adapter->mlmepriv;
 
 #if 0
 	if (rtw_is_drv_stopped(adapter)) {
@@ -2778,20 +2779,15 @@
 
 }
 
-void rtw_join_timeout_handler(struct timer_list *t) {
-	struct	mlme_priv *pmlmepriv = from_timer(pmlmepriv, t, assoc_timer);
-	rtw_join_timeout(pmlmepriv);
-}
-
 /*
 * rtw_scan_timeout_handler - Timeout/Faliure handler for CMD SiteSurvey
 * @adapter: pointer to _adapter structure
 */
-void rtw_scan_timeout_handler(struct timer_list *t)
+void rtw_scan_timeout_handler(void *ctx)
 {
-	struct	mlme_priv *pmlmepriv = from_timer(pmlmepriv, t, scan_to_timer);
-	_adapter *adapter = container_of(pmlmepriv, _adapter, mlmepriv);
+	_adapter *adapter = (_adapter *)ctx;
 	_irqL irqL;
+	struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
 	RTW_INFO(FUNC_ADPT_FMT" fw_state=%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv));
 
 	_enter_critical_bh(&pmlmepriv->lock, &irqL);
@@ -3054,9 +3050,9 @@
 	#endif
 }
 
-void rtw_dynamic_check_timer_handlder(struct timer_list *t)
+void rtw_dynamic_check_timer_handlder(void *ctx)
 {
-	struct dvobj_priv *pdvobj = from_timer(pdvobj, t, dynamic_chk_timer);
+	struct dvobj_priv *pdvobj = (struct dvobj_priv *)ctx;
 	_adapter *adapter = dvobj_get_primary_adapter(pdvobj);
 
 #if (MP_DRIVER == 1)
@@ -3102,10 +3098,9 @@
 		RTW_INFO(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter));
 }
 
-void rtw_set_scan_deny_timer_hdl(struct timer_list *t)
+void rtw_set_scan_deny_timer_hdl(void *ctx)
 {
-	struct	mlme_priv *pmlmepriv = from_timer(pmlmepriv, t, set_scan_deny_timer);
-	_adapter *adapter = container_of(pmlmepriv, _adapter, mlmepriv);
+	_adapter *adapter = (_adapter *)ctx;
 
 	rtw_clear_scan_deny(adapter);
 }
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/core/rtw_mlme_ext.c  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_mlme_ext.c
---  rtl8821ce-git20180902-1/core/rtw_mlme_ext.c	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_mlme_ext.c	2018-01-06 19:48:16.000000000 +0100
@@ -1333,8 +1333,8 @@
 {
 	struct	mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 
-	rtw_init_timer(&pmlmeext->survey_timer, padapter, survey_timer_hdl);
-	rtw_init_timer(&pmlmeext->link_timer, padapter, link_timer_hdl);
+	rtw_init_timer(&pmlmeext->survey_timer, padapter, survey_timer_hdl, padapter);
+	rtw_init_timer(&pmlmeext->link_timer, padapter, link_timer_hdl, padapter);
 #ifdef CONFIG_RTW_80211R
 	rtw_init_timer(&pmlmeext->ft_link_timer, padapter, ft_link_timer_hdl, padapter);
 	rtw_init_timer(&pmlmeext->ft_roam_timer, padapter, ft_roam_timer_hdl, padapter);
@@ -12760,13 +12760,13 @@
 
 }
 
-void survey_timer_hdl(struct timer_list *t)
+void survey_timer_hdl(void *ctx)
 {
-	struct mlme_ext_priv    *pmlmeext = from_timer(pmlmeext, t, survey_timer);
-	_adapter *padapter = container_of(pmlmeext, _adapter, mlmeextpriv);
+	_adapter *padapter = (_adapter *)ctx;
 	struct cmd_obj *cmd;
 	struct sitesurvey_parm *psurveyPara;
 	struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
+	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 #ifdef CONFIG_P2P
 	struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
 #endif
@@ -12793,13 +12793,13 @@
 	return;
 }
 
-void link_timer_hdl(struct timer_list *t)
+void link_timer_hdl(void *ctx)
 {
-	struct mlme_ext_priv    *pmlmeext = from_timer(pmlmeext, t, link_timer);
-	_adapter *padapter = container_of(pmlmeext, _adapter, mlmeextpriv);
+	_adapter *padapter = (_adapter *)ctx;
 	/* static unsigned int		rx_pkt = 0; */
 	/* static u64				tx_cnt = 0; */
 	/* struct xmit_priv		*pxmitpriv = &(padapter->xmitpriv); */
+	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
 	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
 	/* struct sta_priv		*pstapriv = &padapter->stapriv; */
 #ifdef CONFIG_RTW_80211R
@@ -12867,9 +12867,9 @@
 	return;
 }
 
-void addba_timer_hdl(struct timer_list *t)
+void addba_timer_hdl(void *ctx)
 {
-	struct sta_info *psta = from_timer(psta, t, addba_retry_timer);
+	struct sta_info *psta = (struct sta_info *)ctx;
 
 #ifdef CONFIG_80211N_HT
 	struct ht_priv	*phtpriv;
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/core/rtw_mlme_ext.diff  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_mlme_ext.diff
---  rtl8821ce-git20180902-1/core/rtw_mlme_ext.diff	1970-01-01 01:00:00.000000000 +0100
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_mlme_ext.diff	2018-09-02 12:07:19.000000000 +0200
@@ -0,0 +1,80 @@
+---  rtl8821ce-git20180902/core/rtw_mlme_ext.c	2018-09-02 12:04:10.979471062 +0200
++++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_mlme_ext.c	2018-01-06 19:48:16.000000000 +0100
+@@ -1333,13 +1333,8 @@
+ {
+ 	struct	mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+ 
+-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 15, 0))
+ 	rtw_init_timer(&pmlmeext->survey_timer, padapter, survey_timer_hdl, padapter);
+ 	rtw_init_timer(&pmlmeext->link_timer, padapter, link_timer_hdl, padapter);
+-#else
+-	rtw_init_timer(&pmlmeext->survey_timer, padapter, survey_timer_hdl);
+-	rtw_init_timer(&pmlmeext->link_timer, padapter, link_timer_hdl);
+-#endif
+ #ifdef CONFIG_RTW_80211R
+ 	rtw_init_timer(&pmlmeext->ft_link_timer, padapter, ft_link_timer_hdl, padapter);
+ 	rtw_init_timer(&pmlmeext->ft_roam_timer, padapter, ft_roam_timer_hdl, padapter);
+@@ -12765,22 +12760,13 @@
+ 
+ }
+ 
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
+-void survey_timer_hdl(struct timer_list *t)
+-{
+-	struct mlme_ext_priv    *pmlmeext = from_timer(pmlmeext, t, survey_timer);
+-	_adapter *padapter = container_of(pmlmeext, _adapter, mlmeextpriv);
+-#else
+-    void survey_timer_hdl(void *ctx)
++void survey_timer_hdl(void *ctx)
+ {
+ 	_adapter *padapter = (_adapter *)ctx;
+-#endif
+ 	struct cmd_obj *cmd;
+ 	struct sitesurvey_parm *psurveyPara;
+ 	struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
+-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 15, 0))
+-   	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+-#endif
++	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+ #ifdef CONFIG_P2P
+ 	struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
+ #endif
+@@ -12807,22 +12793,13 @@
+ 	return;
+ }
+ 
+-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 15, 0))
+ void link_timer_hdl(void *ctx)
+ {
+ 	_adapter *padapter = (_adapter *)ctx;
+-#else
+-void link_timer_hdl(struct timer_list *t)
+-{
+-	struct mlme_ext_priv    *pmlmeext = from_timer(pmlmeext, t, link_timer);
+-	_adapter *padapter = container_of(pmlmeext, _adapter, mlmeextpriv);
+-#endif
+ 	/* static unsigned int		rx_pkt = 0; */
+ 	/* static u64				tx_cnt = 0; */
+ 	/* struct xmit_priv		*pxmitpriv = &(padapter->xmitpriv); */
+-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 15, 0))
+ 	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
+-#endif
+ 	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
+ 	/* struct sta_priv		*pstapriv = &padapter->stapriv; */
+ #ifdef CONFIG_RTW_80211R
+@@ -12890,15 +12867,9 @@
+ 	return;
+ }
+ 
+-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 15, 0))
+ void addba_timer_hdl(void *ctx)
+ {
+ 	struct sta_info *psta = (struct sta_info *)ctx;
+-#else
+-void addba_timer_hdl(struct timer_list *t)
+-{
+-	struct sta_info *psta = from_timer(psta, t, addba_retry_timer);
+-#endif
+ 
+ #ifdef CONFIG_80211N_HT
+ 	struct ht_priv	*phtpriv;
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/core/rtw_p2p.c  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_p2p.c
---  rtl8821ce-git20180902-1/core/rtw_p2p.c	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_p2p.c	2018-01-06 19:48:16.000000000 +0100
@@ -3355,10 +3355,9 @@
 	return ret;
 }
 
-static void ro_ch_timer_process(struct timer_list *t)
+static void ro_ch_timer_process(void *FunctionContext)
 {
-	struct cfg80211_wifidirect_info *pcfg80211_wdinfo = from_timer(pcfg80211_wdinfo, t, remain_on_ch_timer);
-	_adapter *adapter = container_of(pcfg80211_wdinfo, _adapter, cfg80211_wdinfo);
+	_adapter *adapter = (_adapter *)FunctionContext;
 
 	p2p_cancel_roch_cmd(adapter, 0, NULL, 0);
 }
@@ -4204,7 +4203,7 @@
 
 	_rtw_memset(pcfg80211_wdinfo, 0x00, sizeof(struct cfg80211_wifidirect_info));
 
-	rtw_init_timer(&pcfg80211_wdinfo->remain_on_ch_timer, padapter, ro_ch_timer_process);
+	rtw_init_timer(&pcfg80211_wdinfo->remain_on_ch_timer, padapter, ro_ch_timer_process, padapter);
 }
 #endif /* CONFIG_IOCTL_CFG80211	 */
 
@@ -4520,9 +4519,10 @@
 }
 #endif /* CONFIG_P2P_PS */
 
-static void __reset_ch_sitesurvey_timer_process(struct wifidirect_info *pwdinfo)
+static void reset_ch_sitesurvey_timer_process(void *FunctionContext)
 {
-	_adapter *adapter = container_of(pwdinfo, _adapter, wdinfo);
+	_adapter *adapter = (_adapter *)FunctionContext;
+	struct	wifidirect_info		*pwdinfo = &adapter->wdinfo;
 
 	if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
 		return;
@@ -4538,15 +4538,10 @@
 	pwdinfo->rx_invitereq_info.scan_op_ch_only = 0;
 }
 
-static void reset_ch_sitesurvey_timer_process(struct timer_list *t)
-{
-	struct	wifidirect_info		*pwdinfo = from_timer(pwdinfo, t, reset_ch_sitesurvey);
-	__reset_ch_sitesurvey_timer_process(pwdinfo);
-}
-
-static void __reset_ch_sitesurvey_timer_process2(struct wifidirect_info *pwdinfo)
+static void reset_ch_sitesurvey_timer_process2(void *FunctionContext)
 {
-	_adapter *adapter = container_of(pwdinfo, _adapter, wdinfo);
+	_adapter *adapter = (_adapter *)FunctionContext;
+	struct	wifidirect_info		*pwdinfo = &adapter->wdinfo;
 
 	if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
 		return;
@@ -4562,16 +4557,10 @@
 	pwdinfo->p2p_info.scan_op_ch_only = 0;
 }
 
-static void reset_ch_sitesurvey_timer_process2(struct timer_list *t)
-{
-	struct	wifidirect_info		*pwdinfo = from_timer(pwdinfo, t, reset_ch_sitesurvey2);
-	__reset_ch_sitesurvey_timer_process2(pwdinfo);
-}
-
-static void restore_p2p_state_timer_process(struct timer_list *t)
+static void restore_p2p_state_timer_process(void *FunctionContext)
 {
-	struct	wifidirect_info		*pwdinfo = from_timer(pwdinfo, t, restore_p2p_state_timer);
-	_adapter *adapter = container_of(pwdinfo, _adapter, wdinfo);
+	_adapter *adapter = (_adapter *)FunctionContext;
+	struct	wifidirect_info		*pwdinfo = &adapter->wdinfo;
 
 	if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
 		return;
@@ -4579,10 +4568,10 @@
 	p2p_protocol_wk_cmd(adapter, P2P_RESTORE_STATE_WK);
 }
 
-static void pre_tx_scan_timer_process(struct timer_list *t)
+static void pre_tx_scan_timer_process(void *FunctionContext)
 {
-	struct	wifidirect_info		*pwdinfo = from_timer(pwdinfo, t, pre_tx_scan_timer);
-	_adapter *adapter = container_of(pwdinfo, _adapter, wdinfo);
+	_adapter							*adapter = (_adapter *) FunctionContext;
+	struct	wifidirect_info				*pwdinfo = &adapter->wdinfo;
 	_irqL							irqL;
 	struct mlme_priv					*pmlmepriv = &adapter->mlmepriv;
 	u8								_status = 0;
@@ -4611,10 +4600,10 @@
 	_exit_critical_bh(&pmlmepriv->lock, &irqL);
 }
 
-static void find_phase_timer_process(struct timer_list *t)
+static void find_phase_timer_process(void *FunctionContext)
 {
-	struct	wifidirect_info		*pwdinfo = from_timer(pwdinfo, t, find_phase_timer);
-	_adapter *adapter = container_of(pwdinfo, _adapter, wdinfo);
+	_adapter *adapter = (_adapter *)FunctionContext;
+	struct	wifidirect_info		*pwdinfo = &adapter->wdinfo;
 
 	if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
 		return;
@@ -4870,11 +4859,11 @@
 {
 	struct wifidirect_info *pwdinfo = &padapter->wdinfo;
 
-	rtw_init_timer(&pwdinfo->find_phase_timer, padapter, find_phase_timer_process);
-	rtw_init_timer(&pwdinfo->restore_p2p_state_timer, padapter, restore_p2p_state_timer_process);
-	rtw_init_timer(&pwdinfo->pre_tx_scan_timer, padapter, pre_tx_scan_timer_process);
-	rtw_init_timer(&pwdinfo->reset_ch_sitesurvey, padapter, reset_ch_sitesurvey_timer_process);
-	rtw_init_timer(&pwdinfo->reset_ch_sitesurvey2, padapter, reset_ch_sitesurvey_timer_process2);
+	rtw_init_timer(&pwdinfo->find_phase_timer, padapter, find_phase_timer_process, padapter);
+	rtw_init_timer(&pwdinfo->restore_p2p_state_timer, padapter, restore_p2p_state_timer_process, padapter);
+	rtw_init_timer(&pwdinfo->pre_tx_scan_timer, padapter, pre_tx_scan_timer_process, padapter);
+	rtw_init_timer(&pwdinfo->reset_ch_sitesurvey, padapter, reset_ch_sitesurvey_timer_process, padapter);
+	rtw_init_timer(&pwdinfo->reset_ch_sitesurvey2, padapter, reset_ch_sitesurvey_timer_process2, padapter);
 #ifdef CONFIG_CONCURRENT_MODE
 	rtw_init_timer(&pwdinfo->ap_p2p_switch_timer, padapter, ap_p2p_switch_timer_process, padapter);
 #endif
@@ -5259,8 +5248,8 @@
 			_cancel_timer_ex(&pwdinfo->pre_tx_scan_timer);
 			_cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey);
 			_cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey2);
-			__reset_ch_sitesurvey_timer_process(pwdinfo);
-			__reset_ch_sitesurvey_timer_process2(pwdinfo);
+			reset_ch_sitesurvey_timer_process(padapter);
+			reset_ch_sitesurvey_timer_process2(padapter);
 #ifdef CONFIG_CONCURRENT_MODE
 			_cancel_timer_ex(&pwdinfo->ap_p2p_switch_timer);
 #endif
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/core/rtw_pwrctrl.c  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_pwrctrl.c
---  rtl8821ce-git20180902-1/core/rtw_pwrctrl.c	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_pwrctrl.c	2018-01-06 19:48:16.000000000 +0100
@@ -393,11 +393,9 @@
 	return;
 }
 
-void pwr_state_check_handler(struct timer_list *t)
+void pwr_state_check_handler(void *ctx)
 {
-	struct pwrctrl_priv *pwrpriv = from_timer(pwrpriv, t, pwr_state_check_timer);
-	struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv);
-	_adapter *padapter = dvobj_get_primary_adapter(dvobj);
+	_adapter *padapter = (_adapter *)ctx;
 	rtw_ps_cmd(padapter);
 }
 
@@ -1972,7 +1970,6 @@
 
 	_init_pwrlock(&pwrctrlpriv->lock);
 	_init_pwrlock(&pwrctrlpriv->check_32k_lock);
-	pwrctrlpriv->adapter = padapter;
 	pwrctrlpriv->rf_pwrstate = rf_on;
 	pwrctrlpriv->ips_enter_cnts = 0;
 	pwrctrlpriv->ips_leave_cnts = 0;
@@ -2035,7 +2032,7 @@
 #endif /* CONFIG_LPS_RPWM_TIMER */
 #endif /* CONFIG_LPS_LCLK */
 
-	rtw_init_timer(&pwrctrlpriv->pwr_state_check_timer, padapter, pwr_state_check_handler);
+	rtw_init_timer(&pwrctrlpriv->pwr_state_check_timer, padapter, pwr_state_check_handler, padapter);
 
 	pwrctrlpriv->wowlan_mode = _FALSE;
 	pwrctrlpriv->wowlan_ap_mode = _FALSE;
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/core/rtw_recv.c  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_recv.c
---  rtl8821ce-git20180902-1/core/rtw_recv.c	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_recv.c	2018-01-06 19:48:16.000000000 +0100
@@ -30,7 +30,7 @@
 
 
 #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
-static void rtw_signal_stat_timer_hdl(struct timer_list *t);
+static void rtw_signal_stat_timer_hdl(void *ctx);
 
 enum {
 	SIGNAL_STAT_CALC_PROFILE_0 = 0,
@@ -145,7 +145,7 @@
 	res = rtw_hal_init_recv_priv(padapter);
 
 #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
-	rtw_init_timer(&precvpriv->signal_stat_timer, padapter, rtw_signal_stat_timer_hdl);
+	rtw_init_timer(&precvpriv->signal_stat_timer, padapter, rtw_signal_stat_timer_hdl, padapter);
 
 	precvpriv->signal_stat_sampling_interval = 2000; /* ms */
 	/* precvpriv->signal_stat_converging_constant = 5000; */ /* ms */
@@ -3213,10 +3213,10 @@
 }
 
 
-void rtw_reordering_ctrl_timeout_handler(struct timer_list *t)
+void rtw_reordering_ctrl_timeout_handler(void *pcontext)
 {
 	_irqL irql;
-	struct recv_reorder_ctrl *preorder_ctrl = from_timer(preorder_ctrl, t, reordering_ctrl_timer);
+	struct recv_reorder_ctrl *preorder_ctrl = (struct recv_reorder_ctrl *)pcontext;
 	_adapter *padapter = preorder_ctrl->padapter;
 	_queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
 
@@ -4220,10 +4220,10 @@
 }
 
 #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
-static void rtw_signal_stat_timer_hdl(struct timer_list *t)
+static void rtw_signal_stat_timer_hdl(void *ctx)
 {
-	struct recv_priv *recvpriv = from_timer(recvpriv, t, signal_stat_timer);
-	_adapter *adapter = container_of(recvpriv, _adapter, recvpriv);
+	_adapter *adapter = (_adapter *)ctx;
+	struct recv_priv *recvpriv = &adapter->recvpriv;
 
 	u32 tmp_s, tmp_q;
 	u8 avg_signal_strength = 0;
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/core/rtw_sreset.c  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_sreset.c
---  rtl8821ce-git20180902-1/core/rtw_sreset.c	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_sreset.c	2018-01-06 19:48:16.000000000 +0100
@@ -273,7 +273,7 @@
 
 	if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
 		rtw_set_to_roam(padapter, 0);
-		rtw_join_timeout(pmlmepriv);
+		rtw_join_timeout_handler(padapter);
 	}
 
 }
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/core/rtw_sta_mgt.c  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_sta_mgt.c
---  rtl8821ce-git20180902-1/core/rtw_sta_mgt.c	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/core/rtw_sta_mgt.c	2018-01-06 19:48:16.000000000 +0100
@@ -450,7 +450,7 @@
 {
 	_adapter *padapter = preorder_ctrl->padapter;
 
-	rtw_init_timer(&(preorder_ctrl->reordering_ctrl_timer), padapter, rtw_reordering_ctrl_timeout_handler);
+	rtw_init_timer(&(preorder_ctrl->reordering_ctrl_timer), padapter, rtw_reordering_ctrl_timeout_handler, preorder_ctrl);
 
 }
 
@@ -516,7 +516,7 @@
 		for (i = 0; i < 16; i++)
 			_rtw_memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], &wRxSeqInitialValue, 2);
 
-		rtw_init_timer(&psta->addba_retry_timer, psta->padapter, addba_timer_hdl);
+		rtw_init_timer(&psta->addba_retry_timer, psta->padapter, addba_timer_hdl, psta);
 #ifdef CONFIG_IEEE80211W
 		rtw_init_timer(&psta->dot11w_expire_timer, psta->padapter, sa_query_timer_hdl, psta);
 #endif /* CONFIG_IEEE80211W */
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/hal/hal_btcoex.c  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/hal/hal_btcoex.c
---  rtl8821ce-git20180902-1/hal/hal_btcoex.c	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/hal/hal_btcoex.c	2018-01-06 19:48:16.000000000 +0100
@@ -578,7 +578,7 @@
 	return retVal;
 }
 
-static void _btmpoper_timer_hdl(struct timer_list *t)
+static void _btmpoper_timer_hdl(void *p)
 {
 	if (GLBtcBtMpRptWait) {
 		GLBtcBtMpRptWait = 0;
@@ -2457,7 +2457,7 @@
 	/* BT Control H2C/C2H*/
 	GLBtcBtMpOperSeq = 0;
 	_rtw_mutex_init(&GLBtcBtMpOperLock);
-	rtw_init_timer(&GLBtcBtMpOperTimer, padapter, _btmpoper_timer_hdl);
+	rtw_init_timer(&GLBtcBtMpOperTimer, padapter, _btmpoper_timer_hdl, pBtCoexist);
 	_rtw_init_sema(&GLBtcBtMpRptSema, 0);
 	GLBtcBtMpRptSeq = 0;
 	GLBtcBtMpRptStatus = 0;
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/hal/led/hal_pci_led.c  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/hal/led/hal_pci_led.c
---  rtl8821ce-git20180902-1/hal/led/hal_pci_led.c	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/hal/led/hal_pci_led.c	2018-01-06 19:48:16.000000000 +0100
@@ -785,9 +785,9 @@
  *		Callback function of LED BlinkTimer,
  *		it just schedules to corresponding BlinkWorkItem/led_blink_hdl
  *   */
-void BlinkTimerCallback(struct timer_list *t)
+void BlinkTimerCallback(void *data)
 {
-	PLED_PCIE	 pLed = from_timer(pLed, t, BlinkTimer);
+	PLED_PCIE	 pLed = (PLED_PCIE)data;
 	_adapter		*padapter = pLed->padapter;
 
 	/* RTW_INFO("%s\n", __FUNCTION__); */
@@ -2148,7 +2148,7 @@
 
 	ResetLedStatus(pLed);
 
-	rtw_init_timer(&(pLed->BlinkTimer), padapter, BlinkTimerCallback);
+	rtw_init_timer(&(pLed->BlinkTimer), padapter, BlinkTimerCallback, pLed);
 }
 
 
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/hal/phydm/phydm_interface.c  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/hal/phydm/phydm_interface.c
---  rtl8821ce-git20180902-1/hal/phydm/phydm_interface.c	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/hal/phydm/phydm_interface.c	2018-01-06 19:48:16.000000000 +0100
@@ -572,10 +572,6 @@
 
 }
 
-#if 0
-/* Disabled because all users would need to be converted to the Linux 4.15
-* timer API change. However it has no users so just get rid of this helper.
- */
 void
 odm_initialize_timer(
 	struct PHY_DM_STRUCT			*p_dm_odm,
@@ -598,7 +594,7 @@
 	PlatformInitializeTimer(adapter, p_timer, call_back_func, p_context, sz_id);
 #endif
 }
-#endif
+
 
 void
 odm_cancel_timer(
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/include/hal_com_led.h  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/hal_com_led.h
---  rtl8821ce-git20180902-1/include/hal_com_led.h	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/hal_com_led.h	2018-01-06 19:48:16.000000000 +0100
@@ -373,7 +373,7 @@
 			(adapter)->ledpriv.SwLedOff((adapter), (pLed)); \
 	} while (0)
 
-void BlinkTimerCallback(struct timer_list *t);
+void BlinkTimerCallback(void *data);
 void BlinkWorkItemCallback(_workitem *work);
 
 void ResetLedStatus(PLED_DATA pLed);
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/include/osdep_service.h  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/osdep_service.h
---  rtl8821ce-git20180902-1/include/osdep_service.h	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/osdep_service.h	2018-01-06 19:48:16.000000000 +0100
@@ -343,7 +343,7 @@
 extern void rtw_yield_os(void);
 
 
-extern void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc);
+extern void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc, void *ctx);
 
 
 __inline static unsigned char _cancel_timer_ex(_timer *ptimer)
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/include/osdep_service_linux.h  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/osdep_service_linux.h
---  rtl8821ce-git20180902-1/include/osdep_service_linux.h	2018-09-02 06:40:39.660971459 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/osdep_service_linux.h	2018-09-02 07:00:12.237892351 +0200
@@ -291,10 +291,21 @@
 	list_del_init(plist);
 }
 
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 13, 0))
+__inline static void _init_timer(_timer *ptimer, _nic_hdl nic_hdl, void *pfunc, void *cntx)
+#else
 __inline static void _init_timer(_timer *ptimer, _nic_hdl nic_hdl, void *pfunc)
+#endif
+
 {
 	/* setup_timer(ptimer, pfunc,(u32)cntx);	 */
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 13, 0))
+    ptimer->function = pfunc;
+	ptimer->data = (unsigned long)cntx;
+	init_timer(ptimer);
+#else
 	timer_setup(ptimer, pfunc, 0);
+#endif
 }
 
 __inline static void _set_timer(_timer *ptimer, u32 delay_time)
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/include/rtw_bt_mp.h  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/rtw_bt_mp.h
---  rtl8821ce-git20180902-1/include/rtw_bt_mp.h	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/rtw_bt_mp.h	2018-01-06 19:48:16.000000000 +0100
@@ -190,7 +190,7 @@
 	u1Byte		length
 );
 
-void MPh2c_timeout_handle(struct timer_list *t);
+void MPh2c_timeout_handle(void *FunctionContext);
 
 VOID mptbt_BtControlProcess(
 	PADAPTER	Adapter,
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/include/rtw_mlme_ext.h  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/rtw_mlme_ext.h
---  rtl8821ce-git20180902-1/include/rtw_mlme_ext.h	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/rtw_mlme_ext.h	2018-01-06 19:48:16.000000000 +0100
@@ -1047,9 +1047,9 @@
 
 void _linked_info_dump(_adapter *padapter);
 
-void survey_timer_hdl(struct timer_list *t);
-void link_timer_hdl(struct timer_list *t);
-void addba_timer_hdl(struct timer_list *t);
+void survey_timer_hdl(void *ctx);
+void link_timer_hdl(void *ctx);
+void addba_timer_hdl(void *ctx);
 #ifdef CONFIG_IEEE80211W
 void sa_query_timer_hdl(void *ctx);
 #endif /* CONFIG_IEEE80211W */
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/include/rtw_mlme.h  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/rtw_mlme.h
---  rtl8821ce-git20180902-1/include/rtw_mlme.h	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/rtw_mlme.h	2018-01-06 19:48:16.000000000 +0100
@@ -1040,17 +1040,16 @@
 
 extern void rtw_get_encrypt_decrypt_from_registrypriv(_adapter *adapter);
 
-extern void rtw_join_timeout_handler(struct timer_list *t);
-extern void rtw_join_timeout(struct mlme_priv *pmlmepriv);
-extern void rtw_scan_timeout_handler(struct timer_list *t);
+extern void rtw_join_timeout_handler(void *ctx);
+extern void rtw_scan_timeout_handler(void *ctx);
 
-extern void rtw_dynamic_check_timer_handlder(struct timer_list *t);
+extern void rtw_dynamic_check_timer_handlder(void *ctx);
 extern void rtw_iface_dynamic_check_timer_handlder(_adapter *adapter);
 
 #ifdef CONFIG_SET_SCAN_DENY_TIMER
 bool rtw_is_scan_deny(_adapter *adapter);
 void rtw_clear_scan_deny(_adapter *adapter);
-void rtw_set_scan_deny_timer_hdl(struct timer_list *t);
+void rtw_set_scan_deny_timer_hdl(void *ctx);
 void rtw_set_scan_deny(_adapter *adapter, u32 ms);
 #else
 #define rtw_is_scan_deny(adapter) _FALSE
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/include/rtw_pwrctrl.h  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/rtw_pwrctrl.h
---  rtl8821ce-git20180902-1/include/rtw_pwrctrl.h	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/rtw_pwrctrl.h	2018-01-06 19:48:16.000000000 +0100
@@ -315,7 +315,6 @@
 };
 
 struct pwrctrl_priv {
-	_adapter *adapter;
 	_pwrlock	lock;
 	_pwrlock	check_32k_lock;
 	volatile u8 rpwm; /* requested power state for fw */
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/include/rtw_recv.h  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/rtw_recv.h
---  rtl8821ce-git20180902-1/include/rtw_recv.h	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/include/rtw_recv.h	2018-01-06 19:48:16.000000000 +0100
@@ -667,7 +667,7 @@
 sint rtw_enqueue_recvbuf(struct recv_buf *precvbuf, _queue *queue);
 struct recv_buf *rtw_dequeue_recvbuf(_queue *queue);
 
-void rtw_reordering_ctrl_timeout_handler(struct timer_list *t);
+void rtw_reordering_ctrl_timeout_handler(void *pcontext);
 
 void rx_query_phy_status(union recv_frame *rframe, u8 *phy_stat);
 int rtw_inc_and_chk_continual_no_rx_packet(struct sta_info *sta, int tid_index);
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/os_dep/linux/os_intfs.c  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/os_dep/linux/os_intfs.c
---  rtl8821ce-git20180902-1/os_dep/linux/os_intfs.c	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/os_dep/linux/os_intfs.c	2018-01-06 19:48:16.000000000 +0100
@@ -1924,7 +1924,7 @@
 #endif
 #endif
 
-	rtw_init_timer(&(pdvobj->dynamic_chk_timer), NULL, rtw_dynamic_check_timer_handlder);
+	rtw_init_timer(&(pdvobj->dynamic_chk_timer), NULL, rtw_dynamic_check_timer_handlder, pdvobj);
 
 #ifdef CONFIG_MCC_MODE
 	_rtw_mutex_init(&(pdvobj->mcc_objpriv.mcc_mutex));
diff -U 3 -H -d -r -N --  rtl8821ce-git20180902-1/os_dep/osdep_service.c  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/os_dep/osdep_service.c
---  rtl8821ce-git20180902-1/os_dep/osdep_service.c	2018-09-02 03:26:26.000000000 +0200
+++  rtl8821ce-0.0.0+git20171129-lp150.1.1.src/rtl8821ce/os_dep/osdep_service.c	2018-01-06 19:48:16.000000000 +0100
@@ -1066,12 +1066,12 @@
 
 }
 
-void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc)
+void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc, void *ctx)
 {
 	_adapter *adapter = (_adapter *)padapter;
 
 #ifdef PLATFORM_LINUX
-	_init_timer(ptimer, adapter->pnetdev, pfunc);
+	_init_timer(ptimer, adapter->pnetdev, pfunc, ctx);
 #endif
 #ifdef PLATFORM_FREEBSD
 	_init_timer(ptimer, adapter->pifp, pfunc, ctx);
openSUSE Build Service is sponsored by