Signed-off-by: Janusz Dziedzic --- phy.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/phy.c b/phy.c index 03a7822..ab629c6 100644 --- a/phy.c +++ b/phy.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -143,6 +144,20 @@ static int print_channels_handler(struct nl_msg *msg, void *arg) printf("\t DFS CAC time: %u ms\n", nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_CAC_TIME])); } + + if (tb_freq[NL80211_FREQUENCY_ATTR_CAC_START_TIME]) { + struct timespec now_ts; + unsigned long long now_ns, cac_start_ns, elapsed_ms; + + clock_gettime(CLOCK_BOOTTIME, &now_ts); + now_ns = now_ts.tv_sec * 1000000000ULL; + now_ns += now_ts.tv_nsec; + + cac_start_ns = nla_get_u64(tb_freq[NL80211_FREQUENCY_ATTR_CAC_START_TIME]); + elapsed_ms = (now_ns - cac_start_ns) / 1000000; + + printf("\t CAC ongoing (elapsed time: %llu ms)\n", elapsed_ms); + } } } } -- 2.43.0