[PATCH] Make roc duration configurable

Jouni Malinen j
Sun Oct 19 00:45:58 PDT 2014

On Thu, Oct 16, 2014 at 08:35:06AM +0530, Sujith Manoharan wrote:
> The max remain-on-channel for cfg80211/mac80211 drivers is
> obtained using the NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION
> attribute. This patch adds a config parameter to override
> the driver-provided duration, which will help certain
> use-cases.

Wouldn't such use cases benefit from being able to set this dynamically
at runtime? The design used here seems to limit this to a one-time
configuration option when starting the interface.

In addition, I'd assume it would be useful to do such limitation on
off-channel operations mainly when there is concurrent operations in
progress (one or more wpa_s instances connected as a station or
operating as an AP). Or is the goal really to limit the operation
duration even if there is no such concurrent tasks on the radio?

> diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
> @@ -3919,6 +3919,7 @@ static const struct global_parse_data global_fields[] = {
> +	{ INT(max_remain_on_chan), 0 },

This is the parser for the new config variable, but there should be a
matching change in config_file.c to write the config variable (if
non-zero, i.e., not the default value).

> diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
> @@ -3797,6 +3797,10 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
> +	if (wpa_s->conf->max_remain_on_chan)
> +		wpa_s->max_remain_on_chan = wpa_s->conf->max_remain_on_chan;

This is the only place where wpa_s->max_remain_on_chan gets updated.
First of all, this must not allow the driver-advertised value to be
increased (that would result in driver commands getting rejected).
Secondly, this would be nice to be able to update at runtime based on
current use case. In other words, it may be useful to keep
wpa_s->max_remain_on_chan as-is and use wpa_s->conf->max_remain_on_chan
to reduce that limit in the concurrent cases so that changes to
wpa_s->conf->max_remain_on_chan will be taken into use on the next
attempt. min() of those two (if wpa_s->conf->max_remain_on_chan != 0)
would likely be the best approach for this.
Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list