diff --git a/src/wiphy.c b/src/wiphy.c index 2ff652fe..e50cdbef 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -951,6 +951,39 @@ void wiphy_update_from_genl(struct wiphy *wiphy, struct l_genl_msg *msg) wiphy_parse_attributes(wiphy, &attr); } +static void wiphy_set_station_capability_bits(struct wiphy *wiphy) +{ + uint8_t *ext_capa; + bool anqp_disabled; + + /* No per-type capabilities exist for station, just copy the global */ + if (!wiphy->iftype_extended_capabilities[NL80211_IFTYPE_STATION]) { + wiphy->iftype_extended_capabilities[NL80211_IFTYPE_STATION] = + l_new(uint8_t, EXT_CAP_LEN + 2); + + memcpy(wiphy->iftype_extended_capabilities[ + NL80211_IFTYPE_STATION], + wiphy->extended_capabilities, + EXT_CAP_LEN + 2); + } + + ext_capa = wiphy->iftype_extended_capabilities[NL80211_IFTYPE_STATION]; + + if (!l_settings_get_bool(iwd_get_config(), "General", "disable_anqp", + &anqp_disabled)) + anqp_disabled = true; + + /* Set BSS Transition Management */ + util_set_bit(ext_capa, 19); + + /* Set Interworking */ + if (!anqp_disabled) + util_set_bit(ext_capa, 31); + + /* Set FILS */ + util_set_bit(ext_capa, 72); +} + void wiphy_create_complete(struct wiphy *wiphy) { if (util_mem_is_zero(wiphy->permanent_addr, 6)) { @@ -961,6 +994,8 @@ void wiphy_create_complete(struct wiphy *wiphy) wiphy->name, strerror(-err)); } + wiphy_set_station_capability_bits(wiphy); + wiphy_print_basic_info(wiphy); }