Replace rtw_get_current_time() with jiffies

Port of c01fb49636b65ceea513c00966c58b8bdb095c8f
This commit is contained in:
Carlos Garces
2021-10-14 21:34:26 +02:00
parent 4032543691
commit 7a5f134424
40 changed files with 199 additions and 211 deletions

View File

@@ -907,8 +907,8 @@ struct rf_ctl_t {
#define RTW_CAC_STOPPED 0
#ifdef CONFIG_DFS_MASTER
#define IS_CAC_STOPPED(rfctl) ((rfctl)->cac_end_time == RTW_CAC_STOPPED)
#define IS_CH_WAITING(rfctl) (!IS_CAC_STOPPED(rfctl) && rtw_time_after((rfctl)->cac_end_time, rtw_get_current_time()))
#define IS_UNDER_CAC(rfctl) (IS_CH_WAITING(rfctl) && rtw_time_after(rtw_get_current_time(), (rfctl)->cac_start_time))
#define IS_CH_WAITING(rfctl) (!IS_CAC_STOPPED(rfctl) && rtw_time_after((rfctl)->cac_end_time, jiffies))
#define IS_UNDER_CAC(rfctl) (IS_CH_WAITING(rfctl) && rtw_time_after(jiffies, (rfctl)->cac_start_time))
#define IS_RADAR_DETECTED(rfctl) ((rfctl)->radar_detected)
#else
#define IS_CAC_STOPPED(rfctl) 1

View File

@@ -276,7 +276,6 @@ extern void _rtw_deinit_queue(_queue *pqueue);
extern u32 _rtw_queue_empty(_queue *pqueue);
extern u32 rtw_end_of_queue_search(_list *queue, _list *pelement);
extern systime _rtw_get_current_time(void);
extern u32 _rtw_systime_to_ms(systime stime);
extern systime _rtw_ms_to_systime(u32 ms);
extern systime _rtw_us_to_systime(u32 us);
@@ -286,7 +285,6 @@ extern s32 _rtw_get_time_interval_ms(systime start, systime end);
extern bool _rtw_time_after(systime a, systime b);
#ifdef DBG_SYSTIME
#define rtw_get_current_time() ({systime __stime = _rtw_get_current_time(); __stime;})
#define rtw_systime_to_ms(stime) ({u32 __ms = _rtw_systime_to_ms(stime); typecheck(systime, stime); __ms;})
#define rtw_ms_to_systime(ms) ({systime __stime = _rtw_ms_to_systime(ms); __stime;})
#define rtw_us_to_systime(us) ({systime __stime = _rtw_us_to_systime(us); __stime;})
@@ -296,7 +294,6 @@ extern bool _rtw_time_after(systime a, systime b);
#define rtw_time_after(a,b) ({bool __r = _rtw_time_after(a,b); typecheck(systime, a); typecheck(systime, b); __r;})
#define rtw_time_before(a,b) ({bool __r = _rtw_time_after(b, a); typecheck(systime, a); typecheck(systime, b); __r;})
#else
#define rtw_get_current_time() _rtw_get_current_time()
#define rtw_systime_to_ms(stime) _rtw_systime_to_ms(stime)
#define rtw_ms_to_systime(ms) _rtw_ms_to_systime(ms)
#define rtw_us_to_systime(us) _rtw_us_to_systime(us)

View File

@@ -392,7 +392,7 @@ void rtw_rfctl_deinit(_adapter *adapter);
#ifdef CONFIG_DFS_MASTER
struct rf_ctl_t;
#define CH_IS_NON_OCP(rt_ch_info) (rtw_time_after((rt_ch_info)->non_ocp_end_time, rtw_get_current_time()))
#define CH_IS_NON_OCP(rt_ch_info) (rtw_time_after((rt_ch_info)->non_ocp_end_time, jiffies))
bool rtw_is_cac_reset_needed(struct rf_ctl_t *rfctl, u8 ch, u8 bw, u8 offset);
bool _rtw_rfctl_overlap_radar_detect_ch(struct rf_ctl_t *rfctl, u8 ch, u8 bw, u8 offset);
bool rtw_rfctl_overlap_radar_detect_ch(struct rf_ctl_t *rfctl);