@@ -1679,10 +1679,12 @@ void ieee80211_send_4addr_nullfunc(struct ieee80211_local *local,
16791679}
16801680
16811681/* spectrum management related things */
1682- static void ieee80211_chswitch_work (struct work_struct * work )
1682+ static void ieee80211_chswitch_work (struct wiphy * wiphy ,
1683+ struct wiphy_work * work )
16831684{
16841685 struct ieee80211_link_data * link =
1685- container_of (work , struct ieee80211_link_data , u .mgd .chswitch_work );
1686+ container_of (work , struct ieee80211_link_data ,
1687+ u .mgd .chswitch_work .work );
16861688 struct ieee80211_sub_if_data * sdata = link -> sdata ;
16871689 struct ieee80211_local * local = sdata -> local ;
16881690 struct ieee80211_if_managed * ifmgd = & sdata -> u .mgd ;
@@ -1802,21 +1804,13 @@ void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success)
18021804 ieee80211_queue_work (& sdata -> local -> hw ,
18031805 & ifmgd -> csa_connection_drop_work );
18041806 } else {
1805- ieee80211_queue_work (& sdata -> local -> hw ,
1806- & sdata -> deflink .u .mgd .chswitch_work );
1807+ wiphy_delayed_work_queue (sdata -> local -> hw .wiphy ,
1808+ & sdata -> deflink .u .mgd .chswitch_work ,
1809+ 0 );
18071810 }
18081811}
18091812EXPORT_SYMBOL (ieee80211_chswitch_done );
18101813
1811- static void ieee80211_chswitch_timer (struct timer_list * t )
1812- {
1813- struct ieee80211_link_data * link =
1814- from_timer (link , t , u .mgd .chswitch_timer );
1815-
1816- ieee80211_queue_work (& link -> sdata -> local -> hw ,
1817- & link -> u .mgd .chswitch_work );
1818- }
1819-
18201814static void
18211815ieee80211_sta_abort_chanswitch (struct ieee80211_link_data * link )
18221816{
@@ -1860,6 +1854,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_link_data *link,
18601854 struct ieee80211_csa_ie csa_ie ;
18611855 struct ieee80211_channel_switch ch_switch ;
18621856 struct ieee80211_bss * bss ;
1857+ unsigned long timeout ;
18631858 int res ;
18641859
18651860 sdata_assert_lock (sdata );
@@ -2003,12 +1998,11 @@ ieee80211_sta_process_chanswitch(struct ieee80211_link_data *link,
20031998 }
20041999
20052000 /* channel switch handled in software */
2006- if (csa_ie .count <= 1 )
2007- ieee80211_queue_work (& local -> hw , & link -> u .mgd .chswitch_work );
2008- else
2009- mod_timer (& link -> u .mgd .chswitch_timer ,
2010- TU_TO_EXP_TIME ((csa_ie .count - 1 ) *
2011- cbss -> beacon_interval ));
2001+ timeout = TU_TO_JIFFIES ((max_t (int , csa_ie .count , 1 ) - 1 ) *
2002+ cbss -> beacon_interval );
2003+ wiphy_delayed_work_queue (local -> hw .wiphy ,
2004+ & link -> u .mgd .chswitch_work ,
2005+ timeout );
20122006 return ;
20132007 lock_and_drop_connection :
20142008 mutex_lock (& local -> mtx );
@@ -3030,7 +3024,6 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
30303024 del_timer_sync (& sdata -> u .mgd .conn_mon_timer );
30313025 del_timer_sync (& sdata -> u .mgd .bcn_mon_timer );
30323026 del_timer_sync (& sdata -> u .mgd .timer );
3033- del_timer_sync (& sdata -> deflink .u .mgd .chswitch_timer );
30343027
30353028 sdata -> vif .bss_conf .dtim_period = 0 ;
30363029 sdata -> vif .bss_conf .beacon_rate = NULL ;
@@ -6596,8 +6589,8 @@ void ieee80211_mgd_setup_link(struct ieee80211_link_data *link)
65966589 else
65976590 link -> u .mgd .req_smps = IEEE80211_SMPS_OFF ;
65986591
6599- INIT_WORK (& link -> u .mgd .chswitch_work , ieee80211_chswitch_work );
6600- timer_setup ( & link -> u . mgd . chswitch_timer , ieee80211_chswitch_timer , 0 );
6592+ wiphy_delayed_work_init (& link -> u .mgd .chswitch_work ,
6593+ ieee80211_chswitch_work );
66016594
66026595 if (sdata -> u .mgd .assoc_data )
66036596 ether_addr_copy (link -> conf -> addr ,
@@ -7555,7 +7548,8 @@ void ieee80211_mgd_stop_link(struct ieee80211_link_data *link)
75557548{
75567549 wiphy_work_cancel (link -> sdata -> local -> hw .wiphy ,
75577550 & link -> u .mgd .request_smps_work );
7558- cancel_work_sync (& link -> u .mgd .chswitch_work );
7551+ wiphy_delayed_work_cancel (link -> sdata -> local -> hw .wiphy ,
7552+ & link -> u .mgd .chswitch_work );
75597553}
75607554
75617555void ieee80211_mgd_stop (struct ieee80211_sub_if_data * sdata )
0 commit comments