summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-16 19:35:49 -0400
committerJohannes Berg <johannes.berg@intel.com>2017-11-20 10:55:11 -0500
commit34f11cd329580fe4c3e8f10081d687331fc710f3 (patch)
treee3918de464907d9776bb1a91d5da393027bc90a5 /net/mac80211/mlme.c
parent32a72bbd5da2411eab591bf9bc2e39349106193a (diff)
mac80211: 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: 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: Kees Cook <keescook@chromium.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index e4ededa1909d..04460440d731 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1066,10 +1066,10 @@ void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success)
1066} 1066}
1067EXPORT_SYMBOL(ieee80211_chswitch_done); 1067EXPORT_SYMBOL(ieee80211_chswitch_done);
1068 1068
1069static void ieee80211_chswitch_timer(unsigned long data) 1069static void ieee80211_chswitch_timer(struct timer_list *t)
1070{ 1070{
1071 struct ieee80211_sub_if_data *sdata = 1071 struct ieee80211_sub_if_data *sdata =
1072 (struct ieee80211_sub_if_data *) data; 1072 from_timer(sdata, t, u.mgd.chswitch_timer);
1073 1073
1074 ieee80211_queue_work(&sdata->local->hw, &sdata->u.mgd.chswitch_work); 1074 ieee80211_queue_work(&sdata->local->hw, &sdata->u.mgd.chswitch_work);
1075} 1075}
@@ -1577,9 +1577,9 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work)
1577 } 1577 }
1578} 1578}
1579 1579
1580void ieee80211_dynamic_ps_timer(unsigned long data) 1580void ieee80211_dynamic_ps_timer(struct timer_list *t)
1581{ 1581{
1582 struct ieee80211_local *local = (void *) data; 1582 struct ieee80211_local *local = from_timer(local, t, dynamic_ps_timer);
1583 1583
1584 ieee80211_queue_work(&local->hw, &local->dynamic_ps_enable_work); 1584 ieee80211_queue_work(&local->hw, &local->dynamic_ps_enable_work);
1585} 1585}
@@ -3711,10 +3711,10 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
3711 sdata_unlock(sdata); 3711 sdata_unlock(sdata);
3712} 3712}
3713 3713
3714static void ieee80211_sta_timer(unsigned long data) 3714static void ieee80211_sta_timer(struct timer_list *t)
3715{ 3715{
3716 struct ieee80211_sub_if_data *sdata = 3716 struct ieee80211_sub_if_data *sdata =
3717 (struct ieee80211_sub_if_data *) data; 3717 from_timer(sdata, t, u.mgd.timer);
3718 3718
3719 ieee80211_queue_work(&sdata->local->hw, &sdata->work); 3719 ieee80211_queue_work(&sdata->local->hw, &sdata->work);
3720} 3720}
@@ -3991,10 +3991,10 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
3991 sdata_unlock(sdata); 3991 sdata_unlock(sdata);
3992} 3992}
3993 3993
3994static void ieee80211_sta_bcn_mon_timer(unsigned long data) 3994static void ieee80211_sta_bcn_mon_timer(struct timer_list *t)
3995{ 3995{
3996 struct ieee80211_sub_if_data *sdata = 3996 struct ieee80211_sub_if_data *sdata =
3997 (struct ieee80211_sub_if_data *) data; 3997 from_timer(sdata, t, u.mgd.bcn_mon_timer);
3998 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 3998 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
3999 3999
4000 if (sdata->vif.csa_active && !ifmgd->csa_waiting_bcn) 4000 if (sdata->vif.csa_active && !ifmgd->csa_waiting_bcn)
@@ -4005,10 +4005,10 @@ static void ieee80211_sta_bcn_mon_timer(unsigned long data)
4005 &sdata->u.mgd.beacon_connection_loss_work); 4005 &sdata->u.mgd.beacon_connection_loss_work);
4006} 4006}
4007 4007
4008static void ieee80211_sta_conn_mon_timer(unsigned long data) 4008static void ieee80211_sta_conn_mon_timer(struct timer_list *t)
4009{ 4009{
4010 struct ieee80211_sub_if_data *sdata = 4010 struct ieee80211_sub_if_data *sdata =
4011 (struct ieee80211_sub_if_data *) data; 4011 from_timer(sdata, t, u.mgd.conn_mon_timer);
4012 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 4012 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
4013 struct ieee80211_local *local = sdata->local; 4013 struct ieee80211_local *local = sdata->local;
4014 4014
@@ -4139,14 +4139,10 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
4139 INIT_WORK(&ifmgd->request_smps_work, ieee80211_request_smps_mgd_work); 4139 INIT_WORK(&ifmgd->request_smps_work, ieee80211_request_smps_mgd_work);
4140 INIT_DELAYED_WORK(&ifmgd->tdls_peer_del_work, 4140 INIT_DELAYED_WORK(&ifmgd->tdls_peer_del_work,
4141 ieee80211_tdls_peer_del_work); 4141 ieee80211_tdls_peer_del_work);
4142 setup_timer(&ifmgd->timer, ieee80211_sta_timer, 4142 timer_setup(&ifmgd->timer, ieee80211_sta_timer, 0);
4143 (unsigned long) sdata); 4143 timer_setup(&ifmgd->bcn_mon_timer, ieee80211_sta_bcn_mon_timer, 0);
4144 setup_timer(&ifmgd->bcn_mon_timer, ieee80211_sta_bcn_mon_timer, 4144 timer_setup(&ifmgd->conn_mon_timer, ieee80211_sta_conn_mon_timer, 0);
4145 (unsigned long) sdata); 4145 timer_setup(&ifmgd->chswitch_timer, ieee80211_chswitch_timer, 0);
4146 setup_timer(&ifmgd->conn_mon_timer, ieee80211_sta_conn_mon_timer,
4147 (unsigned long) sdata);
4148 setup_timer(&ifmgd->chswitch_timer, ieee80211_chswitch_timer,
4149 (unsigned long) sdata);
4150 INIT_DELAYED_WORK(&ifmgd->tx_tspec_wk, 4146 INIT_DELAYED_WORK(&ifmgd->tx_tspec_wk,
4151 ieee80211_sta_handle_tspec_ac_params_wk); 4147 ieee80211_sta_handle_tspec_ac_params_wk);
4152 4148