aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-02-01 16:18:32 (GMT)
committerJouni Malinen <j@w1.fi>2011-02-01 16:18:32 (GMT)
commit89e07afb2c987d1776e7b778baa68d62c3fd9693 (patch)
tree02898042ef046e05a73468a192424e23f283caa2 /src
parent11fb02be67e6c7defab7bbfdad53bde124aa9346 (diff)
downloadhostap-89e07afb2c987d1776e7b778baa68d62c3fd9693.zip
hostap-89e07afb2c987d1776e7b778baa68d62c3fd9693.tar.gz
hostap-89e07afb2c987d1776e7b778baa68d62c3fd9693.tar.bz2
nl80211: Use max_remain_on_chan data from nl80211
If the driver advertises max_remain_on_chan data, use it instead of the hardcoded value of 5000. Keep the default at 5000 since that is the value used by earlier versions of cfg80211/mac80211 and not advertised in nl80211 for those. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver_nl80211.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index e6df6f0..d3b0b65 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1476,6 +1476,7 @@ struct wiphy_info_data {
int auth_supported;
int connect_supported;
int offchan_tx_supported;
+ int max_remain_on_chan;
};
@@ -1531,6 +1532,10 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
if (tb[NL80211_ATTR_OFFCHANNEL_TX_OK])
info->offchan_tx_supported = 1;
+ if (tb[NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION])
+ info->max_remain_on_chan =
+ nla_get_u32(tb[NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION]);
+
return NL_SKIP;
}
@@ -1541,6 +1546,10 @@ static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv,
struct nl_msg *msg;
os_memset(info, 0, sizeof(*info));
+
+ /* default to 5000 since early versions of mac80211 don't set it */
+ info->max_remain_on_chan = 5000;
+
msg = nlmsg_alloc();
if (!msg)
return -1;
@@ -1600,7 +1609,7 @@ static int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv)
drv->capa.flags |= WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE;
if (info.p2p_supported)
drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_CAPABLE;
- drv->capa.max_remain_on_chan = 5000;
+ drv->capa.max_remain_on_chan = info.max_remain_on_chan;
return 0;
}