@@ -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 ;
@@ -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