In case of a RRM-supporting connection, in the association request frame: set the RRM capability flag, and add the required IEs.
Unified · Split
| @@ -355,6 +355,7 @@ enum ieee80211_sta_flags { · 354 unmodified lines | |||
| 355 | IEEE80211_STA_DISABLE_80P80MHZ = BIT(12), | 355 | IEEE80211_STA_DISABLE_80P80MHZ = BIT(12), |
| 356 | IEEE80211_STA_DISABLE_160MHZ = BIT(13), | 356 | IEEE80211_STA_DISABLE_160MHZ = BIT(13), |
| 357 | IEEE80211_STA_DISABLE_WMM = BIT(14), | 357 | IEEE80211_STA_DISABLE_WMM = BIT(14), |
| 358 | IEEE80211_STA_ENABLE_RRM = BIT(15), | ||
| 358 | }; | 359 | }; |
| 359 | 360 | ||
| 360 | struct ieee80211_mgd_auth_data { | 361 | struct ieee80211_mgd_auth_data { |
| @@ -673,6 +673,9 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata) · 672 unmodified lines | |||
| 673 | (local->hw.flags & IEEE80211_HW_SPECTRUM_MGMT)) | 673 | (local->hw.flags & IEEE80211_HW_SPECTRUM_MGMT)) |
| 674 | capab |= WLAN_CAPABILITY_SPECTRUM_MGMT; | 674 | capab |= WLAN_CAPABILITY_SPECTRUM_MGMT; |
| 675 | 675 | ||
| 676 | if (ifmgd->flags & IEEE80211_STA_ENABLE_RRM) | ||
| 677 | capab |= WLAN_CAPABILITY_RADIO_MEASURE; | ||
| 678 | |||
| 676 | mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24); | 679 | mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24); |
| 677 | memset(mgmt, 0, 24); | 680 | memset(mgmt, 0, 24); |
| 678 | memcpy(mgmt->da, assoc_data->bss->bssid, ETH_ALEN); | 681 | memcpy(mgmt->da, assoc_data->bss->bssid, ETH_ALEN); |
| @@ -738,16 +741,17 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata) · 59 unmodified lines | |||
| 738 | } | 741 | } |
| 739 | } | 742 | } |
| 740 | 743 | ||
| 741 | if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT) { | 744 | if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT || |
| 742 | /* 1. power capabilities */ | 745 | capab & WLAN_CAPABILITY_RADIO_MEASURE) { |
| 743 | pos = skb_put(skb, 4); | 746 | pos = skb_put(skb, 4); |
| 744 | *pos++ = WLAN_EID_PWR_CAPABILITY; | 747 | *pos++ = WLAN_EID_PWR_CAPABILITY; |
| 745 | *pos++ = 2; | 748 | *pos++ = 2; |
| 746 | *pos++ = 0; /* min tx power */ | 749 | *pos++ = 0; /* min tx power */ |
| 747 | /* max tx power */ | 750 | /* max tx power */ |
| 748 | *pos++ = ieee80211_chandef_max_power(&chanctx_conf->def); | 751 | *pos++ = ieee80211_chandef_max_power(&chanctx_conf->def); |
| 752 | } | ||
| 749 | 753 | ||
| 750 | /* 2. supported channels */ | 754 | if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT) { |
| 751 | /* TODO: get this in reg domain format */ | 755 | /* TODO: get this in reg domain format */ |
| 752 | pos = skb_put(skb, 2 * sband->n_channels + 2); | 756 | pos = skb_put(skb, 2 * sband->n_channels + 2); |
| 753 | *pos++ = WLAN_EID_SUPPORTED_CHANNELS; | 757 | *pos++ = WLAN_EID_SUPPORTED_CHANNELS; |
| @@ -4410,6 +4414,11 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, · 3656 unmodified lines | |||
| 4410 | ifmgd->flags &= ~IEEE80211_STA_MFP_ENABLED; | 4414 | ifmgd->flags &= ~IEEE80211_STA_MFP_ENABLED; |
| 4411 | } | 4415 | } |
| 4412 | 4416 | ||
| 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 | |||
| 4413 | if (req->crypto.control_port) | 4422 | if (req->crypto.control_port) |
| 4414 | ifmgd->flags |= IEEE80211_STA_CONTROL_PORT; | 4423 | ifmgd->flags |= IEEE80211_STA_CONTROL_PORT; |
| 4415 | else | 4424 | else |