From: David Spinadel <david.spinadel@xxxxxxxxx> Save RM enabled capability IE of an associating station if radio measurement is supported in its capability field. Signed-off-by: David Spinadel <david.spinadel@xxxxxxxxx> --- src/ap/ieee802_11.c | 11 ++++++++++- src/ap/sta_info.h | 2 ++ src/common/ieee802_11_common.c | 4 ++++ src/common/ieee802_11_common.h | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 4f65cf3..bf8ea7c 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -1749,6 +1749,11 @@ static u16 check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta, ap_copy_sta_supp_op_classes(sta, elems.supp_op_classes, elems.supp_op_classes_len); + if ((sta->capability & WLAN_CAPABILITY_RADIO_MEASUREMENT) && + elems.rrm_enabled_len == sizeof(sta->rrm_enabled_capa)) + os_memcpy(sta->rrm_enabled_capa, elems.rrm_enabled, + elems.rrm_enabled_len); + return WLAN_STATUS_SUCCESS; } @@ -2093,6 +2098,11 @@ static void handle_assoc(struct hostapd_data *hapd, } #endif /* CONFIG_MBO */ + /* sta->capability is used in check_assoc_ies() for rrm enabled + * capability element. + */ + sta->capability = capab_info; + /* followed by SSID and Supported rates; and HT capabilities if 802.11n * is used */ resp = check_assoc_ies(hapd, sta, pos, left, reassoc); @@ -2106,7 +2116,6 @@ static void handle_assoc(struct hostapd_data *hapd, goto fail; } - sta->capability = capab_info; sta->listen_interval = listen_interval; if (hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G) diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h index 3d9a928..c49402d 100644 --- a/src/ap/sta_info.h +++ b/src/ap/sta_info.h @@ -202,6 +202,8 @@ struct sta_info { u8 *supp_op_classes; /* Supported Operating Classes element, if * received, starting from the Length field */ + + u8 rrm_enabled_capa[5]; }; diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index 5b05b68..b6bc449 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -375,6 +375,10 @@ ParseRes ieee802_11_parse_elems(const u8 *start, size_t len, elems->supp_op_classes = pos; elems->supp_op_classes_len = elen; break; + case WLAN_EID_RRM_ENABLED_CAPABILITIES: + elems->rrm_enabled = pos; + elems->rrm_enabled_len = elen; + break; default: unknown++; if (!show_errors) diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h index d9fecd6..de6876a 100644 --- a/src/common/ieee802_11_common.h +++ b/src/common/ieee802_11_common.h @@ -63,6 +63,7 @@ struct ieee802_11_elems { const u8 *mic; const u8 *pref_freq_list; const u8 *supp_op_classes; + const u8 *rrm_enabled; u8 ssid_len; u8 supp_rates_len; @@ -96,6 +97,7 @@ struct ieee802_11_elems { u8 supp_op_classes_len; struct mb_ies_info mb_ies; + u8 rrm_enabled_len; }; typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes; -- 1.9.1 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap