diff options
Diffstat (limited to 'drivers/staging/rtl8712/mlme_linux.c')
-rw-r--r-- | drivers/staging/rtl8712/mlme_linux.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/staging/rtl8712/mlme_linux.c b/drivers/staging/rtl8712/mlme_linux.c index a077069d6227..3c7c4a4faeb2 100644 --- a/drivers/staging/rtl8712/mlme_linux.c +++ b/drivers/staging/rtl8712/mlme_linux.c @@ -32,39 +32,45 @@ #include "drv_types.h" #include "mlme_osdep.h" -static void sitesurvey_ctrl_handler(unsigned long data) +static void sitesurvey_ctrl_handler(struct timer_list *t) { - struct _adapter *adapter = (struct _adapter *)data; + struct _adapter *adapter = + from_timer(adapter, t, + mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer); _r8712_sitesurvey_ctrl_handler(adapter); mod_timer(&adapter->mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer, jiffies + msecs_to_jiffies(3000)); } -static void join_timeout_handler (unsigned long data) +static void join_timeout_handler (struct timer_list *t) { - struct _adapter *adapter = (struct _adapter *)data; + struct _adapter *adapter = + from_timer(adapter, t, mlmepriv.assoc_timer); _r8712_join_timeout_handler(adapter); } -static void _scan_timeout_handler (unsigned long data) +static void _scan_timeout_handler (struct timer_list *t) { - struct _adapter *adapter = (struct _adapter *)data; + struct _adapter *adapter = + from_timer(adapter, t, mlmepriv.scan_to_timer); r8712_scan_timeout_handler(adapter); } -static void dhcp_timeout_handler (unsigned long data) +static void dhcp_timeout_handler (struct timer_list *t) { - struct _adapter *adapter = (struct _adapter *)data; + struct _adapter *adapter = + from_timer(adapter, t, mlmepriv.dhcp_timer); _r8712_dhcp_timeout_handler(adapter); } -static void wdg_timeout_handler (unsigned long data) +static void wdg_timeout_handler (struct timer_list *t) { - struct _adapter *adapter = (struct _adapter *)data; + struct _adapter *adapter = + from_timer(adapter, t, mlmepriv.wdg_timer); _r8712_wdg_timeout_handler(adapter); @@ -76,17 +82,12 @@ void r8712_init_mlme_timer(struct _adapter *padapter) { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - setup_timer(&pmlmepriv->assoc_timer, join_timeout_handler, - (unsigned long)padapter); - setup_timer(&pmlmepriv->sitesurveyctrl.sitesurvey_ctrl_timer, - sitesurvey_ctrl_handler, - (unsigned long)padapter); - setup_timer(&pmlmepriv->scan_to_timer, _scan_timeout_handler, - (unsigned long)padapter); - setup_timer(&pmlmepriv->dhcp_timer, dhcp_timeout_handler, - (unsigned long)padapter); - setup_timer(&pmlmepriv->wdg_timer, wdg_timeout_handler, - (unsigned long)padapter); + timer_setup(&pmlmepriv->assoc_timer, join_timeout_handler, 0); + timer_setup(&pmlmepriv->sitesurveyctrl.sitesurvey_ctrl_timer, + sitesurvey_ctrl_handler, 0); + timer_setup(&pmlmepriv->scan_to_timer, _scan_timeout_handler, 0); + timer_setup(&pmlmepriv->dhcp_timer, dhcp_timeout_handler, 0); + timer_setup(&pmlmepriv->wdg_timer, wdg_timeout_handler, 0); } void r8712_os_indicate_connect(struct _adapter *adapter) @@ -118,9 +119,8 @@ void r8712_os_indicate_disconnect(struct _adapter *adapter) adapter->securitypriv.btkip_countermeasure; memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv)); - setup_timer(&adapter->securitypriv.tkip_timer, - r8712_use_tkipkey_handler, - (unsigned long)adapter); + timer_setup(&adapter->securitypriv.tkip_timer, + r8712_use_tkipkey_handler, 0); /* Restore the PMK information to securitypriv structure * for the following connection. */ |