summaryrefslogtreecommitdiffstats
path: root/net/mac80211
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
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')
-rw-r--r--net/mac80211/ibss.c7
-rw-r--r--net/mac80211/ieee80211_i.h3
-rw-r--r--net/mac80211/led.c11
-rw-r--r--net/mac80211/main.c3
-rw-r--r--net/mac80211/mesh.c27
-rw-r--r--net/mac80211/mesh.h2
-rw-r--r--net/mac80211/mesh_hwmp.c4
-rw-r--r--net/mac80211/mesh_pathtbl.c3
-rw-r--r--net/mac80211/mlme.c32
-rw-r--r--net/mac80211/ocb.c10
-rw-r--r--net/mac80211/sta_info.c7
11 files changed, 50 insertions, 59 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index e9c6aa3ed05b..db07e0de9a03 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1711,10 +1711,10 @@ void ieee80211_ibss_work(struct ieee80211_sub_if_data *sdata)
1711 sdata_unlock(sdata); 1711 sdata_unlock(sdata);
1712} 1712}
1713 1713
1714static void ieee80211_ibss_timer(unsigned long data) 1714static void ieee80211_ibss_timer(struct timer_list *t)
1715{ 1715{
1716 struct ieee80211_sub_if_data *sdata = 1716 struct ieee80211_sub_if_data *sdata =
1717 (struct ieee80211_sub_if_data *) data; 1717 from_timer(sdata, t, u.ibss.timer);
1718 1718
1719 ieee80211_queue_work(&sdata->local->hw, &sdata->work); 1719 ieee80211_queue_work(&sdata->local->hw, &sdata->work);
1720} 1720}
@@ -1723,8 +1723,7 @@ void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata)
1723{ 1723{
1724 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; 1724 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
1725 1725
1726 setup_timer(&ifibss->timer, ieee80211_ibss_timer, 1726 timer_setup(&ifibss->timer, ieee80211_ibss_timer, 0);
1727 (unsigned long) sdata);
1728 INIT_LIST_HEAD(&ifibss->incomplete_stations); 1727 INIT_LIST_HEAD(&ifibss->incomplete_stations);
1729 spin_lock_init(&ifibss->incomplete_lock); 1728 spin_lock_init(&ifibss->incomplete_lock);
1730 INIT_WORK(&ifibss->csa_connection_drop_work, 1729 INIT_WORK(&ifibss->csa_connection_drop_work,
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 68f874e73561..885d00b41911 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1057,6 +1057,7 @@ struct tpt_led_trigger {
1057 const struct ieee80211_tpt_blink *blink_table; 1057 const struct ieee80211_tpt_blink *blink_table;
1058 unsigned int blink_table_len; 1058 unsigned int blink_table_len;
1059 struct timer_list timer; 1059 struct timer_list timer;
1060 struct ieee80211_local *local;
1060 unsigned long prev_traffic; 1061 unsigned long prev_traffic;
1061 unsigned long tx_bytes, rx_bytes; 1062 unsigned long tx_bytes, rx_bytes;
1062 unsigned int active, want; 1063 unsigned int active, want;
@@ -1932,7 +1933,7 @@ static inline int ieee80211_ac_from_tid(int tid)
1932 1933
1933void ieee80211_dynamic_ps_enable_work(struct work_struct *work); 1934void ieee80211_dynamic_ps_enable_work(struct work_struct *work);
1934void ieee80211_dynamic_ps_disable_work(struct work_struct *work); 1935void ieee80211_dynamic_ps_disable_work(struct work_struct *work);
1935void ieee80211_dynamic_ps_timer(unsigned long data); 1936void ieee80211_dynamic_ps_timer(struct timer_list *t);
1936void ieee80211_send_nullfunc(struct ieee80211_local *local, 1937void ieee80211_send_nullfunc(struct ieee80211_local *local,
1937 struct ieee80211_sub_if_data *sdata, 1938 struct ieee80211_sub_if_data *sdata,
1938 bool powersave); 1939 bool powersave);
diff --git a/net/mac80211/led.c b/net/mac80211/led.c
index 0505845b7ab8..ba0b507ea691 100644
--- a/net/mac80211/led.c
+++ b/net/mac80211/led.c
@@ -248,10 +248,10 @@ static unsigned long tpt_trig_traffic(struct ieee80211_local *local,
248 return DIV_ROUND_UP(delta, 1024 / 8); 248 return DIV_ROUND_UP(delta, 1024 / 8);
249} 249}
250 250
251static void tpt_trig_timer(unsigned long data) 251static void tpt_trig_timer(struct timer_list *t)
252{ 252{
253 struct ieee80211_local *local = (void *)data; 253 struct tpt_led_trigger *tpt_trig = from_timer(tpt_trig, t, timer);
254 struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger; 254 struct ieee80211_local *local = tpt_trig->local;
255 struct led_classdev *led_cdev; 255 struct led_classdev *led_cdev;
256 unsigned long on, off, tpt; 256 unsigned long on, off, tpt;
257 int i; 257 int i;
@@ -306,8 +306,9 @@ __ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw,
306 tpt_trig->blink_table = blink_table; 306 tpt_trig->blink_table = blink_table;
307 tpt_trig->blink_table_len = blink_table_len; 307 tpt_trig->blink_table_len = blink_table_len;
308 tpt_trig->want = flags; 308 tpt_trig->want = flags;
309 tpt_trig->local = local;
309 310
310 setup_timer(&tpt_trig->timer, tpt_trig_timer, (unsigned long)local); 311 timer_setup(&tpt_trig->timer, tpt_trig_timer, 0);
311 312
312 local->tpt_led_trigger = tpt_trig; 313 local->tpt_led_trigger = tpt_trig;
313 314
@@ -326,7 +327,7 @@ static void ieee80211_start_tpt_led_trig(struct ieee80211_local *local)
326 tpt_trig_traffic(local, tpt_trig); 327 tpt_trig_traffic(local, tpt_trig);
327 tpt_trig->running = true; 328 tpt_trig->running = true;
328 329
329 tpt_trig_timer((unsigned long)local); 330 tpt_trig_timer(&tpt_trig->timer);
330 mod_timer(&tpt_trig->timer, round_jiffies(jiffies + HZ)); 331 mod_timer(&tpt_trig->timer, round_jiffies(jiffies + HZ));
331} 332}
332 333
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 8aa1f5b6a051..e054a2fd8d38 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -633,8 +633,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
633 ieee80211_dynamic_ps_enable_work); 633 ieee80211_dynamic_ps_enable_work);
634 INIT_WORK(&local->dynamic_ps_disable_work, 634 INIT_WORK(&local->dynamic_ps_disable_work,
635 ieee80211_dynamic_ps_disable_work); 635 ieee80211_dynamic_ps_disable_work);
636 setup_timer(&local->dynamic_ps_timer, 636 timer_setup(&local->dynamic_ps_timer, ieee80211_dynamic_ps_timer, 0);
637 ieee80211_dynamic_ps_timer, (unsigned long) local);
638 637
639 INIT_WORK(&local->sched_scan_stopped_work, 638 INIT_WORK(&local->sched_scan_stopped_work,
640 ieee80211_sched_scan_stopped_work); 639 ieee80211_sched_scan_stopped_work);
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 7a76c4a6df30..5e27364e10ac 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -37,9 +37,10 @@ void ieee80211s_stop(void)
37 kmem_cache_destroy(rm_cache); 37 kmem_cache_destroy(rm_cache);
38} 38}
39 39
40static void ieee80211_mesh_housekeeping_timer(unsigned long data) 40static void ieee80211_mesh_housekeeping_timer(struct timer_list *t)
41{ 41{
42 struct ieee80211_sub_if_data *sdata = (void *) data; 42 struct ieee80211_sub_if_data *sdata =
43 from_timer(sdata, t, u.mesh.housekeeping_timer);
43 struct ieee80211_local *local = sdata->local; 44 struct ieee80211_local *local = sdata->local;
44 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 45 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
45 46
@@ -528,18 +529,18 @@ int mesh_add_vht_oper_ie(struct ieee80211_sub_if_data *sdata,
528 return 0; 529 return 0;
529} 530}
530 531
531static void ieee80211_mesh_path_timer(unsigned long data) 532static void ieee80211_mesh_path_timer(struct timer_list *t)
532{ 533{
533 struct ieee80211_sub_if_data *sdata = 534 struct ieee80211_sub_if_data *sdata =
534 (struct ieee80211_sub_if_data *) data; 535 from_timer(sdata, t, u.mesh.mesh_path_timer);
535 536
536 ieee80211_queue_work(&sdata->local->hw, &sdata->work); 537 ieee80211_queue_work(&sdata->local->hw, &sdata->work);
537} 538}
538 539
539static void ieee80211_mesh_path_root_timer(unsigned long data) 540static void ieee80211_mesh_path_root_timer(struct timer_list *t)
540{ 541{
541 struct ieee80211_sub_if_data *sdata = 542 struct ieee80211_sub_if_data *sdata =
542 (struct ieee80211_sub_if_data *) data; 543 from_timer(sdata, t, u.mesh.mesh_path_root_timer);
543 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 544 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
544 545
545 set_bit(MESH_WORK_ROOT, &ifmsh->wrkq_flags); 546 set_bit(MESH_WORK_ROOT, &ifmsh->wrkq_flags);
@@ -1442,9 +1443,8 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
1442 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 1443 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1443 static u8 zero_addr[ETH_ALEN] = {}; 1444 static u8 zero_addr[ETH_ALEN] = {};
1444 1445
1445 setup_timer(&ifmsh->housekeeping_timer, 1446 timer_setup(&ifmsh->housekeeping_timer,
1446 ieee80211_mesh_housekeeping_timer, 1447 ieee80211_mesh_housekeeping_timer, 0);
1447 (unsigned long) sdata);
1448 1448
1449 ifmsh->accepting_plinks = true; 1449 ifmsh->accepting_plinks = true;
1450 atomic_set(&ifmsh->mpaths, 0); 1450 atomic_set(&ifmsh->mpaths, 0);
@@ -1458,12 +1458,9 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
1458 1458
1459 mesh_pathtbl_init(sdata); 1459 mesh_pathtbl_init(sdata);
1460 1460
1461 setup_timer(&ifmsh->mesh_path_timer, 1461 timer_setup(&ifmsh->mesh_path_timer, ieee80211_mesh_path_timer, 0);
1462 ieee80211_mesh_path_timer, 1462 timer_setup(&ifmsh->mesh_path_root_timer,
1463 (unsigned long) sdata); 1463 ieee80211_mesh_path_root_timer, 0);
1464 setup_timer(&ifmsh->mesh_path_root_timer,
1465 ieee80211_mesh_path_root_timer,
1466 (unsigned long) sdata);
1467 INIT_LIST_HEAD(&ifmsh->preq_queue.list); 1464 INIT_LIST_HEAD(&ifmsh->preq_queue.list);
1468 skb_queue_head_init(&ifmsh->ps.bc_buf); 1465 skb_queue_head_init(&ifmsh->ps.bc_buf);
1469 spin_lock_init(&ifmsh->mesh_preq_queue_lock); 1466 spin_lock_init(&ifmsh->mesh_preq_queue_lock);
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 465b7853edc0..ee56f18cad3f 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -296,7 +296,7 @@ void mesh_path_tx_pending(struct mesh_path *mpath);
296int mesh_pathtbl_init(struct ieee80211_sub_if_data *sdata); 296int mesh_pathtbl_init(struct ieee80211_sub_if_data *sdata);
297void mesh_pathtbl_unregister(struct ieee80211_sub_if_data *sdata); 297void mesh_pathtbl_unregister(struct ieee80211_sub_if_data *sdata);
298int mesh_path_del(struct ieee80211_sub_if_data *sdata, const u8 *addr); 298int mesh_path_del(struct ieee80211_sub_if_data *sdata, const u8 *addr);
299void mesh_path_timer(unsigned long data); 299void mesh_path_timer(struct timer_list *t);
300void mesh_path_flush_by_nexthop(struct sta_info *sta); 300void mesh_path_flush_by_nexthop(struct sta_info *sta);
301void mesh_path_discard_frame(struct ieee80211_sub_if_data *sdata, 301void mesh_path_discard_frame(struct ieee80211_sub_if_data *sdata,
302 struct sk_buff *skb); 302 struct sk_buff *skb);
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 146ec6c0f12f..4f7826d7b47c 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -1194,9 +1194,9 @@ endlookup:
1194 return err; 1194 return err;
1195} 1195}
1196 1196
1197void mesh_path_timer(unsigned long data) 1197void mesh_path_timer(struct timer_list *t)
1198{ 1198{
1199 struct mesh_path *mpath = (void *) data; 1199 struct mesh_path *mpath = from_timer(mpath, t, timer);
1200 struct ieee80211_sub_if_data *sdata = mpath->sdata; 1200 struct ieee80211_sub_if_data *sdata = mpath->sdata;
1201 int ret; 1201 int ret;
1202 1202
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 97269caafecd..86c8dfef56a4 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -399,8 +399,7 @@ struct mesh_path *mesh_path_new(struct ieee80211_sub_if_data *sdata,
399 skb_queue_head_init(&new_mpath->frame_queue); 399 skb_queue_head_init(&new_mpath->frame_queue);
400 new_mpath->exp_time = jiffies; 400 new_mpath->exp_time = jiffies;
401 spin_lock_init(&new_mpath->state_lock); 401 spin_lock_init(&new_mpath->state_lock);
402 setup_timer(&new_mpath->timer, mesh_path_timer, 402 timer_setup(&new_mpath->timer, mesh_path_timer, 0);
403 (unsigned long) new_mpath);
404 403
405 return new_mpath; 404 return new_mpath;
406} 405}
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
diff --git a/net/mac80211/ocb.c b/net/mac80211/ocb.c
index 88e6ebbbe24f..d351dc1162be 100644
--- a/net/mac80211/ocb.c
+++ b/net/mac80211/ocb.c
@@ -150,9 +150,10 @@ void ieee80211_ocb_work(struct ieee80211_sub_if_data *sdata)
150 sdata_unlock(sdata); 150 sdata_unlock(sdata);
151} 151}
152 152
153static void ieee80211_ocb_housekeeping_timer(unsigned long data) 153static void ieee80211_ocb_housekeeping_timer(struct timer_list *t)
154{ 154{
155 struct ieee80211_sub_if_data *sdata = (void *)data; 155 struct ieee80211_sub_if_data *sdata =
156 from_timer(sdata, t, u.ocb.housekeeping_timer);
156 struct ieee80211_local *local = sdata->local; 157 struct ieee80211_local *local = sdata->local;
157 struct ieee80211_if_ocb *ifocb = &sdata->u.ocb; 158 struct ieee80211_if_ocb *ifocb = &sdata->u.ocb;
158 159
@@ -165,9 +166,8 @@ void ieee80211_ocb_setup_sdata(struct ieee80211_sub_if_data *sdata)
165{ 166{
166 struct ieee80211_if_ocb *ifocb = &sdata->u.ocb; 167 struct ieee80211_if_ocb *ifocb = &sdata->u.ocb;
167 168
168 setup_timer(&ifocb->housekeeping_timer, 169 timer_setup(&ifocb->housekeeping_timer,
169 ieee80211_ocb_housekeeping_timer, 170 ieee80211_ocb_housekeeping_timer, 0);
170 (unsigned long)sdata);
171 INIT_LIST_HEAD(&ifocb->incomplete_stations); 171 INIT_LIST_HEAD(&ifocb->incomplete_stations);
172 spin_lock_init(&ifocb->incomplete_lock); 172 spin_lock_init(&ifocb->incomplete_lock);
173} 173}
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index a3060e55122c..0e50065e3433 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1064,9 +1064,9 @@ int sta_info_destroy_addr_bss(struct ieee80211_sub_if_data *sdata,
1064 return ret; 1064 return ret;
1065} 1065}
1066 1066
1067static void sta_info_cleanup(unsigned long data) 1067static void sta_info_cleanup(struct timer_list *t)
1068{ 1068{
1069 struct ieee80211_local *local = (struct ieee80211_local *) data; 1069 struct ieee80211_local *local = from_timer(local, t, sta_cleanup);
1070 struct sta_info *sta; 1070 struct sta_info *sta;
1071 bool timer_needed = false; 1071 bool timer_needed = false;
1072 1072
@@ -1098,8 +1098,7 @@ int sta_info_init(struct ieee80211_local *local)
1098 mutex_init(&local->sta_mtx); 1098 mutex_init(&local->sta_mtx);
1099 INIT_LIST_HEAD(&local->sta_list); 1099 INIT_LIST_HEAD(&local->sta_list);
1100 1100
1101 setup_timer(&local->sta_cleanup, sta_info_cleanup, 1101 timer_setup(&local->sta_cleanup, sta_info_cleanup, 0);
1102 (unsigned long)local);
1103 return 0; 1102 return 0;
1104} 1103}
1105 1104