diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-24 02:28:29 -0700 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-10-27 10:41:57 +0300 |
commit | 7c51d17c027e52ef6ccc075e31c2eb44c13e3a32 (patch) | |
tree | 4529a39b6c5d7a20cda215ac1dc09d79bb9303f0 | |
parent | 5e5c79b2e1283881e6015031c28e4a3fad1f7a87 (diff) | |
download | op-kernel-dev-7c51d17c027e52ef6ccc075e31c2eb44c13e3a32.zip op-kernel-dev-7c51d17c027e52ef6ccc075e31c2eb44c13e3a32.tar.gz |
rtlwifi: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Chaoming Li <chaoming_li@realsil.com.cn>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Souptick Joarder <jrdr.linux@gmail.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/base.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/base.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/core.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/ps.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c | 12 |
9 files changed, 29 insertions, 28 deletions
diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c index 0b34886..ea90b46 100644 --- a/drivers/net/wireless/realtek/rtlwifi/base.c +++ b/drivers/net/wireless/realtek/rtlwifi/base.c @@ -457,10 +457,10 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw) struct rtl_priv *rtlpriv = rtl_priv(hw); /* <1> timer */ - setup_timer(&rtlpriv->works.watchdog_timer, - rtl_watch_dog_timer_callback, (unsigned long)hw); - setup_timer(&rtlpriv->works.dualmac_easyconcurrent_retrytimer, - rtl_easy_concurrent_retrytimer_callback, (unsigned long)hw); + timer_setup(&rtlpriv->works.watchdog_timer, + rtl_watch_dog_timer_callback, 0); + timer_setup(&rtlpriv->works.dualmac_easyconcurrent_retrytimer, + rtl_easy_concurrent_retrytimer_callback, 0); /* <2> work queue */ rtlpriv->works.hw = hw; rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name); @@ -2057,10 +2057,9 @@ label_lps_done: rtl_scan_list_expire(hw); } -void rtl_watch_dog_timer_callback(unsigned long data) +void rtl_watch_dog_timer_callback(struct timer_list *t) { - struct ieee80211_hw *hw = (struct ieee80211_hw *)data; - struct rtl_priv *rtlpriv = rtl_priv(hw); + struct rtl_priv *rtlpriv = from_timer(rtlpriv, t, works.watchdog_timer); queue_delayed_work(rtlpriv->works.rtl_wq, &rtlpriv->works.watchdog_wq, 0); @@ -2166,10 +2165,11 @@ void rtl_c2hcmd_wq_callback(void *data) rtl_c2hcmd_launcher(hw, 1); } -void rtl_easy_concurrent_retrytimer_callback(unsigned long data) +void rtl_easy_concurrent_retrytimer_callback(struct timer_list *t) { - struct ieee80211_hw *hw = (struct ieee80211_hw *)data; - struct rtl_priv *rtlpriv = rtl_priv(hw); + struct rtl_priv *rtlpriv = + from_timer(rtlpriv, t, works.dualmac_easyconcurrent_retrytimer); + struct ieee80211_hw *hw = rtlpriv->hw; struct rtl_priv *buddy_priv = rtlpriv->buddy_priv; if (buddy_priv == NULL) diff --git a/drivers/net/wireless/realtek/rtlwifi/base.h b/drivers/net/wireless/realtek/rtlwifi/base.h index cfea9fc..2673531 100644 --- a/drivers/net/wireless/realtek/rtlwifi/base.h +++ b/drivers/net/wireless/realtek/rtlwifi/base.h @@ -120,7 +120,7 @@ void rtl_init_rx_config(struct ieee80211_hw *hw); void rtl_init_rfkill(struct ieee80211_hw *hw); void rtl_deinit_rfkill(struct ieee80211_hw *hw); -void rtl_watch_dog_timer_callback(unsigned long data); +void rtl_watch_dog_timer_callback(struct timer_list *t); void rtl_deinit_deferred_work(struct ieee80211_hw *hw); bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx); @@ -173,7 +173,7 @@ int rtl_send_smps_action(struct ieee80211_hw *hw, u8 *rtl_find_ie(u8 *data, unsigned int len, u8 ie); void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len); u8 rtl_tid_to_ac(u8 tid); -void rtl_easy_concurrent_retrytimer_callback(unsigned long data); +void rtl_easy_concurrent_retrytimer_callback(struct timer_list *t); extern struct rtl_global_var rtl_global_var; void rtl_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation); diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c index 015a8ec..1147327 100644 --- a/drivers/net/wireless/realtek/rtlwifi/core.c +++ b/drivers/net/wireless/realtek/rtlwifi/core.c @@ -160,7 +160,7 @@ static int rtl_op_start(struct ieee80211_hw *hw) mutex_lock(&rtlpriv->locks.conf_mutex); err = rtlpriv->intf_ops->adapter_start(hw); if (!err) - rtl_watch_dog_timer_callback((unsigned long)hw); + rtl_watch_dog_timer_callback(&rtlpriv->works.watchdog_timer); mutex_unlock(&rtlpriv->locks.conf_mutex); return err; } diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c index 07ee309..24c87fa 100644 --- a/drivers/net/wireless/realtek/rtlwifi/ps.c +++ b/drivers/net/wireless/realtek/rtlwifi/ps.c @@ -55,7 +55,7 @@ bool rtl_ps_enable_nic(struct ieee80211_hw *hw) rtlpriv->cfg->ops->enable_interrupt(hw); /*<enable timer> */ - rtl_watch_dog_timer_callback((unsigned long)hw); + rtl_watch_dog_timer_callback(&rtlpriv->works.watchdog_timer); return true; } diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c index 207411d..e05af7d 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c @@ -1708,9 +1708,11 @@ static void rtl88e_dm_fast_ant_training(struct ieee80211_hw *hw) } } -void rtl88e_dm_fast_antenna_training_callback(unsigned long data) +void rtl88e_dm_fast_antenna_training_callback(struct timer_list *t) { - struct ieee80211_hw *hw = (struct ieee80211_hw *)data; + struct rtl_priv *rtlpriv = + from_timer(rtlpriv, t, works.fast_antenna_training_timer); + struct ieee80211_hw *hw = rtlpriv->hw; rtl88e_dm_fast_ant_training(hw); } diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.h b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.h index 0fd2bac..50f26a9 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.h +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.h @@ -270,7 +270,7 @@ void rtl88e_dm_set_tx_ant_by_tx_info(struct ieee80211_hw *hw, void rtl88e_dm_ant_sel_statistics(struct ieee80211_hw *hw, u8 antsel_tr_mux, u32 mac_id, u32 rx_pwdb_all); -void rtl88e_dm_fast_antenna_training_callback(unsigned long data); +void rtl88e_dm_fast_antenna_training_callback(struct timer_list *t); void rtl88e_dm_init(struct ieee80211_hw *hw); void rtl88e_dm_watchdog(struct ieee80211_hw *hw); void rtl88e_dm_write_dig(struct ieee80211_hw *hw); diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c index d31117d..2c67136 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c @@ -253,9 +253,12 @@ static void _rtl88ee_set_fw_ps_rf_off_low_power(struct ieee80211_hw *hw) rpwm_val |= FW_PS_STATE_RF_OFF_LOW_PWR_88E; _rtl88ee_set_fw_clock_off(hw, rpwm_val); } -void rtl88ee_fw_clk_off_timer_callback(unsigned long data) + +void rtl88ee_fw_clk_off_timer_callback(struct timer_list *t) { - struct ieee80211_hw *hw = (struct ieee80211_hw *)data; + struct rtl_priv *rtlpriv = from_timer(rtlpriv, t, + works.fw_clockoff_timer); + struct ieee80211_hw *hw = rtlpriv->hw; _rtl88ee_set_fw_ps_rf_off_low_power(hw); } diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.h b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.h index 719b78a..ab8488d 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.h +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.h @@ -58,6 +58,6 @@ void rtl8188ee_bt_reg_init(struct ieee80211_hw *hw); void rtl8188ee_bt_hw_init(struct ieee80211_hw *hw); void rtl88ee_suspend(struct ieee80211_hw *hw); void rtl88ee_resume(struct ieee80211_hw *hw); -void rtl88ee_fw_clk_off_timer_callback(unsigned long data); +void rtl88ee_fw_clk_off_timer_callback(struct timer_list *t); #endif diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c index 35de3ae..82681b9 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c @@ -190,16 +190,12 @@ int rtl88e_init_sw_vars(struct ieee80211_hw *hw) /*low power */ rtlpriv->psc.low_power_enable = false; if (rtlpriv->psc.low_power_enable) { - init_timer(&rtlpriv->works.fw_clockoff_timer); - setup_timer(&rtlpriv->works.fw_clockoff_timer, - rtl88ee_fw_clk_off_timer_callback, - (unsigned long)hw); + timer_setup(&rtlpriv->works.fw_clockoff_timer, + rtl88ee_fw_clk_off_timer_callback, 0); } - init_timer(&rtlpriv->works.fast_antenna_training_timer); - setup_timer(&rtlpriv->works.fast_antenna_training_timer, - rtl88e_dm_fast_antenna_training_callback, - (unsigned long)hw); + timer_setup(&rtlpriv->works.fast_antenna_training_timer, + rtl88e_dm_fast_antenna_training_callback, 0); return err; } |