4545#define IEEE80211_ASSOC_TIMEOUT_SHORT (HZ / 10)
4646#define IEEE80211_ASSOC_MAX_TRIES 3
4747
48- #define IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS msecs_to_jiffies (100)
48+ #define IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS (100 * USEC_PER_MSEC )
4949#define IEEE80211_ADV_TTLM_ST_UNDERFLOW 0xff00
5050
5151#define IEEE80211_NEG_TTLM_REQ_TIMEOUT (HZ / 5)
@@ -2594,7 +2594,7 @@ void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success,
25942594 return ;
25952595 }
25962596
2597- wiphy_delayed_work_queue (sdata -> local -> hw .wiphy ,
2597+ wiphy_hrtimer_work_queue (sdata -> local -> hw .wiphy ,
25982598 & link -> u .mgd .csa .switch_work , 0 );
25992599 }
26002600
@@ -2753,7 +2753,8 @@ ieee80211_sta_process_chanswitch(struct ieee80211_link_data *link,
27532753 .timestamp = timestamp ,
27542754 .device_timestamp = device_timestamp ,
27552755 };
2756- unsigned long now ;
2756+ u32 csa_time_tu ;
2757+ ktime_t now ;
27572758 int res ;
27582759
27592760 lockdep_assert_wiphy (local -> hw .wiphy );
@@ -2983,10 +2984,9 @@ ieee80211_sta_process_chanswitch(struct ieee80211_link_data *link,
29832984 csa_ie .mode );
29842985
29852986 /* we may have to handle timeout for deactivated link in software */
2986- now = jiffies ;
2987- link -> u .mgd .csa .time = now +
2988- TU_TO_JIFFIES ((max_t (int , csa_ie .count , 1 ) - 1 ) *
2989- link -> conf -> beacon_int );
2987+ now = ktime_get_boottime ();
2988+ csa_time_tu = (max_t (int , csa_ie .count , 1 ) - 1 ) * link -> conf -> beacon_int ;
2989+ link -> u .mgd .csa .time = now + us_to_ktime (ieee80211_tu_to_usec (csa_time_tu ));
29902990
29912991 if (ieee80211_vif_link_active (& sdata -> vif , link -> link_id ) &&
29922992 local -> ops -> channel_switch ) {
@@ -3001,7 +3001,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_link_data *link,
30013001 }
30023002
30033003 /* channel switch handled in software */
3004- wiphy_delayed_work_queue (local -> hw .wiphy ,
3004+ wiphy_hrtimer_work_queue (local -> hw .wiphy ,
30053005 & link -> u .mgd .csa .switch_work ,
30063006 link -> u .mgd .csa .time - now );
30073007 return ;
@@ -4242,14 +4242,14 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
42424242
42434243 memset (& sdata -> u .mgd .ttlm_info , 0 ,
42444244 sizeof (sdata -> u .mgd .ttlm_info ));
4245- wiphy_delayed_work_cancel (sdata -> local -> hw .wiphy , & ifmgd -> ttlm_work );
4245+ wiphy_hrtimer_work_cancel (sdata -> local -> hw .wiphy , & ifmgd -> ttlm_work );
42464246
42474247 memset (& sdata -> vif .neg_ttlm , 0 , sizeof (sdata -> vif .neg_ttlm ));
42484248 wiphy_delayed_work_cancel (sdata -> local -> hw .wiphy ,
42494249 & ifmgd -> neg_ttlm_timeout_work );
42504250
42514251 sdata -> u .mgd .removed_links = 0 ;
4252- wiphy_delayed_work_cancel (sdata -> local -> hw .wiphy ,
4252+ wiphy_hrtimer_work_cancel (sdata -> local -> hw .wiphy ,
42534253 & sdata -> u .mgd .ml_reconf_work );
42544254
42554255 wiphy_work_cancel (sdata -> local -> hw .wiphy ,
@@ -6876,7 +6876,7 @@ static void ieee80211_ml_reconfiguration(struct ieee80211_sub_if_data *sdata,
68766876 /* In case the removal was cancelled, abort it */
68776877 if (sdata -> u .mgd .removed_links ) {
68786878 sdata -> u .mgd .removed_links = 0 ;
6879- wiphy_delayed_work_cancel (sdata -> local -> hw .wiphy ,
6879+ wiphy_hrtimer_work_cancel (sdata -> local -> hw .wiphy ,
68806880 & sdata -> u .mgd .ml_reconf_work );
68816881 }
68826882 return ;
@@ -6906,9 +6906,9 @@ static void ieee80211_ml_reconfiguration(struct ieee80211_sub_if_data *sdata,
69066906 }
69076907
69086908 sdata -> u .mgd .removed_links = removed_links ;
6909- wiphy_delayed_work_queue (sdata -> local -> hw .wiphy ,
6909+ wiphy_hrtimer_work_queue (sdata -> local -> hw .wiphy ,
69106910 & sdata -> u .mgd .ml_reconf_work ,
6911- TU_TO_JIFFIES ( delay ));
6911+ us_to_ktime ( ieee80211_tu_to_usec ( delay ) ));
69126912}
69136913
69146914static int ieee80211_ttlm_set_links (struct ieee80211_sub_if_data * sdata ,
@@ -7095,7 +7095,7 @@ static void ieee80211_process_adv_ttlm(struct ieee80211_sub_if_data *sdata,
70957095 /* if a planned TID-to-link mapping was cancelled -
70967096 * abort it
70977097 */
7098- wiphy_delayed_work_cancel (sdata -> local -> hw .wiphy ,
7098+ wiphy_hrtimer_work_cancel (sdata -> local -> hw .wiphy ,
70997099 & sdata -> u .mgd .ttlm_work );
71007100 } else if (sdata -> u .mgd .ttlm_info .active ) {
71017101 /* if no TID-to-link element, set to default mapping in
@@ -7130,7 +7130,7 @@ static void ieee80211_process_adv_ttlm(struct ieee80211_sub_if_data *sdata,
71307130
71317131 if (ttlm_info .switch_time ) {
71327132 u16 beacon_ts_tu , st_tu , delay ;
7133- u32 delay_jiffies ;
7133+ u64 delay_usec ;
71347134 u64 mask ;
71357135
71367136 /* The t2l map switch time is indicated with a partial
@@ -7152,23 +7152,23 @@ static void ieee80211_process_adv_ttlm(struct ieee80211_sub_if_data *sdata,
71527152 if (delay > IEEE80211_ADV_TTLM_ST_UNDERFLOW )
71537153 return ;
71547154
7155- delay_jiffies = TU_TO_JIFFIES (delay );
7155+ delay_usec = ieee80211_tu_to_usec (delay );
71567156
71577157 /* Link switching can take time, so schedule it
71587158 * 100ms before to be ready on time
71597159 */
7160- if (delay_jiffies > IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS )
7161- delay_jiffies -=
7160+ if (delay_usec > IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS )
7161+ delay_usec -=
71627162 IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS ;
71637163 else
7164- delay_jiffies = 0 ;
7164+ delay_usec = 0 ;
71657165
71667166 sdata -> u .mgd .ttlm_info = ttlm_info ;
7167- wiphy_delayed_work_cancel (sdata -> local -> hw .wiphy ,
7167+ wiphy_hrtimer_work_cancel (sdata -> local -> hw .wiphy ,
71687168 & sdata -> u .mgd .ttlm_work );
7169- wiphy_delayed_work_queue (sdata -> local -> hw .wiphy ,
7169+ wiphy_hrtimer_work_queue (sdata -> local -> hw .wiphy ,
71707170 & sdata -> u .mgd .ttlm_work ,
7171- delay_jiffies );
7171+ us_to_ktime ( delay_usec ) );
71727172 return ;
71737173 }
71747174 }
@@ -8793,7 +8793,7 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
87938793 ieee80211_csa_connection_drop_work );
87948794 wiphy_delayed_work_init (& ifmgd -> tdls_peer_del_work ,
87958795 ieee80211_tdls_peer_del_work );
8796- wiphy_delayed_work_init (& ifmgd -> ml_reconf_work ,
8796+ wiphy_hrtimer_work_init (& ifmgd -> ml_reconf_work ,
87978797 ieee80211_ml_reconf_work );
87988798 wiphy_delayed_work_init (& ifmgd -> reconf .wk ,
87998799 ieee80211_ml_sta_reconf_timeout );
@@ -8802,7 +8802,7 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
88028802 timer_setup (& ifmgd -> conn_mon_timer , ieee80211_sta_conn_mon_timer , 0 );
88038803 wiphy_delayed_work_init (& ifmgd -> tx_tspec_wk ,
88048804 ieee80211_sta_handle_tspec_ac_params_wk );
8805- wiphy_delayed_work_init (& ifmgd -> ttlm_work ,
8805+ wiphy_hrtimer_work_init (& ifmgd -> ttlm_work ,
88068806 ieee80211_tid_to_link_map_work );
88078807 wiphy_delayed_work_init (& ifmgd -> neg_ttlm_timeout_work ,
88088808 ieee80211_neg_ttlm_timeout_work );
@@ -8849,7 +8849,7 @@ void ieee80211_mgd_setup_link(struct ieee80211_link_data *link)
88498849 else
88508850 link -> u .mgd .req_smps = IEEE80211_SMPS_OFF ;
88518851
8852- wiphy_delayed_work_init (& link -> u .mgd .csa .switch_work ,
8852+ wiphy_hrtimer_work_init (& link -> u .mgd .csa .switch_work ,
88538853 ieee80211_csa_switch_work );
88548854
88558855 ieee80211_clear_tpe (& link -> conf -> tpe );
@@ -10064,7 +10064,7 @@ void ieee80211_mgd_stop_link(struct ieee80211_link_data *link)
1006410064 & link -> u .mgd .request_smps_work );
1006510065 wiphy_work_cancel (link -> sdata -> local -> hw .wiphy ,
1006610066 & link -> u .mgd .recalc_smps );
10067- wiphy_delayed_work_cancel (link -> sdata -> local -> hw .wiphy ,
10067+ wiphy_hrtimer_work_cancel (link -> sdata -> local -> hw .wiphy ,
1006810068 & link -> u .mgd .csa .switch_work );
1006910069}
1007010070
0 commit comments