[PATCH] Make roc duration configurable
Sujith Manoharan
sujith
Wed Oct 15 20:05:06 PDT 2014
From: Sujith Manoharan <c_manoha at qca.qualcomm.com>
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.
Signed-off-by: Sujith Manoharan <c_manoha at qca.qualcomm.com>
---
wpa_supplicant/config.c | 1 +
wpa_supplicant/config.h | 5 +++++
wpa_supplicant/wpa_supplicant.c | 4 ++++
3 files changed, 10 insertions(+)
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index d56e203..0dc917b 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -3919,6 +3919,7 @@ static const struct global_parse_data global_fields[] = {
{ INT(mac_addr), 0 },
{ INT(rand_addr_lifetime), 0 },
{ INT(preassoc_mac_addr), 0 },
+ { INT(max_remain_on_chan), 0 },
};
#undef FUNC
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index f4c2f88..8285077 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -1088,6 +1088,11 @@ struct wpa_config {
* 2 = like 1, but maintain OUI (with local admin bit set)
*/
int preassoc_mac_addr;
+
+ /**
+ * max_remain_on_chan - Maximum remain-on-channel duration, in msecs.
+ */
+ unsigned int max_remain_on_chan;
};
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index e7aeeac..6e4190b 100644
--- 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,
wpa_s->num_multichan_concurrent =
capa.num_multichan_concurrent;
}
+
+ if (wpa_s->conf->max_remain_on_chan)
+ wpa_s->max_remain_on_chan = wpa_s->conf->max_remain_on_chan;
+
if (wpa_s->max_remain_on_chan == 0)
wpa_s->max_remain_on_chan = 1000;
--
2.1.2
More information about the Hostap
mailing list