Skip to content

Commit cd2f5dd

Browse files
assafkrauss-at-inteljmberg-intel
authored andcommitted
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: Assaf Krauss <assaf.krauss@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent bab5ab7 commit cd2f5dd

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎net/mac80211/ieee80211_i.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ enum ieee80211_sta_flags {
355355
IEEE80211_STA_DISABLE_80P80MHZ = BIT(12),
356356
IEEE80211_STA_DISABLE_160MHZ = BIT(13),
357357
IEEE80211_STA_DISABLE_WMM = BIT(14),
358+
IEEE80211_STA_ENABLE_RRM = BIT(15),
358359
};
359360

360361
struct ieee80211_mgd_auth_data {

‎net/mac80211/mlme.c‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,9 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
673673
(local->hw.flags & IEEE80211_HW_SPECTRUM_MGMT))
674674
capab |= WLAN_CAPABILITY_SPECTRUM_MGMT;
675675

676+
if (ifmgd->flags & IEEE80211_STA_ENABLE_RRM)
677+
capab |= WLAN_CAPABILITY_RADIO_MEASURE;
678+
676679
mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
677680
memset(mgmt, 0, 24);
678681
memcpy(mgmt->da, assoc_data->bss->bssid, ETH_ALEN);
@@ -738,16 +741,17 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
738741
}
739742
}
740743

741-
if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT) {
742-
/* 1. power capabilities */
744+
if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT ||
745+
capab & WLAN_CAPABILITY_RADIO_MEASURE) {
743746
pos = skb_put(skb, 4);
744747
*pos++ = WLAN_EID_PWR_CAPABILITY;
745748
*pos++ = 2;
746749
*pos++ = 0; /* min tx power */
747750
/* max tx power */
748751
*pos++ = ieee80211_chandef_max_power(&chanctx_conf->def);
752+
}
749753

750-
/* 2. supported channels */
754+
if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT) {
751755
/* TODO: get this in reg domain format */
752756
pos = skb_put(skb, 2 * sband->n_channels + 2);
753757
*pos++ = WLAN_EID_SUPPORTED_CHANNELS;
@@ -4410,6 +4414,11 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
44104414
ifmgd->flags &= ~IEEE80211_STA_MFP_ENABLED;
44114415
}
44124416

4417+
if (req->flags & ASSOC_REQ_USE_RRM)
4418+
ifmgd->flags |= IEEE80211_STA_ENABLE_RRM;
4419+
else
4420+
ifmgd->flags &= ~IEEE80211_STA_ENABLE_RRM;
4421+
44134422
if (req->crypto.control_port)
44144423
ifmgd->flags |= IEEE80211_STA_CONTROL_PORT;
44154424
else

0 commit comments

Comments
 (0)