Commit f8f118ce authored by Ondřej Lysoněk's avatar Ondřej Lysoněk Committed by Johannes Berg

mac80211: Use setup_timer instead of init_timer

Use setup_timer() and setup_deferrable_timer() to set the data and
function timer fields. It makes the code cleaner and will allow for
easier change of the timer struct internals.
Signed-off-by: default avatarOndřej Lysoněk <ondrej.lysonek@seznam.cz>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <linux-wireless@vger.kernel.org>
Cc: <netdev@vger.kernel.org>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 85bbd803
...@@ -357,14 +357,14 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, ...@@ -357,14 +357,14 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta,
spin_lock_init(&tid_agg_rx->reorder_lock); spin_lock_init(&tid_agg_rx->reorder_lock);
/* rx timer */ /* rx timer */
tid_agg_rx->session_timer.function = sta_rx_agg_session_timer_expired; setup_deferrable_timer(&tid_agg_rx->session_timer,
tid_agg_rx->session_timer.data = (unsigned long)&sta->timer_to_tid[tid]; sta_rx_agg_session_timer_expired,
init_timer_deferrable(&tid_agg_rx->session_timer); (unsigned long)&sta->timer_to_tid[tid]);
/* rx reorder timer */ /* rx reorder timer */
tid_agg_rx->reorder_timer.function = sta_rx_agg_reorder_timer_expired; setup_timer(&tid_agg_rx->reorder_timer,
tid_agg_rx->reorder_timer.data = (unsigned long)&sta->timer_to_tid[tid]; sta_rx_agg_reorder_timer_expired,
init_timer(&tid_agg_rx->reorder_timer); (unsigned long)&sta->timer_to_tid[tid]);
/* prepare reordering buffer */ /* prepare reordering buffer */
tid_agg_rx->reorder_buf = tid_agg_rx->reorder_buf =
......
...@@ -670,14 +670,14 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, ...@@ -670,14 +670,14 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
tid_tx->timeout = timeout; tid_tx->timeout = timeout;
/* response timer */ /* response timer */
tid_tx->addba_resp_timer.function = sta_addba_resp_timer_expired; setup_timer(&tid_tx->addba_resp_timer,
tid_tx->addba_resp_timer.data = (unsigned long)&sta->timer_to_tid[tid]; sta_addba_resp_timer_expired,
init_timer(&tid_tx->addba_resp_timer); (unsigned long)&sta->timer_to_tid[tid]);
/* tx timer */ /* tx timer */
tid_tx->session_timer.function = sta_tx_agg_session_timer_expired; setup_deferrable_timer(&tid_tx->session_timer,
tid_tx->session_timer.data = (unsigned long)&sta->timer_to_tid[tid]; sta_tx_agg_session_timer_expired,
init_timer_deferrable(&tid_tx->session_timer); (unsigned long)&sta->timer_to_tid[tid]);
/* assign a dialog token */ /* assign a dialog token */
sta->ampdu_mlme.dialog_token_allocator++; sta->ampdu_mlme.dialog_token_allocator++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment