Browse Source

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 <assaf.krauss@intel.com>
Assaf Krauss 10 years ago
parent
commit
58162adf06
2 changed files with 21 additions and 0 deletions
  1. 9 0
      src/drivers/driver_nl80211.c
  2. 12 0
      src/drivers/driver_nl80211_capa.c

+ 9 - 0
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);
 

+ 12 - 0
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;
 }