[PATCH] hostapd: DFS add cac_time cli command
Jouni Malinen
j
Tue Mar 4 10:18:21 PST 2014
On Mon, Mar 03, 2014 at 11:10:53AM +0100, Janusz Dziedzic wrote:
> Add cac_time cli command, that will display
> currently configured and left CAC time.
> Print cac_time also in status command.
> diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
> @@ -771,8 +771,10 @@ int hostapd_start_dfs_cac(struct hostapd_iface *iface, int mode, int freq,
> + if (!res) {
> iface->cac_started = 1;
> + os_get_time(&iface->dfs_cac_start);
> + }
> diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
> @@ -508,3 +510,37 @@ int hostapd_parse_csa_settings(const char *pos,
> +int hostapd_ctrl_iface_cac_time(struct hostapd_data *hapd, char *buf,
> + /* CAC started and CAC time set - calc left time */
> + os_get_time(&now);
> + left_time = iface->dfs_cac_ms/1000 - (now.sec - iface->dfs_cac_start.sec);
This should likely use os_reltime instead of os_time.
> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> @@ -6180,6 +6181,9 @@ static void phy_info_freq(struct hostapd_hw_modes *mode,
> + if (tb_freq[NL80211_FREQUENCY_ATTR_DFS_CAC_TIME])
> + chan->dfs_cac_ms = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_CAC_TIME]);
This attribute does not seem to exist in wireless-testing.git, so I
cannot apply this yet.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list