Commit cd2f5dd7 authored by Assaf Krauss's avatar Assaf Krauss Committed by Johannes Berg

mac80211: Add RRM support to assoc request

In case of a RRM-supporting connection, in the association request
frame: set the RRM capability flag, and add the required IEs.
Signed-off-by: default avatarAssaf Krauss <assaf.krauss@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent bab5ab7d
...@@ -355,6 +355,7 @@ enum ieee80211_sta_flags { ...@@ -355,6 +355,7 @@ enum ieee80211_sta_flags {
IEEE80211_STA_DISABLE_80P80MHZ = BIT(12), IEEE80211_STA_DISABLE_80P80MHZ = BIT(12),
IEEE80211_STA_DISABLE_160MHZ = BIT(13), IEEE80211_STA_DISABLE_160MHZ = BIT(13),
IEEE80211_STA_DISABLE_WMM = BIT(14), IEEE80211_STA_DISABLE_WMM = BIT(14),
IEEE80211_STA_ENABLE_RRM = BIT(15),
}; };
struct ieee80211_mgd_auth_data { struct ieee80211_mgd_auth_data {
......
...@@ -673,6 +673,9 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata) ...@@ -673,6 +673,9 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
(local->hw.flags & IEEE80211_HW_SPECTRUM_MGMT)) (local->hw.flags & IEEE80211_HW_SPECTRUM_MGMT))
capab |= WLAN_CAPABILITY_SPECTRUM_MGMT; capab |= WLAN_CAPABILITY_SPECTRUM_MGMT;
if (ifmgd->flags & IEEE80211_STA_ENABLE_RRM)
capab |= WLAN_CAPABILITY_RADIO_MEASURE;
mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24); mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
memset(mgmt, 0, 24); memset(mgmt, 0, 24);
memcpy(mgmt->da, assoc_data->bss->bssid, ETH_ALEN); memcpy(mgmt->da, assoc_data->bss->bssid, ETH_ALEN);
...@@ -738,16 +741,17 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata) ...@@ -738,16 +741,17 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
} }
} }
if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT) { if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT ||
/* 1. power capabilities */ capab & WLAN_CAPABILITY_RADIO_MEASURE) {
pos = skb_put(skb, 4); pos = skb_put(skb, 4);
*pos++ = WLAN_EID_PWR_CAPABILITY; *pos++ = WLAN_EID_PWR_CAPABILITY;
*pos++ = 2; *pos++ = 2;
*pos++ = 0; /* min tx power */ *pos++ = 0; /* min tx power */
/* max tx power */ /* max tx power */
*pos++ = ieee80211_chandef_max_power(&chanctx_conf->def); *pos++ = ieee80211_chandef_max_power(&chanctx_conf->def);
}
/* 2. supported channels */ if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT) {
/* TODO: get this in reg domain format */ /* TODO: get this in reg domain format */
pos = skb_put(skb, 2 * sband->n_channels + 2); pos = skb_put(skb, 2 * sband->n_channels + 2);
*pos++ = WLAN_EID_SUPPORTED_CHANNELS; *pos++ = WLAN_EID_SUPPORTED_CHANNELS;
...@@ -4410,6 +4414,11 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, ...@@ -4410,6 +4414,11 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
ifmgd->flags &= ~IEEE80211_STA_MFP_ENABLED; ifmgd->flags &= ~IEEE80211_STA_MFP_ENABLED;
} }
if (req->flags & ASSOC_REQ_USE_RRM)
ifmgd->flags |= IEEE80211_STA_ENABLE_RRM;
else
ifmgd->flags &= ~IEEE80211_STA_ENABLE_RRM;
if (req->crypto.control_port) if (req->crypto.control_port)
ifmgd->flags |= IEEE80211_STA_CONTROL_PORT; ifmgd->flags |= IEEE80211_STA_CONTROL_PORT;
else else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment