From 58162adf060c17c040098fdb2b5b43689f59e386 Mon Sep 17 00:00:00 2001 From: Assaf Krauss Date: Wed, 5 Nov 2014 03:42:46 -0500 Subject: [PATCH] nl80211: Populate RRM flags in nl80211 driver Set the RRM capability flags, based on the capabilities reported by the underlying driver. In addition, upon connection, notify the underlying driver regarding RRM support. Signed-off-by: Assaf Krauss --- src/drivers/driver_nl80211.c | 9 +++++++++ src/drivers/driver_nl80211_capa.c | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index fdb1ec226..a37710e0d 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -5291,6 +5291,15 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, if (params->mgmt_frame_protection == MGMT_FRAME_PROTECTION_REQUIRED) NLA_PUT_U32(msg, NL80211_ATTR_USE_MFP, NL80211_MFP_REQUIRED); + if (params->rrm_used) { + u32 drv_rrm_flags = drv->capa.rrm_flags; + if (!(drv_rrm_flags & + WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES) || + !(drv_rrm_flags & WPA_DRIVER_FLAGS_QUIET)) + goto nla_put_failure; + NLA_PUT_FLAG(msg, NL80211_ATTR_USE_RRM); + } + if (params->disable_ht) NLA_PUT_FLAG(msg, NL80211_ATTR_DISABLE_HT); diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index 9f29dd286..9ee49e16d 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -368,6 +368,18 @@ static void wiphy_info_feature_flags(struct wiphy_info_data *info, if (flags & NL80211_FEATURE_SUPPORTS_WMM_ADMISSION) info->wmm_ac_supported = 1; + + if (flags & NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES) + capa->rrm_flags |= WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES; + + if (flags & NL80211_FEATURE_WFA_TPC_IE_IN_PROBES) + capa->rrm_flags |= WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES; + + if (flags & NL80211_FEATURE_QUIET) + capa->rrm_flags |= WPA_DRIVER_FLAGS_QUIET; + + if (flags & NL80211_FEATURE_TX_POWER_INSERTION) + capa->rrm_flags |= WPA_DRIVER_FLAGS_TX_POWER_INSERTION; }