diff --git a/feeds/wifi-ax/hostapd/files/hostapd.sh b/feeds/wifi-ax/hostapd/files/hostapd.sh index 2bb8e15df..7a8e00fd5 100644 --- a/feeds/wifi-ax/hostapd/files/hostapd.sh +++ b/feeds/wifi-ax/hostapd/files/hostapd.sh @@ -1,4 +1,5 @@ . /lib/functions/network.sh +. /lib/functions.sh wpa_supplicant_add_rate() { local var="$1" @@ -44,6 +45,7 @@ hostapd_append_wpa_key_mgmt() { append wpa_key_mgmt "WPA-$auth_type_l" [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-${auth_type_l}" [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-${auth_type_l}-SHA256" + [ "${ieee80211ai:-0}" -gt 0 ] && append wpa_key_mgmt "FILS-SHA256" ;; eap192) append wpa_key_mgmt "WPA-EAP-SUITE-B-192" @@ -70,6 +72,8 @@ hostapd_append_wpa_key_mgmt() { append wpa_key_mgmt "OWE" ;; esac + + [ "$auth_osen" = "1" ] && append wpa_key_mgmt "OSEN" } hostapd_add_log_config() { @@ -96,9 +100,11 @@ hostapd_common_add_device_config() { config_add_string require_mode config_add_boolean legacy_rates - config_add_string acs_chan_bias co_locate + config_add_string acs_chan_bias config_add_array hostapd_options - config_add_boolean multiple_bssid rnr_beacon + + config_add_int airtime_mode + config_add_boolean multiple_bssid rnr_beacon he_co_locate ema hostapd_add_log_config } @@ -111,7 +117,8 @@ hostapd_prepare_device_config() { local base_cfg= json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ - acs_chan_bias local_pwr_constraint spectrum_mgmt_required multiple_bssid co_locate + acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode \ + multiple_bssid he_co_locate rnr_beacon ema hostapd_set_log_options base_cfg @@ -119,8 +126,11 @@ hostapd_prepare_device_config() { set_default spectrum_mgmt_required 0 set_default doth 1 set_default legacy_rates 1 + set_default airtime_mode 0 set_default multiple_bssid 0 - set_default rnr_beacon 1 + set_default rnr_beacon 0 + set_default he_co_locate 0 + set_default ema 0 [ "$hwmode" = "b" ] && legacy_rates=1 @@ -136,7 +146,6 @@ hostapd_prepare_device_config() { } [ -n "$acs_chan_bias" ] && append base_cfg "acs_chan_bias=$acs_chan_bias" "$N" - [ -n "$co_locate" ] && append base_cfg "co_locate=$co_locate" "$N" local brlist= br json_get_values basic_rate_list basic_rate @@ -168,6 +177,11 @@ hostapd_prepare_device_config() { [ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N" append base_cfg "beacon_int=$beacon_int" "$N" append base_cfg "dtim_period=$dtim_period" "$N" + [ "$airtime_mode" -gt 0 ] && append base_cfg "airtime_mode=$airtime_mode" "$N" + [ "$multiple_bssid" -gt 0 ] && append base_cfg "multiple_bssid=$multiple_bssid" "$N" + [ "$rnr_beacon" -gt 0 ] && append base_cfg "rnr_beacon=$rnr_beacon" "$N" + [ "$ema" -gt 0 ] && append base_cfg "ema=$ema" "$N" + [ "$he_co_locate" -gt 0 ] && append base_cfg "he_co_locate=$he_co_locate" "$N" json_get_values opts hostapd_options for val in $opts; do @@ -197,10 +211,11 @@ hostapd_common_add_bss_config() { config_add_boolean rsn_preauth auth_cache config_add_int ieee80211w + config_add_int ieee80211ai config_add_int eapol_version config_add_string 'auth_server:host' 'server:host' - config_add_string auth_secret + config_add_string auth_secret key config_add_int 'auth_port:port' 'port:port' config_add_string acct_server @@ -238,12 +253,15 @@ hostapd_common_add_bss_config() { config_add_string wps_device_type wps_device_name wps_manufacturer wps_pin config_add_string multi_ap_backhaul_ssid multi_ap_backhaul_key - config_add_boolean ieee80211v wnm_sleep_mode bss_transition + config_add_boolean wnm_sleep_mode bss_transition config_add_int time_advertisement config_add_string time_zone config_add_boolean ieee80211k rrm_neighbor_report rrm_beacon_report + config_add_boolean ftm_responder stationary_ap + config_add_string lci civic + config_add_boolean ieee80211r pmk_r1_push ft_psk_generate_local ft_over_ds config_add_int r0_key_lifetime reassociation_deadline config_add_string mobility_domain r1_key_holder @@ -260,10 +278,44 @@ hostapd_common_add_bss_config() { config_add_int mcast_rate config_add_array basic_rate config_add_array supported_rates - + config_add_boolean sae_require_mfp - + config_add_string 'owe_transition_bssid:macaddr' 'owe_transition_ssid:string' + + config_add_boolean iw_enabled iw_internet iw_asra iw_esr iw_uesa + config_add_int iw_access_network_type iw_venue_group iw_venue_type + config_add_int iw_ipaddr_type_availability iw_gas_address3 + config_add_string iw_hessid iw_network_auth_type iw_qos_map_set + config_add_array iw_roaming_consortium iw_domain_name iw_anqp_3gpp_cell_net iw_nai_realm + config_add_array iw_anqp_elem + + config_add_int beacon_rate + config_add_int rssi_reject_assoc_rssi + config_add_int rssi_ignore_probe_request + + config_add_boolean hs20 disable_dgaf osen + config_add_int anqp_domain_id + config_add_int hs20_deauth_req_timeout + config_add_array hs20_oper_friendly_name + config_add_array osu_provider + config_add_array operator_icon + config_add_array hs20_conn_capab + config_add_array roaming_consortium + config_add_array venue_name + config_add_array venue_url + config_add_array nai_realm + config_add_string osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp + + config_add_boolean interworking internet + config_add_int access_network_type asra esr uesa venue_group venue_type ipaddr_type_availability \ + gas_address3 + config_add_string hessid network_auth_type \ + anqp_3gpp_cell_net anqp_elem domain_name qos_map_set hs20_t_c_server_url + + config_add_array airtime_sta_weight + config_add_int airtime_bss_weight airtime_bss_limit + config_add_int rts_threshold } hostapd_set_vlan_file() { @@ -299,6 +351,115 @@ hostapd_set_psk() { for_each_station hostapd_set_psk_file ${ifname} } +append_iw_roaming_consortium() { + [ -n "$1" ] && append bss_conf "roaming_consortium=$1" "$N" +} + +append_iw_domain_name() { + if [ -z "$iw_domain_name_conf" ]; then + iw_domain_name_conf="$1" + else + iw_domain_name_conf="$iw_domain_name_conf,$1" + fi +} + +append_iw_anqp_3gpp_cell_net() { + if [ -z "$iw_anqp_3gpp_cell_net_conf" ]; then + iw_anqp_3gpp_cell_net_conf="$1" + else + iw_anqp_3gpp_cell_net_conf="$iw_anqp_3gpp_cell_net_conf:$1" + fi +} + +append_iw_anqp_elem() { + [ -n "$1" ] && append bss_conf "anqp_elem=$1" "$N" +} + +append_iw_nai_realm() { + [ -n "$1" ] && append bss_conf "nai_realm=$1" "$N" +} + +append_roaming_consortium() { + [ -n "$1" ] && append bss_conf "roaming_consortium=$1" "$N" +} + +append_venue_name() { + [ -n "$1" ] && append bss_conf "venue_name=$1" "$N" +} + +append_venue_url() { + [ -n "$1" ] && append bss_conf "venue_url=$1" "$N" +} + +append_nai_realm() { + [ -n "$1" ] && append bss_conf "nai_realm=$1" "$N" +} + +append_hs20_oper_friendly_name() { + [ -n "$1" ] && append bss_conf "hs20_oper_friendly_name=$1" "$N" +} + +append_osu_provider_service_desc() { + [ -n "$1" ] && append bss_conf "osu_service_desc=$1" "$N" +} + +append_hs20_icon() { + local width height lang type path + config_get width "$1" width + config_get height "$1" height + config_get lang "$1" lang + config_get type "$1" type + config_get path "$1" path + + append bss_conf "hs20_icon=$width:$height:$lang:$type:$1:$path" "$N" +} + +append_hs20_icons() { + config_load wireless + config_foreach append_hs20_icon hs20-icon +} + +append_operator_icon() { + [ -n "$1" ] && append bss_conf "operator_icon=$1" "$N" +} + +append_osu_icon() { + [ -n "$1" ] && append bss_conf "osu_icon=$1" "$N" +} + +append_osu_provider() { + local cfgtype osu_server_uri osu_nai osu_nai2 osu_method_list + + config_load wireless + config_get cfgtype "$1" TYPE + [ "$cfgtype" != "osu-provider" ] && return + + append bss_conf "# provider $1" "$N" + config_get osu_server_uri "$1" osu_server_uri + config_get osu_nai "$1" osu_nai + config_get osu_nai2 "$1" osu_nai2 + config_get osu_method_list "$1" osu_method + + [ -n "$osu_server_uri" ] append bss_conf "osu_server_uri=$osu_server_uri" "$N" + [ -n "$osu_nai" ] append bss_conf "osu_nai=$osu_nai" "$N" + [ -n "$osu_nai2" ] append bss_conf "osu_nai2=$osu_nai2" "$N" + [ -n "$osu_method_list" ] append bss_conf "osu_method_list=$osu_method_list" "$N" + + config_list_foreach "$1" osu_service_desc append_osu_provider_service_desc + config_list_foreach "$1" osu_friendly_name append_osu_friendly_name + config_list_foreach "$1" osu_icon append_osu_icon + + append bss_conf "$N" +} + +append_hs20_conn_capab() { + [ -n "$1" ] && append bss_conf "hs20_conn_capab=$1" "$N" +} + +append_airtime_sta_weight() { + [ -n "$1" ] && append bss_conf "airtime_sta_weight=$1" "$N" +} + hostapd_set_bss_options() { local var="$1" local phy="$2" @@ -316,10 +477,12 @@ hostapd_set_bss_options() { wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 wps_ap_setup_locked \ wps_independent wps_device_type wps_device_name wps_manufacturer wps_pin \ macfilter ssid utf8_ssid wmm uapsd hidden short_preamble rsn_preauth \ - iapp_interface eapol_version dynamic_vlan ieee80211w nasid \ + iapp_interface eapol_version dynamic_vlan ieee80211w ieee80211ai nasid \ acct_server acct_secret acct_port acct_interval \ bss_load_update_period chan_util_avg_period sae_require_mfp \ - multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key + multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key \ + airtime_bss_weight airtime_bss_limit airtime_sta_weight \ + rssi_reject_assoc_rssi rssi_ignore_probe_request rts_threshold set_default isolate 0 set_default maxassoc 0 @@ -337,6 +500,11 @@ hostapd_set_bss_options() { set_default chan_util_avg_period 600 set_default utf8_ssid 1 set_default multi_ap 0 + set_default airtime_bss_weight 0 + set_default airtime_bss_limit 0 + set_default rssi_reject_assoc_rssi 0 + set_default rssi_ignore_probe_request 0 + set_default rts_threshold -1 append bss_conf "ctrl_interface=/var/run/hostapd" if [ "$isolate" -gt 0 ]; then @@ -349,6 +517,10 @@ hostapd_set_bss_options() { append bss_conf "ap_max_inactivity=$max_inactivity" "$N" fi + [ "$airtime_bss_weight" -gt 0 ] && append bss_conf "airtime_bss_weight=$airtime_bss_weight" "$N" + [ "$airtime_bss_limit" -gt 0 ] && append bss_conf "airtime_bss_limit=$airtime_bss_limit" "$N" + json_for_each_item append_airtime_sta_weight airtime_sta_weight + append bss_conf "bss_load_update_period=$bss_load_update_period" "$N" append bss_conf "chan_util_avg_period=$chan_util_avg_period" "$N" append bss_conf "disassoc_low_ack=$disassoc_low_ack" "$N" @@ -358,6 +530,9 @@ hostapd_set_bss_options() { append bss_conf "uapsd_advertisement_enabled=$uapsd" "$N" append bss_conf "utf8_ssid=$utf8_ssid" "$N" append bss_conf "multi_ap=$multi_ap" "$N" + append bss_conf "rssi_reject_assoc_rssi=$rssi_reject_assoc_rssi" "$N" + append bss_conf "rssi_ignore_probe_request=$rssi_ignore_probe_request" "$N" + append bss_conf "rts_threshold=$rts_threshold" "$N" [ "$tdls_prohibit" -gt 0 ] && append bss_conf "tdls_prohibit=$tdls_prohibit" "$N" @@ -406,13 +581,13 @@ hostapd_set_bss_options() { ;; psk|sae|psk-sae) json_get_vars key wpa_psk_file - if [ ${#key} -lt 8 ]; then + if [ ${#key} -eq 64 ]; then + append bss_conf "wpa_psk=$key" "$N" + elif [ ${#key} -ge 8 ] && [ ${#key} -le 63 ]; then + append bss_conf "wpa_passphrase=$key" "$N" + elif [ -n "$key" ] || [ -z "$wpa_psk_file" ]; then wireless_setup_vif_failed INVALID_WPA_PSK return 1 - elif [ ${#key} -eq 64 ]; then - append bss_conf "wpa_psk=$key" "$N" - else - append bss_conf "wpa_passphrase=$key" "$N" fi [ -z "$wpa_psk_file" ] && set_default wpa_psk_file /var/run/hostapd-$ifname.psk [ -n "$wpa_psk_file" ] && { @@ -532,30 +707,31 @@ hostapd_set_bss_options() { append bss_conf "iapp_interface=$ifname" "$N" } - json_get_vars ieee80211v - set_default ieee80211v 0 - if [ "$ieee80211v" -eq "1" ]; then - json_get_vars time_advertisement time_zone wnm_sleep_mode bss_transition + json_get_vars time_advertisement time_zone wnm_sleep_mode bss_transition - set_default time_advertisement 0 - set_default wnm_sleep_mode 0 - set_default bss_transition 0 + [ -n "$time_advertisement" ] && append bss_conf "time_advertisement=$time_advertisement" "$N" + [ -n "$time_zone" ] && append bss_conf "time_zone=$time_zone" "$N" + [ "$wnm_sleep_mode" -eq "1" ] && append bss_conf "wnm_sleep_mode=1" "$N" + [ "$bss_transition" -eq "1" ] && append bss_conf "bss_transition=1" "$N" - append bss_conf "time_advertisement=$time_advertisement" "$N" - [ -n "$time_zone" ] && append bss_conf "time_zone=$time_zone" "$N" - append bss_conf "wnm_sleep_mode=$wnm_sleep_mode" "$N" - append bss_conf "bss_transition=$bss_transition" "$N" - fi - - json_get_vars ieee80211k + json_get_vars ieee80211k rrm_neighbor_report rrm_beacon_report set_default ieee80211k 0 if [ "$ieee80211k" -eq "1" ]; then - json_get_vars rrm_neighbor_report rrm_beacon_report - set_default rrm_neighbor_report 1 set_default rrm_beacon_report 1 - append bss_conf "rrm_neighbor_report=$rrm_neighbor_report" "$N" - append bss_conf "rrm_beacon_report=$rrm_beacon_report" "$N" + fi + + [ "$rrm_neighbor_report" -eq "1" ] && append bss_conf "rrm_neighbor_report=1" "$N" + [ "$rrm_beacon_report" -eq "1" ] && append bss_conf "rrm_beacon_report=1" "$N" + + json_get_vars ftm_responder stationary_ap lci civic + if [ "$ftm_responder" -eq "1" ]; then + iw phy "$phy" info | grep -q "ENABLE_FTM_RESPONDER" && { + append bss_conf "ftm_responder=1" "$N" + [ "$stationary_ap" -eq "1" ] && append bss_conf "stationary_ap=1" "$N" + [ -n "$lci" ] && append bss_conf "lci=$lci" "$N" + [ -n "$civic" ] && append bss_conf "lci=$civic" "$N" + } fi if [ "$wpa" -ge "1" ]; then @@ -692,6 +868,110 @@ hostapd_set_bss_options() { } } + json_get_vars iw_enabled iw_internet iw_asra iw_esr iw_uesa iw_access_network_type + json_get_vars iw_hessid iw_venue_group iw_venue_type iw_network_auth_type + json_get_vars iw_roaming_consortium iw_domain_name iw_anqp_3gpp_cell_net iw_nai_realm + json_get_vars iw_anqp_elem iw_qos_map_set iw_ipaddr_type_availability iw_gas_address3 + + set_default iw_enabled 0 + if [ "$iw_enabled" = "1" ]; then + append bss_conf "interworking=1" "$N" + set_default iw_internet 1 + set_default iw_asra 0 + set_default iw_esr 0 + set_default iw_uesa 0 + + append bss_conf "internet=$iw_internet" "$N" + append bss_conf "asra=$iw_asra" "$N" + append bss_conf "esr=$iw_esr" "$N" + append bss_conf "uesa=$iw_uesa" "$N" + + [ -n "$iw_access_network_type" ] && \ + append bss_conf "access_network_type=$iw_access_network_type" "$N" + [ -n "$iw_hessid" ] && append bss_conf "hessid=$iw_hessid" "$N" + [ -n "$iw_venue_group" ] && \ + append bss_conf "venue_group=$iw_venue_group" "$N" + [ -n "$iw_venue_type" ] && append bss_conf "venue_type=$iw_venue_type" "$N" + [ -n "$iw_network_auth_type" ] && \ + append bss_conf "network_auth_type=$iw_network_auth_type" "$N" + [ -n "$iw_gas_address3" ] && append bss_conf "gas_address3=$iw_gas_address3" "$N" + [ -n "$iw_qos_map_set" ] && append bss_conf "qos_map_set=$iw_qos_map_set" "$N" + + json_for_each_item append_iw_roaming_consortium iw_roaming_consortium + json_for_each_item append_iw_anqp_elem iw_anqp_elem + json_for_each_item append_iw_nai_realm iw_nai_realm + + iw_domain_name_conf= + json_for_each_item append_iw_domain_name iw_domain_name + [ -n "$iw_domain_name_conf" ] && \ + append bss_conf "domain_name=$iw_domain_name_conf" "$N" + + iw_anqp_3gpp_cell_net_conf= + json_for_each_item append_iw_anqp_3gpp_cell_net iw_anqp_3gpp_cell_net + [ -n "$iw_anqp_3gpp_cell_net_conf" ] && \ + append bss_conf "anqp_3gpp_cell_net=$iw_anqp_3gpp_cell_net_conf" "$N" + fi + + + local hs20 disable_dgaf osen anqp_domain_id hs20_deauth_req_timeout \ + osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp \ + interworking internet access_network_type asra esr uesa venue_group venue_type \ + ipaddr_type_availability gas_address3 hessid \ + network_auth_type anqp_3gpp_cell_net domain_name anqp_elem qos_map_set \ + hs20_t_c_server_url + json_get_vars hs20 disable_dgaf osen anqp_domain_id hs20_deauth_req_timeout \ + osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp \ + interworking internet access_network_type asra esr uesa venue_group venue_type \ + ipaddr_type_availability gas_address3 hessid \ + network_auth_type anqp_3gpp_cell_net domain_name anqp_elem qos_map_set \ + hs20_t_c_server_url + + set_default hs20 0 + set_default disable_dgaf $hs20 + set_default osen 0 + set_default anqp_domain_id 0 + set_default hs20_deauth_req_timeout 60 + if [ "$hs20" = "1" ]; then + append bss_conf "hs20=1" "$N" + append_hs20_icons + [ -n "$disable_dgaf"] && append bss_conf "disable_dgaf=$disable_dgaf" "$N" + [ -n "$osen"] && append bss_conf "osen=$osen" "$N" + [ -n "$anqp_domain_id"] && append bss_conf "anqp_domain_id=$anqp_domain_id" "$N" + [ -n "$hs20_deauth_req_timeout"] && append bss_conf "hs20_deauth_req_timeout=$hs20_deauth_req_timeout" "$N" + [ -n "$osu_ssid" ] && append bss_conf "osu_ssid=$osu_ssid" "$N" + [ -n "$hs20_wan_metrics" ] && append bss_conf "hs20_wan_metrics=$hs20_wan_metrics" "$N" + [ -n "$hs20_operating_class" ] && append bss_conf "hs20_operating_class=$hs20_operating_class" "$N" + [ -n "$hs20_t_c_filename" ] && append bss_conf "hs20_t_c_filename=$hs20_t_c_filename" "$N" + [ -n "$hs20_t_c_timestamp" ] && append bss_conf "hs20_t_c_timestamp=$hs20_t_c_timestamp" "$N" + json_for_each_item append_hs20_oper_friendly_name hs20_oper_friendly_name + json_for_each_item append_roaming_consortium roaming_consortium + json_for_each_item append_venue_name venue_name + json_for_each_item append_venue_url venue_url + json_for_each_item append_nai_realm nai_realm + json_for_each_item append_hs20_conn_capab hs20_conn_capab + json_for_each_item append_hs20_oper_friendly_name hs20_oper_friendly_name + json_for_each_item append_osu_provider osu_provider + json_for_each_item append_operator_icon operator_icon + [ -n "$interworking" ] && append bss_conf "interworking=$interworking" "$N" + [ -n "$internet" ] && append bss_conf "internet=$internet" "$N" + [ -n "$access_network_type" ] && append bss_conf "access_network_type=$access_network_type" "$N" + [ -n "$asra" ] && append bss_conf "asra=$asra" "$N" + [ -n "$esr" ] && append bss_conf "esr=$esr" "$N" + [ -n "$uesa" ] && append bss_conf "uesa=$uesa" "$N" + [ -n "$venue_group" ] && append bss_conf "venue_group=$venue_group" "$N" + [ -n "$venue_type" ] && append bss_conf "venue_type=$venue_type" "$N" + [ -n "$ipaddr_type_availability" ] && append bss_conf "ipaddr_type_availability=$ipaddr_type_availability" "$N" + [ -n "$gas_address3" ] && append bss_conf "gas_address3=$gas_address3" "$N" + [ -n "$hessid" ] && append bss_conf "hessid=$hessid" "$N" + [ -n "$network_auth_type" ] && append bss_conf "network_auth_type=$network_auth_type" "$N" + [ -n "$anqp_3gpp_cell_net" ] && append bss_conf "anqp_3gpp_cell_net=$anqp_3gpp_cell_net" "$N" + [ -n "$nai_realm" ] && append bss_conf "nai_realm=$nai_realm" "$N" + [ -n "$anqp_elem" ] && append bss_conf "anqp_elem=$anqp_elem" "$N" + [ -n "$qos_map_set" ] && append bss_conf "qos_map_set=$qos_map_set" "$N" + [ -n "$domain_name" ] && append bss_conf "domain_name=$domain_name" "$N" + [ -n "$hs20_t_c_server_url" ] && append bss_conf "hs20_t_c_server_url=$hs20_t_c_server_url" "$N" + fi + bss_md5sum=$(echo $bss_conf | md5sum | cut -d" " -f1) append bss_conf "config_id=$bss_md5sum" "$N" @@ -790,6 +1070,7 @@ wpa_supplicant_prepare_interface() { fi wpa_supplicant_teardown_interface "$ifname" cat > "$_config" < +Date: Fri, 3 Jul 2020 23:00:34 +0200 +Subject: [PATCH] dfs: enter DFS state if no available channel is found + +Previously hostapd would not stop transmitting when a DFS event was +detected and no available channel to switch to was available. + +Disable and re-enable the interface to enter DFS state. This way, TX +does not happen until the kernel notifies hostapd about the NOP +expiring. + +Signed-off-by: David Bauer +--- + src/ap/dfs.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +--- a/src/ap/dfs.c ++++ b/src/ap/dfs.c +@@ -1066,8 +1066,15 @@ static int hostapd_dfs_start_channel_swi + &oper_centr_freq_seg0_idx, + &oper_centr_freq_seg1_idx, + &skip_radar); +- if (!channel) +- return err; ++ if (!channel) { ++ /* ++ * Toggle interface state to enter DFS state ++ * until NOP is finished. ++ */ ++ hostapd_disable_iface(iface); ++ hostapd_enable_iface(iface); ++ return 0; ++ } + if (!skip_radar) { + iface->freq = channel->freq; + iface->conf->channel = channel->chan; diff --git a/feeds/wifi-ax/hostapd/patches/800-probe_request-ignore-when-rssi-is-too-low.patch b/feeds/wifi-ax/hostapd/patches/800-probe_request-ignore-when-rssi-is-too-low.patch new file mode 100644 index 000000000..182a3bb86 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/800-probe_request-ignore-when-rssi-is-too-low.patch @@ -0,0 +1,68 @@ +From e15b04870a7d7517a9b129d8d5cbebe6b8a25cb8 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Wed, 29 Jul 2020 17:38:15 +0200 +Subject: [PATCH 1/2] probe_request: ignore when rssi is too low + +Signed-off-by: John Crispin +--- + hostapd/config_file.c | 2 ++ + src/ap/ap_config.c | 1 + + src/ap/ap_config.h | 1 + + src/ap/beacon.c | 4 ++++ + 4 files changed, 8 insertions(+) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index 13396aad2..e0b182c8e 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -4454,6 +4454,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, + conf->rssi_reject_assoc_rssi = atoi(pos); + } else if (os_strcmp(buf, "rssi_reject_assoc_timeout") == 0) { + conf->rssi_reject_assoc_timeout = atoi(pos); ++ } else if (os_strcmp(buf, "rssi_ignore_probe_request") == 0) { ++ conf->rssi_ignore_probe_request = atoi(pos); + } else if (os_strcmp(buf, "pbss") == 0) { + bss->pbss = atoi(pos); + } else if (os_strcmp(buf, "transition_disable") == 0) { +diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c +index 56a4ac388..088bb831a 100644 +--- a/src/ap/ap_config.c ++++ b/src/ap/ap_config.c +@@ -277,6 +277,7 @@ struct hostapd_config * hostapd_config_defaults(void) + + conf->rssi_reject_assoc_rssi = 0; + conf->rssi_reject_assoc_timeout = 30; ++ conf->rssi_ignore_probe_request = 0; + + #ifdef CONFIG_AIRTIME_POLICY + conf->airtime_update_interval = AIRTIME_DEFAULT_UPDATE_INTERVAL; +diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h +index 7fe418363..a69a8d324 100644 +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -1042,6 +1042,7 @@ struct hostapd_config { + + int rssi_reject_assoc_rssi; + int rssi_reject_assoc_timeout; ++ int rssi_ignore_probe_request; + + #ifdef CONFIG_AIRTIME_POLICY + enum { +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index ffb2e04d1..21fe04c2f 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -829,6 +829,10 @@ void handle_probe_req(struct hostapd_data *hapd, + struct radius_sta rad_info; + struct hostapd_data *resp_bss = hapd; + ++ if (hapd->iconf->rssi_ignore_probe_request && ssi_signal && ++ ssi_signal < hapd->iconf->rssi_ignore_probe_request) ++ return; ++ + if (len < IEEE80211_HDRLEN) + return; + ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN; +-- +2.25.1 + diff --git a/feeds/wifi-ax/hostapd/patches/807-co-located-add-a-config-option-to-indicate-co-locate.patch b/feeds/wifi-ax/hostapd/patches/807-co-located-add-a-config-option-to-indicate-co-locate.patch deleted file mode 100644 index 93ffe0d06..000000000 --- a/feeds/wifi-ax/hostapd/patches/807-co-located-add-a-config-option-to-indicate-co-locate.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 56f1a13e455787ba2172b471517db80a707f8ba5 Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Mon, 21 Sep 2020 13:38:53 +0200 -Subject: [PATCH 807/813] co-located: add a config option to indicate co locate - -A 6GHz BSS can be co-located with a 2/5GHz BSS. This option allows us to -indicate if this should be done. - -Signed-off-by: John Crispin ---- - hostapd/config_file.c | 2 ++ - hostapd/hostapd.conf | 3 +++ - src/ap/ap_config.h | 1 + - 3 files changed, 6 insertions(+) - -diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index e66790303..9db6d159a 100644 ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -3552,6 +3552,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, - conf->he_oper_centr_freq_seg0_idx = atoi(pos); - } else if (os_strcmp(buf, "he_oper_centr_freq_seg1_idx") == 0) { - conf->he_oper_centr_freq_seg1_idx = atoi(pos); -+ } else if (os_strcmp(buf, "he_co_locate") == 0) { -+ conf->he_co_locate = atoi(pos); - #endif /* CONFIG_IEEE80211AX */ - } else if (os_strcmp(buf, "max_listen_interval") == 0) { - bss->max_listen_interval = atoi(pos); -diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf -index 5fc4d5f86..280316c0c 100644 ---- a/hostapd/hostapd.conf -+++ b/hostapd/hostapd.conf -@@ -571,6 +571,9 @@ wmm_ac_vo_acm=0 - # Default: 1 (enabled) - #broadcast_deauth=1 - -+# Enable co-locate for a 6GHz radio -+#co_locate=0 -+ - ##### IEEE 802.11n related configuration ###################################### - - # ieee80211n: Whether IEEE 802.11n (HT) is enabled -diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index bf7645d23..c811708fc 100644 ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -1031,6 +1031,7 @@ struct hostapd_config { - u8 he_oper_chwidth; - u8 he_oper_centr_freq_seg0_idx; - u8 he_oper_centr_freq_seg1_idx; -+ bool he_co_locate; - #endif /* CONFIG_IEEE80211AX */ - - /* VHT enable/disable config from CHAN_SWITCH */ --- -2.25.1 - diff --git a/feeds/wifi-ax/hostapd/patches/808-neighbor_db-set-the-co-locate-bit.patch b/feeds/wifi-ax/hostapd/patches/808-neighbor_db-set-the-co-locate-bit.patch deleted file mode 100644 index f78311084..000000000 --- a/feeds/wifi-ax/hostapd/patches/808-neighbor_db-set-the-co-locate-bit.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 8d1c1437a9a3ccebcf575b1f92811bdff008c09c Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Mon, 21 Sep 2020 13:22:54 +0200 -Subject: [PATCH 808/813] neighbor_db: set the co-locate bit - -If the BSS is co-located, the corresponding bit needs to be set inside -bssid_info. - -Signed-off-by: John Crispin ---- - src/ap/neighbor_db.c | 3 +++ - src/common/ieee802_11_defs.h | 2 ++ - 2 files changed, 5 insertions(+) - -diff --git a/src/ap/neighbor_db.c b/src/ap/neighbor_db.c -index 01bf88623..3a4cdc004 100644 ---- a/src/ap/neighbor_db.c -+++ b/src/ap/neighbor_db.c -@@ -260,6 +260,9 @@ void hostapd_neighbor_set_own_report(struct hostapd_data *hapd) - bssid_info |= NEI_REP_BSSID_INFO_HE; - } - -+ if (hapd->iconf->he_co_locate) -+ bssid_info |= NEI_REP_BSSID_INFO_HE_CO_LOCATED; -+ - /* TODO: Set NEI_REP_BSSID_INFO_MOBILITY_DOMAIN if MDE is set */ - - if (ieee80211_freq_to_channel_ext(hapd->iface->freq, -diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h -index ec3a0613f..6c0eef885 100644 ---- a/src/common/ieee802_11_defs.h -+++ b/src/common/ieee802_11_defs.h -@@ -2130,6 +2130,8 @@ enum phy_type { - #define NEI_REP_BSSID_INFO_VHT BIT(12) - #define NEI_REP_BSSID_INFO_FTM BIT(13) - #define NEI_REP_BSSID_INFO_HE BIT(14) -+#define NEI_REP_BSSID_INFO_HE_ER_BSS BIT(15) -+#define NEI_REP_BSSID_INFO_HE_CO_LOCATED BIT(16) - - /* - * IEEE P802.11-REVmc/D5.0 Table 9-152 - HT/VHT Operation Information --- -2.25.1 - diff --git a/feeds/wifi-ax/hostapd/patches/809-rrm-add-handling-for-co-located-BSS.patch b/feeds/wifi-ax/hostapd/patches/809-rrm-add-handling-for-co-located-BSS.patch deleted file mode 100644 index e122563ad..000000000 --- a/feeds/wifi-ax/hostapd/patches/809-rrm-add-handling-for-co-located-BSS.patch +++ /dev/null @@ -1,162 +0,0 @@ -From 98367b8d78e1d55f98e745978cb92921028e5938 Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Mon, 21 Sep 2020 13:35:20 +0200 -Subject: [PATCH 809/813] rrm: add handling for co-located BSS - -A BSS shall include the neighbor entry of a co-located BSS upon an incoming -request. - -Signed-off-by: John Crispin ---- - src/ap/rrm.c | 117 ++++++++++++++++++++++++++++++++------------------- - 1 file changed, 74 insertions(+), 43 deletions(-) - -diff --git a/src/ap/rrm.c b/src/ap/rrm.c -index f2d5cd16e..c9d51dfa7 100644 ---- a/src/ap/rrm.c -+++ b/src/ap/rrm.c -@@ -196,6 +196,63 @@ static size_t hostapd_neighbor_report_len(struct wpabuf *buf, - } - - -+static int hostapd_add_nei_report_entry(struct wpabuf *buf, struct hostapd_neighbor_entry *nr, -+ struct wpa_ssid_value *ssid, u8 lci, -+ u8 civic, u16 lci_max_age) -+{ -+ u8 *msmt_token; -+ int send_lci; -+ size_t len; -+ -+ if (ssid->ssid_len != nr->ssid.ssid_len || -+ os_memcmp(ssid->ssid, nr->ssid.ssid, ssid->ssid_len) != 0) -+ return 0; -+ -+ send_lci = (lci != 0) && hostapd_check_lci_age(nr, lci_max_age); -+ len = hostapd_neighbor_report_len(buf, nr, send_lci, civic); -+ -+ if (len - 2 > 0xff) { -+ wpa_printf(MSG_DEBUG, -+ "NR entry for " MACSTR " exceeds 0xFF bytes", -+ MAC2STR(nr->bssid)); -+ return 0; -+ } -+ -+ if (len > wpabuf_tailroom(buf)) -+ return -1; -+ -+ wpabuf_put_u8(buf, WLAN_EID_NEIGHBOR_REPORT); -+ wpabuf_put_u8(buf, len - 2); -+ wpabuf_put_buf(buf, nr->nr); -+ -+ if (send_lci && nr->lci) { -+ wpabuf_put_u8(buf, WLAN_EID_MEASURE_REPORT); -+ wpabuf_put_u8(buf, wpabuf_len(nr->lci)); -+ /* -+ * Override measurement token - the first byte of the -+ * Measurement Report element. -+ */ -+ msmt_token = wpabuf_put(buf, 0); -+ wpabuf_put_buf(buf, nr->lci); -+ *msmt_token = lci; -+ } -+ -+ if (civic && nr->civic) { -+ wpabuf_put_u8(buf, WLAN_EID_MEASURE_REPORT); -+ wpabuf_put_u8(buf, wpabuf_len(nr->civic)); -+ /* -+ * Override measurement token - the first byte of the -+ * Measurement Report element. -+ */ -+ msmt_token = wpabuf_put(buf, 0); -+ wpabuf_put_buf(buf, nr->civic); -+ *msmt_token = civic; -+ } -+ -+ return 0; -+} -+ -+ - static void hostapd_send_nei_report_resp(struct hostapd_data *hapd, - const u8 *addr, u8 dialog_token, - struct wpa_ssid_value *ssid, u8 lci, -@@ -203,7 +260,6 @@ static void hostapd_send_nei_report_resp(struct hostapd_data *hapd, - { - struct hostapd_neighbor_entry *nr; - struct wpabuf *buf; -- u8 *msmt_token; - - /* - * The number and length of the Neighbor Report elements in a Neighbor -@@ -220,52 +276,27 @@ static void hostapd_send_nei_report_resp(struct hostapd_data *hapd, - - dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, - list) { -- int send_lci; -- size_t len; -- -- if (ssid->ssid_len != nr->ssid.ssid_len || -- os_memcmp(ssid->ssid, nr->ssid.ssid, ssid->ssid_len) != 0) -- continue; -- -- send_lci = (lci != 0) && hostapd_check_lci_age(nr, lci_max_age); -- len = hostapd_neighbor_report_len(buf, nr, send_lci, civic); -- -- if (len - 2 > 0xff) { -- wpa_printf(MSG_DEBUG, -- "NR entry for " MACSTR " exceeds 0xFF bytes", -- MAC2STR(nr->bssid)); -- continue; -- } -- -- if (len > wpabuf_tailroom(buf)) -+ if (hostapd_add_nei_report_entry(buf, nr, ssid, lci, civic, lci_max_age)) - break; -+ } - -- wpabuf_put_u8(buf, WLAN_EID_NEIGHBOR_REPORT); -- wpabuf_put_u8(buf, len - 2); -- wpabuf_put_buf(buf, nr->nr); -+ if (!hapd->iconf->he_co_locate) { -+ int i; - -- if (send_lci && nr->lci) { -- wpabuf_put_u8(buf, WLAN_EID_MEASURE_REPORT); -- wpabuf_put_u8(buf, wpabuf_len(nr->lci)); -- /* -- * Override measurement token - the first byte of the -- * Measurement Report element. -- */ -- msmt_token = wpabuf_put(buf, 0); -- wpabuf_put_buf(buf, nr->lci); -- *msmt_token = lci; -- } -+ for (i = 0; i < hapd->iface->interfaces->count; i++) { -+ struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; -+ int j; -+ -+ if (iface == hapd->iface || !iface->conf->he_co_locate) -+ continue; - -- if (civic && nr->civic) { -- wpabuf_put_u8(buf, WLAN_EID_MEASURE_REPORT); -- wpabuf_put_u8(buf, wpabuf_len(nr->civic)); -- /* -- * Override measurement token - the first byte of the -- * Measurement Report element. -- */ -- msmt_token = wpabuf_put(buf, 0); -- wpabuf_put_buf(buf, nr->civic); -- *msmt_token = civic; -+ for (j = 0; j < iface->num_bss; j++) { -+ nr = hostapd_neighbor_get(iface->bss[j], iface->bss[j]->own_addr, NULL); -+ if (!nr) -+ continue; -+ if (hostapd_add_nei_report_entry(buf, nr, ssid, lci, civic, lci_max_age)) -+ break; -+ } - } - } - --- -2.25.1 - diff --git a/feeds/wifi-ax/hostapd/patches/810-client-disconnect-when-rssi-is-low.patch b/feeds/wifi-ax/hostapd/patches/810-client-disconnect-when-rssi-is-low.patch new file mode 100644 index 000000000..08e167efd --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/810-client-disconnect-when-rssi-is-low.patch @@ -0,0 +1,242 @@ +--- a/src/ap/ubus.c ++++ b/src/ap/ubus.c +@@ -146,6 +146,49 @@ hostapd_bss_ban_client(struct hostapd_da + eloop_register_timeout(0, time * 1000, hostapd_bss_del_ban, ban, hapd); + } + ++static void ++hostapd_bss_signal_check(void *eloop_data, void *user_ctx) ++/* This is called by an eloop timeout. All stations in the list are checked ++ * for signal level. This requires calling the driver, since hostapd doesn't ++ * see packets from a station once it is fully authorized. ++ * Stations with signal level below the threshold will be dropped. ++ */ ++{ ++ struct hostapd_data *hapd = user_ctx; ++ struct hostap_sta_driver_data data; ++ struct sta_info *sta, *sta_next; ++ u8 addr[ETH_ALEN]; /* Buffer the address for logging purposes, in case it is destroyed while dropping */ ++ int strikes; /* same with strike count on this station. */ ++ int num_sta = 0; ++ int num_drop = 0; ++ int signal; ++ ++ for (sta = hapd->sta_list; sta; sta = sta_next) { ++ sta_next = sta->next; ++ memcpy(addr, sta->addr, ETH_ALEN); ++ if (!hostapd_drv_read_sta_data(hapd, &data, addr)) { ++ signal = data.signal; ++ num_sta++; ++ strikes = sta->sig_drop_strikes; ++ if (signal < hapd->conf->signal_stay_min) { /* signal bad. */ ++ strikes = ++sta->sig_drop_strikes; ++ if (strikes >= hapd->conf->signal_strikes) { /* Struck out--, drop. */ ++ hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_INFO, ++ "Deauthenticating client due to low signal strength %i", data.signal); ++ ap_sta_deauthenticate(hapd, sta, hapd->conf->signal_drop_reason); ++ num_drop++; ++ } ++ } else { ++ sta->sig_drop_strikes = 0; /* signal OK, reset the strike counter. */ ++ strikes = 0; ++ } ++ } ++ } ++ ++ eloop_register_timeout(hapd->conf->signal_poll_time, 0, hostapd_bss_signal_check, eloop_data, hapd); ++ ++} ++ + static int + hostapd_bss_reload(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, +@@ -580,6 +623,70 @@ hostapd_vendor_elements(struct ubus_cont + return UBUS_STATUS_OK; + } + ++enum { ++ SIGNAL_CONNECT, ++ SIGNAL_STAY, ++ SIGNAL_STRIKES, ++ SIGNAL_POLL, ++ SIGNAL_DROP_REASON, ++ __SIGNAL_SETTINGS_MAX ++}; ++ ++static const struct blobmsg_policy sig_policy[__SIGNAL_SETTINGS_MAX] = { ++ [SIGNAL_CONNECT] = {"connect", BLOBMSG_TYPE_INT32}, ++ [SIGNAL_STAY] = {"stay", BLOBMSG_TYPE_INT32}, ++ [SIGNAL_STRIKES] = {"strikes", BLOBMSG_TYPE_INT32}, ++ [SIGNAL_POLL] = {"poll_time", BLOBMSG_TYPE_INT32}, ++ [SIGNAL_DROP_REASON] = {"reason", BLOBMSG_TYPE_INT32} ++}; ++ ++static int ++hostapd_bss_set_signal(struct ubus_context *ctx, struct ubus_object *obj, ++ struct ubus_request_data *req, const char *method, ++ struct blob_attr *msg) ++{ ++ struct blob_attr *tb[__SIGNAL_SETTINGS_MAX]; ++ struct hostapd_data *hapd = get_hapd_from_object(obj); ++ int sig_stay; ++ ++ blobmsg_parse(sig_policy, __SIGNAL_SETTINGS_MAX, tb, blob_data(msg), blob_len(msg)); ++ ++ if (!tb[SIGNAL_CONNECT]) ++ return UBUS_STATUS_INVALID_ARGUMENT; ++ hapd->conf->signal_auth_min = blobmsg_get_u32(tb[SIGNAL_CONNECT]); ++ if (tb[SIGNAL_STAY]) { ++ sig_stay = blobmsg_get_u32(tb[SIGNAL_STAY]); ++ } else { ++ sig_stay = hapd->conf->signal_auth_min - 5; // Default is 5 dB lower to stay. ++ } ++ hapd->conf->signal_stay_min = sig_stay; ++ if (tb[SIGNAL_STRIKES]) { ++ hapd->conf->signal_strikes = blobmsg_get_u32(tb[SIGNAL_STRIKES]); ++ if (hapd->conf->signal_strikes < 1) ++ return UBUS_STATUS_INVALID_ARGUMENT; ++ } else { ++ hapd->conf->signal_strikes = 3; ++ } ++ if (tb[SIGNAL_POLL]) { ++ hapd->conf->signal_poll_time = blobmsg_get_u32(tb[SIGNAL_POLL]); ++ if (hapd->conf->signal_poll_time < 3) ++ return UBUS_STATUS_INVALID_ARGUMENT; ++ } else { ++ hapd->conf->signal_poll_time = 5; ++ } ++ if (tb[SIGNAL_DROP_REASON]) { ++ hapd->conf->signal_drop_reason = blobmsg_get_u32(tb[SIGNAL_DROP_REASON]); ++ if ((hapd->conf->signal_drop_reason < 1) || (hapd->conf->signal_drop_reason > 35)) // XXX -- look up real limit ++ return UBUS_STATUS_INVALID_ARGUMENT; ++ } else { ++ hapd->conf->signal_drop_reason = 3; // Local choice. 5 (AP too busy) is also a good one. ++ } ++ eloop_cancel_timeout(hostapd_bss_signal_check, ELOOP_ALL_CTX, ELOOP_ALL_CTX); ++ eloop_register_timeout(3, 0, hostapd_bss_signal_check, NULL, hapd); // Start up the poll timer. ++ ++ return UBUS_STATUS_OK; ++} ++ + static void + hostapd_rrm_print_nr(struct hostapd_neighbor_entry *nr) + { +@@ -1049,6 +1156,7 @@ static const struct ubus_method bss_meth + UBUS_METHOD_NOARG("rrm_nr_list", hostapd_rrm_nr_list), + UBUS_METHOD("rrm_nr_set", hostapd_rrm_nr_set, nr_set_policy), + UBUS_METHOD("rrm_beacon_req", hostapd_rrm_beacon_req, beacon_req_policy), ++ UBUS_METHOD("set_required_signal", hostapd_bss_set_signal, sig_policy), + #ifdef CONFIG_WNM_AP + UBUS_METHOD("wnm_disassoc_imminent", hostapd_wnm_disassoc_imminent, wnm_disassoc_policy), + #endif +@@ -1086,6 +1194,8 @@ void hostapd_ubus_add_bss(struct hostapd + obj->n_methods = bss_object_type.n_methods; + ret = ubus_add_object(ctx, obj); + hostapd_ubus_ref_inc(); ++ if (hapd->conf->signal_stay_min > -128) ++ eloop_register_timeout(3, 0, hostapd_bss_signal_check, NULL, hapd); /* Start up the poll timer. */ + } + + void hostapd_ubus_free_bss(struct hostapd_data *hapd) +@@ -1174,6 +1284,15 @@ int hostapd_ubus_handle_event(struct hos + addr = req->mgmt_frame->sa; + else + addr = req->addr; ++ if (req->type < ARRAY_SIZE(types)) ++ type = types[req->type]; ++ ++ if (req->ssi_signal && req->type != HOSTAPD_UBUS_PROBE_REQ) /* don't clutter the log with probes. */ ++ hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_INFO, "%s request, signal %i %s", ++ type, req->ssi_signal, ++ (req->ssi_signal >= hapd->conf->signal_auth_min) ? "(Accepted)" : "(DENIED)"); ++ if (req->ssi_signal && req->ssi_signal < hapd->conf->signal_auth_min) ++ return WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; + + ban = avl_find_element(&hapd->ubus.banned, addr, ban, avl); + if (ban) +@@ -1182,9 +1301,6 @@ int hostapd_ubus_handle_event(struct hos + if (!hapd->ubus.obj.has_subscribers) + return WLAN_STATUS_SUCCESS; + +- if (req->type < ARRAY_SIZE(types)) +- type = types[req->type]; +- + blob_buf_init(&b, 0); + blobmsg_add_macaddr(&b, "address", addr); + if (req->mgmt_frame) +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -3322,6 +3322,24 @@ static int hostapd_config_fill(struct ho + return 1; + } + bss->send_probe_response = val; ++ } else if (os_strcmp(buf, "signal_connect") == 0) { ++ bss->signal_auth_min = atoi(pos); ++ } else if (os_strcmp(buf, "signal_stay") == 0) { ++ bss->signal_stay_min = atoi(pos); ++ } else if (os_strcmp(buf, "signal_poll_time") == 0) { ++ bss->signal_poll_time = atoi(pos); ++ if (bss->signal_poll_time < 3) { ++ wpa_printf(MSG_ERROR, "Line %d: invalid signal poll time", line); ++ return 1; ++ } ++ } else if (os_strcmp(buf, "signal_strikes") == 0) { ++ bss->signal_strikes = atoi(pos); ++ } else if (os_strcmp(buf, "signal_drop_reason") == 0) { ++ bss->signal_drop_reason = atoi(pos); ++ if (bss->signal_drop_reason < 1 || bss->signal_drop_reason > 54) { ++ wpa_printf(MSG_ERROR, "Line %d: invalid signal drop reason", line); ++ return 1; ++ } + } else if (os_strcmp(buf, "supported_rates") == 0) { + if (hostapd_parse_intlist(&conf->supported_rates, pos)) { + wpa_printf(MSG_ERROR, "Line %d: invalid rate list", +--- a/src/ap/ap_config.c ++++ b/src/ap/ap_config.c +@@ -94,6 +94,11 @@ void hostapd_config_defaults_bss(struct + bss->eapol_version = EAPOL_VERSION; + + bss->max_listen_interval = 65535; ++ bss->signal_auth_min = -128; /* this is lower than any real signal, so all stations will be accepted */ ++ bss->signal_stay_min = -128; ++ bss->signal_strikes = 3; ++ bss->signal_poll_time = 5; ++ bss->signal_drop_reason = 3; /* "Local choice" */ + + bss->pwd_group = 19; /* ECC: GF(p=256) */ + +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -351,7 +351,11 @@ struct hostapd_bss_config { + int wds_sta; + int isolate; + int start_disabled; +- ++ int signal_auth_min; /* Minimum signal a STA needs to authenticate */ ++ int signal_stay_min; /* Minimum signal needed to stay connected. */ ++ int signal_poll_time; /* Time in seconds between checks of connected STAs */ ++ int signal_strikes; /* Number of consecutive times signal can be low before dropping the STA. */ ++ int signal_drop_reason; /* IEEE802.11 reason code transmitted when dropping a STA. */ + int auth_algs; /* bitfield of allowed IEEE 802.11 authentication + * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */ + +--- a/src/ap/sta_info.c ++++ b/src/ap/sta_info.c +@@ -732,6 +732,7 @@ struct sta_info * ap_sta_add(struct host + sta_track_claim_taxonomy_info(hapd->iface, addr, + &sta->probe_ie_taxonomy); + #endif /* CONFIG_TAXONOMY */ ++ sta->sig_drop_strikes = 0; + + return sta; + } +--- a/src/ap/sta_info.h ++++ b/src/ap/sta_info.h +@@ -286,6 +286,7 @@ struct sta_info { + unsigned int airtime_weight; + struct os_reltime backlogged_until; + #endif /* CONFIG_AIRTIME_POLICY */ ++ int sig_drop_strikes; /* Number of times signal was below threshold. */ + }; + + diff --git a/feeds/wifi-ax/hostapd/patches/813-rnr-add-reduced-neighbor-reporting.patch b/feeds/wifi-ax/hostapd/patches/813-rnr-add-reduced-neighbor-reporting.patch deleted file mode 100644 index 5fd8b8f22..000000000 --- a/feeds/wifi-ax/hostapd/patches/813-rnr-add-reduced-neighbor-reporting.patch +++ /dev/null @@ -1,279 +0,0 @@ -From de86c43e09f33ed0103e1dcdc661b662a96ee2cf Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Mon, 2 Nov 2020 16:05:03 +0100 -Subject: [PATCH 813/813] rnr: add reduced neighbor reporting - -The Reduced Neighbor Report (rnr) element contains channel and other -information related to neighbor APs. It is part of the OCE requirement. - -Signed-off-by: John Crispin ---- - hostapd/config_file.c | 2 + - hostapd/hostapd.conf | 3 + - src/ap/ap_config.h | 1 + - src/ap/beacon.c | 8 +++ - src/ap/ieee802_11.c | 136 +++++++++++++++++++++++++++++++++++ - src/ap/ieee802_11.h | 2 + - src/common/ieee802_11_defs.h | 14 ++++ - 7 files changed, 166 insertions(+) - -Index: hostapd-2020-07-02-58b384f4/hostapd/config_file.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/hostapd/config_file.c -+++ hostapd-2020-07-02-58b384f4/hostapd/config_file.c -@@ -4587,6 +4587,8 @@ static int hostapd_config_fill(struct ho - conf->multiple_bssid = atoi(pos); - } else if (os_strcmp(buf, "ema_beacon") == 0) { - conf->ema_beacon = atoi(pos); -+ } else if (os_strcmp(buf, "rnr_beacon") == 0) { -+ bss->rnr_beacon = atoi(pos); - } else { - wpa_printf(MSG_ERROR, - "Line %d: unknown configuration item '%s'", -Index: hostapd-2020-07-02-58b384f4/hostapd/hostapd.conf -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/hostapd/hostapd.conf -+++ hostapd-2020-07-02-58b384f4/hostapd/hostapd.conf -@@ -2775,6 +2775,9 @@ own_ip_addr=127.0.0.1 - # that allows sending of such data. Default: 0. - #stationary_ap=0 - -+# Enable reduced neighbour reporting (RNR) -+#rnr_beacon=0 -+ - ##### Airtime policy configuration ########################################### - - # Set the airtime policy operating mode: -Index: hostapd-2020-07-02-58b384f4/src/ap/ap_config.h -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ap_config.h -+++ hostapd-2020-07-02-58b384f4/src/ap/ap_config.h -@@ -863,6 +863,7 @@ struct hostapd_bss_config { - u8 mka_psk_set; - #endif /* CONFIG_MACSEC */ - char *config_id; -+ u8 rnr_beacon; - }; - - /** -Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/beacon.c -+++ hostapd-2020-07-02-58b384f4/src/ap/beacon.c -@@ -477,6 +477,8 @@ static u8 * hostapd_gen_probe_resp(struc - buflen += hostapd_eid_dpp_cc_len(hapd); - if (hapd->iconf->multiple_bssid) - buflen += hostapd_eid_multiple_bssid_len(hapd); -+ if (hapd->conf->rnr_beacon) -+ buflen += hostapd_eid_reduced_neighbor_report_len(hapd, 1); - - resp = os_zalloc(buflen); - if (resp == NULL) -@@ -635,6 +637,8 @@ static u8 * hostapd_gen_probe_resp(struc - pos = hostapd_eid_mbo(hapd, pos, (u8 *) resp + buflen - pos); - pos = hostapd_eid_owe_trans(hapd, pos, (u8 *) resp + buflen - pos); - pos = hostapd_eid_dpp_cc(hapd, pos, (u8 *) resp + buflen - pos); -+ if (hapd->conf->rnr_beacon) -+ pos = hostapd_eid_reduced_neighbor_report(hapd, pos, 1); - - if (hapd->conf->vendor_elements) { - os_memcpy(pos, wpabuf_head(hapd->conf->vendor_elements), -@@ -1207,6 +1211,8 @@ int ieee802_11_build_ap_params(struct ho - tail_len += hostapd_mbo_ie_len(hapd); - tail_len += hostapd_eid_owe_trans_len(hapd); - tail_len += hostapd_eid_dpp_cc_len(hapd); -+ if (hapd->conf->rnr_beacon) -+ tail_len += hostapd_eid_reduced_neighbor_report_len(hapd, 0); - - tailpos = tail = os_malloc(tail_len); - if (head == NULL || tail == NULL) { -@@ -1382,6 +1388,8 @@ int ieee802_11_build_ap_params(struct ho - tailpos = hostapd_eid_owe_trans(hapd, tailpos, - tail + tail_len - tailpos); - tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos); -+ if (hapd->conf->rnr_beacon) -+ tailpos = hostapd_eid_reduced_neighbor_report(hapd, tailpos, 1); - - if (hapd->conf->vendor_elements) { - os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), -Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ieee802_11.c -+++ hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.c -@@ -5773,4 +5773,140 @@ u8 * hostapd_eid_multiple_bssid(struct h - return eid; - } - -+ -+size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd, bool probe_resp) -+{ -+ size_t len = 0; -+ int i; -+ -+ if (hapd->iface->num_bss > 1) -+ len += TBTT_HEADER_LENGTH + ((hapd->iface->num_bss - 1) * TBTT_INFO_LENGTH); -+ for (i = 0; i < hapd->iface->interfaces->count; i++) { -+ struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; -+ -+ if (iface == hapd->iface || !iface->conf->he_co_locate) -+ continue; -+ -+ len += TBTT_HEADER_LENGTH + (iface->num_bss * TBTT_INFO_LENGTH); -+ } -+ -+ if (!probe_resp && !dl_list_empty(&hapd->nr_db)) -+ len += dl_list_len(&hapd->nr_db) * (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH); -+ -+ return len; -+} -+ -+ -+static u8 *hostapd_eid_reduced_neighbor_report_iface(struct hostapd_data *hapd, u8 *eid, int *count) -+{ -+ int tbtt_count = hapd->iface->num_bss; -+ u8 op_class, channel; -+ int i; -+ -+ if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA) || -+ !hapd->iface->freq) -+ return eid; -+ -+ if (ieee80211_freq_to_channel_ext(hapd->iface->freq, -+ hapd->iconf->secondary_channel, -+ hostapd_get_oper_chwidth(hapd->iconf), -+ &op_class, &channel) == -+ NUM_HOSTAPD_MODES) -+ return eid; -+ -+ if (hapd->iface->conf->he_co_locate) -+ tbtt_count -= 1; -+ else -+ tbtt_count -= 2; -+ -+ *eid++ = TBTT_INFO_COUNT(tbtt_count); -+ *eid++ = TBTT_INFO_LENGTH; -+ *eid++ = op_class; -+ *eid++ = hapd->iconf->channel; -+ for (i = 0; i < hapd->iface->num_bss; i++) { -+ u8 bss_param = 0; -+ -+ if (hapd->iface->bss[i] == hapd && !hapd->iface->conf->he_co_locate) -+ continue; -+ *eid++ = TBTT_AP_OFFSET_UNKNOWN; -+ os_memcpy(eid, hapd->iface->bss[i]->own_addr, ETH_ALEN); -+ eid += 6; -+ os_memcpy(eid, &hapd->iface->bss[i]->conf->ssid.short_ssid, 4); -+ eid += 4; -+ if (hapd->iface->bss[i]->conf->ssid.short_ssid == -+ hapd->conf->ssid.short_ssid) -+ bss_param |= TBTT_BSS_PARAM_SAME_SSID; -+ if (hapd->iconf->multiple_bssid) -+ bss_param |= TBTT_BSS_PARAM_MULTIPLE_BSSID; -+ if (!i && hapd->iconf->multiple_bssid && hapd->iface->conf->he_co_locate) -+ bss_param |= TBTT_BSS_PARAM_TRANSMITTED_BSSID; -+ if (hapd->iface->conf->he_co_locate) -+ bss_param |= TBTT_BSS_PARAM_CO_LOCATED; -+ -+ *eid++ = bss_param; -+ *count += 1; -+ } -+ -+ return eid; -+} -+ -+ -+static u8 *hostapd_eid_reduced_neighbor_report_nr_db(struct hostapd_data *hapd, u8 *eid, int *count) -+{ -+ struct hostapd_neighbor_entry *nr; -+ -+ dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, -+ list) { -+ if (!nr->nr || wpabuf_len(nr->nr) < 12) -+ continue; -+ if (nr->short_ssid == hapd->conf->ssid.short_ssid) -+ continue; -+ *eid++ = 0; -+ *eid++ = TBTT_INFO_LENGTH; -+ *eid++ = wpabuf_head_u8(nr->nr)[10]; -+ *eid++ = wpabuf_head_u8(nr->nr)[11]; -+ *eid++ = TBTT_AP_OFFSET_UNKNOWN; -+ os_memcpy(eid, nr->bssid, ETH_ALEN); -+ eid += 6; -+ os_memcpy(eid, &nr->short_ssid, 4); -+ eid += 4; -+ *eid++ = nr->bss_parameters; -+ *count += 1; -+ } -+ -+ return eid; -+} -+ -+u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid, bool probe_resp) -+{ -+ size_t len = hostapd_eid_reduced_neighbor_report_len(hapd, probe_resp); -+ int i, count = 0; -+ -+ if (!len) -+ return eid; -+ -+ *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; -+ *eid++ = len; -+ -+ if (hapd->iface->num_bss > 1) -+ eid = hostapd_eid_reduced_neighbor_report_iface(hapd, eid, &count); -+ -+ for (i = 0; i < hapd->iface->interfaces->count; i++) { -+ struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; -+ -+ if (iface == hapd->iface || !iface->conf->he_co_locate) -+ continue; -+ -+ eid = hostapd_eid_reduced_neighbor_report_iface(iface->bss[0], eid, &count); -+ } -+ -+ if (!probe_resp) -+ hostapd_eid_reduced_neighbor_report_nr_db(hapd, eid, &count); -+ -+ if (!count) -+ eid -= 2; -+ -+ return eid; -+} -+ - #endif /* CONFIG_NATIVE_WINDOWS */ -Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.h -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ieee802_11.h -+++ hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.h -@@ -124,6 +124,8 @@ u8 * hostapd_eid_multiple_bssid(struct h - u8 is_beacon, u8 **eid_offsets, int *eid_count, - int eid_max); - int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd); -+u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid, bool probe_resp); -+size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd, bool probe_resp); - - int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); - #ifdef CONFIG_SAE -Index: hostapd-2020-07-02-58b384f4/src/common/ieee802_11_defs.h -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/common/ieee802_11_defs.h -+++ hostapd-2020-07-02-58b384f4/src/common/ieee802_11_defs.h -@@ -2352,4 +2352,18 @@ enum edmg_bw_config { - */ - #define DOT11BSS_COLOR_COLLISION_AP_PERIOD 50 - -+/* TBTT Information field defines */ -+#define TBTT_HEADER_LENGTH 4 -+#define TBTT_INFO_LENGTH 12 -+#define TBTT_INFO_FILTERED_NEIGH_AP BIT(2) -+#define TBTT_INFO_COUNT(x) (((x) & 0xf) << 4) -+#define TBTT_AP_OFFSET_UNKNOWN 255 -+#define TBTT_BSS_PARAM_OCT_RECOMMENDED BIT(0) -+#define TBTT_BSS_PARAM_SAME_SSID BIT(1) -+#define TBTT_BSS_PARAM_MULTIPLE_BSSID BIT(2) -+#define TBTT_BSS_PARAM_TRANSMITTED_BSSID BIT(3) -+#define TBTT_BSS_PARAM_MEMBER_CO_LOCATED_ESS BIT(4) -+#define TBTT_BSS_PARAM_20_TU_PROBE_RESP_ACTIVE BIT(5) -+#define TBTT_BSS_PARAM_CO_LOCATED BIT(6) -+ - #endif /* IEEE802_11_DEFS_H */ diff --git a/feeds/wifi-ax/hostapd/patches/b00-003-hostapd-Add-ieee80211ad-support-in-ctrl-iface-comman.patch b/feeds/wifi-ax/hostapd/patches/b00-003-hostapd-Add-ieee80211ad-support-in-ctrl-iface-comman.patch deleted file mode 100644 index 81fee0b75..000000000 --- a/feeds/wifi-ax/hostapd/patches/b00-003-hostapd-Add-ieee80211ad-support-in-ctrl-iface-comman.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/src/ap/ctrl_iface_ap.c -+++ b/src/ap/ctrl_iface_ap.c -@@ -739,6 +739,7 @@ int hostapd_ctrl_iface_status(struct hos - "secondary_channel=%d\n" - "ieee80211n=%d\n" - "ieee80211ac=%d\n" -+ "ieee80211ad=%d\n" - "ieee80211ax=%d\n" - "beacon_int=%u\n" - "dtim_period=%d\n", -@@ -750,6 +751,7 @@ int hostapd_ctrl_iface_status(struct hos - iface->conf->ieee80211n && !hapd->conf->disable_11n, - iface->conf->ieee80211ac && - !hapd->conf->disable_11ac, -+ iface->conf->hw_mode == HOSTAPD_MODE_IEEE80211AD, - iface->conf->ieee80211ax, - iface->conf->beacon_int, - hapd->conf->dtim_period); diff --git a/feeds/wifi-ax/hostapd/patches/b00-011-hostapd-add-signal-monitor-command.patch b/feeds/wifi-ax/hostapd/patches/b00-011-hostapd-add-signal-monitor-command.patch deleted file mode 100644 index 75bf51ab9..000000000 --- a/feeds/wifi-ax/hostapd/patches/b00-011-hostapd-add-signal-monitor-command.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- a/hostapd/ctrl_iface.c -+++ b/hostapd/ctrl_iface.c -@@ -3125,6 +3125,26 @@ static int hostapd_ctrl_iface_remove_nei - return hostapd_neighbor_remove(hapd, bssid, ssidp); - } - -+static int hostapd_ctrl_iface_signal_monitor(struct hostapd_data *hapd, -+ char *cmd) -+{ -+ const char *pos; -+ int threshold = 0, hysteresis = 0; -+ -+ pos = os_strstr(cmd, "THRESHOLD="); -+ if (pos) -+ threshold = atoi(pos + 10); -+ pos = os_strstr(cmd, "HYSTERESIS="); -+ if (pos) -+ hysteresis = atoi(pos + 11); -+ -+ if (hapd->driver->signal_monitor) -+ return hapd->driver->signal_monitor(hapd->drv_priv, -+ threshold, hysteresis); -+ -+ return -1; -+} -+ - - static int hostapd_ctrl_driver_flags(struct hostapd_iface *iface, char *buf, - size_t buflen) -@@ -3768,6 +3788,9 @@ static int hostapd_ctrl_iface_receive_pr - if (radius_server_dac_request(hapd->radius_srv, buf + 12) < 0) - reply_len = -1; - #endif /* RADIUS_SERVER */ -+ } else if (os_strncmp(buf, "SIGNAL_MONITOR", 14) == 0) { -+ if (hostapd_ctrl_iface_signal_monitor(hapd, buf + 14)) -+ reply_len = -1; - } else if (os_strncmp(buf, "GET_CAPABILITY ", 15) == 0) { - reply_len = hostapd_ctrl_iface_get_capability( - hapd, buf + 15, reply, reply_size); ---- a/hostapd/hostapd_cli.c -+++ b/hostapd/hostapd_cli.c -@@ -1478,6 +1478,11 @@ static int hostapd_cli_cmd_deny_macacl(s - return hostapd_cli_cmd(ctrl, "DENY_ACL", 1, argc, argv); - } - -+static int hostapd_cli_cmd_signal_monitor(struct wpa_ctrl *ctrl, int argc, -+ char *argv[]) -+{ -+ return hostapd_cli_cmd(ctrl, "SIGNAL_MONITOR", 0, argc, argv); -+} - - static int hostapd_cli_cmd_poll_sta(struct wpa_ctrl *ctrl, int argc, - char *argv[]) -@@ -1673,6 +1678,8 @@ static const struct hostapd_cli_cmd host - "=Add/Delete/Show/Clear deny MAC ACL" }, - { "poll_sta", hostapd_cli_cmd_poll_sta, hostapd_complete_stations, - " = poll a STA to check connectivity with a QoS null frame" }, -+ { "signal_monitor", hostapd_cli_cmd_signal_monitor, NULL, -+ "= set signal monitor parameters" }, - { "req_beacon", hostapd_cli_cmd_req_beacon, NULL, - " [req_mode=] = send a Beacon report request to a station" }, - { "reload_wpa_psk", hostapd_cli_cmd_reload_wpa_psk, NULL, diff --git a/feeds/wifi-ax/hostapd/patches/b00-012-hostapd-handle-rssi-cross-event.patch b/feeds/wifi-ax/hostapd/patches/b00-012-hostapd-handle-rssi-cross-event.patch deleted file mode 100644 index e6529590b..000000000 --- a/feeds/wifi-ax/hostapd/patches/b00-012-hostapd-handle-rssi-cross-event.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/src/drivers/driver_nl80211_event.c -+++ b/src/drivers/driver_nl80211_event.c -@@ -1273,12 +1273,14 @@ static void nl80211_cqm_event(struct wpa - [NL80211_ATTR_CQM_TXE_PKTS] = { .type = NLA_U32 }, - [NL80211_ATTR_CQM_TXE_INTVL] = { .type = NLA_U32 }, - [NL80211_ATTR_CQM_BEACON_LOSS_EVENT] = { .type = NLA_FLAG }, -+ [NL80211_ATTR_CQM_RSSI_LEVEL] = { .type = NLA_U32 }, - }; - struct nlattr *cqm[NL80211_ATTR_CQM_MAX + 1]; - enum nl80211_cqm_rssi_threshold_event event; - union wpa_event_data ed; - struct wpa_signal_info sig; -- int res; -+ int res, rssi_level; -+ u8 *addr = NULL; - - if (tb[NL80211_ATTR_CQM] == NULL || - nla_parse_nested(cqm, NL80211_ATTR_CQM_MAX, tb[NL80211_ATTR_CQM], -@@ -1329,11 +1331,28 @@ static void nl80211_cqm_event(struct wpa - } - event = nla_get_u32(cqm[NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT]); - -+ if (tb[NL80211_ATTR_MAC]) -+ addr = nla_data(tb[NL80211_ATTR_MAC]); -+ -+ rssi_level = (s32) nla_get_u32(cqm[NL80211_ATTR_CQM_RSSI_LEVEL]); -+ - if (event == NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH) { -+ if (addr) { -+ wpa_msg(drv->ctx, MSG_INFO, "nl80211: CQM RSSI HIGH " -+ "event for "MACSTR " RSSI :%d", MAC2STR(addr), -+ rssi_level); -+ return; -+ } - wpa_printf(MSG_DEBUG, "nl80211: Connection quality monitor " - "event: RSSI high"); - ed.signal_change.above_threshold = 1; - } else if (event == NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW) { -+ if (addr) { -+ wpa_msg(drv->ctx, MSG_INFO, "nl80211: CQM RSSI LOW " -+ "event for "MACSTR " RSSI :%d", MAC2STR(addr), -+ rssi_level); -+ return; -+ } - wpa_printf(MSG_DEBUG, "nl80211: Connection quality monitor " - "event: RSSI low"); - ed.signal_change.above_threshold = 0; diff --git a/feeds/wifi-ax/hostapd/patches/b00-013-hostap-add-signal-txrate-command.patch b/feeds/wifi-ax/hostapd/patches/b00-013-hostap-add-signal-txrate-command.patch deleted file mode 100644 index a960ca0ce..000000000 --- a/feeds/wifi-ax/hostapd/patches/b00-013-hostap-add-signal-txrate-command.patch +++ /dev/null @@ -1,262 +0,0 @@ ---- a/hostapd/ctrl_iface.c -+++ b/hostapd/ctrl_iface.c -@@ -3145,6 +3145,25 @@ static int hostapd_ctrl_iface_signal_mon - return -1; - } - -+static int hostapd_ctrl_iface_signal_txrate(struct hostapd_data *hapd, -+ char *cmd) -+{ -+ char *pos; -+ unsigned int low_thold = 0, high_thold = 0; -+ -+ pos = os_strstr(cmd, "LOW="); -+ if (pos) -+ low_thold = atoi(pos + 4); -+ -+ pos = os_strstr(cmd, "HIGH="); -+ if (pos) -+ high_thold = atoi(pos + 5); -+ -+ if (hapd->driver->signal_txrate) -+ return hapd->driver->signal_txrate(hapd->drv_priv, low_thold, -+ high_thold); -+ return -1; -+} - - static int hostapd_ctrl_driver_flags(struct hostapd_iface *iface, char *buf, - size_t buflen) -@@ -3791,6 +3810,9 @@ static int hostapd_ctrl_iface_receive_pr - } else if (os_strncmp(buf, "SIGNAL_MONITOR", 14) == 0) { - if (hostapd_ctrl_iface_signal_monitor(hapd, buf + 14)) - reply_len = -1; -+ } else if (os_strncmp(buf, "SIGNAL_TXRATE", 13) == 0) { -+ if (hostapd_ctrl_iface_signal_txrate(hapd, buf + 13)) -+ reply_len = -1; - } else if (os_strncmp(buf, "GET_CAPABILITY ", 15) == 0) { - reply_len = hostapd_ctrl_iface_get_capability( - hapd, buf + 15, reply, reply_size); ---- a/hostapd/hostapd_cli.c -+++ b/hostapd/hostapd_cli.c -@@ -1505,6 +1505,12 @@ static int hostapd_cli_cmd_reload_wpa_ps - } - - -+static int hostapd_cli_cmd_signal_txrate(struct wpa_ctrl *ctrl, int argc, -+ char *argv[]) -+{ -+ return hostapd_cli_cmd(ctrl, "SIGNAL_TXRATE", 0, argc, argv); -+} -+ - struct hostapd_cli_cmd { - const char *cmd; - int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]); -@@ -1680,6 +1686,9 @@ static const struct hostapd_cli_cmd host - " = poll a STA to check connectivity with a QoS null frame" }, - { "signal_monitor", hostapd_cli_cmd_signal_monitor, NULL, - "= set signal monitor parameters" }, -+ { "signal_txrate", hostapd_cli_cmd_signal_txrate, NULL, -+ "= set signal tx rate parameters: signal_txrate " -+ "LOW=<> HIGH=<>" }, - { "req_beacon", hostapd_cli_cmd_req_beacon, NULL, - " [req_mode=] = send a Beacon report request to a station" }, - { "reload_wpa_psk", hostapd_cli_cmd_reload_wpa_psk, NULL, ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -4412,6 +4412,20 @@ struct wpa_driver_ops { - */ - int (*get_peer_inactive_time)(void *priv, const u8 *addr); - -+ /** -+ * signal_txrate - Set signal monitoring parameters -+ * @priv: Private driver interface data -+ * @low_thold: Low threshold value for signal txrate events; 0 = disabled -+ * @high_thold: High threshold value for signal txrate events; 0 = disabled -+ * Returns: 0 on success, -1 on failure (or if not supported) -+ * -+ * This function can be used to configure monitoring of signal tx rate -+ * with the current AP. Whenever txrate drops below the low_thold -+ * or increases above high_thold. -+ */ -+ int (*signal_txrate)(void *priv, const u32 low_thold, -+ u32 high_thold); -+ - /** - * update_connect_params - Update the connection parameters - * @priv: Private driver interface data ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -8268,6 +8268,29 @@ static int nl80211_signal_monitor(void * - return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL); - } - -+static int nl80211_signal_txrate(void *priv, const u32 low_thold, -+ u32 high_thold) -+{ -+ struct i802_bss *bss = priv; -+ struct wpa_driver_nl80211_data *drv = bss->drv; -+ struct nl_msg *msg; -+ struct nlattr *cqm; -+ -+ if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_CQM)) || -+ !(cqm = nla_nest_start(msg, NL80211_ATTR_CQM)) || -+ nla_put_u32(msg, NL80211_ATTR_CQM_LOW_TX_RATE_THOLD, -+ low_thold) || -+ nla_put_u32(msg, NL80211_ATTR_CQM_HIGH_TX_RATE_THOLD, -+ high_thold)) { -+ nlmsg_free(msg); -+ wpa_printf(MSG_WARNING, "nl80211: Signal txrate returning"); -+ return -1; -+ } -+ -+ nla_nest_end(msg, cqm); -+ -+ return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL); -+} - - static int get_channel_width(struct nl_msg *msg, void *arg) - { -@@ -11725,6 +11748,7 @@ const struct wpa_driver_ops wpa_driver_n - .deinit_p2p_cli = wpa_driver_nl80211_deinit_p2p_cli, - .resume = wpa_driver_nl80211_resume, - .signal_monitor = nl80211_signal_monitor, -+ .signal_txrate = nl80211_signal_txrate, - .signal_poll = nl80211_signal_poll, - .channel_info = nl80211_channel_info, - .set_param = nl80211_set_param, ---- a/src/drivers/driver_nl80211_event.c -+++ b/src/drivers/driver_nl80211_event.c -@@ -1274,12 +1274,15 @@ static void nl80211_cqm_event(struct wpa - [NL80211_ATTR_CQM_TXE_INTVL] = { .type = NLA_U32 }, - [NL80211_ATTR_CQM_BEACON_LOSS_EVENT] = { .type = NLA_FLAG }, - [NL80211_ATTR_CQM_RSSI_LEVEL] = { .type = NLA_U32 }, -+ [NL80211_ATTR_CQM_TX_RATE_THRESHOLD_EVENT] = -+ { .type = NLA_U32 }, - }; - struct nlattr *cqm[NL80211_ATTR_CQM_MAX + 1]; -- enum nl80211_cqm_rssi_threshold_event event; -+ enum nl80211_cqm_rssi_threshold_event rssi_event; -+ enum nl80211_cqm_tx_rate_threshold_event txrate_event; - union wpa_event_data ed; - struct wpa_signal_info sig; -- int res, rssi_level; -+ int res, rssi_level, txrate_level; - u8 *addr = NULL; - - if (tb[NL80211_ATTR_CQM] == NULL || -@@ -1324,19 +1327,41 @@ static void nl80211_cqm_event(struct wpa - return; - } - -+ if (tb[NL80211_ATTR_MAC]) -+ addr = nla_data(tb[NL80211_ATTR_MAC]); -+ -+ if (cqm[NL80211_ATTR_CQM_TX_RATE_THRESHOLD_EVENT]) { -+ txrate_event = -+ nla_get_u32(cqm[NL80211_ATTR_CQM_TX_RATE_THRESHOLD_EVENT]); -+ txrate_level = -+ nla_get_u32(cqm[NL80211_ATTR_CQM_TX_RATE_LEVEL]); -+ -+ if (txrate_event == NL80211_CQM_TX_RATE_THRESHOLD_EVENT_HIGH) { -+ wpa_msg(drv->ctx, MSG_INFO, "nl80211: CQM TXRATE HIGH " -+ "event for "MACSTR " txrate :%d", -+ MAC2STR(addr), txrate_level); -+ } else if (txrate_event == -+ NL80211_CQM_TX_RATE_THRESHOLD_EVENT_LOW) { -+ wpa_msg(drv->ctx, MSG_INFO, "nl80211: CQM TXRATE LOW " -+ "event for "MACSTR " txrate :%d", -+ MAC2STR(addr), txrate_level); -+ } else { -+ wpa_msg(drv->ctx, MSG_INFO, "Unknown CQM TXRATE " -+ " threshold event :%d", txrate_event); -+ return; -+ } -+ } -+ - if (cqm[NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT] == NULL) { - wpa_printf(MSG_DEBUG, - "nl80211: Not a CQM RSSI threshold event"); - return; - } -- event = nla_get_u32(cqm[NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT]); -- -- if (tb[NL80211_ATTR_MAC]) -- addr = nla_data(tb[NL80211_ATTR_MAC]); -+ rssi_event = nla_get_u32(cqm[NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT]); - - rssi_level = (s32) nla_get_u32(cqm[NL80211_ATTR_CQM_RSSI_LEVEL]); - -- if (event == NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH) { -+ if (rssi_event == NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH) { - if (addr) { - wpa_msg(drv->ctx, MSG_INFO, "nl80211: CQM RSSI HIGH " - "event for "MACSTR " RSSI :%d", MAC2STR(addr), -@@ -1346,7 +1371,7 @@ static void nl80211_cqm_event(struct wpa - wpa_printf(MSG_DEBUG, "nl80211: Connection quality monitor " - "event: RSSI high"); - ed.signal_change.above_threshold = 1; -- } else if (event == NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW) { -+ } else if (rssi_event == NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW) { - if (addr) { - wpa_msg(drv->ctx, MSG_INFO, "nl80211: CQM RSSI LOW " - "event for "MACSTR " RSSI :%d", MAC2STR(addr), -@@ -1359,7 +1384,7 @@ static void nl80211_cqm_event(struct wpa - } else { - wpa_printf(MSG_DEBUG, - "nl80211: Unknown CQM RSSI threshold event: %d", -- event); -+ rssi_event); - return; - } - ---- a/src/drivers/nl80211_copy.h -+++ b/src/drivers/nl80211_copy.h -@@ -4792,6 +4792,17 @@ enum nl80211_ps_state { - * loss event - * @NL80211_ATTR_CQM_RSSI_LEVEL: the RSSI value in dBm that triggered the - * RSSI threshold event. -+ * @NL80211_ATTR_CQM_LOW_TX_RATE_THOLD: TX_RATE threshold in Kbps. This value -+ * specifies the low threshold for the TX_RATE level at which an event will be -+ * sent. Zero to disable. Events will be sent when the TX_RATE value goes -+ * lesser than this threshold. -+ * @NL80211_ATTR_CQM_HIGH_TX_RATE_THOLD: TX RATE in Kbps. This value -+ * specifies the high threshold for the TX_RATE level at which an event will -+ * be sent. Zero to diable. Event will be sent when the TX_RATE values goes -+ * greater than this threshold. -+ * @NL80211_ATTR_CQM_TX_RATE_THRESHOLD_EVENT: TX_RATE threshold event -+ * @NL80211_ATTR_CQM_TX_RATE_LEVEL: the tx rate value in Kbps that triggered the -+ * TX_RATE threshold event. - * @__NL80211_ATTR_CQM_AFTER_LAST: internal - * @NL80211_ATTR_CQM_MAX: highest key attribute - */ -@@ -4806,7 +4817,10 @@ enum nl80211_attr_cqm { - NL80211_ATTR_CQM_TXE_INTVL, - NL80211_ATTR_CQM_BEACON_LOSS_EVENT, - NL80211_ATTR_CQM_RSSI_LEVEL, -- -+ NL80211_ATTR_CQM_LOW_TX_RATE_THOLD, -+ NL80211_ATTR_CQM_HIGH_TX_RATE_THOLD, -+ NL80211_ATTR_CQM_TX_RATE_THRESHOLD_EVENT, -+ NL80211_ATTR_CQM_TX_RATE_LEVEL, - /* keep last */ - __NL80211_ATTR_CQM_AFTER_LAST, - NL80211_ATTR_CQM_MAX = __NL80211_ATTR_CQM_AFTER_LAST - 1 -@@ -4820,13 +4834,17 @@ enum nl80211_attr_cqm { - * configured threshold - * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: (reserved, never sent) - */ -+ - enum nl80211_cqm_rssi_threshold_event { - NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, - NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, - NL80211_CQM_RSSI_BEACON_LOSS_EVENT, - }; - -- -+enum nl80211_cqm_tx_rate_threshold_event { -+ NL80211_CQM_TX_RATE_THRESHOLD_EVENT_LOW = 1, -+ NL80211_CQM_TX_RATE_THRESHOLD_EVENT_HIGH, -+}; - /** - * enum nl80211_tx_power_setting - TX power adjustment - * @NL80211_TX_POWER_AUTOMATIC: automatically determine transmit power diff --git a/feeds/wifi-ax/hostapd/patches/b00-014-hostapd-add-ht40-allow-map.patch b/feeds/wifi-ax/hostapd/patches/b00-014-hostapd-add-ht40-allow-map.patch index 5f42dd8de..8f4fbdf55 100644 --- a/feeds/wifi-ax/hostapd/patches/b00-014-hostapd-add-ht40-allow-map.patch +++ b/feeds/wifi-ax/hostapd/patches/b00-014-hostapd-add-ht40-allow-map.patch @@ -93,10 +93,10 @@ static int hostapd_ctrl_iface_remove_neighbor(struct hostapd_data *hapd, char *buf) -@@ -3813,6 +3899,10 @@ static int hostapd_ctrl_iface_receive_pr - } else if (os_strncmp(buf, "SIGNAL_TXRATE", 13) == 0) { - if (hostapd_ctrl_iface_signal_txrate(hapd, buf + 13)) +@@ -3768,6 +3854,10 @@ static int hostapd_ctrl_iface_receive_pr + if (radius_server_dac_request(hapd->radius_srv, buf + 12) < 0) reply_len = -1; + #endif /* RADIUS_SERVER */ + } else if (os_strcmp(buf, "HT40_ALLOW_MAP") == 0) { + reply_len = hostapd_ctrl_iface_ht40_allow_map(hapd->iface, + reply, @@ -119,10 +119,10 @@ #ifdef CONFIG_DPP -@@ -1689,6 +1695,8 @@ static const struct hostapd_cli_cmd host - { "signal_txrate", hostapd_cli_cmd_signal_txrate, NULL, - "= set signal tx rate parameters: signal_txrate " - "LOW=<> HIGH=<>" }, +@@ -1673,6 +1679,8 @@ static const struct hostapd_cli_cmd host + "=Add/Delete/Show/Clear deny MAC ACL" }, + { "poll_sta", hostapd_cli_cmd_poll_sta, hostapd_complete_stations, + " = poll a STA to check connectivity with a QoS null frame" }, + { "ht40_allow_map", hostapd_cli_cmd_ht40_allow_map, NULL, + "= show ht40 allow map status" }, { "req_beacon", hostapd_cli_cmd_req_beacon, NULL, diff --git a/feeds/wifi-ax/hostapd/patches/c00-004-add-HE-cross-check.patch b/feeds/wifi-ax/hostapd/patches/c00-004-add-HE-cross-check.patch index 02dafa2b3..850affe31 100644 --- a/feeds/wifi-ax/hostapd/patches/c00-004-add-HE-cross-check.patch +++ b/feeds/wifi-ax/hostapd/patches/c00-004-add-HE-cross-check.patch @@ -13,7 +13,7 @@ Signed-off-by: Miles Hu --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c -@@ -660,8 +660,59 @@ static int ieee80211ac_supported_vht_cap +@@ -660,8 +660,63 @@ static int ieee80211ac_supported_vht_cap #ifdef CONFIG_IEEE80211AX @@ -60,7 +60,11 @@ Signed-off-by: Miles Hu + HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX, + conf->he_phy_capab.he_mu_beamformer); + HE_CAP_CHECK(hw->phy_cap, HE_PHYCAP_SPR_SR_CAPB, -+ HE_PHYCAP_SPR_SR_CAPB_IDX, conf->spr.sr_control); ++ HE_PHYCAP_SPR_SR_CAPB_IDX, ++ (!(conf->spr.sr_control & SPATIAL_REUSE_SRP_DISALLOWED) && ++ (conf->spr.sr_control & ++ (SPATIAL_REUSE_NON_SRG_OFFSET_PRESENT | ++ SPATIAL_REUSE_SRG_INFORMATION_PRESENT)))); + + HE_CAP_CHECK2(hw->phy_cap, HE_PHYCAP_UL_MUMIMO_CAPB, + HE_PHYCAP_UL_MUMIMO_CAPB_IDX, HE_PHYCAP_UL_MUOFDMA_CAPB, diff --git a/feeds/wifi-ax/hostapd/patches/d00-001-add-HE-support-to-chan-switch-cmd.patch b/feeds/wifi-ax/hostapd/patches/d00-001-add-HE-support-to-chan-switch-cmd.patch index 345cdb10d..fa74551e7 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-001-add-HE-support-to-chan-switch-cmd.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-001-add-HE-support-to-chan-switch-cmd.patch @@ -169,30 +169,6 @@ int hostapd_switch_channel(struct hostapd_data *hapd, struct csa_settings *settings); void ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -580,6 +580,10 @@ static u8 * hostapd_gen_probe_resp(struc - } - #endif /* CONFIG_IEEE80211AX */ - -+ if ((hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) || -+ hapd->iconf->ieee80211ax) -+ pos = hostapd_eid_wb_chsw_wrapper(hapd, pos); -+ - #ifdef CONFIG_IEEE80211AC - if (hapd->conf->vendor_vht) - pos = hostapd_eid_vendor_vht(hapd, pos); -@@ -1317,6 +1321,10 @@ int ieee802_11_build_ap_params(struct ho - } - #endif /* CONFIG_IEEE80211AX */ - -+ if ((hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) || -+ hapd->iconf->ieee80211ax) -+ tailpos = hostapd_eid_wb_chsw_wrapper(hapd, tailpos); -+ - #ifdef CONFIG_IEEE80211AC - if (hapd->conf->vendor_vht) - tailpos = hostapd_eid_vendor_vht(hapd, tailpos); --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -4672,7 +4672,7 @@ static int nl80211_put_freq_params(struc diff --git a/feeds/wifi-ax/hostapd/patches/d00-003-wpa-supplicant-override-HE-toVHT-2G.patch b/feeds/wifi-ax/hostapd/patches/d00-003-wpa-supplicant-override-HE-toVHT-2G.patch index ee2734560..db8aa1330 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-003-wpa-supplicant-override-HE-toVHT-2G.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-003-wpa-supplicant-override-HE-toVHT-2G.patch @@ -65,6 +65,31 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c =================================================================== --- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/wpa_supplicant.c +++ hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c +@@ -2480,17 +2480,17 @@ void ibss_mesh_setup_freq(struct wpa_sup + return; + + /* Allow HE on 2.4 GHz without VHT: see nl80211_put_freq_params() */ ++#ifdef CONFIG_HE_OVERRIDES ++ if (is_24ghz) { ++ if (ssid->disable_he) ++ freq->he_enabled = 0; ++ else ++ freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; ++#else + if (is_24ghz) + freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; +-#ifdef CONFIG_HE_OVERRIDES +- if (is_24ghz && ssid->disable_he) +- freq->he_enabled = 0; + #endif /* CONFIG_HE_OVERRIDES */ + +- /* Setup higher BW only for 5 GHz */ +- if (mode->mode != HOSTAPD_MODE_IEEE80211A && !(ssid->noscan)) +- return; +- + for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) { + pri_chan = &mode->channels[chan_idx]; + if (pri_chan->chan == channel) @@ -2585,6 +2585,11 @@ void ibss_mesh_setup_freq(struct wpa_sup wpa_scan_results_free(scan_res); diff --git a/feeds/wifi-ax/hostapd/patches/d00-004-hostapd-Add-param-to-enable-disable-ul-mumimo.patch b/feeds/wifi-ax/hostapd/patches/d00-004-hostapd-Add-param-to-enable-disable-ul-mumimo.patch index b78b2137e..adddcce12 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-004-hostapd-Add-param-to-enable-disable-ul-mumimo.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-004-hostapd-Add-param-to-enable-disable-ul-mumimo.patch @@ -1,39 +1,31 @@ -Index: hostapd-2020-07-02-58b384f4/hostapd/config_file.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/hostapd/config_file.c -+++ hostapd-2020-07-02-58b384f4/hostapd/config_file.c -@@ -3455,6 +3455,8 @@ static int hostapd_config_fill(struct ho +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -3444,6 +3444,8 @@ static int hostapd_config_fill(struct ho conf->he_phy_capab.he_su_beamformee = atoi(pos); } else if (os_strcmp(buf, "he_mu_beamformer") == 0) { conf->he_phy_capab.he_mu_beamformer = atoi(pos); + } else if (os_strcmp(buf, "he_ul_mumimo") == 0) { + conf->he_phy_capab.he_ul_mumimo = atoi(pos); } else if (os_strcmp(buf, "he_bss_color") == 0) { - conf->he_op.he_bss_color = atoi(pos); - if (conf->he_op.he_bss_color > 63) -Index: hostapd-2020-07-02-58b384f4/hostapd/hostapd.conf -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/hostapd/hostapd.conf -+++ hostapd-2020-07-02-58b384f4/hostapd/hostapd.conf -@@ -801,7 +801,13 @@ wmm_ac_vo_acm=0 + conf->he_op.he_bss_color = atoi(pos) & 0x3f; + conf->he_op.he_bss_color_disabled = 0; +--- a/hostapd/hostapd.conf ++++ b/hostapd/hostapd.conf +@@ -801,6 +801,12 @@ wmm_ac_vo_acm=0 # 1 = supported #he_mu_beamformer=1 --# he_bss_color: +#he_ul_mumimo: HE Uplink multiple user MIMO support +# -1 or unspecified = Decided by firmware or underlying hardware(Default) +# 0 = not supported +# 1 = supported +#he_mu_beamformer=1 + -+ # he_bss_color: - # 0 = disable - # 1-63 = pre-defined color - # 64+ = random color -Index: hostapd-2020-07-02-58b384f4/src/ap/ap_config.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ap_config.c -+++ hostapd-2020-07-02-58b384f4/src/ap/ap_config.c + # he_bss_color: BSS color (1-63) + #he_bss_color=1 + +--- a/src/ap/ap_config.c ++++ b/src/ap/ap_config.c @@ -265,6 +265,8 @@ struct hostapd_config * hostapd_config_d HE_OPERATION_RTS_THRESHOLD_OFFSET; /* Set default basic MCS/NSS set to single stream MCS 0-7 */ @@ -43,11 +35,9 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ap_config.c conf->he_op.he_bss_color_disabled = 1; conf->he_op.he_bss_color_partial = 0; conf->he_op.he_bss_color = 1; -Index: hostapd-2020-07-02-58b384f4/src/ap/ap_config.h -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ap_config.h -+++ hostapd-2020-07-02-58b384f4/src/ap/ap_config.h -@@ -878,6 +878,7 @@ struct he_phy_capabilities_info { +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -874,6 +874,7 @@ struct he_phy_capabilities_info { bool he_su_beamformer; bool he_su_beamformee; bool he_mu_beamformer; @@ -55,10 +45,8 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ap_config.h }; /** -Index: hostapd-2020-07-02-58b384f4/src/ap/hw_features.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/hw_features.c -+++ hostapd-2020-07-02-58b384f4/src/ap/hw_features.c +--- a/src/ap/hw_features.c ++++ b/src/ap/hw_features.c @@ -714,9 +714,10 @@ static int ieee80211ax_supported_he_capa HE_CAP_CHECK(hw->phy_cap, HE_PHYCAP_SPR_SR_CAPB, HE_PHYCAP_SPR_SR_CAPB_IDX, conf->spr.sr_control); @@ -73,10 +61,8 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/hw_features.c HE_CAP_CHECK2(hw->mac_cap, HE_MACCAP_TWT_REQUESTER, HE_MACCAP_TWT_REQUESTER_IDX, HE_MACCAP_TWT_RESPONDER, HE_MACCAP_TWT_RESPONDER_IDX, -Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11_he.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ieee802_11_he.c -+++ hostapd-2020-07-02-58b384f4/src/ap/ieee802_11_he.c +--- a/src/ap/ieee802_11_he.c ++++ b/src/ap/ieee802_11_he.c @@ -151,6 +151,13 @@ u8 * hostapd_eid_he_capab(struct hostapd cap->he_phy_capab_info[HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX] &= ~HE_PHYCAP_MU_BEAMFORMER_CAPAB; diff --git a/feeds/wifi-ax/hostapd/patches/d00-004-set-supp-chan-width-for-40mghz.patch b/feeds/wifi-ax/hostapd/patches/d00-004-set-supp-chan-width-for-40mghz.patch deleted file mode 100644 index e04bae4e6..000000000 --- a/feeds/wifi-ax/hostapd/patches/d00-004-set-supp-chan-width-for-40mghz.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -3466,7 +3466,30 @@ static int hostapd_fill_csa_settings(str - if (!iface || !iface->freq || hapd->csa_in_progress) - return -1; - -+ if (settings->freq_params.bandwidth != 20) -+ hapd->iconf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET; -+ - switch (settings->freq_params.bandwidth) { -+ case 40: -+ /* If secondary channel offset is not provided as -+ * parameter, it will default to 0. If bw is 40, -+ * secondary channel offset needs to be set to -1/1 -+ * to determine if center freq PLUS or MINUS -+ */ -+ -+ if (!settings->freq_params.sec_channel_offset) { -+ if (settings->freq_params.center_freq1 < -+ settings->freq_params.freq) -+ hapd->cs_freq_params.sec_channel_offset = -1; -+ else -+ hapd->cs_freq_params.sec_channel_offset = 1; -+ -+ settings->freq_params.sec_channel_offset = -+ hapd->cs_freq_params.sec_channel_offset; -+ } -+ -+ bandwidth = CHANWIDTH_USE_HT; -+ break; - case 80: - if (settings->freq_params.center_freq2) - bandwidth = CHANWIDTH_80P80MHZ; diff --git a/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch b/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch index 4dfd0b80a..dac816215 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch @@ -1,22 +1,24 @@ -From 3d7534f5105287759d50e68158ce77e09ae10b5b Mon Sep 17 00:00:00 2001 +From ed93959f61e103703d04b85351eed7a1c4fe644b Mon Sep 17 00:00:00 2001 From: Karthikeyan Kathirvel -Date: Tue, 7 Jul 2020 15:48:46 +0530 +Date: Fri, 28 Aug 2020 14:16:10 +0530 Subject: [PATCH] hostapd: Fixed compilation warnings -Fixed uninitalized and unused variable warnings +Below warnings are fixed + +1) ../src/rsn_supp/wpa.c:2693:12: error: 'wpa_key_mgmt_suite' defined + but not used [-Werror=unused-function] + static u32 wpa_key_mgmt_suite(struct wpa_sm *sm) +2) ../src/ap/wpa_auth.c:4449:21: error: 'wpa_bool_txt' defined but not + used [-Werror=unused-function] + static const char * wpa_bool_txt(int val) +3) Uninitialized warning has been fixed Signed-off-by: Karthikeyan Kathirvel -Change-Id: I9e4e4ea928aa62213243a3d74d7b10d866d0875a --- - .../hostapd/patches/600-ubus_support.patch | 7 ++--- - ...on-to-test-RADAR-detection-probablity-in-.patch | 16 +++++----- - .../b00-012-hostapd-handle-rssi-cross-event.patch | 6 ++-- - .../b00-013-hostap-add-signal-txrate-command.patch | 34 +++++++++++----------- - .../patches/c00-004-add-HE-cross-check.patch | 3 +- - .../patches/c00-011-hostapd-add-mbo-support.patch | 2 +- - .../hostapd/patches/d00-007-fixing-warning.patch | 28 ++++++++++++++++++ - 7 files changed, 61 insertions(+), 35 deletions(-) - create mode 100644 package/network/services/hostapd/patches/d00-007-fixing-warning.patch + src/ap/ieee802_11.c | 2 +- + src/ap/wpa_auth.c | 4 ++++ + src/rsn_supp/wpa.c | 2 +- + 3 files changed, 6 insertions(+), 2 deletions(-) --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -29,3 +31,53 @@ Change-Id: I9e4e4ea928aa62213243a3d74d7b10d866d0875a const u8 *pos; int left, i; struct sta_info *sta; +--- a/src/ap/wpa_auth.c ++++ b/src/ap/wpa_auth.c +@@ -4446,12 +4446,13 @@ void wpa_gtk_rekey(struct wpa_authentica + } + + ++#ifdef CONFIG_CTRL_IFACE_MIB ++ + static const char * wpa_bool_txt(int val) + { + return val ? "TRUE" : "FALSE"; + } + +-#ifdef CONFIG_CTRL_IFACE_MIB + + #define RSN_SUITE "%02x-%02x-%02x-%d" + #define RSN_SUITE_ARG(s) \ +--- a/src/rsn_supp/wpa.c ++++ b/src/rsn_supp/wpa.c +@@ -2689,7 +2689,7 @@ out: + } + + +-#ifdef CONFIG_CTRL_IFACE ++#if defined(CONFIG_CTRL_IFACE) && defined(CONFIG_CTRL_IFACE_MIB) + static u32 wpa_key_mgmt_suite(struct wpa_sm *sm) + { + switch (sm->key_mgmt) { +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -4855,7 +4855,7 @@ static int wpa_driver_nl80211_sta_add(vo + + if (params->he_capab) { + wpa_hexdump(MSG_DEBUG, " * he_capab", +- params->he_capab, params->he_capab_len); ++ (u8 *) params->he_capab, params->he_capab_len); + if (nla_put(msg, NL80211_ATTR_HE_CAPABILITY, + params->he_capab_len, params->he_capab)) + goto fail; +--- a/src/tls/tlsv1_client_ocsp.c ++++ b/src/tls/tlsv1_client_ocsp.c +@@ -322,7 +322,7 @@ tls_process_ocsp_responses(struct tlsv1_ + { + struct asn1_hdr hdr; + const u8 *pos, *end; +- enum tls_ocsp_result res; ++ enum tls_ocsp_result res = TLS_OCSP_NO_RESPONSE; + + pos = resp; + end = resp + len; diff --git a/feeds/wifi-ax/hostapd/patches/d00-008-hostapd-fix-enable-40-80mhz-bandwidth-in-6Ghz.patch b/feeds/wifi-ax/hostapd/patches/d00-008-hostapd-fix-enable-40-80mhz-bandwidth-in-6Ghz.patch index 733aa6a3b..33c47a78d 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-008-hostapd-fix-enable-40-80mhz-bandwidth-in-6Ghz.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-008-hostapd-fix-enable-40-80mhz-bandwidth-in-6Ghz.patch @@ -1,11 +1,17 @@ From 5144ba29e5687818afcfacaadb0c31575a8315e6 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Chitrapu Date: Fri, 19 Jun 2020 14:46:54 -0700 -Subject: [PATCH 2/2] hostapd: fix enable 40/80mhz bandwidth in 6Ghz +Subject: [PATCH] hostapd: fix enable 40/80mhz bandwidth in 6Ghz Currently higher bandwidths are being rejected by hostapd for 6ghz channels due to invalid sanity check. So fix that. +Also, currently 6GHz AP is setting unicast destination address +for probe response which need to be set to broadcast address +according to spec IEEE P802.11ax/D6.1. So fix that. + +Make management frame protection required as default for 6Ghz band. + Signed-off-by: Pradeep Kumar Chitrapu --- src/common/hw_features_common.c | 2 +- @@ -27,7 +33,7 @@ Signed-off-by: Pradeep Kumar Chitrapu return -1; --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -10677,7 +10677,8 @@ static int add_acs_ch_list(struct nl_msg +@@ -10654,7 +10654,8 @@ static int add_acs_ch_list(struct nl_msg * compatibility. */ if (!(freq >= 2412 && freq <= 2484) && @@ -57,3 +63,173 @@ Signed-off-by: Pradeep Kumar Chitrapu return 0; if (op_class->op_class >= 81 && op_class->op_class <= 84 && !freq2) return 0; +--- a/src/ap/acs.c ++++ b/src/ap/acs.c +@@ -372,40 +372,44 @@ acs_survey_chan_interference_factor(stru + } + + +-static int acs_usable_ht40_chan(const struct hostapd_channel_data *chan) ++static int acs_usable_bw40_chan(const struct hostapd_channel_data *chan) + { +- const int allowed[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, +- 157, 184, 192 }; ++ const int allowed[] = { 5180, 5220, 5260, 5300, 5500, 5540, 5580, 5620, 5660, 5745, ++ 5785, 5955, 5995, 6035, 6075, 6115, 6155, 6195, 6235, 6275, ++ 6315, 6355, 6395, 6435, 6475, 6515, 6555, 6595, 6635, 6675, ++ 6715, 6755, 6795, 6835, 6875, 6915, 6955, 6995, 7035, 7075 }; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(allowed); i++) +- if (chan->chan == allowed[i]) ++ if (chan->freq == allowed[i]) + return 1; + + return 0; + } + + +-static int acs_usable_vht80_chan(const struct hostapd_channel_data *chan) ++static int acs_usable_bw80_chan(const struct hostapd_channel_data *chan) + { +- const int allowed[] = { 36, 52, 100, 116, 132, 149 }; ++ const int allowed[] = { 5180, 5260, 5550, 5580, 5660, 5680, 5955, 6035, 6115, ++ 6195, 6275, 6355, 6435, 6515, 6595, 6675, 6755, 6835, ++ 6915, 6995 }; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(allowed); i++) +- if (chan->chan == allowed[i]) ++ if (chan->freq == allowed[i]) + return 1; + + return 0; + } + + +-static int acs_usable_vht160_chan(const struct hostapd_channel_data *chan) ++static int acs_usable_bw160_chan(const struct hostapd_channel_data *chan) + { +- const int allowed[] = { 36, 100 }; ++ const int allowed[] = { 5180, 5500, 5955, 6115, 6275, 6435, 6595, 6755, 6915 }; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(allowed); i++) +- if (chan->chan == allowed[i]) ++ if (chan->freq == allowed[i]) + return 1; + + return 0; +@@ -678,10 +682,11 @@ acs_find_ideal_chan_mode(struct hostapd_ + /* HT40 on 5 GHz has a limited set of primary channels as per + * 11n Annex J */ + if (mode->mode == HOSTAPD_MODE_IEEE80211A && +- iface->conf->ieee80211n && +- iface->conf->secondary_channel && +- !acs_usable_ht40_chan(chan)) { +- wpa_printf(MSG_DEBUG, "ACS: Channel %d: not allowed as primary channel for HT40", ++ ((iface->conf->ieee80211n && ++ iface->conf->secondary_channel) || ++ is_6ghz_freq(chan->freq)) && ++ !acs_usable_bw40_chan(chan)) { ++ wpa_printf(MSG_DEBUG, "ACS: Channel %d: not allowed as primary channel for 40MHz bandwidth", + chan->chan); + continue; + } +@@ -690,18 +695,18 @@ acs_find_ideal_chan_mode(struct hostapd_ + (iface->conf->ieee80211ac || iface->conf->ieee80211ax)) { + if (hostapd_get_oper_chwidth(iface->conf) == + CHANWIDTH_80MHZ && +- !acs_usable_vht80_chan(chan)) { ++ !acs_usable_bw80_chan(chan)) { + wpa_printf(MSG_DEBUG, +- "ACS: Channel %d: not allowed as primary channel for VHT80", ++ "ACS: Channel %d: not allowed as primary channel for 80MHz bandwidth", + chan->chan); + continue; + } + + if (hostapd_get_oper_chwidth(iface->conf) == + CHANWIDTH_160MHZ && +- !acs_usable_vht160_chan(chan)) { ++ !acs_usable_bw160_chan(chan)) { + wpa_printf(MSG_DEBUG, +- "ACS: Channel %d: not allowed as primary channel for VHT160", ++ "ACS: Channel %d: not allowed as primary channel for 160MHz bandwidth", + chan->chan); + continue; + } +@@ -832,16 +837,20 @@ acs_find_ideal_chan(struct hostapd_iface + u32 bw; + struct hostapd_hw_modes *mode; + +- /* TODO: HT40- support */ ++ if (is_6ghz_op_class(iface->conf->op_class)) { ++ bw = op_class_to_bandwidth(iface->conf->op_class); ++ n_chans = bw/20; ++ goto bw_selected; ++ } + ++ /* TODO: HT40- support */ + if (iface->conf->ieee80211n && + iface->conf->secondary_channel == -1) { + wpa_printf(MSG_ERROR, "ACS: HT40- is not supported yet. Please try HT40+"); + return NULL; + } + +- if (iface->conf->ieee80211n && +- iface->conf->secondary_channel) ++ if (iface->conf->ieee80211n && iface->conf->secondary_channel) + n_chans = 2; + + if (iface->conf->ieee80211ac || iface->conf->ieee80211ax) { +@@ -857,6 +866,7 @@ acs_find_ideal_chan(struct hostapd_iface + + bw = num_chan_to_bw(n_chans); + ++bw_selected: + /* TODO: VHT/HE80+80. Update acs_adjust_center_freq() too. */ + + wpa_printf(MSG_DEBUG, +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -1689,6 +1689,10 @@ static int setup_interface2(struct hosta + + ch_width = op_class_to_ch_width(iface->conf->op_class); + hostapd_set_oper_chwidth(iface->conf, ch_width); ++ if (!iface->conf->secondary_channel && ++ op_class_to_bandwidth(iface->conf->op_class) >= 40) ++ iface->conf->secondary_channel = ++ (((iface->conf->channel - 1) / 4 ) % 2) ? -1 : 1 ; + } + + ret = hostapd_select_hw_mode(iface); +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index 668d9094e28d..ff17b2f00e85 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -486,8 +486,10 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + + resp->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT, + WLAN_FC_STYPE_PROBE_RESP); +- if (req) ++ os_memset(resp->da, 0xff, ETH_ALEN); ++ if (req && !is_6ghz_op_class(hapd->iconf->op_class)) + os_memcpy(resp->da, req->sa, ETH_ALEN); ++ + os_memcpy(resp->sa, hapd->own_addr, ETH_ALEN); + + os_memcpy(resp->bssid, hapd->own_addr, ETH_ALEN); +diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c +index c1630d09a254..56f40edc0fdc 100644 +--- a/wpa_supplicant/mesh.c ++++ b/wpa_supplicant/mesh.c +@@ -512,6 +512,8 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, + params->flags |= WPA_DRIVER_MESH_FLAG_SAE_AUTH; + params->flags |= WPA_DRIVER_MESH_FLAG_AMPE; + wpa_s->conf->user_mpm = 1; ++ if (is_6ghz_freq(ssid->frequency)) ++ ssid->ieee80211w = MGMT_FRAME_PROTECTION_REQUIRED; + } + + if (wpa_s->conf->user_mpm) { diff --git a/feeds/wifi-ax/hostapd/patches/d00-009-hostapd-update-muedca-params.patch b/feeds/wifi-ax/hostapd/patches/d00-009-hostapd-update-muedca-params.patch new file mode 100644 index 000000000..befc99932 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/d00-009-hostapd-update-muedca-params.patch @@ -0,0 +1,233 @@ +--- a/src/ap/drv_callbacks.c ++++ b/src/ap/drv_callbacks.c +@@ -1747,6 +1747,39 @@ static void hostapd_event_wds_sta_interf + ifname, MAC2STR(addr)); + } + ++static void hostapd_event_update_muedca_params(struct hostapd_data *hapd, ++ struct update_muedca *params) ++{ ++ int i; ++ u8 updated_count; ++ ++ /* Update current MU-EDCA parameters */ ++ for (i = 0; i < 3; i++) { ++ hapd->iface->conf->he_mu_edca.he_mu_ac_be_param[i] = ++ params->he_mu_ac_be_param[i]; ++ hapd->iface->conf->he_mu_edca.he_mu_ac_bk_param[i] = ++ params->he_mu_ac_bk_param[i]; ++ hapd->iface->conf->he_mu_edca.he_mu_ac_vo_param[i] = ++ params->he_mu_ac_vo_param[i]; ++ hapd->iface->conf->he_mu_edca.he_mu_ac_vi_param[i] = ++ params->he_mu_ac_vi_param[i]; ++ } ++ ++ /* Increment Parameter Set Update Count for MU-EDCA and WME EDCA only ++ * if any STA is connected ++ */ ++ if (hapd->num_sta) { ++ updated_count = (hapd->iface->conf->he_mu_edca.he_qos_info + 1) & 0xf; ++ hapd->iface->conf->he_mu_edca.he_qos_info &= 0xf0; ++ hapd->iface->conf->he_mu_edca.he_qos_info |= updated_count; ++ hapd->parameter_set_count++; ++ } ++ ++ /* Update beacon with updated MU-EDCA parameters */ ++ if (ieee802_11_update_beacons(hapd->iface)) ++ wpa_printf(MSG_DEBUG, ++ "Failed to update beacons with MU-EDCA parameters"); ++} + + #ifdef CONFIG_OWE + static int hostapd_notif_update_dh_ie(struct hostapd_data *hapd, +@@ -2055,6 +2088,9 @@ void hostapd_wpa_event(void *ctx, enum w + data->wds_sta_interface.ifname, + data->wds_sta_interface.sta_addr); + break; ++ case EVENT_UPDATE_MUEDCA_PARAMS: ++ hostapd_event_update_muedca_params(hapd, &data->update_muedca); ++ break; + default: + wpa_printf(MSG_DEBUG, "Unknown event %d", event); + break; +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -5052,6 +5052,15 @@ enum wpa_event_type { + * is required to provide more details of the frame. + */ + EVENT_UNPROT_BEACON, ++ ++ /** ++ * EVENT_UPDATE_MUEDCA_PARAMS - Updated MU-EDCA parameters received ++ * ++ * This event is emitted when updated MU-EDCA parameters from driver ++ * are received. Updated MU-EDCA parameters need to be updated in ++ * beacon. ++ */ ++ EVENT_UPDATE_MUEDCA_PARAMS, + }; + + +@@ -5911,6 +5920,16 @@ union wpa_event_data { + struct unprot_beacon { + const u8 *sa; + } unprot_beacon; ++ ++ /** ++ * struct update_muedca - Data for EVENT_UPDATE_MU_EDCA_PARAMS ++ */ ++ struct update_muedca { ++ u8 he_mu_ac_be_param[3]; ++ u8 he_mu_ac_bk_param[3]; ++ u8 he_mu_ac_vi_param[3]; ++ u8 he_mu_ac_vo_param[3]; ++ } update_muedca; + }; + + /** +--- a/src/drivers/driver_nl80211_event.c ++++ b/src/drivers/driver_nl80211_event.c +@@ -2584,6 +2584,35 @@ static void nl80211_sta_opmode_change_ev + wpa_supplicant_event(drv->ctx, EVENT_STATION_OPMODE_CHANGED, &ed); + } + ++static void nl80211_update_muedca_params_event(struct wpa_driver_nl80211_data *drv, ++ struct nlattr **tb) ++{ ++ struct host_update_muedca { ++ u8 mu_qos_info; ++ u8 ac_be[3]; ++ u8 ac_bk[3]; ++ u8 ac_vi[3]; ++ u8 ac_vo[3]; ++ }; ++ ++ struct host_update_muedca *rx_muedca_params; ++ union wpa_event_data ed; ++ int i; ++ ++ if (!tb[NL80211_ATTR_HE_MUEDCA_PARAMS]) ++ return; ++ ++ rx_muedca_params = nla_data(tb[NL80211_ATTR_HE_MUEDCA_PARAMS]); ++ ++ for (i = 0; i< 3; i++) { ++ ed.update_muedca.he_mu_ac_be_param[i] = rx_muedca_params->ac_be[i]; ++ ed.update_muedca.he_mu_ac_bk_param[i] = rx_muedca_params->ac_bk[i]; ++ ed.update_muedca.he_mu_ac_vi_param[i] = rx_muedca_params->ac_vi[i]; ++ ed.update_muedca.he_mu_ac_vo_param[i] = rx_muedca_params->ac_vo[i]; ++ } ++ ++ wpa_supplicant_event(drv->ctx, EVENT_UPDATE_MUEDCA_PARAMS, &ed); ++} + + static void nl80211_control_port_frame(struct wpa_driver_nl80211_data *drv, + struct nlattr **tb) +@@ -2641,7 +2670,6 @@ nl80211_control_port_frame_tx_status(str + wpa_supplicant_event(drv->ctx, EVENT_EAPOL_TX_STATUS, &event); + } + +- + static void do_process_drv_event(struct i802_bss *bss, int cmd, + struct nlattr **tb) + { +@@ -2869,6 +2897,9 @@ static void do_process_drv_event(struct + tb[NL80211_ATTR_ACK], + tb[NL80211_ATTR_COOKIE]); + break; ++ case NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS: ++ nl80211_update_muedca_params_event(drv, tb); ++ break; + default: + wpa_dbg(drv->ctx, MSG_DEBUG, "nl80211: Ignored unknown event " + "(cmd=%d)", cmd); +--- a/src/drivers/nl80211_copy.h ++++ b/src/drivers/nl80211_copy.h +@@ -1170,6 +1170,11 @@ + * includes the contents of the frame. %NL80211_ATTR_ACK flag is included + * if the recipient acknowledged the frame. + * ++ * @NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS: Updated MU-EDCA parameters from driver. ++ * This event is used to update MU-EDCA parameters in Beacon frame, which ++ * were indicated by driver and now need to be reflected in ++ * Beacon frame. ++ * + * @NL80211_CMD_MAX: highest used command number + * @__NL80211_CMD_AFTER_LAST: internal use + */ +@@ -1400,6 +1405,7 @@ enum nl80211_commands { + + NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS, + ++ NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS, + /* add new commands above here */ + + /* used to define NL80211_CMD_MAX below */ +@@ -2505,6 +2511,9 @@ enum nl80211_commands { + * @NL80211_ATTR_HE_6GHZ_CAPABILITY: HE 6 GHz Band Capability element (from + * association request when used with NL80211_CMD_NEW_STATION). + * ++ * @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the ++ NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command. ++ * + * @NUM_NL80211_ATTR: total number of nl80211_attrs available + * @NL80211_ATTR_MAX: highest attribute number currently defined + * @__NL80211_ATTR_AFTER_LAST: internal use +@@ -2987,6 +2996,7 @@ enum nl80211_attrs { + + NL80211_ATTR_HE_6GHZ_CAPABILITY, + ++ NL80211_ATTR_HE_MUEDCA_PARAMS, + /* add attributes here, update the policy in nl80211.c */ + + __NL80211_ATTR_AFTER_LAST, +--- a/src/drivers/driver_common.c ++++ b/src/drivers/driver_common.c +@@ -90,6 +90,7 @@ const char * event_to_string(enum wpa_ev + E2S(WDS_STA_INTERFACE_STATUS); + E2S(UPDATE_DH); + E2S(UNPROT_BEACON); ++ E2S(UPDATE_MUEDCA_PARAMS); + } + + return "UNKNOWN"; +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -3541,6 +3541,10 @@ static int hostapd_fill_csa_settings(str + hapd->cs_count = settings->cs_count; + hapd->cs_block_tx = settings->block_tx; + ++ /* reset MU-EDCA and WME EDCA parameter set count */ ++ hapd->iface->conf->he_mu_edca.he_qos_info &= 0xfff0; ++ hapd->parameter_set_count = 0; ++ + ret = hostapd_build_beacon_data(hapd, &settings->beacon_csa); + if (ret) { + free_beacon_data(&settings->beacon_after); +--- a/hostapd/ctrl_iface.c ++++ b/hostapd/ctrl_iface.c +@@ -1471,6 +1471,11 @@ static int hostapd_ctrl_iface_set(struct + } else if (os_strncmp(cmd, "wme_ac_", 7) == 0 || + os_strncmp(cmd, "wmm_ac_", 7) == 0) { + hapd->parameter_set_count++; ++ /* Incrementing MU-EDCA Parameter Set Update Count*/ ++ hapd->iface->conf->he_mu_edca.he_qos_info = ++ hapd->iface->conf->he_mu_edca.he_qos_info & 0xf0 | ++ ((hapd->iface->conf->he_mu_edca.he_qos_info + 1) & ++ 0xf); + if (ieee802_11_update_beacons(hapd->iface)) + wpa_printf(MSG_DEBUG, + "Failed to update beacons with WMM parameters"); +--- a/src/ap/wmm.c ++++ b/src/ap/wmm.c +@@ -98,6 +98,10 @@ static void wmm_calc_regulatory_limit(st + os_memcpy(hapd->iface->prev_wmm, acp, + sizeof(hapd->iconf->wmm_ac_params)); + hapd->parameter_set_count++; ++ /* Incrementing MU-EDCA Parameter Set Update Count*/ ++ hapd->iface->conf->he_mu_edca.he_qos_info = ++ hapd->iface->conf->he_mu_edca.he_qos_info & 0xf0 | ++ ((hapd->iface->conf->he_mu_edca.he_qos_info + 1) & 0xf); + } + } + diff --git a/feeds/wifi-ax/hostapd/patches/d00-010-hostapd-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch b/feeds/wifi-ax/hostapd/patches/d00-010-hostapd-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch new file mode 100644 index 000000000..bb04eb445 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/d00-010-hostapd-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch @@ -0,0 +1,724 @@ +Index: hostapd-2020-07-02-58b384f4/hostapd/config_file.c +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/hostapd/config_file.c ++++ hostapd-2020-07-02-58b384f4/hostapd/config_file.c +@@ -3561,6 +3561,10 @@ static int hostapd_config_fill(struct ho + conf->he_oper_centr_freq_seg0_idx = atoi(pos); + } else if (os_strcmp(buf, "he_oper_centr_freq_seg1_idx") == 0) { + conf->he_oper_centr_freq_seg1_idx = atoi(pos); ++ } else if (os_strcmp(buf, ++ "unsol_bcast_probe_resp_interval") == 0) { ++ bss->unsol_bcast_probe_resp_interval = ++ (atoi(pos) > 20) ? 20 : atoi(pos); + #endif /* CONFIG_IEEE80211AX */ + } else if (os_strcmp(buf, "max_listen_interval") == 0) { + bss->max_listen_interval = atoi(pos); +@@ -4369,6 +4373,10 @@ static int hostapd_config_fill(struct ho + bss->dhcp_server_port = atoi(pos); + } else if (os_strcmp(buf, "dhcp_relay_port") == 0) { + bss->dhcp_relay_port = atoi(pos); ++ } else if (os_strcmp(buf, "fils_discovery_min_interval") == 0) { ++ bss->fils_discovery_min_int = atoi(pos); ++ } else if (os_strcmp(buf, "fils_discovery_max_interval") == 0) { ++ bss->fils_discovery_max_int = atoi(pos); + #endif /* CONFIG_FILS */ + } else if (os_strcmp(buf, "multicast_to_unicast") == 0) { + bss->multicast_to_unicast = atoi(pos); +Index: hostapd-2020-07-02-58b384f4/hostapd/hostapd.conf +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/hostapd/hostapd.conf ++++ hostapd-2020-07-02-58b384f4/hostapd/hostapd.conf +@@ -873,6 +873,12 @@ wmm_ac_vo_acm=0 + #he_spr_srg_obss_pd_min_offset + #he_spr_srg_obss_pd_max_offset + ++# Unsolicited broadcast probe response transmission settings, 6GHz only. ++# If interval is set to non-zero, the AP schedules unsolicited ++# broadcast probe response frames for in-band discovery. Refer to ++# IEEE P802.11ax/D6.0 26.17.2.3.2, AP behavior for fast passive scanning. ++#unsol_bcast_probe_resp_interval=0(default) to 20 TUs. ++ + ##### IEEE 802.1X-2004 related configuration ################################## + + # Require IEEE 802.1X authorization +@@ -1914,6 +1920,11 @@ own_ip_addr=127.0.0.1 + # default: 30 TUs (= 30.72 milliseconds) + #fils_hlp_wait_time=30 + ++# FILS discovery transmission minimum and maximum packet interval settings. ++# If maximum interval is non-zero, the AP schedules FILS discovery transmission ++#fils_discovery_max_interval=0 to 10000 (in TUs). ++#fils_discovery_min_interval=0 to 10000 (in TUs). ++ + # Transition Disable indication + # The AP can notify authenticated stations to disable transition mode in their + # network profiles when the network has completed transition steps, i.e., once +Index: hostapd-2020-07-02-58b384f4/src/ap/ap_config.c +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/ap/ap_config.c ++++ hostapd-2020-07-02-58b384f4/src/ap/ap_config.c +@@ -131,6 +131,7 @@ void hostapd_config_defaults_bss(struct + bss->fils_hlp_wait_time = 30; + bss->dhcp_server_port = DHCP_SERVER_PORT; + bss->dhcp_relay_port = DHCP_SERVER_PORT; ++ bss->fils_discovery_min_int = 20; + #endif /* CONFIG_FILS */ + + bss->broadcast_deauth = 1; +@@ -1334,6 +1335,15 @@ static int hostapd_config_check_bss(stru + } + #endif /* CONFIG_SAE_PK */ + ++#ifdef CONFIG_FILS ++ if (bss->fils_discovery_max_int && ++ bss->unsol_bcast_probe_resp_interval) { ++ wpa_printf(MSG_ERROR, ++ "Cannot enable both FILS discovery and unsolicited broadcast probe response at the same time"); ++ return -1; ++ } ++#endif /* CONFIG_FILS */ ++ + return 0; + } + +Index: hostapd-2020-07-02-58b384f4/src/ap/ap_config.h +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/ap/ap_config.h ++++ hostapd-2020-07-02-58b384f4/src/ap/ap_config.h +@@ -735,6 +735,8 @@ struct hostapd_bss_config { + unsigned int fils_hlp_wait_time; + u16 dhcp_server_port; + u16 dhcp_relay_port; ++ u32 fils_discovery_min_int; ++ u32 fils_discovery_max_int; + #endif /* CONFIG_FILS */ + + int multicast_to_unicast; +@@ -868,6 +870,7 @@ struct hostapd_bss_config { + u8 mka_psk_set; + #endif /* CONFIG_MACSEC */ + char *config_id; ++ u32 unsol_bcast_probe_resp_interval; + }; + + /** +Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/ap/beacon.c ++++ hostapd-2020-07-02-58b384f4/src/ap/beacon.c +@@ -1127,6 +1127,21 @@ static u8 * hostapd_probe_resp_offloads( + + #endif /* NEED_AP_MLME */ + ++#ifdef CONFIG_IEEE80211AX ++/* Unsolicited broadcast probe response transmission, 6GHz only */ ++static u8 *hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd, ++ struct wpa_driver_ap_params *params) ++{ ++ if (!is_6ghz_op_class(hapd->iconf->op_class)) ++ return NULL; ++ ++ params->unsol_bcast_probe_resp_interval = ++ hapd->conf->unsol_bcast_probe_resp_interval; ++ ++ return hostapd_gen_probe_resp(hapd, NULL, 0, ++ ¶ms->unsol_bcast_probe_resp_tmpl_len); ++} ++#endif /* CONFIG_IEEE80211AX */ + + void sta_track_del(struct hostapd_sta_info *info) + { +@@ -1138,6 +1153,271 @@ void sta_track_del(struct hostapd_sta_in + } + + ++#ifdef CONFIG_FILS ++static u8 hostapd_fils_discovery_rsn(struct hostapd_data *hapd, u16 *cap, ++ u32 *suite_selector_ptr) ++{ ++ const u8 *ie, *start; ++ u8 len; ++ u16 cnt; ++ u32 suite_selector = 0; ++ ++ ie = hostapd_wpa_ie(hapd, WLAN_EID_RSN); ++ if (!ie || ie[1] < 6) ++ return 0; ++ ++ len = ie[1]; ++ start = &ie[2]; ++ ie += 4; ++ do { ++ /* Group Data Cipher Suite Selector */ ++ suite_selector = ie[3]; ++ ie += 4; ++ ++ /* Pairwise Cipher Suite Selector */ ++ if ((ie - start) >= len) ++ break; ++ os_memcpy((u8 *) &cnt, ie, 2); ++ ie += 2; ++ if (cnt) { ++ suite_selector |= (((u32) ie[3]) << 12); ++ ie += (4 * cnt); ++ } ++ ++ /* AKM Cipher Suite Selector */ ++ if ((ie - start) >= len) ++ break; ++ os_memcpy((u8 *) &cnt, ie, 2); ++ ie += 2; ++ if (cnt) { ++ suite_selector |= (((u32) ie[3]) << 18); ++ ie += (4 * cnt); ++ } ++ ++ /* RSN capabilities */ ++ if ((ie - start) >= len) ++ break; ++ os_memcpy((u8 *) cap, ie, 2); ++ ie += 2; ++ ++ /* Group Management Cipher Suite Selector */ ++ if ((ie - start) < len) ++ suite_selector |= (((u32) ie[3]) << 6); ++ } while (0); ++ ++ *suite_selector_ptr = suite_selector; ++ return 1; ++} ++ ++ ++u16 hostapd_fils_discovery_cap(struct hostapd_data *hapd) ++{ ++ u16 cap_info = 0, nss_mask = 0x0003; ++ u8 nss = 0, chwidth = 0; ++ int i; ++ ++ cap_info = FILS_DISCOVERY_CAP_ESS | ++ (hapd->conf->wpa ? FILS_DISCOVERY_CAP_PRIVACY : 0) | ++ (hapd->iconf->multiple_bssid ? ++ FILS_DISCOVERY_CAP_MULTIPLE_BSSID_PRESENT : 0); ++ ++ if (is_6ghz_op_class(hapd->iconf->op_class)) { ++ cap_info |= (FILS_DISCOVERY_CAP_PHY_INDEX_HE << ++ FILS_DISCOVERY_CAP_PHY_INDEX_SHIFT); ++ ++ switch (hapd->iconf->op_class) { ++ case 132: ++ chwidth = FILS_DISCOVERY_CAP_BSS_CHWIDTH_40; ++ break; ++ case 133: ++ chwidth = FILS_DISCOVERY_CAP_BSS_CHWIDTH_80; ++ break; ++ case 134: ++ case 135: ++ chwidth = FILS_DISCOVERY_CAP_BSS_CHWIDTH_160_8080; ++ break; ++ } ++ } else { ++ switch (hostapd_get_oper_chwidth(hapd->iconf)) { ++ case CHANWIDTH_80P80MHZ: ++ case CHANWIDTH_160MHZ: ++ chwidth = FILS_DISCOVERY_CAP_BSS_CHWIDTH_160_8080; ++ break; ++ case CHANWIDTH_80MHZ: ++ chwidth = FILS_DISCOVERY_CAP_BSS_CHWIDTH_80; ++ break; ++ case CHANWIDTH_USE_HT: ++ if (hapd->iconf->secondary_channel) ++ chwidth = FILS_DISCOVERY_CAP_BSS_CHWIDTH_40; ++ break; ++ } ++ ++ if (hapd->iconf->ieee80211ax) { ++#ifdef CONFIG_IEEE80211AX ++ cap_info |= (FILS_DISCOVERY_CAP_PHY_INDEX_HE << ++ FILS_DISCOVERY_CAP_PHY_INDEX_SHIFT); ++#endif /* CONFIG_IEEE80211AX */ ++ } else if (hapd->conf->vendor_vht) { ++#ifdef CONFIG_IEEE80211AC ++ cap_info |= (FILS_DISCOVERY_CAP_PHY_INDEX_VHT << ++ FILS_DISCOVERY_CAP_PHY_INDEX_SHIFT); ++#endif /* CONFIG_IEEE80211AC */ ++ } else if (hapd->iconf->ieee80211n && ++ !hapd->conf->disable_11n) { ++ cap_info |= (FILS_DISCOVERY_CAP_PHY_INDEX_HT << ++ FILS_DISCOVERY_CAP_PHY_INDEX_SHIFT); ++ } ++ } ++ ++ cap_info |= (chwidth << FILS_DISCOVERY_CAP_BSS_CHWIDTH_SHIFT); ++ ++ for (i = 0; i < 8; i++) { ++ if ((hapd->iconf->he_op.he_basic_mcs_nss_set & nss_mask) != ++ nss_mask) ++ nss++; ++ nss_mask = nss_mask << 2; ++ } ++ if (nss > 4) ++ cap_info |= (4 << FILS_DISCOVERY_CAP_NSS_SHIFT); ++ else ++ cap_info |= ((nss - 1) << FILS_DISCOVERY_CAP_NSS_SHIFT); ++ ++ /* TODO: FILS minimum rate */ ++ return cap_info; ++} ++ ++ ++static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, u32 *len) ++{ ++ struct ieee80211_mgmt *head; ++ const u8 *mobility_domain; ++ u8 *pos, *length_pos, rsn = 0, buf[200], buf_len; ++ u16 frm_cntl = 0, rsn_cap = 0; ++ u32 suite_selectors = 0, total_len; ++ ++#define FILS_DISOVERY_TMPL_HEAD_LEN 26 ++#define FILS_DISOVERY_TMPL_MIN_LEN 19 ++ ++ total_len = FILS_DISOVERY_TMPL_HEAD_LEN + FILS_DISOVERY_TMPL_MIN_LEN; ++ ++ /* FILS discovery frame control: 2 bytes */ ++ frm_cntl = (sizeof(hapd->conf->ssid.short_ssid) - 1) | ++ FILS_DISCOVERY_FRM_CNTL_CAP_PRESENT | ++ FILS_DISCOVERY_FRM_CNTL_SHORT_SSID_PRESENT | ++ FILS_DISCOVERY_FRM_CNTL_LENGTH_PRESENT; ++ ++ /* Check for optional subfields and calculate length */ ++ rsn = hostapd_fils_discovery_rsn(hapd, &rsn_cap, &suite_selectors); ++ if (rsn) { ++ frm_cntl |= FILS_DISCOVERY_FRM_CNTL_RSN_INFO_PRESENT; ++ total_len += 5; ++ } ++ ++ mobility_domain = hostapd_wpa_ie(hapd, WLAN_EID_MOBILITY_DOMAIN); ++ if (mobility_domain) { ++ frm_cntl |= FILS_DISCOVERY_FRM_CNTL_MOBILITY_DOMAIN_PRESENT; ++ total_len += 3; ++ } ++ ++ total_len += hostapd_eid_reduced_neighbor_report_len(hapd); ++ ++ pos = hostapd_eid_fils_indic(hapd, buf, 0); ++ buf_len = pos - buf; ++ total_len += buf_len; ++ ++ head = os_zalloc(total_len); ++ if (!head) ++ return NULL; ++ ++ head->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT, ++ WLAN_FC_STYPE_ACTION); ++ os_memset(head->da, 0xff, ETH_ALEN); ++ os_memcpy(head->sa, hapd->own_addr, ETH_ALEN); ++ os_memcpy(head->bssid, hapd->own_addr, ETH_ALEN); ++ ++ head->u.action.category = WLAN_ACTION_PUBLIC; ++ head->u.action.u.public_action.action = WLAN_PA_FILS_DISCOVERY; ++ ++ pos = &head->u.action.u.public_action.variable[0]; ++ *((u16 *) pos) = host_to_le16(frm_cntl); ++ pos += 2; ++ ++ /* hardware or low-level driver will setup timestamp */ ++ pos += 8; ++ ++ /* Beacon interval */ ++ *((u16 *) pos) = host_to_le16(hapd->iconf->beacon_int); ++ pos += 2; ++ ++ /* Short SSID */ ++ *((u32 *) pos) = host_to_le32(hapd->conf->ssid.short_ssid); ++ pos += sizeof(hapd->conf->ssid.short_ssid); ++ ++ /* Store position of FILS discovery information element length field */ ++ length_pos = pos++; ++ ++ /* FD Capability : total 2 bytes */ ++ *((u16 *) pos) = host_to_le16(hostapd_fils_discovery_cap(hapd)); ++ pos += 2; ++ ++ /* RSN */ ++ if (frm_cntl & FILS_DISCOVERY_FRM_CNTL_RSN_INFO_PRESENT) { ++ os_memcpy(pos, &rsn_cap, 2); ++ os_memcpy(&pos[2], &suite_selectors, 3); ++ pos += 5; ++ } ++ ++ /* Mobility Domain */ ++ if (frm_cntl & FILS_DISCOVERY_FRM_CNTL_MOBILITY_DOMAIN_PRESENT) { ++ os_memcpy(pos, &mobility_domain[2], 3); ++ pos += 3; ++ } ++ ++ /* Fill the FILS discovery information element length */ ++ *length_pos = pos - (length_pos + 1); ++ ++ /* Reduced Neighbor Report element */ ++ pos = hostapd_eid_reduced_neighbor_report(hapd, pos); ++ ++ /* FILS indication element */ ++ if (buf_len) { ++ os_memcpy(pos, buf, buf_len); ++ pos += buf_len; ++ } ++ ++ *len = pos - (u8 *) head; ++ return ((u8 *) head); ++} ++ ++ ++/* Configure FILS discovery transmission */ ++static u8 * hostapd_fils_discovery(struct hostapd_data *hapd, ++ struct wpa_driver_ap_params *params) ++{ ++ if (hapd->iconf->multiple_bssid && hapd != hapd->iface->bss[0]) ++ return NULL; ++ ++#define VALID_INTERVAL(x,y) { x = (x > y) ? y : x; } ++ ++ params->fils_discovery_max_int = hapd->conf->fils_discovery_max_int; ++ if (is_6ghz_op_class(hapd->iconf->op_class)) ++ VALID_INTERVAL(params->fils_discovery_max_int, ++ FILS_DISCOVERY_MAX_INTERVAL_6GHZ); ++ ++ params->fils_discovery_min_int = hapd->conf->fils_discovery_min_int; ++ VALID_INTERVAL(params->fils_discovery_min_int, ++ params->fils_discovery_max_int); ++#undef VALID_INTERVAL ++ ++ if (params->fils_discovery_max_int) ++ return hostapd_gen_fils_discovery(hapd, ++ ¶ms->fils_discovery_tmpl_len); ++ ++ return NULL; ++} ++#endif /* CONFIG_FILS */ ++ ++ + int ieee802_11_build_ap_params(struct hostapd_data *hapd, + struct wpa_driver_ap_params *params) + { +@@ -1475,6 +1755,14 @@ void ieee802_11_free_ap_params(struct wp + params->head = NULL; + os_free(params->proberesp); + params->proberesp = NULL; ++#ifdef CONFIG_FILS ++ os_free(params->fils_discovery_tmpl); ++ params->fils_discovery_tmpl = NULL; ++#endif /* CONFIG_FILS */ ++#ifdef CONFIG_IEEE80211AX ++ os_free(params->unsol_bcast_probe_resp_tmpl); ++ params->unsol_bcast_probe_resp_tmpl = NULL; ++#endif /* CONFIG_IEEE80211AX */ + } + + +@@ -1514,9 +1802,15 @@ int ieee802_11_set_beacon(struct hostapd + params.he_bss_color = hapd->iface->conf->he_op.he_bss_color; + params.twt_responder = hostapd_get_he_twt_responder(hapd, + IEEE80211_MODE_AP); ++ params.unsol_bcast_probe_resp_tmpl = ++ hostapd_unsol_bcast_probe_resp(hapd, ¶ms); + #endif /* CONFIG_IEEE80211AX */ + hapd->reenable_beacon = 0; + ++#ifdef CONFIG_FILS ++ params.fils_discovery_tmpl = hostapd_fils_discovery(hapd, ¶ms); ++#endif /* CONFIG_FILS */ ++ + if (cmode && + hostapd_set_freq_params(&freq, iconf->hw_mode, iface->freq, + iconf->channel, iconf->enable_edmg, +Index: hostapd-2020-07-02-58b384f4/src/common/ieee802_11_defs.h +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/common/ieee802_11_defs.h ++++ hostapd-2020-07-02-58b384f4/src/common/ieee802_11_defs.h +@@ -2350,4 +2350,40 @@ enum edmg_bw_config { + /* DPP Public Action frame identifiers - OUI_WFA */ + #define DPP_OUI_TYPE 0x1A + ++/** ++ * IEEE Std 802.11ai-2016 9.6.8.36 FILS Discovery frame format, ++ * Figure 9-687b - FILS Discovery Frame Control subfield format ++ */ ++#define FILS_DISCOVERY_FRM_CNTL_CAP_PRESENT ((u16)BIT(5)) ++#define FILS_DISCOVERY_FRM_CNTL_SHORT_SSID_PRESENT ((u16)BIT(6)) ++#define FILS_DISCOVERY_FRM_CNTL_AP_CSN_PRESENT ((u16)BIT(7)) ++#define FILS_DISCOVERY_FRM_CNTL_ANO_PRESENT ((u16)BIT(8)) ++#define FILS_DISCOVERY_FRM_CNTL_FREQ_SEG1_PRESENT ((u16)BIT(9)) ++#define FILS_DISCOVERY_FRM_CNTL_PRI_CHAN_PRESENT ((u16)BIT(10)) ++#define FILS_DISCOVERY_FRM_CNTL_RSN_INFO_PRESENT ((u16)BIT(11)) ++#define FILS_DISCOVERY_FRM_CNTL_LENGTH_PRESENT ((u16)BIT(12)) ++#define FILS_DISCOVERY_FRM_CNTL_MOBILITY_DOMAIN_PRESENT ((u16)BIT(13)) ++ ++/** ++ * IEEE Std 802.11ai-2016 9.6.8.36 FILS Discovery frame format, ++ * Figure 9-687c - FD Capability subfield format ++ */ ++#define FILS_DISCOVERY_CAP_ESS BIT(0) ++#define FILS_DISCOVERY_CAP_PRIVACY BIT(1) ++#define FILS_DISCOVERY_CAP_MULTIPLE_BSSID_PRESENT BIT(9) ++#define FILS_DISCOVERY_CAP_BSS_CHWIDTH_20 0 ++#define FILS_DISCOVERY_CAP_BSS_CHWIDTH_40 1 ++#define FILS_DISCOVERY_CAP_BSS_CHWIDTH_80 2 ++#define FILS_DISCOVERY_CAP_BSS_CHWIDTH_160_8080 3 ++#define FILS_DISCOVERY_CAP_BSS_CHWIDTH_SHIFT 2 ++#define FILS_DISCOVERY_CAP_NSS_SHIFT 5 ++#define FILS_DISCOVERY_CAP_PHY_INDEX_SHIFT 10 ++#define FILS_DISCOVERY_CAP_PHY_INDEX_HT 2 ++#define FILS_DISCOVERY_CAP_PHY_INDEX_VHT 3 ++ ++/** ++ * IEEE P802.11ax/D6.0 26.17.2.3.2, AP behavior for fast passive scanning ++ */ ++#define FILS_DISCOVERY_CAP_PHY_INDEX_HE 4 ++#define FILS_DISCOVERY_MAX_INTERVAL_6GHZ 20 + #endif /* IEEE802_11_DEFS_H */ +Index: hostapd-2020-07-02-58b384f4/src/drivers/driver.h +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver.h ++++ hostapd-2020-07-02-58b384f4/src/drivers/driver.h +@@ -1518,6 +1518,41 @@ struct wpa_driver_ap_params { + * twt_responder - Whether Target Wait Time responder is enabled + */ + int twt_responder; ++ ++ /** ++ * FILS discovery minimum interval ++ */ ++ u32 fils_discovery_min_int; ++ ++ /** ++ * FILS discovery maximum interval ++ */ ++ u32 fils_discovery_max_int; ++ ++ /** ++ * FILS discovery template data ++ */ ++ u8 *fils_discovery_tmpl; ++ ++ /** ++ * FILS discovery template length ++ */ ++ size_t fils_discovery_tmpl_len; ++ ++ /** ++ * Unsolicited broadcast probe response interval ++ */ ++ u32 unsol_bcast_probe_resp_interval; ++ ++ /** ++ * Unsolicited broadcast probe response template data ++ */ ++ u8 *unsol_bcast_probe_resp_tmpl; ++ ++ /** ++ * Unsolicited broadcast probe response template length ++ */ ++ size_t unsol_bcast_probe_resp_tmpl_len; + }; + + struct wpa_driver_mesh_bss_params { +Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver_nl80211.c ++++ hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c +@@ -4255,7 +4255,6 @@ static int nl80211_put_beacon_rate(struc + return 0; + } + +- + static int nl80211_set_multicast_to_unicast(struct i802_bss *bss, + int multicast_to_unicast) + { +@@ -4302,6 +4301,75 @@ static int nl80211_set_multicast_to_unic + } + + ++#ifdef CONFIG_FILS ++static int nl80211_fils_discovery(struct i802_bss *bss, struct nl_msg *msg, ++ struct wpa_driver_ap_params *params) ++{ ++ struct nlattr *attr; ++ ++ attr = nla_nest_start(msg, NL80211_ATTR_FILS_DISCOVERY); ++ if (!attr) ++ return -1; ++ ++ if (nla_put_u32(msg, NL80211_FILS_DISCOVERY_INT_MIN, ++ params->fils_discovery_min_int) || ++ nla_put_u32(msg, NL80211_FILS_DISCOVERY_INT_MAX, ++ params->fils_discovery_max_int)) { ++ wpa_printf(MSG_ERROR, ++ "nl80211: Failed to build FILS discovery msg for %s\n", ++ bss->ifname); ++ return -1; ++ } ++ ++ if (params->fils_discovery_tmpl && ++ nla_put(msg, NL80211_FILS_DISCOVERY_TMPL, ++ params->fils_discovery_tmpl_len, ++ params->fils_discovery_tmpl)) { ++ wpa_printf(MSG_ERROR, ++ "nl80211: Failed to build FILS discovery msg for %s\n", ++ bss->ifname); ++ return -1; ++ } ++ ++ nla_nest_end(msg, attr); ++ return 0; ++} ++#endif /* CONFIG_FILS */ ++ ++#ifdef CONFIG_IEEE80211AX ++static int nl80211_unsol_bcast_probe_resp(struct i802_bss *bss, ++ struct nl_msg *msg, ++ struct wpa_driver_ap_params *params) ++{ ++ struct nlattr *attr; ++ ++ attr = nla_nest_start(msg, NL80211_ATTR_UNSOL_BCAST_PROBE_RESP); ++ if (!attr) ++ return -1; ++ ++ if (nla_put_u32(msg, NL80211_UNSOL_BCAST_PROBE_RESP_INT, ++ params->unsol_bcast_probe_resp_interval)) { ++ wpa_printf(MSG_ERROR, ++ "nl80211: Failed to build unsolicited broadcast probe response msg for %s\n", ++ bss->ifname); ++ return -1; ++ } ++ ++ if (params->unsol_bcast_probe_resp_tmpl && ++ nla_put(msg, NL80211_UNSOL_BCAST_PROBE_RESP_TMPL, ++ params->unsol_bcast_probe_resp_tmpl_len, ++ params->unsol_bcast_probe_resp_tmpl)) { ++ wpa_printf(MSG_ERROR, ++ "nl80211: Failed to build unsolicited broadcast probe response msg for %s\n", ++ bss->ifname); ++ return -1; ++ } ++ ++ nla_nest_end(msg, attr); ++ return 0; ++} ++#endif /* CONFIG_IEEE80211AX */ ++ + static int wpa_driver_nl80211_set_ap(void *priv, + struct wpa_driver_ap_params *params) + { +@@ -4560,8 +4628,18 @@ static int wpa_driver_nl80211_set_ap(voi + if (nla_put_flag(msg, NL80211_ATTR_TWT_RESPONDER)) + goto fail; + } ++ ++ ret = nl80211_unsol_bcast_probe_resp(bss, msg, params); ++ if (ret < 0) ++ goto fail; + #endif /* CONFIG_IEEE80211AX */ + ++#ifdef CONFIG_FILS ++ ret = nl80211_fils_discovery(bss, msg, params); ++ if (ret < 0) ++ goto fail; ++#endif /* CONFIG_FILS */ ++ + ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1, + NULL, NULL, NULL, NULL); + if (ret) { +Index: hostapd-2020-07-02-58b384f4/src/drivers/nl80211_copy.h +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/drivers/nl80211_copy.h ++++ hostapd-2020-07-02-58b384f4/src/drivers/nl80211_copy.h +@@ -2514,6 +2514,14 @@ enum nl80211_commands { + * @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the + NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command. + * ++ * @NL80211_ATTR_FILS_DISCOVERY: Optional parameter to configure FILS ++ * discovery. It is a nested attribute, see ++ * &enum nl80211_fils_discovery_attributes. ++ * ++ * @NL80211_ATTR_UNSOL_BCAST_PROBE_RESP: Optional parameter to configure ++ * unsolicited broadcast probe response. It is a nested attribute, see ++ * &enum nl80211_unsol_bcast_probe_resp_attributes. ++ * + * @NUM_NL80211_ATTR: total number of nl80211_attrs available + * @NL80211_ATTR_MAX: highest attribute number currently defined + * @__NL80211_ATTR_AFTER_LAST: internal use +@@ -2997,6 +3005,11 @@ enum nl80211_attrs { + NL80211_ATTR_HE_6GHZ_CAPABILITY, + + NL80211_ATTR_HE_MUEDCA_PARAMS, ++ ++ NL80211_ATTR_FILS_DISCOVERY, ++ ++ NL80211_ATTR_UNSOL_BCAST_PROBE_RESP, ++ + /* add attributes here, update the policy in nl80211.c */ + + __NL80211_ATTR_AFTER_LAST, +@@ -6936,4 +6949,61 @@ enum nl80211_iftype_akm_attributes { + NL80211_IFTYPE_AKM_ATTR_MAX = __NL80211_IFTYPE_AKM_ATTR_LAST - 1, + }; + ++/** ++ * enum nl80211_fils_discovery_attributes - FILS discovery configuration ++ * from IEEE Std 802.11ai-2016, Annex C.3 MIB detail. ++ * ++ * @__NL80211_FILS_DISCOVERY_INVALID: Invalid ++ * ++ * @NL80211_FILS_DISCOVERY_INT_MIN: Minimum packet interval (u32, TU). ++ * Allowed range: 0..10000 (TU = Time Unit) ++ * @NL80211_FILS_DISCOVERY_INT_MAX: Maximum packet interval (u32, TU). ++ * Allowed range: 0..10000 (TU = Time Unit) ++ * @NL80211_FILS_DISCOVERY_TMPL: Optional FILS discovery template. ++ * It has contents of IEEE Std 802.11ai-2016 9.6.8.36 FILS discovery frame ++ * (Figure 9-687a). ++ * It may include 6GHz specific data specified in IEEE P802.11ax/D6.0, ++ * 9.6.7.36 FILS Discovery frame format. ++ * ++ * @__NL80211_FILS_DISCOVERY_LAST: Internal ++ * @NL80211_FILS_DISCOVERY_MAX: highest attribute ++ */ ++enum nl80211_fils_discovery_attributes { ++ __NL80211_FILS_DISCOVERY_INVALID, ++ ++ NL80211_FILS_DISCOVERY_INT_MIN, ++ NL80211_FILS_DISCOVERY_INT_MAX, ++ NL80211_FILS_DISCOVERY_TMPL, ++ ++ /* keep last */ ++ __NL80211_FILS_DISCOVERY_LAST, ++ NL80211_FILS_DISCOVERY_MAX = __NL80211_FILS_DISCOVERY_LAST - 1 ++}; ++ ++/** ++ * enum nl80211_unsol_bcast_probe_resp_attributes - Unsolicited broadcast probe ++ * response configuration. Applicable only in 6GHz. ++ * ++ * @__NL80211_UNSOL_BCAST_PROBE_RESP_INVALID: Invalid ++ * ++ * @NL80211_UNSOL_BCAST_PROBE_RESP_INT: Maximum packet interval (u32, TU). ++ * Allowed range: 0..20 (TU = Time Unit). IEEE P802.11ax/D6.0 ++ * 26.17.2.3.2 (AP behavior for fast passive scanning. ++ * @NL80211_UNSOL_BCAST_PROBE_RESP_TMPL: Unsolicited broadcast probe response ++ * frame template (binary). ++ * ++ * @__NL80211_UNSOL_BCAST_PROBE_RESP_LAST: Internal ++ * @NL80211_UNSOL_BCAST_PROBE_RESP_MAX: highest attribute ++ */ ++enum nl80211_unsol_bcast_probe_resp_attributes { ++ __NL80211_UNSOL_BCAST_PROBE_RESP_INVALID, ++ ++ NL80211_UNSOL_BCAST_PROBE_RESP_INT, ++ NL80211_UNSOL_BCAST_PROBE_RESP_TMPL, ++ ++ /* keep last */ ++ __NL80211_UNSOL_BCAST_PROBE_RESP_LAST, ++ NL80211_UNSOL_BCAST_PROBE_RESP_MAX = ++ __NL80211_UNSOL_BCAST_PROBE_RESP_LAST - 1 ++}; + #endif /* __LINUX_NL80211_H */ diff --git a/feeds/wifi-ax/hostapd/patches/800-multiple_bssid-add-support.patch b/feeds/wifi-ax/hostapd/patches/d00-011-01-multiple_bssid-add-the-config-file.patch similarity index 53% rename from feeds/wifi-ax/hostapd/patches/800-multiple_bssid-add-support.patch rename to feeds/wifi-ax/hostapd/patches/d00-011-01-multiple_bssid-add-the-config-file.patch index 4817b4cb1..e8db36ab5 100644 --- a/feeds/wifi-ax/hostapd/patches/800-multiple_bssid-add-support.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-011-01-multiple_bssid-add-the-config-file.patch @@ -1,76 +1,154 @@ -From 23c244c8ab916b04c5ecfc3572e5368e3d5edf13 Mon Sep 17 00:00:00 2001 +From be8312cd122fbe35e45173d23e936fa1b76e56e8 Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Fri, 9 Oct 2020 12:47:53 +0200 -Subject: [PATCH 800/813] multiple_bssid: add support +Date: Wed, 3 Jun 2020 16:32:11 +0200 +Subject: [PATCH 1/7] multiple_bssid: add the config file -Add support for multiple bssid. In order to be able to do EMA HW offloading -inside the kernel, we need to send the multiple bssid elemets inside a -dedicated nl80211 arreibute. +This patch adds a new config option to enable this feature. -Changes in V4 -* make the patch work with the latest mac80211 series - -Signed-off-by: Aloka Dixit Signed-off-by: John Crispin --- - hostapd/config_file.c | 4 ++ - hostapd/ctrl_iface.c | 3 + - src/ap/ap_config.h | 3 + - src/ap/beacon.c | 37 +++++++++- - src/ap/hostapd.c | 20 ++++++ - src/ap/hostapd.h | 2 + - src/ap/ieee802_11.c | 132 ++++++++++++++++++++++++++++++++++- - src/ap/ieee802_11.h | 5 ++ - src/ap/ieee802_11_shared.c | 2 + - src/common/ieee802_11_defs.h | 3 + - src/drivers/driver.h | 42 +++++++++++ - src/drivers/driver_nl80211.c | 32 ++++++++- - src/drivers/nl80211_copy.h | 19 +++++ - 13 files changed, 299 insertions(+), 5 deletions(-) + hostapd/config_file.c | 2 ++ + src/ap/ap_config.h | 2 ++ + 2 files changed, 4 insertions(+) Index: hostapd-2020-07-02-58b384f4/hostapd/config_file.c =================================================================== --- hostapd-2020-07-02-58b384f4.orig/hostapd/config_file.c +++ hostapd-2020-07-02-58b384f4/hostapd/config_file.c -@@ -4571,6 +4571,10 @@ static int hostapd_config_fill(struct ho +@@ -4587,6 +4587,8 @@ static int hostapd_config_fill(struct ho } bss->mka_psk_set |= MKA_PSK_SET_CKN; #endif /* CONFIG_MACSEC */ + } else if (os_strcmp(buf, "multiple_bssid") == 0) { + conf->multiple_bssid = atoi(pos); -+ } else if (os_strcmp(buf, "ema_beacon") == 0) { -+ conf->ema_beacon = atoi(pos); } else { wpa_printf(MSG_ERROR, "Line %d: unknown configuration item '%s'", -Index: hostapd-2020-07-02-58b384f4/hostapd/ctrl_iface.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/hostapd/ctrl_iface.c -+++ hostapd-2020-07-02-58b384f4/hostapd/ctrl_iface.c -@@ -2729,6 +2729,9 @@ static int hostapd_ctrl_iface_chan_switc - * submitting multi-BSS CSA requests? */ - return ret; - } -+ -+ if (iface->bss[i]->iconf->multiple_bssid) -+ break; - } - - return 0; Index: hostapd-2020-07-02-58b384f4/src/ap/ap_config.h =================================================================== --- hostapd-2020-07-02-58b384f4.orig/src/ap/ap_config.h +++ hostapd-2020-07-02-58b384f4/src/ap/ap_config.h -@@ -991,6 +991,9 @@ struct hostapd_config { +@@ -1001,6 +1001,8 @@ struct hostapd_config { u8 vht_oper_centr_freq_seg1_idx; u8 ht40_plus_minus_allowed; + u8 multiple_bssid; -+ u8 ema_beacon; + /* Use driver-generated interface addresses when adding multiple BSSs */ u8 use_driver_iface_addr; +Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.c +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/ap/hostapd.c ++++ hostapd-2020-07-02-58b384f4/src/ap/hostapd.c +@@ -87,6 +87,26 @@ int hostapd_for_each_interface(struct ha + } + + ++int hostapd_get_bss_index(struct hostapd_data *hapd) ++{ ++ size_t i; ++ ++ for (i = 1; i < hapd->iface->num_bss; i++) ++ if (hapd->iface->bss[i] == hapd) ++ return i; ++ return 0; ++} ++ ++ ++struct hostapd_data * hostapd_get_primary_bss(struct hostapd_data *hapd) ++{ ++ if (hapd->iconf->multiple_bssid) ++ return hapd->iface->bss[0]; ++ ++ return hapd; ++} ++ ++ + void hostapd_reconfig_encryption(struct hostapd_data *hapd) + { + if (hapd->wpa_auth) +@@ -1182,6 +1202,13 @@ static int hostapd_setup_bss(struct host + + if (!first || first == -1) { + u8 *addr = hapd->own_addr; ++ int multiple_bssid_non_transmitted = false; ++ const char *multiple_bssid_parent = NULL; ++ ++ if (hapd->iconf->multiple_bssid) { ++ multiple_bssid_non_transmitted = true; ++ multiple_bssid_parent = hapd->iface->bss[0]->conf->iface; ++ } + + if (!is_zero_ether_addr(conf->bssid)) { + /* Allocate the configured BSSID. */ +@@ -1209,7 +1236,7 @@ static int hostapd_setup_bss(struct host + conf->iface, addr, hapd, + &hapd->drv_priv, force_ifname, if_addr, + conf->bridge[0] ? conf->bridge : NULL, +- first == -1)) { ++ first == -1, multiple_bssid_non_transmitted, multiple_bssid_parent)) { + wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID=" + MACSTR ")", MAC2STR(hapd->own_addr)); + hapd->interface_added = 0; +Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.h +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/ap/hostapd.h ++++ hostapd-2020-07-02-58b384f4/src/ap/hostapd.h +@@ -598,6 +598,8 @@ struct hostapd_iface { + int hostapd_for_each_interface(struct hapd_interfaces *interfaces, + int (*cb)(struct hostapd_iface *iface, + void *ctx), void *ctx); ++int hostapd_get_bss_index(struct hostapd_data *hapd); ++struct hostapd_data * hostapd_get_primary_bss(struct hostapd_data *hapd); + int hostapd_reload_config(struct hostapd_iface *iface, int reconf); + void hostapd_reconfig_encryption(struct hostapd_data *hapd); + struct hostapd_data * +Index: hostapd-2020-07-02-58b384f4/src/ap/ap_drv_ops.c +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/ap/ap_drv_ops.c ++++ hostapd-2020-07-02-58b384f4/src/ap/ap_drv_ops.c +@@ -321,7 +321,7 @@ int hostapd_vlan_if_add(struct hostapd_d + char force_ifname[IFNAMSIZ]; + u8 if_addr[ETH_ALEN]; + return hostapd_if_add(hapd, WPA_IF_AP_VLAN, ifname, hapd->own_addr, +- NULL, NULL, force_ifname, if_addr, NULL, 0); ++ NULL, NULL, force_ifname, if_addr, NULL, 0, 0, NULL); + } + + +@@ -497,13 +497,15 @@ int hostapd_set_ssid(struct hostapd_data + int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type, + const char *ifname, const u8 *addr, void *bss_ctx, + void **drv_priv, char *force_ifname, u8 *if_addr, +- const char *bridge, int use_existing) ++ const char *bridge, int use_existing, ++ int multi_bssid_mode, const char *multi_bssid_parent) + { + if (hapd->driver == NULL || hapd->driver->if_add == NULL) + return -1; + return hapd->driver->if_add(hapd->drv_priv, type, ifname, addr, + bss_ctx, drv_priv, force_ifname, if_addr, +- bridge, use_existing, 1); ++ bridge, use_existing, 1, ++ multi_bssid_mode, multi_bssid_parent); + } + + +Index: hostapd-2020-07-02-58b384f4/src/ap/ap_drv_ops.h +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/ap/ap_drv_ops.h ++++ hostapd-2020-07-02-58b384f4/src/ap/ap_drv_ops.h +@@ -54,7 +54,8 @@ int hostapd_set_ssid(struct hostapd_data + int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type, + const char *ifname, const u8 *addr, void *bss_ctx, + void **drv_priv, char *force_ifname, u8 *if_addr, +- const char *bridge, int use_existing); ++ const char *bridge, int use_existin, ++ int multi_bssid_mode, const char *multi_bssid_parent); + int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type, + const char *ifname); + int hostapd_set_ieee8021x(struct hostapd_data *hapd, Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c =================================================================== --- hostapd-2020-07-02-58b384f4.orig/src/ap/beacon.c @@ -103,7 +181,7 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c resp = os_zalloc(buflen); if (resp == NULL) -@@ -527,6 +532,9 @@ static u8 * hostapd_gen_probe_resp(struc +@@ -529,6 +534,9 @@ static u8 * hostapd_gen_probe_resp(struc pos = hostapd_eid_rm_enabled_capab(hapd, pos, epos - pos); pos = hostapd_get_mde(hapd, pos, epos - pos); @@ -113,7 +191,7 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c /* eCSA IE */ csa_pos = hostapd_eid_ecsa(hapd, pos); if (csa_pos != pos) -@@ -824,6 +832,10 @@ void handle_probe_req(struct hostapd_dat +@@ -826,6 +834,10 @@ void handle_probe_req(struct hostapd_dat .elems = &elems, }; @@ -124,7 +202,7 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c if (len < IEEE80211_HDRLEN) return; ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN; -@@ -1073,7 +1085,7 @@ void handle_probe_req(struct hostapd_dat +@@ -1075,7 +1087,7 @@ void handle_probe_req(struct hostapd_dat hapd->cs_c_off_ecsa_proberesp; } @@ -133,18 +211,18 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c csa_offs_len ? csa_offs : NULL, csa_offs_len, 0); -@@ -1473,6 +1485,8 @@ void ieee802_11_free_ap_params(struct wp +@@ -1755,6 +1767,8 @@ void ieee802_11_free_ap_params(struct wp params->head = NULL; os_free(params->proberesp); params->proberesp = NULL; + os_free(params->multiple_bssid_ies); + params->multiple_bssid_ies = NULL; - } - - -@@ -1513,6 +1527,25 @@ int ieee802_11_set_beacon(struct hostapd - params.twt_responder = hostapd_get_he_twt_responder(hapd, - IEEE80211_MODE_AP); + #ifdef CONFIG_FILS + os_free(params->fils_discovery_tmpl); + params->fils_discovery_tmpl = NULL; +@@ -1805,6 +1819,22 @@ int ieee802_11_set_beacon(struct hostapd + params.unsol_bcast_probe_resp_tmpl = + hostapd_unsol_bcast_probe_resp(hapd, ¶ms); #endif /* CONFIG_IEEE80211AX */ + if (hapd->iconf->multiple_bssid) { + int len = hostapd_eid_multiple_bssid_len(hapd); @@ -152,9 +230,6 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c + + params.multiple_bssid_index = hostapd_get_bss_index(hapd); + params.multiple_bssid_count = iface->num_bss; -+ params.ema_beacon = hapd->iconf->ema_beacon; -+ if (hapd != hapd->iface->bss[0]) -+ params.multiple_bssid_parent = hapd->iface->bss[0]->conf->iface; + params.multiple_bssid_ies = os_zalloc(len); + if (params.multiple_bssid_ies == NULL) + goto fail; @@ -167,51 +242,287 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c + } hapd->reenable_beacon = 0; - if (cmode && -Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.c + #ifdef CONFIG_FILS +Index: hostapd-2020-07-02-58b384f4/src/drivers/driver.h =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/hostapd.c -+++ hostapd-2020-07-02-58b384f4/src/ap/hostapd.c -@@ -87,6 +87,26 @@ int hostapd_for_each_interface(struct ha +--- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver.h ++++ hostapd-2020-07-02-58b384f4/src/drivers/driver.h +@@ -1222,6 +1222,8 @@ struct wowlan_triggers { + u8 rfkill_release; + }; + ++#define MULTIPLE_BSSID_IE_MAX 8 ++ + struct wpa_driver_ap_params { + /** + * head - Beacon head from IEEE 802.11 header to IEs before TIM IE +@@ -1553,6 +1555,41 @@ struct wpa_driver_ap_params { + * Unsolicited broadcast probe response template length + */ + size_t unsol_bcast_probe_resp_tmpl_len; ++ ++ /** ++ * multiple_bssid_non_transmitted - Is this a non transmitted BSS ++ */ ++ int multiple_bssid_non_transmitted; ++ ++ /** ++ * multiple_bssid_index - The index of this BSS in the group ++ */ ++ unsigned int multiple_bssid_index; ++ ++ /** ++ * multiple_bssid_count - The number of BSSs in the group ++ */ ++ unsigned int multiple_bssid_count; ++ ++ /** ++ * multiple_bssid_ies - This buffer contains all of the IEs ++ */ ++ u8 *multiple_bssid_ies; ++ ++ /** ++ * multiple_bssid_ie_len - The IE buffer length ++ */ ++ int multiple_bssid_ie_len; ++ ++ /** ++ * multiple_bssid_ie_offsets - The offsets to the IEs inside multiple_bssid_ies ++ */ ++ u8 *multiple_bssid_ie_offsets[MULTIPLE_BSSID_IE_MAX]; ++ ++ /** ++ * multiple_bssid_ie_count - The the number of offsets inside multiple_bssid_ie_offsets ++ */ ++ int multiple_bssid_ie_count; + }; + + struct wpa_driver_mesh_bss_params { +@@ -3294,7 +3331,8 @@ struct wpa_driver_ops { + int (*if_add)(void *priv, enum wpa_driver_if_type type, + const char *ifname, const u8 *addr, void *bss_ctx, + void **drv_priv, char *force_ifname, u8 *if_addr, +- const char *bridge, int use_existing, int setup_ap); ++ const char *bridge, int use_existing, int setup_ap, ++ int multi_bssid_mode, const char *multi_bssid_parent); + + /** + * if_remove - Remove a virtual interface +Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/driver_i.h +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/driver_i.h ++++ hostapd-2020-07-02-58b384f4/wpa_supplicant/driver_i.h +@@ -444,7 +444,7 @@ static inline int wpa_drv_if_add(struct + if (wpa_s->driver->if_add) + return wpa_s->driver->if_add(wpa_s->drv_priv, type, ifname, + addr, bss_ctx, NULL, force_ifname, +- if_addr, bridge, 0, 0); ++ if_addr, bridge, 0, 0, 0, NULL); + return -1; } - -+int hostapd_get_bss_index(struct hostapd_data *hapd) -+{ -+ size_t i; -+ -+ for (i = 1; i < hapd->iface->num_bss; i++) -+ if (hapd->iface->bss[i] == hapd) -+ return i; -+ return 0; -+} -+ -+ -+struct hostapd_data * hostapd_get_primary_bss(struct hostapd_data *hapd) -+{ -+ if (hapd->iconf->multiple_bssid) -+ return hapd->iface->bss[0]; -+ -+ return hapd; -+} -+ -+ - void hostapd_reconfig_encryption(struct hostapd_data *hapd) - { - if (hapd->wpa_auth) -Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.h +Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/hostapd.h -+++ hostapd-2020-07-02-58b384f4/src/ap/hostapd.h -@@ -598,6 +598,8 @@ struct hostapd_iface { - int hostapd_for_each_interface(struct hapd_interfaces *interfaces, - int (*cb)(struct hostapd_iface *iface, - void *ctx), void *ctx); -+int hostapd_get_bss_index(struct hostapd_data *hapd); -+struct hostapd_data * hostapd_get_primary_bss(struct hostapd_data *hapd); - int hostapd_reload_config(struct hostapd_iface *iface, int reconf); - void hostapd_reconfig_encryption(struct hostapd_data *hapd); - struct hostapd_data * +--- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver_nl80211.c ++++ hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c +@@ -4640,6 +4640,27 @@ static int wpa_driver_nl80211_set_ap(voi + goto fail; + #endif /* CONFIG_FILS */ + ++ if (params->multiple_bssid_count) { ++ nla_put_u8(msg, NL80211_ATTR_MULTIPLE_BSSID_INDEX, ++ params->multiple_bssid_index); ++ nla_put_u8(msg, NL80211_ATTR_MULTIPLE_BSSID_COUNT, ++ params->multiple_bssid_count); ++ } ++ ++ if (params->multiple_bssid_ie_len) { ++ struct nlattr *ies = nla_nest_start(msg, NL80211_ATTR_MULTIPLE_BSSID_IES); ++ u8 **offs = params->multiple_bssid_ie_offsets; ++ int i; ++ ++ for (i = 0; i < params->multiple_bssid_ie_count - 1; i++) ++ nla_put(msg, i + 1, ++ offs[i + 1] - offs[i], offs[i]); ++ nla_put(msg, i + 1, ++ *offs + params->multiple_bssid_ie_len - offs[i], ++ offs[i]); ++ nla_nest_end(msg, ies); ++ } ++ + ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1, + NULL, NULL, NULL, NULL); + if (ret) { +@@ -5232,13 +5253,13 @@ const char * nl80211_iftype_str(enum nl8 + } + } + +- + static int nl80211_create_iface_once(struct wpa_driver_nl80211_data *drv, + const char *ifname, + enum nl80211_iftype iftype, + const u8 *addr, int wds, + int (*handler)(struct nl_msg *, void *), +- void *arg) ++ void *arg, int multiple_bssid_non_transmitted, ++ const char *multiple_bssid_parent) + { + struct nl_msg *msg; + int ifidx; +@@ -5267,6 +5288,17 @@ static int nl80211_create_iface_once(str + goto fail; + } + ++ if (multiple_bssid_non_transmitted) { ++ if (!multiple_bssid_parent) ++ goto fail; ++ ifidx = if_nametoindex(multiple_bssid_parent); ++ if (ifidx <= 0) ++ goto fail; ++ nla_put_flag(msg, NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING); ++ nla_put_u32(msg, NL80211_ATTR_MULTIPLE_BSSID_PARENT, ++ ifidx); ++ } ++ + /* + * Tell cfg80211 that the interface belongs to the socket that created + * it, and the interface should be deleted when the socket is closed. +@@ -5320,12 +5352,15 @@ int nl80211_create_iface(struct wpa_driv + const char *ifname, enum nl80211_iftype iftype, + const u8 *addr, int wds, + int (*handler)(struct nl_msg *, void *), +- void *arg, int use_existing) ++ void *arg, int use_existing, ++ int multiple_bssid_non_transmitted, ++ const char *multiple_bssid_parent) + { + int ret; + + ret = nl80211_create_iface_once(drv, ifname, iftype, addr, wds, handler, +- arg); ++ arg, multiple_bssid_non_transmitted, ++ multiple_bssid_parent); + + /* if error occurred and interface exists already */ + if (ret == -ENFILE && if_nametoindex(ifname)) { +@@ -5351,7 +5386,9 @@ int nl80211_create_iface(struct wpa_driv + + /* Try to create the interface again */ + ret = nl80211_create_iface_once(drv, ifname, iftype, addr, +- wds, handler, arg); ++ wds, handler, arg, ++ multiple_bssid_non_transmitted, ++ multiple_bssid_parent); + } + + if (ret >= 0 && is_p2p_net_interface(iftype)) { +@@ -7331,7 +7368,7 @@ static int i802_set_wds_sta(void *priv, + if (!if_nametoindex(name)) { + if (nl80211_create_iface(drv, name, + NL80211_IFTYPE_AP_VLAN, +- bss->addr, 1, NULL, NULL, 0) < ++ bss->addr, 1, NULL, NULL, 0, 0, NULL) < + 0) + return -1; + if (bridge_ifname && +@@ -7678,7 +7715,9 @@ static int wpa_driver_nl80211_if_add(voi + void *bss_ctx, void **drv_priv, + char *force_ifname, u8 *if_addr, + const char *bridge, int use_existing, +- int setup_ap) ++ int setup_ap, ++ int multiple_bssid_non_transmitted, ++ const char *multiple_bssid_parent) + { + enum nl80211_iftype nlmode; + struct i802_bss *bss = priv; +@@ -7695,7 +7734,8 @@ static int wpa_driver_nl80211_if_add(voi + os_memset(&p2pdev_info, 0, sizeof(p2pdev_info)); + ifidx = nl80211_create_iface(drv, ifname, nlmode, addr, + 0, nl80211_wdev_handler, +- &p2pdev_info, use_existing); ++ &p2pdev_info, use_existing, ++ 0, NULL); + if (!p2pdev_info.wdev_id_set || ifidx != 0) { + wpa_printf(MSG_ERROR, "nl80211: Failed to create a P2P Device interface %s", + ifname); +@@ -7711,7 +7751,9 @@ static int wpa_driver_nl80211_if_add(voi + (long long unsigned int) p2pdev_info.wdev_id); + } else { + ifidx = nl80211_create_iface(drv, ifname, nlmode, addr, +- 0, NULL, NULL, use_existing); ++ 0, NULL, NULL, use_existing, ++ multiple_bssid_non_transmitted, ++ multiple_bssid_parent); + if (use_existing && ifidx == -ENFILE) { + added = 0; + ifidx = if_nametoindex(ifname); +Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.h +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver_nl80211.h ++++ hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.h +@@ -240,7 +240,9 @@ int nl80211_create_iface(struct wpa_driv + const char *ifname, enum nl80211_iftype iftype, + const u8 *addr, int wds, + int (*handler)(struct nl_msg *, void *), +- void *arg, int use_existing); ++ void *arg, int use_existing, ++ int multi_bssid_mode, ++ const char *multi_bssid_parent); + void nl80211_remove_iface(struct wpa_driver_nl80211_data *drv, int ifidx); + unsigned int nl80211_get_assoc_freq(struct wpa_driver_nl80211_data *drv); + int nl80211_get_assoc_ssid(struct wpa_driver_nl80211_data *drv, u8 *ssid); +Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211_monitor.c +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver_nl80211_monitor.c ++++ hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211_monitor.c +@@ -381,7 +381,7 @@ int nl80211_create_monitor_interface(str + + drv->monitor_ifidx = + nl80211_create_iface(drv, buf, NL80211_IFTYPE_MONITOR, NULL, +- 0, NULL, NULL, 0); ++ 0, NULL, NULL, 0, 0, NULL); + + if (drv->monitor_ifidx == -EOPNOTSUPP) { + /* +Index: hostapd-2020-07-02-58b384f4/src/drivers/nl80211_copy.h +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/src/drivers/nl80211_copy.h ++++ hostapd-2020-07-02-58b384f4/src/drivers/nl80211_copy.h +@@ -2522,6 +2522,20 @@ enum nl80211_commands { + * unsolicited broadcast probe response. It is a nested attribute, see + * &enum nl80211_unsol_bcast_probe_resp_attributes. + * ++ * @NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING: Set the Non-Transmitted flag for this ++ * BSSIDs beacon. ++ * ++ * @NL80211_ATTR_MULTIPLE_BSSID_PARENT: If this is a Non-Transmitted BSSID, define ++ * the parent (transmitting) interface. ++ * ++ * @NL80211_ATTR_MULTIPLE_BSSID_INDEX: The index of this BSS inside the multi bssid ++ * element. ++ * ++ * @NL80211_ATTR_MULTIPLE_BSSID_COUNT: The number of BSSs inside the multi bssid element. ++ * ++ * @NL80211_ATTR_MULTIPLE_BSSID_IES: The Elements that describe our multiple BSS group. ++ * these get passed separately as the kernel might need to split them up for EMA VAP. ++ * + * @NUM_NL80211_ATTR: total number of nl80211_attrs available + * @NL80211_ATTR_MAX: highest attribute number currently defined + * @__NL80211_ATTR_AFTER_LAST: internal use +@@ -3010,6 +3024,12 @@ enum nl80211_attrs { + + NL80211_ATTR_UNSOL_BCAST_PROBE_RESP, + ++ NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING, ++ NL80211_ATTR_MULTIPLE_BSSID_PARENT, ++ NL80211_ATTR_MULTIPLE_BSSID_INDEX, ++ NL80211_ATTR_MULTIPLE_BSSID_COUNT, ++ NL80211_ATTR_MULTIPLE_BSSID_IES, ++ + /* add attributes here, update the policy in nl80211.c */ + + __NL80211_ATTR_AFTER_LAST, Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.c =================================================================== --- hostapd-2020-07-02-58b384f4.orig/src/ap/ieee802_11.c @@ -246,7 +557,7 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.c hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_INFO, "No room for more AIDs"); resp = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; -@@ -5645,4 +5650,127 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct +@@ -5645,4 +5650,117 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct return eid; } @@ -299,7 +610,7 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.c + + for (i = *count; i < hapd->iface->num_bss; i++) { + struct hostapd_data *bss = hapd->iface->bss[i]; -+ u8 *bss_size_offset, *index_size_offset, *pos = eid, *rsn; ++ u8 *bss_size_offset, *index_size_offset, *pos = eid; + u16 capab_info; + + *eid++ = WLAN_EID_SUBELEMENT_NONTRANSMITTED_BSSID_PROFILE; @@ -325,17 +636,7 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.c + } + *index_size_offset = (eid - index_size_offset) - 1; + -+ rsn = hostapd_get_rsne(bss, eid, end - eid); -+ if (rsn == eid) { -+ /* add RSN non-inheritance IE */ -+ *eid++ = WLAN_EID_EXTENSION; -+ *eid++ = 3; -+ *eid++ = WLAN_EID_EXT_NON_INHERITANCE; -+ *eid++ = 1; -+ *eid++ = WLAN_EID_RSN; -+ } else { -+ eid = rsn; -+ } ++ eid = hostapd_get_rsne(bss, eid, end - eid); + *bss_size_offset = (eid - bss_size_offset) - 1; + + if ((eid - size_offset) - 1 > 255) { @@ -378,37 +679,25 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.h =================================================================== --- hostapd-2020-07-02-58b384f4.orig/src/ap/ieee802_11.h +++ hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.h -@@ -119,6 +119,10 @@ u8 * hostapd_eid_time_zone(struct hostap +@@ -119,7 +119,10 @@ u8 * hostapd_eid_time_zone(struct hostap int hostapd_update_time_adv(struct hostapd_data *hapd); void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid); +- +u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, u8 *eid, u8 *end, + u8 is_beacon, u8 **eid_offsets, int *eid_count, + int eid_max); +int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd); - int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); #ifdef CONFIG_SAE -@@ -194,5 +198,6 @@ int get_tx_parameters(struct sta_info *s + void sae_clear_retransmit_timer(struct hostapd_data *hapd, +@@ -197,5 +200,6 @@ int get_tx_parameters(struct sta_info *s void auth_sae_process_commit(void *eloop_ctx, void *user_ctx); u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len); +u8 * hostapd_get_rsne(struct hostapd_data *hapd, u8 *pos, size_t len); #endif /* IEEE802_11_H */ -Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11_shared.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ieee802_11_shared.c -+++ hostapd-2020-07-02-58b384f4/src/ap/ieee802_11_shared.c -@@ -356,6 +356,8 @@ static void hostapd_ext_capab_byte(struc - *pos |= 0x02; /* Bit 17 - WNM-Sleep Mode */ - if (hapd->conf->bss_transition) - *pos |= 0x08; /* Bit 19 - BSS Transition */ -+ if (hapd->iconf->multiple_bssid) -+ *pos |= 0x40; /* Bit 22 - Multiple BSSID */ - break; - case 3: /* Bits 24-31 */ - #ifdef CONFIG_WNM_AP Index: hostapd-2020-07-02-58b384f4/src/common/ieee802_11_defs.h =================================================================== --- hostapd-2020-07-02-58b384f4.orig/src/common/ieee802_11_defs.h @@ -422,121 +711,16 @@ Index: hostapd-2020-07-02-58b384f4/src/common/ieee802_11_defs.h /* Element ID Extension (EID 255) values */ #define WLAN_EID_EXT_ASSOC_DELAY_INFO 1 #define WLAN_EID_EXT_FILS_REQ_PARAMS 2 -@@ -474,6 +476,7 @@ - #define WLAN_EID_EXT_HE_MU_EDCA_PARAMS 38 - #define WLAN_EID_EXT_SPATIAL_REUSE 39 - #define WLAN_EID_EXT_OCV_OCI 54 -+#define WLAN_EID_EXT_NON_INHERITANCE 56 - #define WLAN_EID_EXT_SHORT_SSID_LIST 58 - #define WLAN_EID_EXT_HE_6GHZ_BAND_CAP 59 - #define WLAN_EID_EXT_EDMG_CAPABILITIES 61 -Index: hostapd-2020-07-02-58b384f4/src/drivers/driver.h +Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11_shared.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver.h -+++ hostapd-2020-07-02-58b384f4/src/drivers/driver.h -@@ -1216,6 +1216,8 @@ struct wowlan_triggers { - u8 rfkill_release; - }; - -+#define MULTIPLE_BSSID_IE_MAX 8 -+ - struct wpa_driver_ap_params { - /** - * head - Beacon head from IEEE 802.11 header to IEs before TIM IE -@@ -1512,6 +1514,46 @@ struct wpa_driver_ap_params { - * twt_responder - Whether Target Wait Time responder is enabled - */ - int twt_responder; -+ -+ /** -+ * multiple_bssid_parent - The transmitting iface -+ */ -+ const char *multiple_bssid_parent; -+ -+ /** -+ * multiple_bssid_index - The index of this BSS in the group -+ */ -+ unsigned int multiple_bssid_index; -+ -+ /** -+ * multiple_bssid_count - The number of BSSs in the group -+ */ -+ unsigned int multiple_bssid_count; -+ -+ /** -+ * multiple_bssid_ies - This buffer contains all of the IEs -+ */ -+ u8 *multiple_bssid_ies; -+ -+ /** -+ * multiple_bssid_ie_len - The IE buffer length -+ */ -+ int multiple_bssid_ie_len; -+ -+ /** -+ * multiple_bssid_ie_offsets - The offsets to the IEs inside multiple_bssid_ies -+ */ -+ u8 *multiple_bssid_ie_offsets[MULTIPLE_BSSID_IE_MAX]; -+ -+ /** -+ * multiple_bssid_ie_count - The the number of offsets inside multiple_bssid_ie_offsets -+ */ -+ int multiple_bssid_ie_count; -+ -+ /** -+ * ema_beacon - should the multiple_bssid beacons be sent out in EMA mode -+ */ -+ int ema_beacon; - }; - - struct wpa_driver_mesh_bss_params { -Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver_nl80211.c -+++ hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c -@@ -4562,6 +4562,37 @@ static int wpa_driver_nl80211_set_ap(voi - } - #endif /* CONFIG_IEEE80211AX */ - -+ if (params->multiple_bssid_count) { -+ nla_put_u8(msg, NL80211_ATTR_MULTIPLE_BSSID_INDEX, -+ params->multiple_bssid_index); -+ nla_put_u8(msg, NL80211_ATTR_MULTIPLE_BSSID_COUNT, -+ params->multiple_bssid_count); -+ if (params->ema_beacon) -+ nla_put_flag(msg, NL80211_ATTR_MULTIPLE_BSSID_EMA); -+ } -+ -+ if (params->multiple_bssid_parent) { -+ int ifidx = if_nametoindex(params->multiple_bssid_parent); -+ if (ifidx <= 0) -+ goto fail; -+ nla_put_u32(msg, NL80211_ATTR_MULTIPLE_BSSID_PARENT, -+ ifidx); -+ } -+ -+ if (params->multiple_bssid_ie_len) { -+ struct nlattr *ies = nla_nest_start(msg, NL80211_ATTR_MULTIPLE_BSSID_IES); -+ u8 **offs = params->multiple_bssid_ie_offsets; -+ int i; -+ -+ for (i = 0; i < params->multiple_bssid_ie_count - 1; i++) -+ nla_put(msg, i + 1, -+ offs[i + 1] - offs[i], offs[i]); -+ nla_put(msg, i + 1, -+ *offs + params->multiple_bssid_ie_len - offs[i], -+ offs[i]); -+ nla_nest_end(msg, ies); -+ } -+ - ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1, - NULL, NULL, NULL, NULL); - if (ret) { -@@ -5154,7 +5185,6 @@ const char * nl80211_iftype_str(enum nl8 - } - } - -- - static int nl80211_create_iface_once(struct wpa_driver_nl80211_data *drv, - const char *ifname, - enum nl80211_iftype iftype, +--- hostapd-2020-07-02-58b384f4.orig/src/ap/ieee802_11_shared.c ++++ hostapd-2020-07-02-58b384f4/src/ap/ieee802_11_shared.c +@@ -356,6 +356,8 @@ static void hostapd_ext_capab_byte(struc + *pos |= 0x02; /* Bit 17 - WNM-Sleep Mode */ + if (hapd->conf->bss_transition) + *pos |= 0x08; /* Bit 19 - BSS Transition */ ++ if (hapd->iconf->multiple_bssid) ++ *pos |= 0x40; /* Bit 22 - Multiple BSSID */ + break; + case 3: /* Bits 24-31 */ + #ifdef CONFIG_WNM_AP diff --git a/feeds/wifi-ax/hostapd/patches/810-rnr-move-crc32-generation-to-config-load-time.patch b/feeds/wifi-ax/hostapd/patches/d00-012a-hostapd-add-support-for-reduced-neighbour-report.patch similarity index 85% rename from feeds/wifi-ax/hostapd/patches/810-rnr-move-crc32-generation-to-config-load-time.patch rename to feeds/wifi-ax/hostapd/patches/d00-012a-hostapd-add-support-for-reduced-neighbour-report.patch index 827bfad31..c9aca1c83 100644 --- a/feeds/wifi-ax/hostapd/patches/810-rnr-move-crc32-generation-to-config-load-time.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-012a-hostapd-add-support-for-reduced-neighbour-report.patch @@ -1,7 +1,7 @@ -From 35e8a6d7f2ae34a1df281e3349cebee4d1a1b045 Mon Sep 17 00:00:00 2001 +From 96900cbc6ec0fa1af02458f7700301cbb1b56ca3 Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Thu, 18 Jun 2020 17:21:53 +0200 -Subject: [PATCH 810/813] rnr: move crc32 generation to config load time +Date: Wed, 24 Jun 2020 15:12:09 +0200 +Subject: [PATCH 1/4] RNR: move crc32 generation to config load time During config reload the short_ssid was getting flushed. Move the generation into the config loading code. @@ -13,7 +13,7 @@ Signed-off-by: John Crispin 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 9db6d159a..d7aa85e72 100644 +index 38d1dd7ac4ed..95cd779ec8a0 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -13,6 +13,7 @@ @@ -38,7 +38,7 @@ index 9db6d159a..d7aa85e72 100644 size_t slen; char *str = wpa_config_parse_string(pos, &slen); diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c -index 1992b38d6..f51083a23 100644 +index a23e05e556e9..bbb2c642bd19 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -13,7 +13,6 @@ @@ -49,7 +49,7 @@ index 1992b38d6..f51083a23 100644 #include "common/ieee802_11_defs.h" #include "common/wpa_ctrl.h" #include "common/hw_features_common.h" -@@ -1244,12 +1243,6 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) +@@ -1247,12 +1246,6 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) os_memcpy(conf->ssid.ssid, ssid, conf->ssid.ssid_len); } @@ -63,5 +63,4 @@ index 1992b38d6..f51083a23 100644 wpa_printf(MSG_DEBUG, "Using interface %s with hwaddr " MACSTR " and ssid \"%s\"", -- -2.25.1 - +2.17.1 diff --git a/feeds/wifi-ax/hostapd/patches/811-rnr-add-bss_parameters-to-the-neighbor_db.patch b/feeds/wifi-ax/hostapd/patches/d00-012b-hostapd-add-support-for-reduced-neighbour-report.patch similarity index 78% rename from feeds/wifi-ax/hostapd/patches/811-rnr-add-bss_parameters-to-the-neighbor_db.patch rename to feeds/wifi-ax/hostapd/patches/d00-012b-hostapd-add-support-for-reduced-neighbour-report.patch index 9920525ec..065379c2a 100644 --- a/feeds/wifi-ax/hostapd/patches/811-rnr-add-bss_parameters-to-the-neighbor_db.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-012b-hostapd-add-support-for-reduced-neighbour-report.patch @@ -1,12 +1,12 @@ -From 9eba95a674dc7e65fd6c4ba34eb1ed9db1d2dafa Mon Sep 17 00:00:00 2001 +From ce618acbef40f8a411e7458f3fece26930b538d0 Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Thu, 18 Jun 2020 17:35:42 +0200 -Subject: [PATCH 811/813] rnr: add bss_parameters to the neighbor_db +Date: Thu, 16 Jul 2020 17:05:45 -0700 +Subject: [PATCH 2/4] RNR: add bss_parameters to the neighbor_db -P802.11ax/D4.0 9.4.2.170 (Reduced Neighbor Report element) described this -field used inside reduced neighbor reports. It holds info about multiple -bssid and 6G co-location which was not present in the existing neighbor -reports. +P802.11ax/D4.0 9.4.2.170 (Reduced Neighbor Report element) described +this field used inside reduced neighbor reports. It holds info about +multiple ssid and 6G co-location which was not present in the +existing neighbor reports. Signed-off-by: John Crispin --- @@ -17,10 +17,10 @@ Signed-off-by: John Crispin 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c -index f99849771..00b20a349 100644 +index 0a5712e33305..f61210d5e282 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -3006,6 +3006,7 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf) +@@ -3004,6 +3004,7 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf) u8 bssid[ETH_ALEN]; struct wpabuf *nr, *lci = NULL, *civic = NULL; int stationary = 0; @@ -28,7 +28,7 @@ index f99849771..00b20a349 100644 char *tmp; int ret; -@@ -3090,9 +3091,22 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf) +@@ -3088,9 +3089,22 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf) if (os_strstr(buf, "stat")) stationary = 1; @@ -53,10 +53,10 @@ index f99849771..00b20a349 100644 wpabuf_free(nr); wpabuf_free(lci); diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h -index 19dcd1b51..a9050ebac 100644 +index cab845714135..e7eacd235fa5 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -138,6 +138,7 @@ struct hostapd_neighbor_entry { +@@ -139,6 +139,7 @@ struct hostapd_neighbor_entry { /* LCI update time */ struct os_time lci_date; int stationary; @@ -65,7 +65,7 @@ index 19dcd1b51..a9050ebac 100644 struct hostapd_sae_commit_queue { diff --git a/src/ap/neighbor_db.c b/src/ap/neighbor_db.c -index 3a4cdc004..eaf0650f1 100644 +index 97840681247b..4f8233c78bf3 100644 --- a/src/ap/neighbor_db.c +++ b/src/ap/neighbor_db.c @@ -120,7 +120,8 @@ hostapd_neighbor_add(struct hostapd_data *hapd) @@ -86,7 +86,7 @@ index 3a4cdc004..eaf0650f1 100644 return 0; -@@ -314,7 +316,7 @@ void hostapd_neighbor_set_own_report(struct hostapd_data *hapd) +@@ -329,7 +331,7 @@ void hostapd_neighbor_set_own_report(struct hostapd_data *hapd) wpabuf_put_u8(nr, center_freq2_idx); hostapd_neighbor_set(hapd, hapd->own_addr, &ssid, nr, hapd->iconf->lci, @@ -96,7 +96,7 @@ index 3a4cdc004..eaf0650f1 100644 wpabuf_free(nr); #endif /* NEED_AP_MLME */ diff --git a/src/ap/neighbor_db.h b/src/ap/neighbor_db.h -index bed0a2f5f..992671b62 100644 +index f15ea1aa411d..2b20d8920018 100644 --- a/src/ap/neighbor_db.h +++ b/src/ap/neighbor_db.h @@ -17,7 +17,8 @@ int hostapd_neighbor_show(struct hostapd_data *hapd, char *buf, size_t buflen); @@ -107,8 +107,7 @@ index bed0a2f5f..992671b62 100644 + const struct wpabuf *civic, int stationary, + u8 bss_parameters); void hostapd_neighbor_set_own_report(struct hostapd_data *hapd); - int hostapd_neighbor_remove(struct hostapd_data *hapd, const u8 *bssid, - const struct wpa_ssid_value *ssid); + int hostapd_prepare_neighbor_buf(struct hostapd_data *hapd, + const u8 *bssid, struct wpabuf *nrbuf); -- -2.25.1 - +2.17.1 diff --git a/feeds/wifi-ax/hostapd/patches/812-rnr-add-short_ssid-to-neighbor_db-entries.patch b/feeds/wifi-ax/hostapd/patches/d00-012c-hostapd-add-support-for-reduced-neighbour-report.patch similarity index 74% rename from feeds/wifi-ax/hostapd/patches/812-rnr-add-short_ssid-to-neighbor_db-entries.patch rename to feeds/wifi-ax/hostapd/patches/d00-012c-hostapd-add-support-for-reduced-neighbour-report.patch index edf2d08e9..b36a31a06 100644 --- a/feeds/wifi-ax/hostapd/patches/812-rnr-add-short_ssid-to-neighbor_db-entries.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-012c-hostapd-add-support-for-reduced-neighbour-report.patch @@ -1,9 +1,9 @@ -From 09978262c7d7d3d23b51afbbace502e6178c7c87 Mon Sep 17 00:00:00 2001 +From 1e28f602d70af2cc2c956d9bb41f09a248f5150f Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Thu, 18 Jun 2020 18:16:25 +0200 -Subject: [PATCH 812/813] rnr: add short_ssid to neighbor_db entries +Date: Wed, 24 Jun 2020 15:12:11 +0200 +Subject: [PATCH 3/4] RNR: add short_ssid to neighbor_db entries -The rnr IE requires this field. +The RNR IE requires this field. Signed-off-by: John Crispin --- @@ -12,10 +12,10 @@ Signed-off-by: John Crispin 2 files changed, 3 insertions(+) diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h -index a9050ebac..72cb8bd4f 100644 +index e7eacd235fa5..16ffeeb4ac82 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -139,6 +139,7 @@ struct hostapd_neighbor_entry { +@@ -140,6 +140,7 @@ struct hostapd_neighbor_entry { struct os_time lci_date; int stationary; u8 bss_parameters; @@ -24,7 +24,7 @@ index a9050ebac..72cb8bd4f 100644 struct hostapd_sae_commit_queue { diff --git a/src/ap/neighbor_db.c b/src/ap/neighbor_db.c -index eaf0650f1..b042b1daf 100644 +index 4f8233c78bf3..06f6691342a0 100644 --- a/src/ap/neighbor_db.c +++ b/src/ap/neighbor_db.c @@ -10,6 +10,7 @@ @@ -44,5 +44,4 @@ index eaf0650f1..b042b1daf 100644 entry->nr = wpabuf_dup(nr); if (!entry->nr) -- -2.25.1 - +2.17.1 diff --git a/feeds/wifi-ax/hostapd/patches/d00-012d-hostapd-add-support-for-reduced-neighbour-report.patch b/feeds/wifi-ax/hostapd/patches/d00-012d-hostapd-add-support-for-reduced-neighbour-report.patch new file mode 100644 index 000000000..3a4fc0a42 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/d00-012d-hostapd-add-support-for-reduced-neighbour-report.patch @@ -0,0 +1,200 @@ +From: John Crispin +Date: Thu, 16 Jul 2020 17:31:40 -0700 +Subject: [PATCH 4/4] RNR: add reduced neighbor reporting + +The Reduced Neighbor Report (RNR) element contains channel and other +information related to neighbor APs. It is part of the OCE requirement. + +Fix bssid field in RNR when there are multiple BSS. + +Signed-off-by: John Crispin +Signed-off-by: Pradeep Kumar Chitrapu +--- + hostapd/config_file.c | 2 + + hostapd/hostapd.conf | 3 ++ + src/ap/ap_config.h | 1 + + src/ap/beacon.c | 2 + + src/ap/ieee802_11.c | 89 ++++++++++++++++++++++++++++++++++++ + src/ap/ieee802_11.h | 2 + + src/common/ieee802_11_defs.h | 14 ++++++ + 7 files changed, 113 insertions(+) + +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -4592,6 +4592,8 @@ static int hostapd_config_fill(struct ho + #endif /* CONFIG_MACSEC */ + } else if (os_strcmp(buf, "multiple_bssid") == 0) { + conf->multiple_bssid = atoi(pos); ++ } else if (os_strcmp(buf, "rnr_beacon") == 0) { ++ bss->rnr_beacon = atoi(pos); + } else { + wpa_printf(MSG_ERROR, + "Line %d: unknown configuration item '%s'", +--- a/hostapd/hostapd.conf ++++ b/hostapd/hostapd.conf +@@ -2786,6 +2786,9 @@ own_ip_addr=127.0.0.1 + # that allows sending of such data. Default: 0. + #stationary_ap=0 + ++# Enable reduced neighbour reporting (RNR) ++#rnr_beacon=0 ++ + ##### Airtime policy configuration ########################################### + + # Set the airtime policy operating mode: +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -869,6 +869,7 @@ struct hostapd_bss_config { + #endif /* CONFIG_MACSEC */ + + u32 unsol_bcast_probe_resp_interval; ++ u8 rnr_beacon; + }; + + /** +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -1475,6 +1475,7 @@ int ieee802_11_build_ap_params(struct ho + tail_len += hostapd_mbo_ie_len(hapd); + tail_len += hostapd_eid_owe_trans_len(hapd); + tail_len += hostapd_eid_dpp_cc_len(hapd); ++ tail_len += hostapd_eid_reduced_neighbor_report_len(hapd); + + tailpos = tail = os_malloc(tail_len); + if (head == NULL || tail == NULL) { +@@ -1648,6 +1649,7 @@ int ieee802_11_build_ap_params(struct ho + tailpos = hostapd_eid_owe_trans(hapd, tailpos, + tail + tail_len - tailpos); + tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos); ++ tailpos = hostapd_eid_reduced_neighbor_report(hapd, tailpos); + + if (hapd->conf->vendor_elements) { + os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -5762,4 +5762,93 @@ u8 * hostapd_eid_multiple_bssid(struct h + return eid; + } + ++ ++size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd) ++{ ++ size_t len = 0; ++ ++ if (hapd->iface->num_bss > 1) ++ len += TBTT_HEADER_LENGTH + ((hapd->iface->num_bss - 1) * TBTT_INFO_LENGTH); ++ if (!dl_list_empty(&hapd->nr_db)) ++ len += dl_list_len(&hapd->nr_db) * (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH); ++ ++ return len; ++} ++ ++ ++u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid) ++{ ++ size_t len = hostapd_eid_reduced_neighbor_report_len(hapd); ++ struct hostapd_neighbor_entry *nr; ++ int i, count = 0; ++ ++ if (!len) ++ return eid; ++ ++ *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; ++ *eid++ = len; ++ ++ if (hapd->iface->num_bss > 1) { ++ u8 op_class, channel; ++ ++ if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA) || ++ !hapd->iface->freq) ++ goto nr_db; ++ ++ if (ieee80211_freq_to_channel_ext(hapd->iface->freq, ++ hapd->iconf->secondary_channel, ++ hostapd_get_oper_chwidth(hapd->iconf), ++ &op_class, &channel) == ++ NUM_HOSTAPD_MODES) ++ goto nr_db; ++ ++ *eid++ = TBTT_INFO_COUNT(hapd->iface->num_bss - 2); ++ *eid++ = TBTT_INFO_LENGTH; ++ *eid++ = op_class; ++ *eid++ = hapd->iconf->channel; ++ for (i = 0; i < hapd->iface->num_bss; i++) { ++ u8 bss_param = 0; ++ ++ if (hapd->iface->bss[i] == hapd) ++ continue; ++ *eid++ = TBTT_AP_OFFSET_UNKNOWN; ++ os_memcpy(eid, hapd->iface->bss[i]->conf->bssid, ETH_ALEN); ++ eid += 6; ++ os_memcpy(eid, &hapd->iface->bss[i]->conf->ssid.short_ssid, 4); ++ eid += 4; ++ if (hapd->iface->bss[i]->conf->ssid.short_ssid == ++ hapd->conf->ssid.short_ssid) ++ bss_param |= TBTT_BSS_PARAM_SAME_SSID; ++ if (hapd->iconf->multiple_bssid) ++ bss_param |= TBTT_BSS_PARAM_MULTIPLE_BSSID; ++ *eid++ = bss_param; ++ count++; ++ } ++ } ++ ++nr_db: ++ dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, ++ list) { ++ if (!nr->nr || wpabuf_len(nr->nr) < 12) ++ continue; ++ if (nr->short_ssid == hapd->conf->ssid.short_ssid) ++ continue; ++ *eid++ = 0; ++ *eid++ = TBTT_INFO_LENGTH; ++ *eid++ = wpabuf_head_u8(nr->nr)[10]; ++ *eid++ = wpabuf_head_u8(nr->nr)[11]; ++ *eid++ = TBTT_AP_OFFSET_UNKNOWN; ++ os_memcpy(eid, nr->bssid, ETH_ALEN); ++ eid += 6; ++ os_memcpy(eid, &nr->short_ssid, 4); ++ eid += 4; ++ *eid++ = nr->bss_parameters; ++ count++; ++ } ++ ++ if (!count) ++ eid -= 2; ++ return eid; ++} ++ + #endif /* CONFIG_NATIVE_WINDOWS */ +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h +@@ -123,6 +123,8 @@ u8 * hostapd_eid_multiple_bssid(struct h + u8 is_beacon, u8 **eid_offsets, int *eid_count, + int eid_max); + int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd); ++u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid); ++size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd); + int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); + #ifdef CONFIG_SAE + void sae_clear_retransmit_timer(struct hostapd_data *hapd, +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h +@@ -2387,4 +2387,18 @@ enum edmg_bw_config { + */ + #define FILS_DISCOVERY_CAP_PHY_INDEX_HE 4 + #define FILS_DISCOVERY_MAX_INTERVAL_6GHZ 20 ++ ++/* TBTT Information field defines */ ++#define TBTT_HEADER_LENGTH 4 ++#define TBTT_INFO_LENGTH 12 ++#define TBTT_INFO_FILTERED_NEIGH_AP BIT(2) ++#define TBTT_INFO_COUNT(x) (((x) & 0xf) << 4) ++#define TBTT_AP_OFFSET_UNKNOWN 255 ++#define TBTT_BSS_PARAM_OCT_RECOMMENDED BIT(0) ++#define TBTT_BSS_PARAM_SAME_SSID BIT(1) ++#define TBTT_BSS_PARAM_MULTIPLE_BSSID BIT(2) ++#define TBTT_BSS_PARAM_TRANSMITTED_BSSID BIT(3) ++#define TBTT_BSS_PARAM_CO_LOCATED_ESS BIT(4) ++#define TBTT_BSS_PARAM_20_TU_PROBE_RESP_ACTIVE BIT(5) ++ + #endif /* IEEE802_11_DEFS_H */ diff --git a/feeds/wifi-ax/hostapd/patches/e00-001-send-6ghz-cap-to-kernel-and-fix-6ghz-op-class.patch b/feeds/wifi-ax/hostapd/patches/e00-001-send-6ghz-cap-to-kernel-and-fix-6ghz-op-class.patch index f6a99decc..066cc2eaf 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-001-send-6ghz-cap-to-kernel-and-fix-6ghz-op-class.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-001-send-6ghz-cap-to-kernel-and-fix-6ghz-op-class.patch @@ -1,14 +1,12 @@ -Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver_nl80211.c -+++ hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c -@@ -4886,6 +4886,14 @@ static int wpa_driver_nl80211_sta_add(vo +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -4960,6 +4960,14 @@ static int wpa_driver_nl80211_sta_add(vo goto fail; } + if (params->he_6ghz_capab) { + wpa_hexdump(MSG_DEBUG, " * he_6ghz_capab", -+ params->he_6ghz_capab, sizeof(*params->he_6ghz_capab)); ++ (u8 *) params->he_6ghz_capab, sizeof(*params->he_6ghz_capab)); + if (nla_put(msg, NL80211_ATTR_HE_6GHZ_CAPABILITY, + sizeof(*params->he_6ghz_capab), params->he_6ghz_capab)) + goto fail; @@ -17,24 +15,8 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c if (params->ext_capab) { wpa_hexdump(MSG_DEBUG, " * ext_capab", params->ext_capab, params->ext_capab_len); -Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/hostapd.c -+++ hostapd-2020-07-02-58b384f4/src/ap/hostapd.c -@@ -1766,6 +1766,9 @@ static int setup_interface2(struct hosta - - ch_width = op_class_to_ch_width(iface->conf->op_class); - hostapd_set_oper_chwidth(iface->conf, ch_width); -+ if (is_6ghz_op_class(iface->conf->op_class) && !iface->conf->secondary_channel && -+ center_idx_to_bw_6ghz(iface->conf->he_oper_centr_freq_seg0_idx)) -+ iface->conf->secondary_channel = (((iface->conf->channel - 1) / 4 ) % 2) ? -1 : 1 ; - } - - ret = hostapd_select_hw_mode(iface); -Index: hostapd-2020-07-02-58b384f4/src/common/ieee802_11_common.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/common/ieee802_11_common.c -+++ hostapd-2020-07-02-58b384f4/src/common/ieee802_11_common.c +--- a/src/common/ieee802_11_common.c ++++ b/src/common/ieee802_11_common.c @@ -884,6 +884,7 @@ enum hostapd_hw_mode ieee80211_freq_to_c u8 *op_class, u8 *channel) { diff --git a/feeds/wifi-ax/hostapd/patches/e00-002-6G-enable-TX-power-envelope-IE-incase-of-6GHz.patch b/feeds/wifi-ax/hostapd/patches/e00-002-6G-enable-TX-power-envelope-IE-incase-of-6GHz.patch new file mode 100644 index 000000000..aa1ec76c9 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-002-6G-enable-TX-power-envelope-IE-incase-of-6GHz.patch @@ -0,0 +1,62 @@ +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -563,7 +563,6 @@ static u8 * hostapd_gen_probe_resp(struc + !is_6ghz_op_class(hapd->iconf->op_class)) { + pos = hostapd_eid_vht_capabilities(hapd, pos, 0); + pos = hostapd_eid_vht_operation(hapd, pos); +- pos = hostapd_eid_txpower_envelope(hapd, pos); + } + #endif /* CONFIG_IEEE80211AC */ + +@@ -571,6 +570,7 @@ static u8 * hostapd_gen_probe_resp(struc + hapd->iconf->ieee80211ax) + pos = hostapd_eid_wb_chsw_wrapper(hapd, pos); + ++ pos = hostapd_eid_txpower_envelope(hapd, pos); + pos = hostapd_eid_fils_indic(hapd, pos, 0); + pos = hostapd_get_rsnxe(hapd, pos, epos - pos); + +@@ -1577,7 +1577,6 @@ int ieee802_11_build_ap_params(struct ho + if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) { + tailpos = hostapd_eid_vht_capabilities(hapd, tailpos, 0); + tailpos = hostapd_eid_vht_operation(hapd, tailpos); +- tailpos = hostapd_eid_txpower_envelope(hapd, tailpos); + } + #endif /* CONFIG_IEEE80211AC */ + +@@ -1585,6 +1584,7 @@ int ieee802_11_build_ap_params(struct ho + hapd->iconf->ieee80211ax) + tailpos = hostapd_eid_wb_chsw_wrapper(hapd, tailpos); + ++ tailpos = hostapd_eid_txpower_envelope(hapd, tailpos); + tailpos = hostapd_eid_fils_indic(hapd, tailpos, 0); + tailpos = hostapd_get_rsnxe(hapd, tailpos, tailend - tailpos); + +--- a/src/ap/ieee802_11_vht.c ++++ b/src/ap/ieee802_11_vht.c +@@ -177,8 +177,10 @@ u8 * hostapd_eid_txpower_envelope(struct + u8 channel, tx_pwr_count, local_pwr_constraint; + int max_tx_power; + u8 tx_pwr; ++ u8 oper_chwidth; + +- if (!mode) ++ if (!mode || (!(hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) && ++ !hapd->iconf->ieee80211ax)) + return eid; + + if (ieee80211_freq_to_chan(iface->freq, &channel) == NUM_HOSTAPD_MODES) +@@ -191,7 +193,12 @@ u8 * hostapd_eid_txpower_envelope(struct + if (i == mode->num_channels) + return eid; + +- switch (iface->conf->vht_oper_chwidth) { ++ if (is_6ghz_op_class(iconf->op_class)) ++ oper_chwidth = iface->conf->he_oper_chwidth; ++ else ++ oper_chwidth = iface->conf->vht_oper_chwidth; ++ ++ switch (oper_chwidth) { + case CHANWIDTH_USE_HT: + if (iconf->secondary_channel == 0) { + /* Max Transmit Power count = 0 (20 MHz) */ diff --git a/feeds/wifi-ax/hostapd/patches/e00-003-6G-security-constraints.patch b/feeds/wifi-ax/hostapd/patches/e00-003-6G-security-constraints.patch new file mode 100644 index 000000000..77a4013b0 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-003-6G-security-constraints.patch @@ -0,0 +1,314 @@ +From dea995bbaf7693c59c37c08b69ac23d5a04d25eb Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Tue, 8 Sep 2020 16:36:32 -0700 +Subject: [PATCH] AP: Add 6GHz security constraints + +Add security constraints in 6GHz band as given in IEEE P802.11ax/D6.1, +section 12.13.2 (Security constraints in the 6 GHz band). + +Additionally this commit also adds checks for following: +(1) Make management frame protection mandatory in 6GHz. +(2) For WPA3-SAE, only H2E mechanism is allowed. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 2 + + src/drivers/driver.h | 14 ++++ + src/drivers/driver_nl80211.c | 140 +++++++++++++++++++++++++++++++---- + wpa_supplicant/ap.c | 1 + + 4 files changed, 144 insertions(+), 13 deletions(-) + +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index 26422b65f321..3094979907c3 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -1699,6 +1699,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + params->auth_algs = hapd->conf->auth_algs; + params->wpa_version = hapd->conf->wpa; + params->privacy = hapd->conf->wpa; ++ params->ieee80211w = hapd->conf->ieee80211w; ++ params->sae_pwe = hapd->conf->sae_pwe; + #ifdef CONFIG_WEP + params->privacy |= hapd->conf->ssid.wep.keys_set || + (hapd->conf->ieee802_1x && +diff --git a/src/drivers/driver.h b/src/drivers/driver.h +index 1a44254405ef..d574d8179c65 100644 +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -1201,6 +1201,10 @@ struct wpa_driver_associate_params { + */ + int disable_he; + #endif /* CONFIG_HE_OVERRIDES */ ++ /** ++ * PWE derivation mechanism for SAE ++ */ ++ int sae_pwe; + }; + + enum hide_ssid { +@@ -1592,6 +1596,16 @@ struct wpa_driver_ap_params { + * multiple_bssid_ie_count - The the number of offsets inside multiple_bssid_ie_offsets + */ + int multiple_bssid_ie_count; ++ ++ /** ++ * Management frame protection ++ */ ++ enum mfp_options ieee80211w; ++ ++ /** ++ * PWE derivation mechanism for SAE ++ */ ++ int sae_pwe; + }; + + struct wpa_driver_mesh_bss_params { +diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c +index 89607cfa3ecb..1c79c54c4018 100644 +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -4369,6 +4369,46 @@ static int nl80211_unsol_bcast_probe_resp(struct i802_bss *bss, + } + #endif /* CONFIG_IEEE80211AX */ + ++ ++static bool wpa_driver_6g_crypto_validity(int n_suite, u32 *suite, ++ u32 suite_type, int sae_pwe) ++{ ++ int i; ++ switch (suite_type) { ++ case NL80211_ATTR_AKM_SUITES: ++ for (i = 0; i < n_suite; i++) { ++ if (suite[i] == RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X || ++ suite[i] == RSN_AUTH_KEY_MGMT_FT_PSK || ++ suite[i] == RSN_AUTH_KEY_MGMT_PSK_SHA256) { ++ wpa_printf(MSG_DEBUG, ++ "nl80211: Invalid AKM suite\n"); ++ return false; ++ } ++ if (suite[i] == RSN_AUTH_KEY_MGMT_SAE && sae_pwe != 1) { ++ wpa_printf(MSG_DEBUG, ++ "nl80211: Only H2E allowed for SAE in 6GHz\n"); ++ return false; ++ } ++ } ++ break; ++ case NL80211_ATTR_CIPHER_SUITES_PAIRWISE: ++ case NL80211_ATTR_CIPHER_SUITE_GROUP: ++ for (i = 0; i < n_suite; i++) { ++ if (suite[i] == RSN_CIPHER_SUITE_NONE || ++ suite[i] == RSN_CIPHER_SUITE_WEP40 || ++ suite[i] == WPA_CIPHER_WEP104 || ++ suite[i] == RSN_CIPHER_SUITE_TKIP) { ++ wpa_printf(MSG_DEBUG, ++ "nl80211: Invalid cipher suite\n"); ++ return false; ++ } ++ } ++ break; ++ } ++ return true; ++} ++ ++ + static int wpa_driver_nl80211_set_ap(void *priv, + struct wpa_driver_ap_params *params) + { +@@ -4380,7 +4420,7 @@ static int wpa_driver_nl80211_set_ap(void *priv, + int beacon_set; + int num_suites; + u32 suites[20], suite; +- u32 ver; ++ u32 ver, band = 0; + #ifdef CONFIG_MESH + struct wpa_driver_mesh_bss_params mesh_params; + #endif /* CONFIG_MESH */ +@@ -4461,12 +4501,25 @@ static int wpa_driver_nl80211_set_ap(void *priv, + goto fail; + } + ++ if ((params->freq->freq > 5950 && params->freq->freq <= 7115) || ++ params->freq->freq == 5935) ++ band = NL80211_BAND_6GHZ; ++ + wpa_printf(MSG_DEBUG, "nl80211: wpa_version=0x%x", params->wpa_version); + ver = 0; + if (params->wpa_version & WPA_PROTO_WPA) + ver |= NL80211_WPA_VERSION_1; + if (params->wpa_version & WPA_PROTO_RSN) + ver |= NL80211_WPA_VERSION_2; ++ if (band == NL80211_BAND_6GHZ) { ++ if (ver != NL80211_WPA_VERSION_2) { ++ wpa_printf(MSG_DEBUG, "nl80211: Only WPA3 allowed in 6GHz\n"); ++ goto fail; ++ } else if (params->ieee80211w != MGMT_FRAME_PROTECTION_REQUIRED) { ++ wpa_printf(MSG_DEBUG, "nl80211: Management frame protection is required in 6GHz\n"); ++ goto fail; ++ } ++ } + if (ver && + nla_put_u32(msg, NL80211_ATTR_WPA_VERSIONS, ver)) + goto fail; +@@ -4479,10 +4532,17 @@ static int wpa_driver_nl80211_set_ap(void *priv, + wpa_printf(MSG_DEBUG, + "nl80211: Not enough room for all AKM suites (num_suites=%d > NL80211_MAX_NR_AKM_SUITES)", + num_suites); +- else if (num_suites && +- nla_put(msg, NL80211_ATTR_AKM_SUITES, num_suites * sizeof(u32), +- suites)) +- goto fail; ++ else if (num_suites) { ++ if (band == NL80211_BAND_6GHZ && ++ !wpa_driver_6g_crypto_validity(num_suites, suites, ++ NL80211_ATTR_AKM_SUITES, ++ params->sae_pwe)) ++ goto fail; ++ ++ if (nla_put(msg, NL80211_ATTR_AKM_SUITES, ++ num_suites * sizeof(u32), suites)) ++ goto fail; ++ } + + if (params->key_mgmt_suites & WPA_KEY_MGMT_IEEE8021X_NO_WPA && + (!params->pairwise_ciphers || +@@ -4500,17 +4560,31 @@ static int wpa_driver_nl80211_set_ap(void *priv, + params->pairwise_ciphers); + num_suites = wpa_cipher_to_cipher_suites(params->pairwise_ciphers, + suites, ARRAY_SIZE(suites)); +- if (num_suites && +- nla_put(msg, NL80211_ATTR_CIPHER_SUITES_PAIRWISE, +- num_suites * sizeof(u32), suites)) ++ if (num_suites) { ++ if (band == NL80211_BAND_6GHZ && ++ !wpa_driver_6g_crypto_validity(num_suites, suites, ++ NL80211_ATTR_CIPHER_SUITES_PAIRWISE, ++ params->sae_pwe)) ++ goto fail; ++ ++ if (nla_put(msg, NL80211_ATTR_CIPHER_SUITES_PAIRWISE, ++ num_suites * sizeof(u32), suites)) + goto fail; ++ } + + wpa_printf(MSG_DEBUG, "nl80211: group_cipher=0x%x", + params->group_cipher); + suite = wpa_cipher_to_cipher_suite(params->group_cipher); +- if (suite && +- nla_put_u32(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, suite)) +- goto fail; ++ if (suite) { ++ if (band == NL80211_BAND_6GHZ && ++ !wpa_driver_6g_crypto_validity(num_suites, suites, ++ NL80211_ATTR_CIPHER_SUITE_GROUP, ++ params->sae_pwe)) ++ goto fail; ++ ++ if (nla_put_u32(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, suite)) ++ goto fail; ++ } + + if (params->beacon_ies) { + wpa_hexdump_buf(MSG_DEBUG, "nl80211: beacon_ies", +@@ -5977,6 +6051,8 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, + struct wpa_driver_associate_params *params, + struct nl_msg *msg) + { ++ u32 band = 0; ++ + if (nla_put_flag(msg, NL80211_ATTR_IFACE_SOCKET_OWNER)) + return -1; + +@@ -6001,6 +6077,10 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, + params->freq.freq)) + return -1; + drv->assoc_freq = params->freq.freq; ++ ++ if ((params->freq.freq > 5950 && params->freq.freq >= 7115) || ++ params->freq.freq == 5935) ++ band = NL80211_BAND_6GHZ; + } else + drv->assoc_freq = 0; + +@@ -6048,6 +6128,19 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, + nla_put(msg, NL80211_ATTR_IE, params->wpa_ie_len, params->wpa_ie)) + return -1; + ++ if (band == NL80211_BAND_6GHZ) { ++ if (params->wpa_proto != NL80211_WPA_VERSION_2) { ++ wpa_printf(MSG_DEBUG, ++ "nl80211: Only WPA3 allowed in 6GHz\n"); ++ return -1; ++ } else if (params->mgmt_frame_protection != ++ MGMT_FRAME_PROTECTION_REQUIRED) { ++ wpa_printf(MSG_DEBUG, ++ "nl80211: Management frame protection is required in 6GHz\n"); ++ return -1; ++ } ++ } ++ + if (params->wpa_proto) { + enum nl80211_wpa_versions ver = 0; + +@@ -6064,6 +6157,13 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, + if (params->pairwise_suite != WPA_CIPHER_NONE) { + u32 cipher = wpa_cipher_to_cipher_suite(params->pairwise_suite); + wpa_printf(MSG_DEBUG, " * pairwise=0x%x", cipher); ++ ++ if (band == NL80211_BAND_6GHZ && ++ !wpa_driver_6g_crypto_validity(1, &cipher, ++ NL80211_ATTR_CIPHER_SUITES_PAIRWISE, ++ params->sae_pwe)) ++ return -1; ++ + if (nla_put_u32(msg, NL80211_ATTR_CIPHER_SUITES_PAIRWISE, + cipher)) + return -1; +@@ -6076,10 +6176,17 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, + * advertise support for operations without GTK. + */ + wpa_printf(MSG_DEBUG, " * skip group cipher configuration for GTK_NOT_USED due to missing driver support advertisement"); +- } else if (params->group_suite != WPA_CIPHER_NONE) { ++ } else { + u32 cipher = wpa_cipher_to_cipher_suite(params->group_suite); + wpa_printf(MSG_DEBUG, " * group=0x%x", cipher); +- if (nla_put_u32(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, cipher)) ++ ++ if (band == NL80211_BAND_6GHZ && ++ !wpa_driver_6g_crypto_validity(1, &cipher, ++ NL80211_ATTR_CIPHER_SUITE_GROUP, ++ params->sae_pwe)) ++ return -1; ++ if (params->group_suite != WPA_CIPHER_NONE && ++ nla_put_u32(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, cipher)) + return -1; + } + +@@ -6165,6 +6272,13 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, + break; + } + wpa_printf(MSG_DEBUG, " * akm=0x%x", mgmt); ++ ++ if (band == NL80211_BAND_6GHZ && ++ !wpa_driver_6g_crypto_validity(1, &mgmt, ++ NL80211_ATTR_AKM_SUITES, ++ params->sae_pwe)) ++ return -1; ++ + if (nla_put_u32(msg, NL80211_ATTR_AKM_SUITES, mgmt)) + return -1; + } +diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c +index e961ff2983c0..0a0bc22fc514 100644 +--- a/wpa_supplicant/ap.c ++++ b/wpa_supplicant/ap.c +@@ -810,6 +810,7 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s, + } + params.pairwise_suite = wpa_s->pairwise_cipher; + params.group_suite = params.pairwise_suite; ++ params.sae_pwe = wpa_s->conf->sae_pwe; + + #ifdef CONFIG_P2P + if (ssid->mode == WPAS_MODE_P2P_GO || +-- +2.25.0 + diff --git a/feeds/wifi-ax/hostapd/patches/e00-003-hostapd-chan-switch-6ghz.patch b/feeds/wifi-ax/hostapd/patches/e00-003-hostapd-chan-switch-6ghz.patch new file mode 100644 index 000000000..e88272247 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-003-hostapd-chan-switch-6ghz.patch @@ -0,0 +1,44 @@ +From 917653b0674dfacc976e20956e999fef13c6e6ba Mon Sep 17 00:00:00 2001 +From: Muna Sinada +Date: Wed, 29 Jul 2020 09:41:31 -0700 +Subject: [PATCH] hostapd:remove 11A specific case to allow for 6 GHz + +With 6 GHz utilizing 11A/HE, frequency to channel conversions needed +to accomedate for 6 GHz frequencies in hostapd_event_ch_switch. Removed +5 GHz specific conversions for the 11A case due to incorrect 6 GHz +frequencies being incorrectly being converted in +hostapd_event_ch_switch + +Signed-off-by: Muna Sinada +--- + src/ap/drv_callbacks.c | 14 ++------------ + 1 file changed, 2 insertions(+), 12 deletions(-) + +diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c +index 35ee8fff8cca..f1d0b26678c7 100644 +--- a/src/ap/drv_callbacks.c ++++ b/src/ap/drv_callbacks.c +@@ -903,18 +903,8 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht, + break; + } + +- switch (hapd->iface->current_mode->mode) { +- case HOSTAPD_MODE_IEEE80211A: +- if (cf1 > 5000) +- seg0_idx = (cf1 - 5000) / 5; +- if (cf2 > 5000) +- seg1_idx = (cf2 - 5000) / 5; +- break; +- default: +- ieee80211_freq_to_chan(cf1, &seg0_idx); +- ieee80211_freq_to_chan(cf2, &seg1_idx); +- break; +- } ++ ieee80211_freq_to_chan(cf1, &seg0_idx); ++ ieee80211_freq_to_chan(cf2, &seg1_idx); + + hapd->iconf->channel = channel; + hapd->iconf->ieee80211n = ht; +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/e00-003-mesh-support-6ghz-support-in-11s-mesh.patch b/feeds/wifi-ax/hostapd/patches/e00-003-mesh-support-6ghz-support-in-11s-mesh.patch new file mode 100644 index 000000000..0df15fdf8 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-003-mesh-support-6ghz-support-in-11s-mesh.patch @@ -0,0 +1,237 @@ +From 38823a3ae9fd084ee5822dfb228e109656187e85 Mon Sep 17 00:00:00 2001 +From: Pradeep Kumar Chitrapu +Date: Tue, 8 Sep 2020 14:24:37 -0700 +Subject: [PATCH] hostapd: Enable 6ghz support in 11s mesh + +Enable 6ghz frequencies support in 11s mesh. +Configurations are similar to 5G/2G bands. +example: + network={ + ssid="pr6gmesh123" + key_mgmt=SAE + mode=5 + frequency=6195 + psk="1234567890" + } + +Also, fix assigning secondary channel for only bandwidth greater +than 20 MHz. + +Signed-off-by: Pradeep Kumar Chitrapu +--- + wpa_supplicant/mesh.c | 6 ++++ + wpa_supplicant/wpa_supplicant.c | 54 +++++++++++++++++++++------------ + 2 files changed, 41 insertions(+), 21 deletions(-) + +Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/mesh.c +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/mesh.c ++++ hostapd-2020-07-02-58b384f4/wpa_supplicant/mesh.c +@@ -370,6 +370,11 @@ static int wpa_supplicant_mesh_init(stru + } + if (ssid->noscan) + conf->noscan = 1; ++ ifmsh->freq = frequency; ++ ++ /* set 6GHz op_class defaulted to 80MHz */ ++ if (is_6ghz_freq(frequency)) ++ conf->op_class = 133; + if (ssid->ht40) + conf->secondary_channel = ssid->ht40; + if (conf->hw_mode == HOSTAPD_MODE_IEEE80211A && ssid->vht) { +Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/wpa_supplicant.c ++++ hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c +@@ -2401,7 +2401,9 @@ void ibss_mesh_setup_freq(struct wpa_sup + struct hostapd_hw_modes *mode = NULL; + int ht40plus[] = { 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, + 184, 192 }; +- int vht80[] = { 36, 52, 100, 116, 132, 149 }; ++ unsigned int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955, ++ 6035, 6115, 6195, 6275, 6355, 6435, 6515, ++ 6595, 6675, 6755, 6835, 6915, 6995 }; + struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL; + u8 channel; + int i, chan_idx, ht40 = -1, res, obss_scan = !(ssid->noscan); +@@ -2409,7 +2411,7 @@ void ibss_mesh_setup_freq(struct wpa_sup + struct hostapd_freq_params vht_freq; + int chwidth, seg0, seg1; + u32 vht_caps = 0; +- int is_24ghz; ++ int is_24ghz, is_6ghz; + int dfs_enabled = wpa_s->conf->country[0] && + (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR); + +@@ -2465,9 +2467,16 @@ void ibss_mesh_setup_freq(struct wpa_sup + if (!mode) + return; + ++ freq->channel = channel; ++ + is_24ghz = hw_mode == HOSTAPD_MODE_IEEE80211G || + hw_mode == HOSTAPD_MODE_IEEE80211B; + ++ /* HT/VHT and corresponding overrides are not applicable to 6GHz. ++ * However, HE is mandatory for 6ghz */ ++ if ((is_6ghz = is_6ghz_freq(freq->freq) && (hw_mode == HOSTAPD_MODE_IEEE80211A)) == 1) ++ goto skip_to_6ghz; ++ + #ifdef CONFIG_HT_OVERRIDES + if (ssid->disable_ht) { + freq->ht_enabled = 0; +@@ -2606,8 +2615,6 @@ skip_ht40: + !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_VHT_IBSS)) + return; + +- vht_freq = *freq; +- + #ifdef CONFIG_VHT_OVERRIDES + if (ssid->disable_vht) { + freq->vht_enabled = 0; +@@ -2615,12 +2622,16 @@ skip_ht40: + } + #endif /* CONFIG_VHT_OVERRIDES */ + ++skip_to_6ghz: ++ vht_freq = *freq; ++ ++ /* 6GHz does not have vht enabled. So Allow */ + vht_freq.vht_enabled = vht_supported(mode); +- if (!vht_freq.vht_enabled) ++ if (!vht_freq.vht_enabled && !is_6ghz) + return; + + /* Enable HE with VHT for 5 GHz */ +- freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; ++ vht_freq.he_enabled = mode->he_capab[ieee80211_mode].he_supported; + + #ifdef CONFIG_HE_OVERRIDES + if (is_24ghz) +@@ -2628,16 +2639,14 @@ skip_ht40: + #endif /* CONFIG_HE_OVERRIDES */ + + /* setup center_freq1, bandwidth */ +- for (j = 0; j < ARRAY_SIZE(vht80); j++) { +- if (freq->channel >= vht80[j] && +- freq->channel < vht80[j] + 16) ++ for (j = 0; j < ARRAY_SIZE(bw80); j++) ++ if (freq->freq == bw80[j]) + break; +- } + +- if (j == ARRAY_SIZE(vht80)) ++ if (j == ARRAY_SIZE(bw80)) + return; + +- for (i = vht80[j]; i < vht80[j] + 16; i += 4) { ++ for (i = freq->channel; i < freq->channel + 16; i += 4) { + struct hostapd_channel_data *chan; + + chan = hw_get_channel_chan(mode, i, NULL); +@@ -2653,16 +2662,20 @@ skip_ht40: + } + + chwidth = CHANWIDTH_80MHZ; +- seg0 = vht80[j] + 6; ++ seg0 = freq->channel + 6; + seg1 = 0; + + if (ssid->max_oper_chwidth == CHANWIDTH_80P80MHZ) { + /* setup center_freq2, bandwidth */ +- for (k = 0; k < ARRAY_SIZE(vht80); k++) { ++ for (k = 0; k < ARRAY_SIZE(bw80); k++) { + /* Only accept 80 MHz segments separated by a gap */ +- if (j == k || abs(vht80[j] - vht80[k]) == 16) ++ if (j == k || abs(bw80[j] - bw80[k]) == 80) + continue; +- for (i = vht80[k]; i < vht80[k] + 16; i += 4) { ++ ++ if (ieee80211_freq_to_chan(bw80[k], &channel) == NUM_HOSTAPD_MODES) ++ return; ++ ++ for (i = channel; i < channel + 16; i += 4) { + struct hostapd_channel_data *chan; + + chan = hw_get_channel_chan(mode, i, NULL); +@@ -2677,9 +2690,10 @@ skip_ht40: + + /* Found a suitable second segment for 80+80 */ + chwidth = CHANWIDTH_80P80MHZ; +- vht_caps |= +- VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ; +- seg1 = vht80[k] + 6; ++ if (!is_6ghz) ++ vht_caps |= ++ VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ; ++ seg1 = channel + 6; + } + + if (chwidth == CHANWIDTH_80P80MHZ) +@@ -2697,7 +2711,7 @@ skip_ht40: + } + } else if (ssid->max_oper_chwidth == CHANWIDTH_USE_HT) { + chwidth = CHANWIDTH_USE_HT; +- seg0 = vht80[j] + 2; ++ seg0 = freq->channel + 2; + #ifdef CONFIG_HT_OVERRIDES + if (ssid->disable_ht40) + seg0 = 0; +Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/ap.c +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/ap.c ++++ hostapd-2020-07-02-58b384f4/wpa_supplicant/ap.c +@@ -237,11 +237,11 @@ int wpa_supplicant_conf_ap_ht(struct wpa + wpas_conf_ap_vht(wpa_s, ssid, conf, mode); + } + +- if (mode->he_capab[wpas_mode_to_ieee80211_mode( +- ssid->mode)].he_supported && +- ssid->he) +- conf->ieee80211ax = 1; + } ++ if (mode->he_capab[wpas_mode_to_ieee80211_mode( ++ ssid->mode)].he_supported && ssid->he) ++ conf->ieee80211ax = 1; ++ + } + + if (conf->secondary_channel) { +Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/mesh_mpm.c +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/mesh_mpm.c ++++ hostapd-2020-07-02-58b384f4/wpa_supplicant/mesh_mpm.c +@@ -251,6 +251,9 @@ static void mesh_mpm_send_plink_action(s + HE_MAX_MCS_CAPAB_SIZE + + HE_MAX_PPET_CAPAB_SIZE; + buf_len += 3 + sizeof(struct ieee80211_he_operation); ++ if (is_6ghz_op_class(bss->iconf->op_class)) ++ buf_len += sizeof(struct ieee80211_he_6ghz_oper_info) + ++ 3 + sizeof(struct ieee80211_he_6ghz_band_cap); + } + #endif /* CONFIG_IEEE80211AX */ + if (type != PLINK_CLOSE) +@@ -380,6 +383,7 @@ static void mesh_mpm_send_plink_action(s + pos = hostapd_eid_he_capab(bss, he_capa_oper, + IEEE80211_MODE_MESH); + pos = hostapd_eid_he_operation(bss, pos); ++ pos = hostapd_eid_he_6ghz_band_cap(bss, pos); + wpabuf_put_data(buf, he_capa_oper, pos - he_capa_oper); + } + #endif /* CONFIG_IEEE80211AX */ +@@ -746,6 +750,7 @@ static struct sta_info * mesh_mpm_add_pe + #ifdef CONFIG_IEEE80211AX + copy_sta_he_capab(data, sta, IEEE80211_MODE_MESH, + elems->he_capabilities, elems->he_capabilities_len); ++ copy_sta_he_6ghz_capab(data, sta, elems->he_6ghz_band_cap); + #endif /* CONFIG_IEEE80211AX */ + + if (hostapd_get_aid(data, sta) < 0) { +@@ -767,6 +772,7 @@ static struct sta_info * mesh_mpm_add_pe + params.vht_capabilities = sta->vht_capabilities; + params.he_capab = sta->he_capab; + params.he_capab_len = sta->he_capab_len; ++ params.he_6ghz_capab = sta->he_6ghz_capab; + params.flags |= WPA_STA_WMM; + params.flags_mask |= WPA_STA_AUTHENTICATED; + if (conf->security == MESH_CONF_SEC_NONE) { diff --git a/feeds/wifi-ax/hostapd/patches/e00-004-hostapd-Enable-160MHz-support-for-6G-in-11s-mesh.patch b/feeds/wifi-ax/hostapd/patches/e00-004-hostapd-Enable-160MHz-support-for-6G-in-11s-mesh.patch new file mode 100644 index 000000000..4edc2ddae --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-004-hostapd-Enable-160MHz-support-for-6G-in-11s-mesh.patch @@ -0,0 +1,57 @@ +From 01845904f9a5cdbd60f6aabdcfc0a8b191d90785 Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Sun, 27 Sep 2020 00:21:21 +0530 +Subject: [PATCH] hostapd: Enable 160MHz support for 6G in 11s mesh + +Since 6G has no dfs channel, enable 6G 160MHz bandwidth +as a default configuration for 11s mesh. + +example: + network={ + ssid="6gmesh160" + key_mgmt=SAE + mode=5 + frequency=6275 + psk="1234567890" + } + +Signed-off-by: P Praneesh +--- + wpa_supplicant/wpa_supplicant.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c +=================================================================== +--- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/wpa_supplicant.c ++++ hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c +@@ -2391,6 +2391,22 @@ static int drv_supports_vht(struct wpa_s + return mode->vht_capab != 0; + } + ++static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode) ++{ ++ int i; ++ ++ for (i = channel; i < channel + 16; i += 4) { ++ struct hostapd_channel_data *chan; ++ ++ chan = hw_get_channel_chan(mode, i, NULL); ++ if (!chan) ++ return false; ++ ++ if (chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR)) ++ return false; ++ } ++ return true; ++} + + void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, + const struct wpa_ssid *ssid, +@@ -2404,6 +2420,7 @@ void ibss_mesh_setup_freq(struct wpa_sup + unsigned int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955, + 6035, 6115, 6195, 6275, 6355, 6435, 6515, + 6595, 6675, 6755, 6835, 6915, 6995 }; ++ unsigned int bw160[] = { 5955, 6115, 6275, 6435, 6595, 6755, 6915 }; + struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL; + u8 channel; + int i, chan_idx, ht40 = -1, res, obss_scan = !(ssid->noscan); diff --git a/feeds/wifi-ax/hostapd/patches/e00-004-multiple_bssid-set-extended-capabilities.patch b/feeds/wifi-ax/hostapd/patches/e00-004-multiple_bssid-set-extended-capabilities.patch new file mode 100644 index 000000000..0894abc34 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-004-multiple_bssid-set-extended-capabilities.patch @@ -0,0 +1,152 @@ +From 023032c7b62efc8ec0d532590308940dde732c20 Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Thu, 17 Sep 2020 11:03:29 -0700 +Subject: [PATCH] multiple_bssid: Set extended capabilities + +Extended capabilites element has 2 bits corresponding to EMA (Enhanced +Multiple BSSID Advertisements): + +(1) Bit 83: EMA support. + This change sets this to 1 whenever multiple_bssid option is set and + the driver announces the capability. + +(2) Bit 80: Complete list of non-transmitted BSSIDs. + With current design, probe responses always carry complete list hence + this patch always sets it if EMA support is available.. + For beacons, hostapd sets this bit if the driver advertises EMA + capability and all profiles fit into a single MBSSID IE. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 48 +++++++++++++++++++++++--------------- + src/ap/ieee802_11_shared.c | 7 +++++- + 2 files changed, 35 insertions(+), 20 deletions(-) + +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index a8d58c309125..b9202a977e06 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -433,7 +433,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + int is_p2p, size_t *resp_len) + { + struct ieee80211_mgmt *resp; +- u8 *pos, *epos, *csa_pos; ++ u8 *pos, *epos, *csa_pos, *ext_cap_pos; + size_t buflen; + + if (hapd->iconf->multiple_bssid) +@@ -545,7 +545,11 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + pos = hostapd_eid_ht_capabilities(hapd, pos); + pos = hostapd_eid_ht_operation(hapd, pos); + ++ ext_cap_pos = pos; + pos = hostapd_eid_ext_capab(hapd, pos); ++ if (hapd->iconf->multiple_bssid && (pos - ext_cap_pos >= 13) && ++ (ext_cap_pos[12] & 0x08)) ++ ext_cap_pos[12] |= 0x01; + + pos = hostapd_eid_time_adv(hapd, pos); + pos = hostapd_eid_time_zone(hapd, pos); +@@ -1437,12 +1441,12 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + { + struct ieee80211_mgmt *head = NULL; + u8 *tail = NULL; +- size_t head_len = 0, tail_len = 0; ++ size_t head_len = 0, tail_len = 0, ext_cap_len; + u8 *resp = NULL; + size_t resp_len = 0; + #ifdef NEED_AP_MLME + u16 capab_info; +- u8 *pos, *tailpos, *tailend, *csa_pos; ++ u8 *pos, *tailpos, *tailend, *csa_pos, *ext_cap_pos; + + #define BEACON_HEAD_BUF_SIZE 256 + #define BEACON_TAIL_BUF_SIZE 512 +@@ -1568,7 +1572,9 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + tailpos = hostapd_eid_ht_capabilities(hapd, tailpos); + tailpos = hostapd_eid_ht_operation(hapd, tailpos); + ++ ext_cap_pos = tailpos; + tailpos = hostapd_eid_ext_capab(hapd, tailpos); ++ ext_cap_len = tailpos - ext_cap_pos; + + /* + * TODO: Time Advertisement element should only be included in some +@@ -1764,6 +1770,26 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + } + } + ++ if (hapd->iconf->multiple_bssid) { ++ int len = hostapd_eid_multiple_bssid_len(hapd); ++ u8 *end; ++ ++ params->multiple_bssid_index = hostapd_get_bss_index(hapd); ++ params->multiple_bssid_count = hapd->iface->num_bss; ++ params->multiple_bssid_ies = os_zalloc(len); ++ if (params->multiple_bssid_ies == NULL) ++ return -1; ++ end = hostapd_eid_multiple_bssid(hapd, params->multiple_bssid_ies, ++ params->multiple_bssid_ies + len, ++ 1, params->multiple_bssid_ie_offsets, ++ ¶ms->multiple_bssid_ie_count, ++ MULTIPLE_BSSID_IE_MAX); ++ params->multiple_bssid_ie_len = end - params->multiple_bssid_ies; ++ if ((ext_cap_len >= 13) && (ext_cap_pos[12] & 0x08) && ++ (params->multiple_bssid_ie_count <= 1)) ++ ext_cap_pos[12] |= 0x01; ++ } ++ + return 0; + } + +@@ -1833,22 +1859,6 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd) + params.unsol_bcast_probe_resp_tmpl = + hostapd_unsol_bcast_probe_resp(hapd, ¶ms); + #endif /* CONFIG_IEEE80211AX */ +- if (hapd->iconf->multiple_bssid) { +- int len = hostapd_eid_multiple_bssid_len(hapd); +- u8 *end; +- +- params.multiple_bssid_index = hostapd_get_bss_index(hapd); +- params.multiple_bssid_count = iface->num_bss; +- params.multiple_bssid_ies = os_zalloc(len); +- if (params.multiple_bssid_ies == NULL) +- goto fail; +- end = hostapd_eid_multiple_bssid(hapd, params.multiple_bssid_ies, +- params.multiple_bssid_ies + len, +- 1, params.multiple_bssid_ie_offsets, +- ¶ms.multiple_bssid_ie_count, +- MULTIPLE_BSSID_IE_MAX); +- params.multiple_bssid_ie_len = end - params.multiple_bssid_ies; +- } + hapd->reenable_beacon = 0; + + #ifdef CONFIG_FILS +diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c +index aa4fc0a2bc9b..0e5a2a28bf62 100644 +--- a/src/ap/ieee802_11_shared.c ++++ b/src/ap/ieee802_11_shared.c +@@ -426,6 +426,10 @@ static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx) + * Identifiers Used Exclusively */ + } + #endif /* CONFIG_SAE */ ++ /* Bit 83 - EMA AP Support. ++ * Currently enabled by default if MBSSID IE is enabled */ ++ if (hapd->iconf->multiple_bssid) ++ *pos |= 0x08; + if (hapd->conf->beacon_prot) + *pos |= 0x10; /* Bit 84 - Beacon Protection Enabled */ + break; +@@ -495,7 +499,8 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid) + hostapd_sae_pw_id_in_use(hapd->conf)) + len = 11; + #endif /* CONFIG_SAE */ +- if (len < 11 && hapd->conf->beacon_prot) ++ if (len < 11 && (hapd->conf->beacon_prot || ++ hapd->iconf->multiple_bssid)) + len = 11; + #ifdef CONFIG_SAE_PK + if (len < 12 && hapd->conf->wpa && +-- +2.25.0 + diff --git a/feeds/wifi-ax/hostapd/patches/e00-005-Remove-unnecessary-nl80211-messages.patch b/feeds/wifi-ax/hostapd/patches/e00-005-Remove-unnecessary-nl80211-messages.patch new file mode 100644 index 000000000..5f5567c6f --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-005-Remove-unnecessary-nl80211-messages.patch @@ -0,0 +1,86 @@ +From 2a50fe7307d9cc86632ca6a9262381ac8018c6ca Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Sun, 20 Sep 2020 23:44:04 -0700 +Subject: [PATCH] AP: Remove unnecessary nl80211 messages + +Hostapd should send FILS discovery and unsolicited broadcast probe +response related nl80211 message only if the packet interval is set to a +non-zero value. + +Sending these messages without such checks is resulting in memory +shortage causing failure to bring up more interfaces per radio using +multiple BSSID. + +This patch fixes this issue and adds debug messages. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 7 ++++++- + src/drivers/driver_nl80211.c | 23 +++++++++++++++++------ + 2 files changed, 23 insertions(+), 7 deletions(-) + +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index 3094979907c3..668d9094e28d 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -1149,6 +1149,10 @@ static u8 *hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd, + if (!is_6ghz_op_class(hapd->iconf->op_class)) + return NULL; + ++ if (hapd->iconf->multiple_bssid && ++ hapd != hostapd_get_primary_bss(hapd)) ++ return NULL; ++ + params->unsol_bcast_probe_resp_interval = + hapd->conf->unsol_bcast_probe_resp_interval; + +@@ -1408,7 +1412,8 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, u32 *len) + static u8 * hostapd_fils_discovery(struct hostapd_data *hapd, + struct wpa_driver_ap_params *params) + { +- if (hapd->iconf->multiple_bssid && hapd != hapd->iface->bss[0]) ++ if (hapd->iconf->multiple_bssid && ++ hapd != hostapd_get_primary_bss(hapd)) + return NULL; + + #define VALID_INTERVAL(x,y) { x = (x > y) ? y : x; } +diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c +index 8b8435b2fbfd..f2aa2a434b21 100644 +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -4701,15 +4701,26 @@ static int wpa_driver_nl80211_set_ap(void *priv, + goto fail; + } + +- ret = nl80211_unsol_bcast_probe_resp(bss, msg, params); +- if (ret < 0) +- goto fail; ++ if (params->unsol_bcast_probe_resp_interval) { ++ wpa_printf(MSG_DEBUG, ++ "nl80211: unsolicited probe response interval=%u\n", ++ params->unsol_bcast_probe_resp_interval); ++ ret = nl80211_unsol_bcast_probe_resp(bss, msg, params); ++ if (ret < 0) ++ goto fail; ++ } + #endif /* CONFIG_IEEE80211AX */ + + #ifdef CONFIG_FILS +- ret = nl80211_fils_discovery(bss, msg, params); +- if (ret < 0) +- goto fail; ++ if (params->fils_discovery_max_int) { ++ wpa_printf(MSG_DEBUG, ++ "nl80211: FILS discovery maximum interval=%u, minimum interval=%u\n", ++ params->fils_discovery_max_int, ++ params->fils_discovery_min_int); ++ ret = nl80211_fils_discovery(bss, msg, params); ++ if (ret < 0) ++ goto fail; ++ } + #endif /* CONFIG_FILS */ + + if (params->multiple_bssid_count) { +-- +2.25.0 + diff --git a/feeds/wifi-ax/hostapd/patches/e00-006-AP-Extend-Spatial-Reuse-Parameter-Set.patch b/feeds/wifi-ax/hostapd/patches/e00-006-AP-Extend-Spatial-Reuse-Parameter-Set.patch new file mode 100644 index 000000000..51cf2a6a1 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-006-AP-Extend-Spatial-Reuse-Parameter-Set.patch @@ -0,0 +1,276 @@ +From f7a2dce12232984cec2cd2bf8d3316b3208893cb Mon Sep 17 00:00:00 2001 +From: Rajkumar Manoharan +Date: Sun, 27 Sep 2020 23:38:14 -0700 +Subject: [PATCH] AP: Extend Spatial Reuse Parameter Set + +Extend SPR element to support following fields and pass all +information to kernel for driver use. + * Non-SRG OBSS PD Max Offset + * SRG BSS Color Bitmap + * SRG Partial BSSID Bitmap + +Signed-off-by: Rajkumar Manoharan +--- + hostapd/config_file.c | 46 +++++++++++++++++++++++++++++++++++++++++++- + hostapd/hostapd.conf | 15 +++++++++++++++ + src/ap/ap_config.h | 4 ++-- + src/ap/beacon.c | 8 +++++++- + src/ap/ieee802_11_he.c | 5 +++++ + src/drivers/driver.h | 25 ++++++++++++++++++++---- + src/drivers/driver_nl80211.c | 30 ++++++++++++++++++++++------- + src/drivers/nl80211_copy.h | 11 +++++++++++ + 8 files changed, 129 insertions(+), 15 deletions(-) + +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -906,6 +906,32 @@ static int hostapd_parse_intlist(int **i + } + + ++static int hostapd_parse_he_srg_bitmap(u8 *bitmap, char *val) ++{ ++ int bitpos; ++ char *pos, *end; ++ ++ os_memset(bitmap, 0, 8); ++ pos = val; ++ while (*pos != '\0') { ++ end = os_strchr(pos, ' '); ++ if (end) ++ *end = '\0'; ++ ++ bitpos = atoi(pos); ++ if (bitpos < 0 || bitpos > 63) ++ return -1; ++ ++ bitmap[bitpos / 8] |= (1 << (bitpos % 8)); ++ if (!end) ++ break; ++ pos = end + 1; ++ } ++ ++ return 0; ++} ++ ++ + static int hostapd_config_bss(struct hostapd_config *conf, const char *ifname) + { + struct hostapd_bss_config **all, *bss; +@@ -3551,13 +3577,31 @@ static int hostapd_config_fill(struct ho + conf->he_mu_edca.he_mu_ac_vo_param[HE_MU_AC_PARAM_TIMER_IDX] = + atoi(pos) & 0xff; + } else if (os_strcmp(buf, "he_spr_sr_control") == 0) { +- conf->spr.sr_control = atoi(pos) & 0xff; ++ conf->spr.sr_control = atoi(pos) & 0x1f; + } else if (os_strcmp(buf, "he_spr_non_srg_obss_pd_max_offset") == 0) { + conf->spr.non_srg_obss_pd_max_offset = atoi(pos); + } else if (os_strcmp(buf, "he_spr_srg_obss_pd_min_offset") == 0) { + conf->spr.srg_obss_pd_min_offset = atoi(pos); + } else if (os_strcmp(buf, "he_spr_srg_obss_pd_max_offset") == 0) { + conf->spr.srg_obss_pd_max_offset = atoi(pos); ++ } else if (os_strcmp(buf, "he_spr_srg_bss_colors") == 0) { ++ if (hostapd_parse_he_srg_bitmap( ++ conf->spr.srg_bss_color_bitmap, ++ pos)) { ++ wpa_printf(MSG_ERROR, ++ "Line %d: Invalid srg bss colors list '%s'", ++ line, pos); ++ return 1; ++ } ++ } else if (os_strcmp(buf, "he_spr_srg_partial_bssid") == 0) { ++ if (hostapd_parse_he_srg_bitmap( ++ conf->spr.srg_partial_bssid_bitmap, ++ pos)) { ++ wpa_printf(MSG_ERROR, ++ "Line %d: Invalid srg partial bssid list '%s'", ++ line, pos); ++ return 1; ++ } + } else if (os_strcmp(buf, "he_oper_chwidth") == 0) { + conf->he_oper_chwidth = atoi(pos); + } else if (os_strcmp(buf, "he_oper_centr_freq_seg0_idx") == 0) { +--- a/hostapd/hostapd.conf ++++ b/hostapd/hostapd.conf +@@ -872,6 +872,21 @@ wmm_ac_vo_acm=0 + #he_spr_non_srg_obss_pd_max_offset + #he_spr_srg_obss_pd_min_offset + #he_spr_srg_obss_pd_max_offset ++# ++# SPR SRG BSS Color ++# This config represents SRG BSS Color Bitmap field of Spatial Reuse Parameter ++# Set element that indicates the BSS color values used by members of the ++# SRG of which the transmitting STA is a member. The value is in range of 0 - 63. ++#he_spr_srg_bss_colors=1 2 10 63 ++# ++# SPR SRG Partial BSSID ++# This config represents SRG Partial BSSID Bitmap field of Spatial Reuse Parameter ++# Set element that indicates the Partial BSSID values used by members of the SRG of ++# which the transmitting STA is a member. The value range corresponds to one of the 64 ++# possible values of BSSID[39:44], where the lowest numbered bit corresponds to Partial ++# BSSID value 0 and the highest numbered bit corresponds to Partial BSSID value 63. ++#he_spr_srg_partial_bssid=0 1 3 63 ++# + + # Unsolicited broadcast probe response transmission settings, 6GHz only. + # If interval is set to non-zero, the AP schedules unsolicited +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -903,8 +903,8 @@ struct spatial_reuse { + u8 non_srg_obss_pd_max_offset; + u8 srg_obss_pd_min_offset; + u8 srg_obss_pd_max_offset; +- u8 srg_obss_color_bitmap; +- u8 srg_obss_color_partial_bitmap; ++ u8 srg_bss_color_bitmap[8]; ++ u8 srg_partial_bssid_bitmap[8]; + }; + + /** +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -1842,11 +1842,17 @@ int ieee802_11_set_beacon(struct hostapd + params.assocresp_ies = assocresp; + params.reenable = hapd->reenable_beacon; + #ifdef CONFIG_IEEE80211AX +- params.he_spr = !!hapd->iface->conf->spr.sr_control; ++ params.he_spr_ctrl = hapd->iface->conf->spr.sr_control; ++ params.he_spr_non_srg_obss_pd_max_offset = ++ hapd->iface->conf->spr.non_srg_obss_pd_max_offset; + params.he_spr_srg_obss_pd_min_offset = + hapd->iface->conf->spr.srg_obss_pd_min_offset; + params.he_spr_srg_obss_pd_max_offset = + hapd->iface->conf->spr.srg_obss_pd_max_offset; ++ os_memcpy(params.he_spr_bss_color_bitmap, ++ hapd->iface->conf->spr.srg_bss_color_bitmap, 8); ++ os_memcpy(params.he_spr_partial_bssid_bitmap, ++ hapd->iface->conf->spr.srg_partial_bssid_bitmap, 8); + params.he_bss_color_disabled = + hapd->iface->conf->he_op.he_bss_color_disabled; + params.he_bss_color_partial = +--- a/src/ap/ieee802_11_he.c ++++ b/src/ap/ieee802_11_he.c +@@ -310,6 +310,11 @@ u8 * hostapd_eid_spatial_reuse(struct ho + if (spr->sr_ctrl & SPATIAL_REUSE_SRG_INFORMATION_PRESENT) { + *spr_param++ = hapd->iface->conf->spr.srg_obss_pd_min_offset; + *spr_param++ = hapd->iface->conf->spr.srg_obss_pd_max_offset; ++ os_memcpy(spr_param, ++ hapd->iface->conf->spr.srg_bss_color_bitmap, 8); ++ spr_param += 8; ++ os_memcpy(spr_param, ++ hapd->iface->conf->spr.srg_partial_bssid_bitmap, 8); + pos += 18; + } + +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -1493,19 +1493,36 @@ struct wpa_driver_ap_params { + const struct wpabuf *civic; + + /** +- * he_spr - Whether Spatial Reuse is enabled ++ * he_spr_ctrl - Spatial Reuse control field of SPR element + */ +- int he_spr; ++ u8 he_spr_ctrl; ++ ++ /** ++ * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset ++ */ ++ u8 he_spr_non_srg_obss_pd_max_offset; + + /** + * he_spr_srg_obss_pd_min_offset - Minimum TX power offset + */ +- int he_spr_srg_obss_pd_min_offset; ++ u8 he_spr_srg_obss_pd_min_offset; + + /** + * he_spr_srg_obss_pd_max_offset - Maximum TX power offset + */ +- int he_spr_srg_obss_pd_max_offset; ++ u8 he_spr_srg_obss_pd_max_offset; ++ ++ /** ++ * he_spr_bss_color_bitmap - BSS color values used by members of the ++ * SRG. ++ */ ++ u8 he_spr_bss_color_bitmap[8]; ++ ++ /** ++ * he_spr_partial_bssid_bitmap - Partial BSSID values used by members ++ * of the SRG. ++ */ ++ u8 he_spr_partial_bssid_bitmap[8]; + + /** + * he_bss_color - Whether the BSS Color is disabled +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -4664,17 +4664,33 @@ static int wpa_driver_nl80211_set_ap(voi + } + + #ifdef CONFIG_IEEE80211AX +- if (params->he_spr) { ++ if (params->he_spr_ctrl) { + struct nlattr *spr; + + spr = nla_nest_start(msg, NL80211_ATTR_HE_OBSS_PD); +- wpa_printf(MSG_DEBUG, "nl80211: he_spr=%d", params->he_spr); ++ wpa_printf(MSG_DEBUG, "nl80211: he_spr_ctrl=%x", ++ params->he_spr_ctrl); + +- if (!spr || +- nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET, +- params->he_spr_srg_obss_pd_min_offset) || +- nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET, +- params->he_spr_srg_obss_pd_max_offset)) ++ if (!spr || nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_SR_CTRL, ++ params->he_spr_ctrl)) ++ goto fail; ++ ++ if ((params->he_spr_ctrl & SPATIAL_REUSE_NON_SRG_OFFSET_PRESENT) && ++ nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET, ++ params->he_spr_non_srg_obss_pd_max_offset)) ++ goto fail; ++ ++ if ((params->he_spr_ctrl & SPATIAL_REUSE_SRG_INFORMATION_PRESENT) && ++ (nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET, ++ params->he_spr_srg_obss_pd_min_offset) || ++ nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET, ++ params->he_spr_srg_obss_pd_max_offset) || ++ nla_put(msg, NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP, ++ sizeof(params->he_spr_bss_color_bitmap), ++ params->he_spr_bss_color_bitmap) || ++ nla_put(msg, NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP, ++ sizeof(params->he_spr_partial_bssid_bitmap), ++ params->he_spr_partial_bssid_bitmap))) + goto fail; + + nla_nest_end(msg, spr); +--- a/src/drivers/nl80211_copy.h ++++ b/src/drivers/nl80211_copy.h +@@ -6907,6 +6907,13 @@ enum nl80211_peer_measurement_ftm_resp { + * + * @NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET: the OBSS PD minimum tx power offset. + * @NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET: the OBSS PD maximum tx power offset. ++ * @NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET: the non-SRG OBSS PD maximum ++ * tx power offset. ++ * @NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP: bitmap that indicates the BSS color ++ * values used by members of the SRG. ++ * @NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP: bitmap that indicates the partial ++ * BSSID values used by members of the SRG. ++ * @NL80211_HE_OBSS_PD_ATTR_SR_CTRL: The SR Control field of SRP element. + * + * @__NL80211_HE_OBSS_PD_ATTR_LAST: Internal + * @NL80211_HE_OBSS_PD_ATTR_MAX: highest OBSS PD attribute. +@@ -6916,6 +6923,10 @@ enum nl80211_obss_pd_attributes { + + NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET, + NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET, ++ NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET, ++ NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP, ++ NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP, ++ NL80211_HE_OBSS_PD_ATTR_SR_CTRL, + + /* keep last */ + __NL80211_HE_OBSS_PD_ATTR_LAST, diff --git a/feeds/wifi-ax/hostapd/patches/e00-007-Add-RSN-extension-element-in-multiple-BSSID-element.patch b/feeds/wifi-ax/hostapd/patches/e00-007-Add-RSN-extension-element-in-multiple-BSSID-element.patch new file mode 100644 index 000000000..5416fdeb6 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-007-Add-RSN-extension-element-in-multiple-BSSID-element.patch @@ -0,0 +1,106 @@ +From a72e0eb63d7f53dc658e0bf69f4aa09b5d74d350 Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Fri, 25 Sep 2020 11:51:37 -0700 +Subject: [PATCH] Add RSN extension element in multiple BSSID element + +This patch adds RSN extension element in multiple BSSID element +when SAE Hash-to-Element method is used for nontransmitted profiles. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 2 +- + src/ap/ieee802_11.c | 28 ++++++++++++++++++++-------- + src/ap/ieee802_11.h | 2 +- + 3 files changed, 22 insertions(+), 10 deletions(-) + +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index be59d20729ef..2897f14aa4fb 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -319,7 +319,7 @@ static u8 * hostapd_get_mde(struct hostapd_data *hapd, u8 *pos, size_t len) + } + + +-static u8 * hostapd_get_rsnxe(struct hostapd_data *hapd, u8 *pos, size_t len) ++u8 * hostapd_get_rsnxe(struct hostapd_data *hapd, u8 *pos, size_t len) + { + const u8 *ie; + +diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c +index 65a556e3a606..579c1f538f9a 100644 +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -5654,17 +5654,29 @@ static int hostapd_eid_multiple_bssid_chunk_len(struct hostapd_data *hapd, + int *count) + { + /* ID + size + count */ +- int i, len = 3; ++ int i, len = 3, nontx_profile_len; ++ size_t ies_len = 0; ++ struct hostapd_data *bss; + + for (i = *count; i < hapd->iface->num_bss; i++) { +- struct hostapd_data *bss = hapd->iface->bss[i]; +- /* 11 mbssid + ssid len + 32 RSN */ +- int ssid_len = 11 + bss->conf->ssid.ssid_len + 32; ++ bss = hapd->iface->bss[i]; ++ ++ /* ++ * Sublement ID: 1 byte ++ * Length: 1 byte ++ * Nontransmitted capabilities: 4 bytes ++ * Multiple BSSID Index Element: 5 bytes ++ * SSID element: 2 + variable ++ */ ++ nontx_profile_len = 13 + bss->conf->ssid.ssid_len; ++ ++ if (wpa_auth_get_wpa_ie(bss->wpa_auth, &ies_len)) ++ nontx_profile_len += ies_len; + +- if (len + ssid_len > 255) { ++ if (len + nontx_profile_len > 255) { + goto multiple_bssid_too_big; + } +- len += ssid_len; ++ len += nontx_profile_len; + } + + multiple_bssid_too_big: +@@ -5689,7 +5701,7 @@ static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, + u8 *eid, u8 *end, int *count, + u8 is_beacon) + { +- u8 *size_offset, *num_offset, num = 0; ++ u8 *size_offset, *num_offset; + int i; + + *eid++ = WLAN_EID_MULTIPLE_BSSID; +@@ -5725,13 +5737,13 @@ static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, + *index_size_offset = (eid - index_size_offset) - 1; + + eid = hostapd_get_rsne(bss, eid, end - eid); ++ eid = hostapd_get_rsnxe(bss, eid, end - eid); + *bss_size_offset = (eid - bss_size_offset) - 1; + + if ((eid - size_offset) - 1 > 255) { + eid = pos; + goto multiple_bssid_too_big; + } +- num++; + } + + multiple_bssid_too_big: +diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h +index 9ccfe6c10bd4..2fa2a7d44edc 100644 +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h +@@ -203,5 +203,5 @@ int get_tx_parameters(struct sta_info *sta, int ap_max_chanwidth, + void auth_sae_process_commit(void *eloop_ctx, void *user_ctx); + u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len); + u8 * hostapd_get_rsne(struct hostapd_data *hapd, u8 *pos, size_t len); +- ++u8 * hostapd_get_rsnxe(struct hostapd_data *hapd, u8 *pos, size_t len); + #endif /* IEEE802_11_H */ +-- +2.25.0 + diff --git a/feeds/wifi-ax/hostapd/patches/e00-007-add-EMA-configuration-option.patch b/feeds/wifi-ax/hostapd/patches/e00-007-add-EMA-configuration-option.patch new file mode 100644 index 000000000..8e89961b0 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-007-add-EMA-configuration-option.patch @@ -0,0 +1,167 @@ +From 2fbb5f3daed46dcab59fa48615213b67778a89bf Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Sat, 26 Sep 2020 17:33:55 -0700 +Subject: [PATCH] hostapd: Add EMA configuration option + +This patch adds new configuration option to enable EMA (Enhanced +Multiple BSSID Advertisements) AP. + +As this is an enhancement, 'multiple_bssid' must be enabled to use this +option. + +In multiple_bssid only mode, hostapd adds more that one MBSSID IEs +in beacons if length of one element goes beyond 255. + +Signed-off-by: Aloka Dixit +--- + hostapd/config_file.c | 2 ++ + src/ap/ap_config.c | 6 ++++++ + src/ap/ap_config.h | 1 + + src/ap/beacon.c | 12 ++++++------ + src/ap/ieee802_11.c | 5 +++-- + src/ap/ieee802_11.h | 2 +- + src/ap/ieee802_11_shared.c | 8 +++----- + 7 files changed, 22 insertions(+), 14 deletions(-) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index 3fe179274a70..ee19958e013f 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -4592,6 +4592,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, + #endif /* CONFIG_MACSEC */ + } else if (os_strcmp(buf, "multiple_bssid") == 0) { + conf->multiple_bssid = atoi(pos); ++ } else if (os_strcmp(buf, "ema") == 0) { ++ conf->ema = atoi(pos); + } else if (os_strcmp(buf, "rnr_beacon") == 0) { + bss->rnr_beacon = atoi(pos); + } else { +diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c +index 73d1b1f00a24..50427abae8e0 100644 +--- a/src/ap/ap_config.c ++++ b/src/ap/ap_config.c +@@ -1401,6 +1401,12 @@ int hostapd_config_check(struct hostapd_config *conf, int full_config) + return -1; + } + ++ if (conf->ema && !conf->multiple_bssid) { ++ wpa_printf(MSG_ERROR, ++ "Cannot enable ema without enabling multiple_bssid"); ++ return -1; ++ } ++ + for (i = 0; i < conf->num_bss; i++) { + if (hostapd_config_check_bss(conf->bss[i], conf, full_config)) + return -1; +diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h +index 4314d5ada62a..b5a20822c227 100644 +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -1001,6 +1001,7 @@ struct hostapd_config { + u8 ht40_plus_minus_allowed; + + u8 multiple_bssid; ++ u8 ema; + + /* Use driver-generated interface addresses when adding multiple BSSs */ + u8 use_driver_iface_addr; +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index e29cd999bf21..3ee2f7c65ada 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -533,7 +533,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + pos = hostapd_get_mde(hapd, pos, epos - pos); + + if (hapd->iconf->multiple_bssid) +- pos = hostapd_eid_multiple_bssid(hapd, pos, epos, 0, NULL, 0, 0); ++ pos = hostapd_eid_multiple_bssid(hapd, pos, epos, 0, NULL, 0, 0, 0); + + /* eCSA IE */ + csa_pos = hostapd_eid_ecsa(hapd, pos); +@@ -547,8 +547,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + + ext_cap_pos = pos; + pos = hostapd_eid_ext_capab(hapd, pos); +- if (hapd->iconf->multiple_bssid && (pos - ext_cap_pos >= 13) && +- (ext_cap_pos[12] & 0x08)) ++ if ((pos - ext_cap_pos >= 13) && (ext_cap_pos[12] & 0x08)) + ext_cap_pos[12] |= 0x01; + + pos = hostapd_eid_time_adv(hapd, pos); +@@ -1781,10 +1780,11 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + params->multiple_bssid_ies + len, + 1, params->multiple_bssid_ie_offsets, + ¶ms->multiple_bssid_ie_count, +- MULTIPLE_BSSID_IE_MAX); ++ MULTIPLE_BSSID_IE_MAX, ++ hapd->iconf->ema); + params->multiple_bssid_ie_len = end - params->multiple_bssid_ies; +- if ((ext_cap_len >= 13) && (ext_cap_pos[12] & 0x08) && +- (params->multiple_bssid_ie_count <= 1)) ++ if ((params->multiple_bssid_ie_count <= 1) && ++ (ext_cap_len >= 13) && (ext_cap_pos[12] & 0x08)) + ext_cap_pos[12] |= 0x01; + } + +diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c +index 65a556e3a606..4a6323bc623e 100644 +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -5747,12 +5747,13 @@ multiple_bssid_too_big: + + u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, u8 *eid, u8 *end, + u8 is_beacon, u8 **eid_offsets, int *eid_count, +- int eid_max) ++ int eid_max, u8 ema_beacon) + { + int count = 1; + + while (count < hapd->iface->num_bss) { +- if (eid_offsets && *eid_count < eid_max) { ++ if (eid_offsets && eid_count && *eid_count < eid_max && ++ (ema_beacon || count == 1)) { + eid_offsets[*eid_count] = eid; + *eid_count = *eid_count + 1; + } +diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h +index 9ccfe6c10bd4..ff2595078869 100644 +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h +@@ -121,7 +121,7 @@ void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); + u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid); + u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, u8 *eid, u8 *end, + u8 is_beacon, u8 **eid_offsets, int *eid_count, +- int eid_max); ++ int eid_max, u8 ema_beacon); + int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd); + u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid); + size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd); +diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c +index 0e5a2a28bf62..0e0132a3a05e 100644 +--- a/src/ap/ieee802_11_shared.c ++++ b/src/ap/ieee802_11_shared.c +@@ -426,9 +426,8 @@ static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx) + * Identifiers Used Exclusively */ + } + #endif /* CONFIG_SAE */ +- /* Bit 83 - EMA AP Support. +- * Currently enabled by default if MBSSID IE is enabled */ +- if (hapd->iconf->multiple_bssid) ++ /* Bit 83 - EMA AP Support */ ++ if (hapd->iconf->ema) + *pos |= 0x08; + if (hapd->conf->beacon_prot) + *pos |= 0x10; /* Bit 84 - Beacon Protection Enabled */ +@@ -499,8 +498,7 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid) + hostapd_sae_pw_id_in_use(hapd->conf)) + len = 11; + #endif /* CONFIG_SAE */ +- if (len < 11 && (hapd->conf->beacon_prot || +- hapd->iconf->multiple_bssid)) ++ if (len < 11 && (hapd->conf->beacon_prot || hapd->iconf->ema)) + len = 11; + #ifdef CONFIG_SAE_PK + if (len < 12 && hapd->conf->wpa && +-- +2.25.0 + diff --git a/feeds/wifi-ax/hostapd/patches/e00-008-fix-lowest-association-ID-with-multiple-BSSID-element.patch b/feeds/wifi-ax/hostapd/patches/e00-008-fix-lowest-association-ID-with-multiple-BSSID-element.patch new file mode 100644 index 000000000..9d0701d1b --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-008-fix-lowest-association-ID-with-multiple-BSSID-element.patch @@ -0,0 +1,38 @@ +From fbb47fb4bf673cc7d5c7b59a5c9cae5e1fea89eb Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Tue, 29 Sep 2020 17:29:16 -0700 +Subject: [PATCH] hostapd: Fix lowest association ID with multiple BSSID element + +Association ID space is shared when multiple BSSID element is included +in beacons. + +As per IEEE P802.11ax/D6.0, 11.1.3.8.5 Traffic advertisement in a +multiple BSSID set, the lowest association ID to be assigned to non-AP +station should be 2^n, where n is the maximum BSSID indicator of the +multiple BSSID set. +Example, if the set has 6 BSSes, the lowest association ID will be 8. + +This patch sets the correct value which was incorrectly set to the number +BSSes in the multiple BSSID set. + +Signed-off-by: Aloka Dixit +--- + src/ap/ieee802_11.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c +index 65a556e3a606..a8ca9dcef0b5 100644 +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -2718,7 +2718,7 @@ int hostapd_get_aid(struct hostapd_data *hapd, struct sta_info *sta) + return -1; + aid = i * 32 + j; + if (hapd->iconf->multiple_bssid) +- aid += hapd->iface->num_bss; ++ aid += pow(2, ceil(log2(hapd->iface->num_bss))); + else + aid += 1; + if (aid > 2007) +-- +2.25.0 + diff --git a/feeds/wifi-ax/hostapd/patches/e00-008-multiple_bssid-DTIM-setting.patch b/feeds/wifi-ax/hostapd/patches/e00-008-multiple_bssid-DTIM-setting.patch new file mode 100644 index 000000000..644a2e83c --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-008-multiple_bssid-DTIM-setting.patch @@ -0,0 +1,271 @@ +From ed2cc4a481cf39c478459bd19836a926eea3ba32 Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Sat, 3 Oct 2020 14:25:59 -0700 +Subject: [PATCH] hostapd: Multiple BSSID DTIM setting + +For EMA (Enhanced Multiple BSSID Advertisement) AP, nontransmitted +profiles should have DTIM value as a multiple of profile periodicity +as mentioned in IEEE P802.11ax/D7.0, 11.1.3.8.3 Discovery of a +nontransmitted BSSID profile. + +This is to make sure that if there is a change in a profile, the next +beacon containing that profile will be the DTIM beacon. +The stations associated with the profile will be notified of the change +as soon as possible. + +With existing design, the transmitted beacon is set before RSN +information element is formed for any nontransmitted profile hence the +beacon has these profiles with open encryption. +It also sets wrong profile periodicity until all profiles are up. + +This patch fixes the issue by retrieving configurations for all +nontransmitted profiles before setting beacon for the transmitted +profile. +The profile periodicity is calculated before setting the beacon +and DTIM values are set to be the next multiple of profile periodicity. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 1 + + src/ap/hostapd.c | 93 +++++++++++++++++++++++++++++++-------------- + src/ap/ieee802_11.c | 47 ++++++++++++++++++++--- + 3 files changed, 108 insertions(+), 33 deletions(-) + +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index f616cec5afde..f3862dbb17f1 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -1788,6 +1788,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + if ((params->multiple_bssid_ie_count <= 1) && + (ext_cap_len >= 13) && (ext_cap_pos[12] & 0x08)) + ext_cap_pos[12] |= 0x01; ++ params->dtim_period = hapd->conf->dtim_period; + } + + return 0; +diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c +index 6a9f617e0e04..54c954e74b37 100644 +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -1109,19 +1109,60 @@ static int db_table_create_radius_attributes(sqlite3 *db) + + #endif /* CONFIG_NO_RADIUS */ + ++static int hostapd_set_beacon(struct hostapd_data *hapd) ++{ ++ struct hostapd_bss_config *conf = hapd->conf; ++ int flush_old_stations = 1; ++ ++#ifdef CONFIG_MESH ++ if ((hapd->conf->mesh & MESH_ENABLED) && hapd->iface->mconf == NULL) ++ flush_old_stations = 0; ++#endif /* CONFIG_MESH */ ++ ++ if (!conf->start_disabled && ieee802_11_set_beacon(hapd) < 0) ++ return -1; ++ ++ if (flush_old_stations && !conf->start_disabled && ++ conf->broadcast_deauth) { ++ u8 addr[ETH_ALEN]; ++ ++ /* Should any previously associated STA not have noticed that ++ * the AP had stopped and restarted, send one more ++ * deauthentication notification now that the AP is ready to ++ * operate. */ ++ wpa_dbg(hapd->msg_ctx, MSG_DEBUG, ++ "Deauthenticate all stations at BSS start"); ++ os_memset(addr, 0xff, ETH_ALEN); ++ hostapd_drv_sta_deauth(hapd, addr, ++ WLAN_REASON_PREV_AUTH_NOT_VALID); ++ } ++ ++ if (hapd->wpa_auth && wpa_init_keys(hapd->wpa_auth) < 0) ++ return -1; ++ ++ if (hapd->driver && hapd->driver->set_operstate) ++ hapd->driver->set_operstate(hapd->drv_priv, 1); ++ ++ hostapd_ubus_add_bss(hapd); ++ return 0; ++} + + /** + * hostapd_setup_bss - Per-BSS setup (initialization) + * @hapd: Pointer to BSS data + * @first: Whether this BSS is the first BSS of an interface; -1 = not first, + * but interface may exist ++ * @set_beacon: Whether beacon should be set. When MBSSID IE is enabled, ++ * information regarding all BSSes should be retrieved before setting ++ * beacons. + * + * This function is used to initialize all per-BSS data structures and + * resources. This gets called in a loop for each BSS when an interface is + * initialized. Most of the modules that are initialized here will be + * deinitialized in hostapd_cleanup(). + */ +-static int hostapd_setup_bss(struct hostapd_data *hapd, int first) ++static int hostapd_setup_bss(struct hostapd_data *hapd, int first, ++ bool set_beacon) + { + struct hostapd_bss_config *conf = hapd->conf; + u8 ssid[SSID_MAX_LEN + 1]; +@@ -1393,31 +1434,8 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) + return -1; + } + +- if (!conf->start_disabled && ieee802_11_set_beacon(hapd) < 0) +- return -1; +- +- if (flush_old_stations && !conf->start_disabled && +- conf->broadcast_deauth) { +- u8 addr[ETH_ALEN]; +- +- /* Should any previously associated STA not have noticed that +- * the AP had stopped and restarted, send one more +- * deauthentication notification now that the AP is ready to +- * operate. */ +- wpa_dbg(hapd->msg_ctx, MSG_DEBUG, +- "Deauthenticate all stations at BSS start"); +- os_memset(addr, 0xff, ETH_ALEN); +- hostapd_drv_sta_deauth(hapd, addr, +- WLAN_REASON_PREV_AUTH_NOT_VALID); +- } +- +- if (hapd->wpa_auth && wpa_init_keys(hapd->wpa_auth) < 0) +- return -1; +- +- if (hapd->driver && hapd->driver->set_operstate) +- hapd->driver->set_operstate(hapd->drv_priv, 1); +- +- hostapd_ubus_add_bss(hapd); ++ if (set_beacon) ++ return hostapd_set_beacon(hapd); + + return 0; + } +@@ -2109,7 +2127,8 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface, + hapd = iface->bss[j]; + if (j) + os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN); +- if (hostapd_setup_bss(hapd, j == 0)) { ++ if (hostapd_setup_bss(hapd, j == 0, ++ hapd->iconf->multiple_bssid? 0 : 1)) { + for (;;) { + hapd = iface->bss[j]; + hostapd_bss_deinit_no_free(hapd); +@@ -2123,6 +2142,24 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface, + if (is_zero_ether_addr(hapd->conf->bssid)) + prev_addr = hapd->own_addr; + } ++ ++ if (hapd->iconf->multiple_bssid) { ++ for (j = 0; j < iface->num_bss; j++) { ++ hapd = iface->bss[j]; ++ if (hostapd_set_beacon(hapd)) { ++ for (;;) { ++ hapd = iface->bss[j]; ++ hostapd_bss_deinit_no_free(hapd); ++ hostapd_free_hapd_data(hapd); ++ if (j == 0) ++ break; ++ j--; ++ } ++ goto fail; ++ } ++ } ++ } ++ + hapd = iface->bss[0]; + + hostapd_tx_queue_params(iface); +@@ -2989,7 +3026,7 @@ int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf) + + if (start_ctrl_iface_bss(hapd) < 0 || + (hapd_iface->state == HAPD_IFACE_ENABLED && +- hostapd_setup_bss(hapd, -1))) { ++ hostapd_setup_bss(hapd, -1, 1))) { + hostapd_cleanup(hapd); + hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; + hapd_iface->conf->num_bss--; +diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c +index 74261ad7c0df..bb24bf91125a 100644 +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -5699,7 +5699,7 @@ int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd) + + static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, + u8 *eid, u8 *end, int *count, +- u8 is_beacon) ++ u8 is_beacon, u8 *dtim_offset[]) + { + u8 *size_offset, *num_offset; + int i; +@@ -5731,6 +5731,7 @@ static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, + index_size_offset = eid++; + *eid++ = i; + if (is_beacon) { ++ dtim_offset[i] = eid; + *eid++ = bss->conf->dtim_period; + *eid++ = 0xFF; + } +@@ -5761,17 +5762,53 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, u8 *eid, u8 *end, + u8 is_beacon, u8 **eid_offsets, int *eid_count, + int eid_max, u8 ema_beacon) + { +- int count = 1; ++ int count = 1, dtim_period; ++ u8 remainder, **dtim_offset = NULL; ++ struct hostapd_bss_config *conf; ++ struct hostapd_iface *iface = hapd->iface; ++ ++ if (eid_count && ++ !(dtim_offset = os_zalloc(iface->num_bss * sizeof(eid)))) ++ return eid; + +- while (count < hapd->iface->num_bss) { +- if (eid_offsets && eid_count && *eid_count < eid_max && ++ while (count < iface->num_bss) { ++ if (eid_offsets && eid_count && (*eid_count < eid_max) && + (ema_beacon || count == 1)) { + eid_offsets[*eid_count] = eid; + *eid_count = *eid_count + 1; + } + eid = hostapd_eid_multiple_bssid_chunk(hapd, eid, end, &count, +- is_beacon); ++ is_beacon, dtim_offset); + } ++ ++ if (!eid_count || !(*eid_count)) { ++ if (dtim_offset) ++ os_free(dtim_offset); ++ return eid; ++ } ++ ++ do { ++ if (hapd != hostapd_get_primary_bss(hapd)) ++ break; ++ ++ for (count = 0; count < iface->num_bss; count++) { ++ conf = iface->bss[count]->conf; ++ dtim_period = conf->dtim_period; ++ remainder = dtim_period % (*eid_count); ++ if (remainder) { ++ conf->dtim_period += ((*eid_count) - remainder); ++ wpa_printf(MSG_DEBUG, ++ "Multiple BSSID: DTIM period changed from %d to %d for SSID %s\n", ++ dtim_period, conf->dtim_period, ++ conf->ssid.ssid); ++ ++ if (count && dtim_offset[count]) ++ *dtim_offset[count] = conf->dtim_period; ++ } ++ } ++ } while (0); ++ ++ os_free(dtim_offset); + return eid; + } + +-- +2.25.0 + diff --git a/feeds/wifi-ax/hostapd/patches/e00-009-fix-reduced-neighbor-report-length.patch b/feeds/wifi-ax/hostapd/patches/e00-009-fix-reduced-neighbor-report-length.patch new file mode 100644 index 000000000..f08302dab --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-009-fix-reduced-neighbor-report-length.patch @@ -0,0 +1,58 @@ +From 2fc69199a935c06c95f9b2766a4ec30208478720 Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Wed, 30 Sep 2020 20:41:54 -0700 +Subject: [PATCH] hostapd: Fix reduced neighbor report length + +The function hostapd_eid_reduced_neighbor_report_len() doesn't include 2 +bytes for the element ID and length fields which results in failure to +set beacon when more than basic features are enabled. + +This patch fixes this error which was found after enabling radio +measurement capabilities. + +Signed-off-by: Aloka Dixit +--- + src/ap/ieee802_11.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c +index 65a556e3a606..806e8b02b732 100644 +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -5771,6 +5771,8 @@ size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd) + len += TBTT_HEADER_LENGTH + ((hapd->iface->num_bss - 1) * TBTT_INFO_LENGTH); + if (!dl_list_empty(&hapd->nr_db)) + len += dl_list_len(&hapd->nr_db) * (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH); ++ if (len) ++ len += 2; /* Element ID and length */ + + return len; + } +@@ -5781,12 +5783,13 @@ u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid) + size_t len = hostapd_eid_reduced_neighbor_report_len(hapd); + struct hostapd_neighbor_entry *nr; + int i, count = 0; ++ u8 *size_offset; + + if (!len) + return eid; + + *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; +- *eid++ = len; ++ size_offset = eid++; + + if (hapd->iface->num_bss > 1) { + u8 op_class, channel; +@@ -5848,6 +5851,9 @@ nr_db: + + if (!count) + eid -= 2; ++ else ++ *size_offset = (eid - size_offset) - 1; ++ + return eid; + } + +-- +2.25.0 + diff --git a/feeds/wifi-ax/hostapd/patches/e00-010-hidden-SSID-support-in-multiple-BSSID-IE.patch b/feeds/wifi-ax/hostapd/patches/e00-010-hidden-SSID-support-in-multiple-BSSID-IE.patch new file mode 100644 index 000000000..7036f34e1 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-010-hidden-SSID-support-in-multiple-BSSID-IE.patch @@ -0,0 +1,262 @@ +From 427d9ffc462dd1e76d03334d477864b7a33afc05 Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Sat, 3 Oct 2020 15:41:11 -0700 +Subject: [PATCH] hostapd: Hidden SSID support in multiple BSSID IE + +Hidden nontransmitted BSSID profiles will be included in the beacons and +probe responses but SSID value will be removed or set to all zeros +depending on the configured value of 'ignore_broadcast_ssid'. +If complete profiles are omited, clients cannot stay connected to the AP. + +For unicast probe requests with SSID set to a hidden nontransmitted BSSID +profile, complete SSID is included in the probe response. +This patch adds a new input parameter in related functions, pointer to +hostapd_data for nontransmitted profiles, to differentiate this case. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 24 +++++++++++-------- + src/ap/ieee802_11.c | 56 +++++++++++++++++++++++++++++++++------------ + src/ap/ieee802_11.h | 7 ++++-- + 3 files changed, 62 insertions(+), 25 deletions(-) + +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index f3862dbb17f1..808a2d939cbe 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -432,12 +432,16 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + const struct ieee80211_mgmt *req, + int is_p2p, size_t *resp_len) + { ++ struct hostapd_data *hidden = NULL; + struct ieee80211_mgmt *resp; + u8 *pos, *epos, *csa_pos, *ext_cap_pos; + size_t buflen; + +- if (hapd->iconf->multiple_bssid) ++ if (hapd->iconf->multiple_bssid && ++ hapd != hostapd_get_primary_bss(hapd)) { ++ hidden = hapd; + hapd = hostapd_get_primary_bss(hapd); ++ } + + #define MAX_PROBERESP_LEN 768 + buflen = MAX_PROBERESP_LEN; +@@ -476,7 +480,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + buflen += hostapd_eid_owe_trans_len(hapd); + buflen += hostapd_eid_dpp_cc_len(hapd); + if (hapd->iconf->multiple_bssid) +- buflen += hostapd_eid_multiple_bssid_len(hapd); ++ buflen += hostapd_eid_multiple_bssid_len(hapd, hidden, 0); + + resp = os_zalloc(buflen); + if (resp == NULL) +@@ -535,7 +539,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + pos = hostapd_get_mde(hapd, pos, epos - pos); + + if (hapd->iconf->multiple_bssid) +- pos = hostapd_eid_multiple_bssid(hapd, pos, epos, 0, NULL, 0, 0, 0); ++ pos = hostapd_eid_multiple_bssid(hapd, hidden, pos, epos, 0, ++ NULL, 0, 0, 0); + + /* eCSA IE */ + csa_pos = hostapd_eid_ecsa(hapd, pos); +@@ -837,10 +842,6 @@ void handle_probe_req(struct hostapd_data *hapd, + .frame_info = fi, + }; + +- if (hapd->iconf->multiple_bssid && +- hapd != hostapd_get_primary_bss(hapd)) +- return; +- + if (len < IEEE80211_HDRLEN) + return; + ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN; +@@ -1067,6 +1068,10 @@ void handle_probe_req(struct hostapd_data *hapd, + wpa_msg_ctrl(hapd->msg_ctx, MSG_INFO, RX_PROBE_REQUEST "sa=" MACSTR + " signal=%d", MAC2STR(mgmt->sa), ssi_signal); + ++ if (hapd->iconf->multiple_bssid && ++ hapd != hostapd_get_primary_bss(hapd) && res != EXACT_SSID_MATCH) ++ return; ++ + resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL, + &resp_len); + if (resp == NULL) +@@ -1770,7 +1775,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + } + + if (hapd->iconf->multiple_bssid) { +- int len = hostapd_eid_multiple_bssid_len(hapd); ++ int len = hostapd_eid_multiple_bssid_len(hapd, NULL, 1); + u8 *end; + + params->multiple_bssid_index = hostapd_get_bss_index(hapd); +@@ -1778,7 +1783,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + params->multiple_bssid_ies = os_zalloc(len); + if (params->multiple_bssid_ies == NULL) + return -1; +- end = hostapd_eid_multiple_bssid(hapd, params->multiple_bssid_ies, ++ end = hostapd_eid_multiple_bssid(hapd, NULL, ++ params->multiple_bssid_ies, + params->multiple_bssid_ies + len, + 1, params->multiple_bssid_ie_offsets, + ¶ms->multiple_bssid_ie_count, +diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c +index 88c06d43d341..ffbadc535711 100644 +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -5651,24 +5651,35 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid) + + + static int hostapd_eid_multiple_bssid_chunk_len(struct hostapd_data *hapd, +- int *count) ++ struct hostapd_data *hidden, ++ int *count, ++ u8 is_beacon) + { + /* ID + size + count */ + int i, len = 3, nontx_profile_len; + size_t ies_len = 0; + struct hostapd_data *bss; ++ struct hostapd_bss_config *conf; + + for (i = *count; i < hapd->iface->num_bss; i++) { + bss = hapd->iface->bss[i]; ++ conf = bss->conf; + + /* + * Sublement ID: 1 byte + * Length: 1 byte + * Nontransmitted capabilities: 4 bytes +- * Multiple BSSID Index Element: 5 bytes +- * SSID element: 2 + variable ++ * SSID element: 2 bytes ++ * Multiple BSSID Index Element: 3 bytes (+2 bytes in beacons) + */ +- nontx_profile_len = 13 + bss->conf->ssid.ssid_len; ++ nontx_profile_len = 11; ++ ++ if (!conf->ignore_broadcast_ssid || ++ conf->ignore_broadcast_ssid == 2 || bss == hidden) ++ nontx_profile_len += conf->ssid.ssid_len; ++ ++ if (is_beacon) ++ nontx_profile_len += 2; + + if (wpa_auth_get_wpa_ie(bss->wpa_auth, &ies_len)) + nontx_profile_len += ies_len; +@@ -5686,21 +5697,27 @@ multiple_bssid_too_big: + } + + +-int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd) ++int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, ++ struct hostapd_data *hidden, ++ u8 is_beacon) + { + int count = 1, len = 0; + + while (count < hapd->iface->num_bss) +- len += hostapd_eid_multiple_bssid_chunk_len(hapd, &count); ++ len += hostapd_eid_multiple_bssid_chunk_len(hapd, hidden, ++ &count, is_beacon); + + return len; + } + + + static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, ++ struct hostapd_data *hidden, + u8 *eid, u8 *end, int *count, + u8 is_beacon, u8 *dtim_offset[]) + { ++ struct hostapd_data *bss; ++ struct hostapd_bss_config *conf; + u8 *size_offset, *num_offset; + int i; + +@@ -5709,7 +5726,8 @@ static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, + num_offset = eid++; + + for (i = *count; i < hapd->iface->num_bss; i++) { +- struct hostapd_data *bss = hapd->iface->bss[i]; ++ bss = hapd->iface->bss[i]; ++ conf = bss->conf; + u8 *bss_size_offset, *index_size_offset, *pos = eid; + u16 capab_info; + +@@ -5723,16 +5741,24 @@ static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, + eid += sizeof(capab_info); + + *eid++ = WLAN_EID_SSID; +- *eid++ = bss->conf->ssid.ssid_len; +- os_memcpy(eid, bss->conf->ssid.ssid, bss->conf->ssid.ssid_len); +- eid += bss->conf->ssid.ssid_len; ++ if (!conf->ignore_broadcast_ssid || bss == hidden) { ++ *eid++ = conf->ssid.ssid_len; ++ os_memcpy(eid, conf->ssid.ssid, conf->ssid.ssid_len); ++ eid += conf->ssid.ssid_len; ++ } else if (conf->ignore_broadcast_ssid == 2) { ++ *eid++ = conf->ssid.ssid_len; ++ os_memset(eid, 0, conf->ssid.ssid_len); ++ eid += conf->ssid.ssid_len; ++ } else { ++ *eid++ = 0; ++ } + + *eid++ = WLAN_EID_MULTIPLE_BSSID_INDEX; + index_size_offset = eid++; + *eid++ = i; + if (is_beacon) { + dtim_offset[i] = eid; +- *eid++ = bss->conf->dtim_period; ++ *eid++ = conf->dtim_period; + *eid++ = 0xFF; + } + *index_size_offset = (eid - index_size_offset) - 1; +@@ -5758,7 +5784,8 @@ multiple_bssid_too_big: + } + + +-u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, u8 *eid, u8 *end, ++u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, ++ struct hostapd_data *hidden, u8 *eid, u8 *end, + u8 is_beacon, u8 **eid_offsets, int *eid_count, + int eid_max, u8 ema_beacon) + { +@@ -5777,8 +5804,9 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, u8 *eid, u8 *end, + eid_offsets[*eid_count] = eid; + *eid_count = *eid_count + 1; + } +- eid = hostapd_eid_multiple_bssid_chunk(hapd, eid, end, &count, +- is_beacon, dtim_offset); ++ eid = hostapd_eid_multiple_bssid_chunk(hapd, hidden, eid, end, ++ &count, is_beacon, ++ dtim_offset); + } + + if (!eid_count) +diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h +index 9fbe89ed7c8e..1145210dbfc7 100644 +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h +@@ -119,10 +119,13 @@ u8 * hostapd_eid_time_zone(struct hostapd_data *hapd, u8 *eid); + int hostapd_update_time_adv(struct hostapd_data *hapd); + void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); + u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid); +-u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, u8 *eid, u8 *end, ++u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, ++ struct hostapd_data *hidden, u8 *eid, u8 *end, + u8 is_beacon, u8 **eid_offsets, int *eid_count, + int eid_max, u8 ema_beacon); +-int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd); ++int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, ++ struct hostapd_data *hidden, ++ u8 is_beacon); + u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid); + size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd); + int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); +-- +2.25.0 + diff --git a/feeds/wifi-ax/hostapd/patches/e00-011-6ghz-out-of-band-advertisements.patch b/feeds/wifi-ax/hostapd/patches/e00-011-6ghz-out-of-band-advertisements.patch new file mode 100644 index 000000000..2fe290398 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-011-6ghz-out-of-band-advertisements.patch @@ -0,0 +1,659 @@ +From 147810b51909c31fe9483190996190b6a89252fd Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 6 Oct 2020 15:03:13 -0700 +Subject: [PATCH 1/4] co-located: add a config option to indicate co locate + +A 6GHz BSS can be co-located with a 2/5GHz BSS. This option allows us to +indicate if this should be done. + +Signed-off-by: John Crispin +--- + hostapd/config_file.c | 2 ++ + hostapd/hostapd.conf | 3 +++ + src/ap/ap_config.h | 1 + + 3 files changed, 6 insertions(+) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index 0638b675bc34..18fc13569bc3 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -3612,6 +3612,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, + "unsol_bcast_probe_resp_interval") == 0) { + bss->unsol_bcast_probe_resp_interval = + (atoi(pos) > 20) ? 20 : atoi(pos); ++ } else if (os_strcmp(buf, "he_co_locate") == 0) { ++ conf->he_co_locate = atoi(pos); + #endif /* CONFIG_IEEE80211AX */ + } else if (os_strcmp(buf, "max_listen_interval") == 0) { + bss->max_listen_interval = atoi(pos); +diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf +index d593bba97c83..48207af9b0b5 100644 +--- a/hostapd/hostapd.conf ++++ b/hostapd/hostapd.conf +@@ -571,6 +571,9 @@ wmm_ac_vo_acm=0 + # Default: 1 (enabled) + #broadcast_deauth=1 + ++# Enable co-locate for a 6GHz radio ++#co_locate=0 ++ + ##### IEEE 802.11n related configuration ###################################### + + # ieee80211n: Whether IEEE 802.11n (HT) is enabled +diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h +index 440384136b74..0c1afced5cfe 100644 +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -1046,6 +1046,7 @@ struct hostapd_config { + u8 he_oper_chwidth; + u8 he_oper_centr_freq_seg0_idx; + u8 he_oper_centr_freq_seg1_idx; ++ bool he_co_locate; + #endif /* CONFIG_IEEE80211AX */ + + #ifdef CONFIG_IEEE80211AX +-- +2.7.4 + + +From 7624ae547dc5623a8e9e7d7e891b5968f73cf9db Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 6 Oct 2020 15:05:24 -0700 +Subject: [PATCH 2/4] neighbor_db: set the co-locate bit + +If the BSS is co-located, the corresponding bit needs to be set inside +bssid_info. + +Signed-off-by: John Crispin +--- + src/ap/neighbor_db.c | 3 +++ + src/common/ieee802_11_defs.h | 2 ++ + 2 files changed, 5 insertions(+) + +diff --git a/src/ap/neighbor_db.c b/src/ap/neighbor_db.c +index 06f6691342a0..2e63bebc5f13 100644 +--- a/src/ap/neighbor_db.c ++++ b/src/ap/neighbor_db.c +@@ -282,6 +282,9 @@ void hostapd_neighbor_set_own_report(struct hostapd_data *hapd) + bssid_info |= NEI_REP_BSSID_INFO_HE; + } + ++ if (hapd->iconf->he_co_locate) ++ bssid_info |= NEI_REP_BSSID_INFO_HE_CO_LOCATED; ++ + /* TODO: Set NEI_REP_BSSID_INFO_MOBILITY_DOMAIN if MDE is set */ + + if (ieee80211_freq_to_channel_ext(hapd->iface->freq, +diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h +index b7d0787280e9..94dd677b3308 100644 +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h +@@ -2128,6 +2128,8 @@ enum phy_type { + #define NEI_REP_BSSID_INFO_VHT BIT(12) + #define NEI_REP_BSSID_INFO_FTM BIT(13) + #define NEI_REP_BSSID_INFO_HE BIT(14) ++#define NEI_REP_BSSID_INFO_HE_ER_BSS BIT(15) ++#define NEI_REP_BSSID_INFO_HE_CO_LOCATED BIT(16) + + /* + * IEEE P802.11-REVmc/D5.0 Table 9-152 - HT/VHT Operation Information +-- +2.7.4 + + +From a2ec27dae137affda5f033c0dc26d3cf6a5ca6ed Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Mon, 21 Sep 2020 13:50:58 +0200 +Subject: [PATCH 3/4] rrm: add handling for co-located BSS + +A BSS shall include the neighbor entry of a co-located BSS upon an incoming +request. + +Signed-off-by: John Crispin +--- + src/ap/rrm.c | 117 +++++++++++++++++++++++++++++++++++++---------------------- + 1 file changed, 74 insertions(+), 43 deletions(-) + +diff --git a/src/ap/rrm.c b/src/ap/rrm.c +index f2d5cd16e885..c9d51dfa7132 100644 +--- a/src/ap/rrm.c ++++ b/src/ap/rrm.c +@@ -196,6 +196,63 @@ static size_t hostapd_neighbor_report_len(struct wpabuf *buf, + } + + ++static int hostapd_add_nei_report_entry(struct wpabuf *buf, struct hostapd_neighbor_entry *nr, ++ struct wpa_ssid_value *ssid, u8 lci, ++ u8 civic, u16 lci_max_age) ++{ ++ u8 *msmt_token; ++ int send_lci; ++ size_t len; ++ ++ if (ssid->ssid_len != nr->ssid.ssid_len || ++ os_memcmp(ssid->ssid, nr->ssid.ssid, ssid->ssid_len) != 0) ++ return 0; ++ ++ send_lci = (lci != 0) && hostapd_check_lci_age(nr, lci_max_age); ++ len = hostapd_neighbor_report_len(buf, nr, send_lci, civic); ++ ++ if (len - 2 > 0xff) { ++ wpa_printf(MSG_DEBUG, ++ "NR entry for " MACSTR " exceeds 0xFF bytes", ++ MAC2STR(nr->bssid)); ++ return 0; ++ } ++ ++ if (len > wpabuf_tailroom(buf)) ++ return -1; ++ ++ wpabuf_put_u8(buf, WLAN_EID_NEIGHBOR_REPORT); ++ wpabuf_put_u8(buf, len - 2); ++ wpabuf_put_buf(buf, nr->nr); ++ ++ if (send_lci && nr->lci) { ++ wpabuf_put_u8(buf, WLAN_EID_MEASURE_REPORT); ++ wpabuf_put_u8(buf, wpabuf_len(nr->lci)); ++ /* ++ * Override measurement token - the first byte of the ++ * Measurement Report element. ++ */ ++ msmt_token = wpabuf_put(buf, 0); ++ wpabuf_put_buf(buf, nr->lci); ++ *msmt_token = lci; ++ } ++ ++ if (civic && nr->civic) { ++ wpabuf_put_u8(buf, WLAN_EID_MEASURE_REPORT); ++ wpabuf_put_u8(buf, wpabuf_len(nr->civic)); ++ /* ++ * Override measurement token - the first byte of the ++ * Measurement Report element. ++ */ ++ msmt_token = wpabuf_put(buf, 0); ++ wpabuf_put_buf(buf, nr->civic); ++ *msmt_token = civic; ++ } ++ ++ return 0; ++} ++ ++ + static void hostapd_send_nei_report_resp(struct hostapd_data *hapd, + const u8 *addr, u8 dialog_token, + struct wpa_ssid_value *ssid, u8 lci, +@@ -203,7 +260,6 @@ static void hostapd_send_nei_report_resp(struct hostapd_data *hapd, + { + struct hostapd_neighbor_entry *nr; + struct wpabuf *buf; +- u8 *msmt_token; + + /* + * The number and length of the Neighbor Report elements in a Neighbor +@@ -220,52 +276,27 @@ static void hostapd_send_nei_report_resp(struct hostapd_data *hapd, + + dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, + list) { +- int send_lci; +- size_t len; +- +- if (ssid->ssid_len != nr->ssid.ssid_len || +- os_memcmp(ssid->ssid, nr->ssid.ssid, ssid->ssid_len) != 0) +- continue; +- +- send_lci = (lci != 0) && hostapd_check_lci_age(nr, lci_max_age); +- len = hostapd_neighbor_report_len(buf, nr, send_lci, civic); +- +- if (len - 2 > 0xff) { +- wpa_printf(MSG_DEBUG, +- "NR entry for " MACSTR " exceeds 0xFF bytes", +- MAC2STR(nr->bssid)); +- continue; +- } +- +- if (len > wpabuf_tailroom(buf)) ++ if (hostapd_add_nei_report_entry(buf, nr, ssid, lci, civic, lci_max_age)) + break; ++ } + +- wpabuf_put_u8(buf, WLAN_EID_NEIGHBOR_REPORT); +- wpabuf_put_u8(buf, len - 2); +- wpabuf_put_buf(buf, nr->nr); ++ if (!hapd->iconf->he_co_locate) { ++ int i; + +- if (send_lci && nr->lci) { +- wpabuf_put_u8(buf, WLAN_EID_MEASURE_REPORT); +- wpabuf_put_u8(buf, wpabuf_len(nr->lci)); +- /* +- * Override measurement token - the first byte of the +- * Measurement Report element. +- */ +- msmt_token = wpabuf_put(buf, 0); +- wpabuf_put_buf(buf, nr->lci); +- *msmt_token = lci; +- } ++ for (i = 0; i < hapd->iface->interfaces->count; i++) { ++ struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; ++ int j; ++ ++ if (iface == hapd->iface || !iface->conf->he_co_locate) ++ continue; + +- if (civic && nr->civic) { +- wpabuf_put_u8(buf, WLAN_EID_MEASURE_REPORT); +- wpabuf_put_u8(buf, wpabuf_len(nr->civic)); +- /* +- * Override measurement token - the first byte of the +- * Measurement Report element. +- */ +- msmt_token = wpabuf_put(buf, 0); +- wpabuf_put_buf(buf, nr->civic); +- *msmt_token = civic; ++ for (j = 0; j < iface->num_bss; j++) { ++ nr = hostapd_neighbor_get(iface->bss[j], iface->bss[j]->own_addr, NULL); ++ if (!nr) ++ continue; ++ if (hostapd_add_nei_report_entry(buf, nr, ssid, lci, civic, lci_max_age)) ++ break; ++ } + } + } + +-- +2.7.4 + + +From 9e0865b8135bf1286c864ae3da601c40e3325153 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Wed, 21 Oct 2020 11:47:22 -0700 +Subject: [PATCH 4/4] rnr: add reduced neighbor reporting + +The Reduced Neighbor Report (rnr) element contains channel and other +information related to neighbor APs. It is part of the OCE requirement. + +Signed-off-by: John Crispin +Signed-off-by: Aloka Dixit +Signed-off-by: Muna Sinada +--- + src/ap/beacon.c | 40 ++++++++-- + src/ap/ieee802_11.c | 177 ++++++++++++++++++++++++++++++++----------- + src/ap/ieee802_11.h | 4 +- + src/common/ieee802_11_defs.h | 6 +- + 4 files changed, 171 insertions(+), 56 deletions(-) + +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index 808a2d939cbe..b6592f219e65 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -481,6 +481,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + buflen += hostapd_eid_dpp_cc_len(hapd); + if (hapd->iconf->multiple_bssid) + buflen += hostapd_eid_multiple_bssid_len(hapd, hidden, 0); ++ if (hapd->conf->rnr_beacon) ++ buflen += hostapd_eid_reduced_neighbor_report_len(hapd, 1); + + resp = os_zalloc(buflen); + if (resp == NULL) +@@ -639,6 +641,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + pos = hostapd_eid_mbo(hapd, pos, (u8 *) resp + buflen - pos); + pos = hostapd_eid_owe_trans(hapd, pos, (u8 *) resp + buflen - pos); + pos = hostapd_eid_dpp_cc(hapd, pos, (u8 *) resp + buflen - pos); ++ if (hapd->conf->rnr_beacon) ++ pos = hostapd_eid_reduced_neighbor_report(hapd, pos, 1); + + if (hapd->conf->vendor_elements) { + os_memcpy(pos, wpabuf_head(hapd->conf->vendor_elements), +@@ -654,7 +658,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + enum ssid_match_result { + NO_SSID_MATCH, + EXACT_SSID_MATCH, +- WILDCARD_SSID_MATCH ++ WILDCARD_SSID_MATCH, ++ CO_LOCATED_SSID_MATCH + }; + + static enum ssid_match_result ssid_match(struct hostapd_data *hapd, +@@ -666,6 +671,7 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd, + { + const u8 *pos, *end; + int wildcard = 0; ++ size_t i, j; + + if (ssid_len == 0) + wildcard = 1; +@@ -699,6 +705,25 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd, + } + } + ++ /* Case of probe request from STA with SSID matching the SSID of a ++ * co-located AP ++ */ ++ if (!wildcard && hapd->conf->rnr_beacon) { ++ for (i = 0; i < hapd->iface->interfaces->count; i++) { ++ struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; ++ ++ if (iface == hapd->iface || !iface->conf->he_co_locate) ++ continue; ++ ++ struct hostapd_iface *iface2 = iface->bss[0]->iface; ++ for (j = 0; j < iface2->num_bss; j++){ ++ if (ssid_len == iface2->bss[j]->conf->ssid.ssid_len && ++ os_memcmp(ssid, iface2->bss[j]->conf->ssid.ssid, ssid_len) == 0) ++ return CO_LOCATED_SSID_MATCH; ++ } ++ } ++ } ++ + return wildcard ? WILDCARD_SSID_MATCH : NO_SSID_MATCH; + } + +@@ -1069,7 +1094,8 @@ void handle_probe_req(struct hostapd_data *hapd, + " signal=%d", MAC2STR(mgmt->sa), ssi_signal); + + if (hapd->iconf->multiple_bssid && +- hapd != hostapd_get_primary_bss(hapd) && res != EXACT_SSID_MATCH) ++ hapd != hostapd_get_primary_bss(hapd) && ++ (res != EXACT_SSID_MATCH && res != CO_LOCATED_SSID_MATCH)) + return; + + resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL, +@@ -1343,7 +1369,7 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, u32 *len) + total_len += 3; + } + +- total_len += hostapd_eid_reduced_neighbor_report_len(hapd); ++ total_len += hostapd_eid_reduced_neighbor_report_len(hapd, 0); + + pos = hostapd_eid_fils_indic(hapd, buf, 0); + buf_len = pos - buf; +@@ -1401,7 +1427,7 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, u32 *len) + *length_pos = pos - (length_pos + 1); + + /* Reduced Neighbor Report element */ +- pos = hostapd_eid_reduced_neighbor_report(hapd, pos); ++ pos = hostapd_eid_reduced_neighbor_report(hapd, pos, 0); + + /* FILS indication element */ + if (buf_len) { +@@ -1496,7 +1522,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + tail_len += hostapd_mbo_ie_len(hapd); + tail_len += hostapd_eid_owe_trans_len(hapd); + tail_len += hostapd_eid_dpp_cc_len(hapd); +- tail_len += hostapd_eid_reduced_neighbor_report_len(hapd); ++ if (hapd->conf->rnr_beacon) ++ tail_len += hostapd_eid_reduced_neighbor_report_len(hapd, 0); + + tailpos = tail = os_malloc(tail_len); + if (head == NULL || tail == NULL) { +@@ -1668,7 +1695,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + tailpos = hostapd_eid_owe_trans(hapd, tailpos, + tail + tail_len - tailpos); + tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos); +- tailpos = hostapd_eid_reduced_neighbor_report(hapd, tailpos); ++ if (hapd->conf->rnr_beacon) ++ tailpos = hostapd_eid_reduced_neighbor_report(hapd, tailpos, 0); + + if (hapd->conf->vendor_elements) { + os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), +diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c +index 9c0f38fc0bf1..3be299a477b9 100644 +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -5841,14 +5841,45 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, + } + + +-size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd) ++size_t hostapd_eid_reduced_neighbor_report_iface_len(struct hostapd_data *hapd, ++ struct hostapd_data *reporting_hapd) + { + size_t len = 0; ++ int i; ++ for (i = 0; i < hapd->iface->num_bss; i++) { ++ if (hapd->iface->bss[i] == reporting_hapd || ++ hapd->iface->bss[i]->conf->ignore_broadcast_ssid) ++ continue; ++ len += TBTT_INFO_LENGTH; ++ } ++ return len; ++} ++ ++ ++size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd, bool probe_resp) ++{ ++ size_t len = 0; ++ int i; + + if (hapd->iface->num_bss > 1) +- len += TBTT_HEADER_LENGTH + ((hapd->iface->num_bss - 1) * TBTT_INFO_LENGTH); +- if (!dl_list_empty(&hapd->nr_db)) ++ len += (TBTT_HEADER_LENGTH + ++ hostapd_eid_reduced_neighbor_report_iface_len(hapd, ++ hapd)); ++ ++ for (i = 0; i < hapd->iface->interfaces->count; i++) { ++ struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; ++ ++ if (iface == hapd->iface || !iface->conf->he_co_locate) ++ continue; ++ ++ len += (TBTT_HEADER_LENGTH + ++ hostapd_eid_reduced_neighbor_report_iface_len(iface->bss[0], ++ hapd)); ++ } ++ ++ if (!probe_resp && !dl_list_empty(&hapd->nr_db)) + len += dl_list_len(&hapd->nr_db) * (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH); ++ + if (len) + len += 2; /* Element ID and length */ + +@@ -5856,58 +5887,76 @@ size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd) + } + + +-u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid) ++static u8 *hostapd_eid_reduced_neighbor_report_iface(struct hostapd_data *hapd, ++ struct hostapd_data *reporting_hapd, ++ u8 *eid, int *count) + { +- size_t len = hostapd_eid_reduced_neighbor_report_len(hapd); +- struct hostapd_neighbor_entry *nr; +- int i, count = 0; +- u8 *size_offset; ++ u8 *eid_start = eid, *tbtt_count_pos; ++ u8 tbtt_count = 0; ++ u8 op_class, channel; ++ int i; + +- if (!len) ++ if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA) || ++ !hapd->iface->freq) + return eid; + +- *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; +- size_offset = eid++; +- +- if (hapd->iface->num_bss > 1) { +- u8 op_class, channel; ++ if (ieee80211_freq_to_channel_ext(hapd->iface->freq, ++ hapd->iconf->secondary_channel, ++ hostapd_get_oper_chwidth(hapd->iconf), ++ &op_class, &channel) == ++ NUM_HOSTAPD_MODES) ++ return eid; + +- if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA) || +- !hapd->iface->freq) +- goto nr_db; ++ tbtt_count_pos = eid++; ++ *eid++ = TBTT_INFO_LENGTH; ++ *eid++ = op_class; ++ *eid++ = hapd->iconf->channel; ++ for (i = 0; i < hapd->iface->num_bss; i++) { ++ u8 bss_param = 0; + +- if (ieee80211_freq_to_channel_ext(hapd->iface->freq, +- hapd->iconf->secondary_channel, +- hostapd_get_oper_chwidth(hapd->iconf), +- &op_class, &channel) == +- NUM_HOSTAPD_MODES) +- goto nr_db; ++ if (hapd->iface->bss[i] == reporting_hapd || ++ hapd->iface->bss[i]->conf->ignore_broadcast_ssid) ++ continue; + +- *eid++ = TBTT_INFO_COUNT(hapd->iface->num_bss - 2); +- *eid++ = TBTT_INFO_LENGTH; +- *eid++ = op_class; +- *eid++ = hapd->iconf->channel; +- for (i = 0; i < hapd->iface->num_bss; i++) { +- u8 bss_param = 0; +- +- if (hapd->iface->bss[i] == hapd) +- continue; +- *eid++ = TBTT_AP_OFFSET_UNKNOWN; +- os_memcpy(eid, hapd->iface->bss[i]->conf->bssid, ETH_ALEN); +- eid += 6; +- os_memcpy(eid, &hapd->iface->bss[i]->conf->ssid.short_ssid, 4); +- eid += 4; +- if (hapd->iface->bss[i]->conf->ssid.short_ssid == +- hapd->conf->ssid.short_ssid) +- bss_param |= TBTT_BSS_PARAM_SAME_SSID; +- if (hapd->iconf->multiple_bssid) +- bss_param |= TBTT_BSS_PARAM_MULTIPLE_BSSID; +- *eid++ = bss_param; +- count++; ++ *eid++ = TBTT_AP_OFFSET_UNKNOWN; ++ os_memcpy(eid, hapd->iface->bss[i]->conf->bssid, ETH_ALEN); ++ eid += 6; ++ os_memcpy(eid, &hapd->iface->bss[i]->conf->ssid.short_ssid, 4); ++ eid += 4; ++ if (hapd->iface->bss[i]->conf->ssid.short_ssid == ++ reporting_hapd->conf->ssid.short_ssid) ++ bss_param |= TBTT_BSS_PARAM_SAME_SSID; ++ ++ if (hapd->iconf->multiple_bssid && hapd->iface->num_bss > 1) { ++ bss_param |= TBTT_BSS_PARAM_MULTIPLE_BSSID; ++ if (hapd->iface->bss[i] == hostapd_get_primary_bss(hapd->iface->bss[i])) ++ bss_param |= TBTT_BSS_PARAM_TRANSMITTED_BSSID; + } ++ if (hapd->iface->bss[i]->iconf->he_co_locate) ++ bss_param |= TBTT_BSS_PARAM_CO_LOCATED; ++ ++ if (hapd->iface->bss[i]->conf->unsol_bcast_probe_resp_interval) ++ bss_param |= TBTT_BSS_PARAM_20_TU_PROBE_RESP_ACTIVE; ++ ++ *eid++ = bss_param; ++ /* Setting 20 MHz PSD */ ++ *eid++ = TBTT_PSD_MAX_TXPOWER; ++ *count += 1; ++ tbtt_count++; + } + +-nr_db: ++ if (tbtt_count == 0) ++ return eid_start; ++ ++ *tbtt_count_pos = TBTT_INFO_COUNT(tbtt_count - 1); ++ return eid; ++} ++ ++ ++static u8 *hostapd_eid_reduced_neighbor_report_nr_db(struct hostapd_data *hapd, u8 *eid, int *count) ++{ ++ struct hostapd_neighbor_entry *nr; ++ + dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, + list) { + if (!nr->nr || wpabuf_len(nr->nr) < 12) +@@ -5924,9 +5973,45 @@ nr_db: + os_memcpy(eid, &nr->short_ssid, 4); + eid += 4; + *eid++ = nr->bss_parameters; +- count++; ++ /* setting 20 MHZ PSD */ ++ *eid++ = TBTT_PSD_MAX_TXPOWER; ++ *count += 1; + } + ++ return eid; ++} ++ ++ ++u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid, bool probe_resp) ++{ ++ size_t len = hostapd_eid_reduced_neighbor_report_len(hapd, probe_resp); ++ int i, count = 0; ++ u8 *size_offset; ++ ++ if (!len) ++ return eid; ++ ++ *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; ++ size_offset = eid++; ++ ++ if (hapd->iface->num_bss > 1) ++ eid = hostapd_eid_reduced_neighbor_report_iface(hapd, hapd, ++ eid, &count); ++ ++ for (i = 0; i < hapd->iface->interfaces->count; i++) { ++ struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; ++ ++ if (iface == hapd->iface || !iface->conf->he_co_locate) ++ continue; ++ ++ eid = hostapd_eid_reduced_neighbor_report_iface(iface->bss[0], ++ hapd, eid, ++ &count); ++ } ++ ++ if (!probe_resp) ++ hostapd_eid_reduced_neighbor_report_nr_db(hapd, eid, &count); ++ + if (!count) + eid -= 2; + else +diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h +index 1145210dbfc7..2f45b615f15d 100644 +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h +@@ -126,8 +126,8 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, + int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, + struct hostapd_data *hidden, + u8 is_beacon); +-u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid); +-size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd); ++u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid, bool probe_resp); ++size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd, bool probe_resp); + int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); + #ifdef CONFIG_SAE + void sae_clear_retransmit_timer(struct hostapd_data *hapd, +diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h +index 94dd677b3308..2ac497db067e 100644 +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h +@@ -2393,7 +2393,7 @@ enum edmg_bw_config { + + /* TBTT Information field defines */ + #define TBTT_HEADER_LENGTH 4 +-#define TBTT_INFO_LENGTH 12 ++#define TBTT_INFO_LENGTH 13 + #define TBTT_INFO_FILTERED_NEIGH_AP BIT(2) + #define TBTT_INFO_COUNT(x) (((x) & 0xf) << 4) + #define TBTT_AP_OFFSET_UNKNOWN 255 +@@ -2401,7 +2401,9 @@ enum edmg_bw_config { + #define TBTT_BSS_PARAM_SAME_SSID BIT(1) + #define TBTT_BSS_PARAM_MULTIPLE_BSSID BIT(2) + #define TBTT_BSS_PARAM_TRANSMITTED_BSSID BIT(3) +-#define TBTT_BSS_PARAM_CO_LOCATED_ESS BIT(4) ++#define TBTT_BSS_PARAM_MEMBER_CO_LOCATED_ESS BIT(4) + #define TBTT_BSS_PARAM_20_TU_PROBE_RESP_ACTIVE BIT(5) ++#define TBTT_BSS_PARAM_CO_LOCATED BIT(6) ++#define TBTT_PSD_MAX_TXPOWER 255 /* dBm */ + + #endif /* IEEE802_11_DEFS_H */ +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/801-bss-coloring-add-support-for-handling-collision-even.patch b/feeds/wifi-ax/hostapd/patches/f00-001-bss-coloring-add-support-for-handling-collision-events-and-triggering-CCA.patch similarity index 83% rename from feeds/wifi-ax/hostapd/patches/801-bss-coloring-add-support-for-handling-collision-even.patch rename to feeds/wifi-ax/hostapd/patches/f00-001-bss-coloring-add-support-for-handling-collision-events-and-triggering-CCA.patch index b9e0ef828..262dd55f6 100644 --- a/feeds/wifi-ax/hostapd/patches/801-bss-coloring-add-support-for-handling-collision-even.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-001-bss-coloring-add-support-for-handling-collision-events-and-triggering-CCA.patch @@ -1,8 +1,7 @@ -From c50e1c21882182fe8fa568204d831eb618d313c0 Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Wed, 17 Jun 2020 14:40:58 +0200 -Subject: [PATCH 801/813] bss coloring: add support for handling collision +Subject: [PATCH V4 1/6] bss coloring: add support for handling collision events and triggering CCA +Date: Wed, 26 Aug 2020 08:22:11 +0200 Add the core code for handling bss color collision events and triggering CCA inside the kernel. @@ -16,11 +15,9 @@ Signed-off-by: John Crispin src/drivers/driver.h | 31 +++++++++ 5 files changed, 184 insertions(+) -diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h -index 5738c1c97..838d4c57a 100644 --- a/src/ap/ap_drv_ops.h +++ b/src/ap/ap_drv_ops.h -@@ -298,6 +298,18 @@ static inline int hostapd_drv_switch_channel(struct hostapd_data *hapd, +@@ -299,6 +299,18 @@ static inline int hostapd_drv_switch_cha return hapd->driver->switch_channel(hapd->drv_priv, settings); } @@ -39,11 +36,9 @@ index 5738c1c97..838d4c57a 100644 static inline int hostapd_drv_status(struct hostapd_data *hapd, char *buf, size_t buflen) { -diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c -index c442b82db..1992b38d6 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -66,6 +66,8 @@ static int setup_interface2(struct hostapd_iface *iface); +@@ -65,6 +65,8 @@ static int setup_interface2(struct hosta static void channel_list_update_timeout(void *eloop_ctx, void *timeout_ctx); static void hostapd_interface_setup_failure_handler(void *eloop_ctx, void *timeout_ctx); @@ -52,7 +47,7 @@ index c442b82db..1992b38d6 100644 int hostapd_for_each_interface(struct hapd_interfaces *interfaces, -@@ -476,6 +478,9 @@ static void hostapd_free_hapd_data(struct hostapd_data *hapd) +@@ -476,6 +478,9 @@ static void hostapd_free_hapd_data(struc } eloop_cancel_timeout(auth_sae_process_commit, hapd, NULL); #endif /* CONFIG_SAE */ @@ -62,7 +57,7 @@ index c442b82db..1992b38d6 100644 } -@@ -3654,6 +3659,120 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface, +@@ -3698,6 +3703,119 @@ hostapd_switch_channel_fallback(struct h hostapd_enable_iface(iface); } @@ -122,7 +117,7 @@ index c442b82db..1992b38d6 100644 + return; + + /* check if there has been a recent collision */ -+ if (now.sec - hapd->last_color_collision.sec >= 10) ++ if (now.sec - hapd->last_color_collision.sec > 50) + return; + + r = os_random() % HE_OPERATION_BSS_COLOR_MAX; @@ -135,7 +130,6 @@ index c442b82db..1992b38d6 100644 + /* there are no free colors so turn bss coloring off */ + wpa_printf(MSG_INFO, "no free colors left, turning of BSS coloring"); + hapd->iface->conf->he_op.he_bss_color_disabled = 1; -+ hapd->iface->conf->he_op.he_bss_color = 1; + for (b = 0; b < hapd->iface->num_bss; b++) + ieee802_11_set_beacon(hapd->iface->bss[b]); + return; @@ -183,11 +177,9 @@ index c442b82db..1992b38d6 100644 #endif /* NEED_AP_MLME */ -diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h -index 44d2c6068..19dcd1b51 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -292,6 +292,16 @@ struct hostapd_data { +@@ -296,6 +296,16 @@ struct hostapd_data { unsigned int cs_c_off_ecsa_beacon; unsigned int cs_c_off_ecsa_proberesp; @@ -204,7 +196,7 @@ index 44d2c6068..19dcd1b51 100644 #ifdef CONFIG_P2P struct p2p_data *p2p; struct p2p_group *p2p_group; -@@ -636,6 +646,12 @@ void hostapd_periodic_iface(struct hostapd_iface *iface); +@@ -642,6 +652,12 @@ void hostapd_periodic_iface(struct hosta int hostapd_owe_trans_get_info(struct hostapd_data *hapd); void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx); @@ -217,11 +209,9 @@ index 44d2c6068..19dcd1b51 100644 /* utils.c */ int hostapd_register_probereq_cb(struct hostapd_data *hapd, int (*cb)(void *ctx, const u8 *sa, -diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h -index ebb98ed38..92d3c1d49 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h -@@ -2266,6 +2266,7 @@ struct ieee80211_spatial_reuse { +@@ -2275,6 +2275,7 @@ struct ieee80211_spatial_reuse { #define HE_OPERATION_BSS_COLOR_PARTIAL ((u32) BIT(30)) #define HE_OPERATION_BSS_COLOR_DISABLED ((u32) BIT(31)) #define HE_OPERATION_BSS_COLOR_OFFSET 24 @@ -229,9 +219,9 @@ index ebb98ed38..92d3c1d49 100644 /* Spatial Reuse defines */ #define SPATIAL_REUSE_SRP_DISALLOWED BIT(0) -@@ -2343,4 +2344,9 @@ enum edmg_bw_config { - /* DPP Public Action frame identifiers - OUI_WFA */ - #define DPP_OUI_TYPE 0x1A +@@ -2402,4 +2403,9 @@ enum edmg_bw_config { + #define TBTT_BSS_PARAM_CO_LOCATED_ESS BIT(4) + #define TBTT_BSS_PARAM_20_TU_PROBE_RESP_ACTIVE BIT(5) +/* IEEE802.11/D6.0 - 26.17.3.5.1 + * the minimum default timeout between color collision and color change is defined as 50s @@ -239,11 +229,9 @@ index ebb98ed38..92d3c1d49 100644 +#define DOT11BSS_COLOR_COLLISION_AP_PERIOD 50 + #endif /* IEEE802_11_DEFS_H */ -diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index eca2ca3a4..2a2bc29db 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -2343,6 +2343,26 @@ struct csa_settings { +@@ -2400,6 +2400,26 @@ struct csa_settings { u16 counter_offset_presp[2]; }; @@ -270,11 +258,10 @@ index eca2ca3a4..2a2bc29db 100644 /* TDLS peer capabilities for send_tdls_mgmt() */ enum tdls_peer_capability { TDLS_PEER_HT = BIT(0), -@@ -3913,6 +3933,17 @@ struct wpa_driver_ops { - */ +@@ -3972,6 +3992,17 @@ struct wpa_driver_ops { int (*switch_channel)(void *priv, struct csa_settings *settings); -+ /** + /** + * switch_color - Announce color switch and migrate the BSS to the + * given color + * @priv: Private driver interface data @@ -285,9 +272,7 @@ index eca2ca3a4..2a2bc29db 100644 + */ + int (*switch_color)(void *priv, struct cca_settings *settings); + - /** ++ /** * add_tx_ts - Add traffic stream * @priv: Private driver interface data --- -2.25.1 - + * @tsid: Traffic stream ID diff --git a/feeds/wifi-ax/hostapd/patches/f00-001-hostapd-Fix-calling-hostapd_disassoc_accept_mac-in-CLI.patch b/feeds/wifi-ax/hostapd/patches/f00-001-hostapd-Fix-calling-hostapd_disassoc_accept_mac-in-CLI.patch new file mode 100644 index 000000000..6cbce368d --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/f00-001-hostapd-Fix-calling-hostapd_disassoc_accept_mac-in-CLI.patch @@ -0,0 +1,46 @@ +From aa394e37a56eaed0a575b8a1a34ebc31ca06af42 Mon Sep 17 00:00:00 2001 +From: Nishant Pandey +Date: Tue, 22 Sep 2020 14:07:05 +0530 +Subject: [PATCH] hostapd: Fix calling hostapd_disassoc_accept_mac in CLI + command + +Calling hostapd_disassoc_accept_mac is not needed when we add mac +address to accept list and it is required to be called when any of +the mac address is deleted from accept mac list + +Signed-off-by: Nishant Pandey +--- + hostapd/ctrl_iface.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c +index 584aee2..66c63a0 100644 +--- a/hostapd/ctrl_iface.c ++++ b/hostapd/ctrl_iface.c +@@ -3709,16 +3709,16 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, + eloop_terminate(); + } else if (os_strncmp(buf, "ACCEPT_ACL ", 11) == 0) { + if (os_strncmp(buf + 11, "ADD_MAC ", 8) == 0) { +- if (!hostapd_ctrl_iface_acl_add_mac( +- &hapd->conf->accept_mac, +- &hapd->conf->num_accept_mac, buf + 19)) ++ hostapd_ctrl_iface_acl_add_mac( ++ &hapd->conf->accept_mac, ++ &hapd->conf->num_accept_mac, buf + 19); ++ } else if (os_strncmp((buf + 11), "DEL_MAC ", 8) == 0) { ++ if (!hostapd_ctrl_iface_acl_del_mac( ++ &hapd->conf->accept_mac, ++ &hapd->conf->num_accept_mac, buf + 19)) + hostapd_disassoc_accept_mac(hapd); + else + reply_len = -1; +- } else if (os_strncmp((buf + 11), "DEL_MAC ", 8) == 0) { +- hostapd_ctrl_iface_acl_del_mac( +- &hapd->conf->accept_mac, +- &hapd->conf->num_accept_mac, buf + 19); + } else if (os_strcmp(buf + 11, "SHOW") == 0) { + reply_len = hostapd_ctrl_iface_acl_show_mac( + hapd->conf->accept_mac, +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/802-bss_coloring-add-the-code-required-to-generate-the-C.patch b/feeds/wifi-ax/hostapd/patches/f00-002-bss_coloring-add-the-code-required-to-generate-the-CCA-IE.patch similarity index 91% rename from feeds/wifi-ax/hostapd/patches/802-bss_coloring-add-the-code-required-to-generate-the-C.patch rename to feeds/wifi-ax/hostapd/patches/f00-002-bss_coloring-add-the-code-required-to-generate-the-CCA-IE.patch index 20b4da9a9..ba73fa28a 100644 --- a/feeds/wifi-ax/hostapd/patches/802-bss_coloring-add-the-code-required-to-generate-the-C.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-002-bss_coloring-add-the-code-required-to-generate-the-CCA-IE.patch @@ -1,8 +1,8 @@ -From 5bcdaaee4909e7f80d99ffa98a352fb313234fd9 Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Wed, 17 Jun 2020 14:37:31 +0200 -Subject: [PATCH 802/813] bss_coloring: add the code required to generate the +Subject: [PATCH V4 2/6] bss_coloring: add the code required to generate the CCA IE +Date: Wed, 26 Aug 2020 08:22:12 +0200 + This IE is similar to the CSA one. It contains a counter and the target color. Once the counter expired, the change to the new color happens. @@ -16,7 +16,7 @@ Signed-off-by: John Crispin 4 files changed, 28 insertions(+) diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index 8a80dbe79..e67653853 100644 +index c59842edc..b59e34623 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -580,11 +580,17 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, @@ -91,7 +91,7 @@ index 85b714090..049ac7f0e 100644 + return eid; +} diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h -index 92d3c1d49..ec3a0613f 100644 +index 5b834c5c8..16f517ac6 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -475,6 +475,7 @@ @@ -100,8 +100,5 @@ index 92d3c1d49..ec3a0613f 100644 #define WLAN_EID_EXT_SPATIAL_REUSE 39 +#define WLAN_EID_EXT_COLOR_CHANGE_ANNOUNCEMENT 42 #define WLAN_EID_EXT_OCV_OCI 54 - #define WLAN_EID_EXT_NON_INHERITANCE 56 #define WLAN_EID_EXT_SHORT_SSID_LIST 58 --- -2.25.1 - + #define WLAN_EID_EXT_HE_6GHZ_BAND_CAP 59 diff --git a/feeds/wifi-ax/hostapd/patches/f00-002-hostap-Move-acl-related-code-to-generic-to-be-used-for-mesh.patch b/feeds/wifi-ax/hostapd/patches/f00-002-hostap-Move-acl-related-code-to-generic-to-be-used-for-mesh.patch new file mode 100644 index 000000000..6d1645155 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/f00-002-hostap-Move-acl-related-code-to-generic-to-be-used-for-mesh.patch @@ -0,0 +1,620 @@ +From 171c96df407c45e94d1fe8afd44ca6cc3a191157 Mon Sep 17 00:00:00 2001 +From: Nishant Pandey +Date: Tue, 22 Sep 2020 14:15:36 +0530 +Subject: [PATCH] hostap: Move ACL configuration callback to generic + +Move ACL configuration support callbacks to generic +place so that it can be utilized for mesh functionality. +No functional change as such made in this patch + +Signed-off-by: Nishant Pandey +--- + hostapd/config_file.c | 119 +----------------------------------- + hostapd/config_file.h | 5 -- + hostapd/ctrl_iface.c | 111 ---------------------------------- + src/ap/ctrl_iface_ap.c | 159 +++++++++++++++++++++++++++++++++++++++++++++++++ + src/ap/ctrl_iface_ap.h | 10 ++++ + src/ap/ieee802_11.c | 81 +++++++++++++++++++++++++ + src/ap/ieee802_11.h | 9 +++ + 7 files changed, 260 insertions(+), 234 deletions(-) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index 3fe1792..a81553b 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -23,6 +23,7 @@ + #include "radius/radius_client.h" + #include "ap/wpa_auth.h" + #include "ap/ap_config.h" ++#include "ap/ieee802_11.h" + #include "config_file.h" + + +@@ -118,124 +119,6 @@ static int hostapd_config_read_vlan_file(struct hostapd_bss_config *bss, + #endif /* CONFIG_NO_VLAN */ + + +-int hostapd_acl_comp(const void *a, const void *b) +-{ +- const struct mac_acl_entry *aa = a; +- const struct mac_acl_entry *bb = b; +- return os_memcmp(aa->addr, bb->addr, sizeof(macaddr)); +-} +- +- +-int hostapd_add_acl_maclist(struct mac_acl_entry **acl, int *num, +- int vlan_id, const u8 *addr) +-{ +- struct mac_acl_entry *newacl; +- +- newacl = os_realloc_array(*acl, *num + 1, sizeof(**acl)); +- if (!newacl) { +- wpa_printf(MSG_ERROR, "MAC list reallocation failed"); +- return -1; +- } +- +- *acl = newacl; +- os_memcpy((*acl)[*num].addr, addr, ETH_ALEN); +- os_memset(&(*acl)[*num].vlan_id, 0, sizeof((*acl)[*num].vlan_id)); +- (*acl)[*num].vlan_id.untagged = vlan_id; +- (*acl)[*num].vlan_id.notempty = !!vlan_id; +- (*num)++; +- +- return 0; +-} +- +- +-void hostapd_remove_acl_mac(struct mac_acl_entry **acl, int *num, +- const u8 *addr) +-{ +- int i = 0; +- +- while (i < *num) { +- if (os_memcmp((*acl)[i].addr, addr, ETH_ALEN) == 0) { +- os_remove_in_array(*acl, *num, sizeof(**acl), i); +- (*num)--; +- } else { +- i++; +- } +- } +-} +- +- +-static int hostapd_config_read_maclist(const char *fname, +- struct mac_acl_entry **acl, int *num) +-{ +- FILE *f; +- char buf[128], *pos; +- int line = 0; +- u8 addr[ETH_ALEN]; +- int vlan_id; +- +- f = fopen(fname, "r"); +- if (!f) { +- wpa_printf(MSG_ERROR, "MAC list file '%s' not found.", fname); +- return -1; +- } +- +- while (fgets(buf, sizeof(buf), f)) { +- int rem = 0; +- +- line++; +- +- if (buf[0] == '#') +- continue; +- pos = buf; +- while (*pos != '\0') { +- if (*pos == '\n') { +- *pos = '\0'; +- break; +- } +- pos++; +- } +- if (buf[0] == '\0') +- continue; +- pos = buf; +- if (buf[0] == '-') { +- rem = 1; +- pos++; +- } +- +- if (hwaddr_aton(pos, addr)) { +- wpa_printf(MSG_ERROR, "Invalid MAC address '%s' at " +- "line %d in '%s'", pos, line, fname); +- fclose(f); +- return -1; +- } +- +- if (rem) { +- hostapd_remove_acl_mac(acl, num, addr); +- continue; +- } +- vlan_id = 0; +- pos = buf; +- while (*pos != '\0' && *pos != ' ' && *pos != '\t') +- pos++; +- while (*pos == ' ' || *pos == '\t') +- pos++; +- if (*pos != '\0') +- vlan_id = atoi(pos); +- +- if (hostapd_add_acl_maclist(acl, num, vlan_id, addr) < 0) { +- fclose(f); +- return -1; +- } +- } +- +- fclose(f); +- +- if (*acl) +- qsort(*acl, *num, sizeof(**acl), hostapd_acl_comp); +- +- return 0; +-} +- + + #ifdef EAP_SERVER + +diff --git a/hostapd/config_file.h b/hostapd/config_file.h +index 9830f5a..c98bdb6 100644 +--- a/hostapd/config_file.h ++++ b/hostapd/config_file.h +@@ -13,10 +13,5 @@ struct hostapd_config * hostapd_config_read(const char *fname); + int hostapd_set_iface(struct hostapd_config *conf, + struct hostapd_bss_config *bss, const char *field, + char *value); +-int hostapd_acl_comp(const void *a, const void *b); +-int hostapd_add_acl_maclist(struct mac_acl_entry **acl, int *num, +- int vlan_id, const u8 *addr); +-void hostapd_remove_acl_mac(struct mac_acl_entry **acl, int *num, +- const u8 *addr); + + #endif /* CONFIG_FILE_H */ +diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c +index 66c63a0..60e549f 100644 +--- a/hostapd/ctrl_iface.c ++++ b/hostapd/ctrl_iface.c +@@ -1309,42 +1309,6 @@ static int hostapd_ctrl_iface_get_config(struct hostapd_data *hapd, + } + + +-static void hostapd_disassoc_accept_mac(struct hostapd_data *hapd) +-{ +- struct sta_info *sta; +- struct vlan_description vlan_id; +- +- if (hapd->conf->macaddr_acl != DENY_UNLESS_ACCEPTED) +- return; +- +- for (sta = hapd->sta_list; sta; sta = sta->next) { +- if (!hostapd_maclist_found(hapd->conf->accept_mac, +- hapd->conf->num_accept_mac, +- sta->addr, &vlan_id) || +- (vlan_id.notempty && +- vlan_compare(&vlan_id, sta->vlan_desc))) +- ap_sta_disconnect(hapd, sta, sta->addr, +- WLAN_REASON_UNSPECIFIED); +- } +-} +- +- +-static void hostapd_disassoc_deny_mac(struct hostapd_data *hapd) +-{ +- struct sta_info *sta; +- struct vlan_description vlan_id; +- +- for (sta = hapd->sta_list; sta; sta = sta->next) { +- if (hostapd_maclist_found(hapd->conf->deny_mac, +- hapd->conf->num_deny_mac, sta->addr, +- &vlan_id) && +- (!vlan_id.notempty || +- !vlan_compare(&vlan_id, sta->vlan_desc))) +- ap_sta_disconnect(hapd, sta, sta->addr, +- WLAN_REASON_UNSPECIFIED); +- } +-} +- + + static int hostapd_ctrl_iface_set_band(struct hostapd_data *hapd, + const char *band) +@@ -3287,81 +3251,6 @@ static int hostapd_ctrl_driver_flags2(struct hostapd_iface *iface, char *buf, + return pos - buf; + } + +- +-static int hostapd_ctrl_iface_acl_del_mac(struct mac_acl_entry **acl, int *num, +- const char *txtaddr) +-{ +- u8 addr[ETH_ALEN]; +- struct vlan_description vlan_id; +- +- if (!(*num)) +- return 0; +- +- if (hwaddr_aton(txtaddr, addr)) +- return -1; +- +- if (hostapd_maclist_found(*acl, *num, addr, &vlan_id)) +- hostapd_remove_acl_mac(acl, num, addr); +- +- return 0; +-} +- +- +-static void hostapd_ctrl_iface_acl_clear_list(struct mac_acl_entry **acl, +- int *num) +-{ +- while (*num) +- hostapd_remove_acl_mac(acl, num, (*acl)[0].addr); +-} +- +- +-static int hostapd_ctrl_iface_acl_show_mac(struct mac_acl_entry *acl, int num, +- char *buf, size_t buflen) +-{ +- int i = 0, len = 0, ret = 0; +- +- if (!acl) +- return 0; +- +- while (i < num) { +- ret = os_snprintf(buf + len, buflen - len, +- MACSTR " VLAN_ID=%d\n", +- MAC2STR(acl[i].addr), +- acl[i].vlan_id.untagged); +- if (ret < 0 || (size_t) ret >= buflen - len) +- return len; +- i++; +- len += ret; +- } +- return len; +-} +- +- +-static int hostapd_ctrl_iface_acl_add_mac(struct mac_acl_entry **acl, int *num, +- const char *cmd) +-{ +- u8 addr[ETH_ALEN]; +- struct vlan_description vlan_id; +- int ret = 0, vlanid = 0; +- const char *pos; +- +- if (hwaddr_aton(cmd, addr)) +- return -1; +- +- pos = os_strstr(cmd, "VLAN_ID="); +- if (pos) +- vlanid = atoi(pos + 8); +- +- if (!hostapd_maclist_found(*acl, *num, addr, &vlan_id)) { +- ret = hostapd_add_acl_maclist(acl, num, vlanid, addr); +- if (ret != -1 && *acl) +- qsort(*acl, *num, sizeof(**acl), hostapd_acl_comp); +- } +- +- return ret < 0 ? -1 : 0; +-} +- +- + static int hostapd_ctrl_iface_get_capability(struct hostapd_data *hapd, + const char *field, char *buf, + size_t buflen) +diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c +index c9f5c1a..4a03ec4 100644 +--- a/src/ap/ctrl_iface_ap.c ++++ b/src/ap/ctrl_iface_ap.c +@@ -24,6 +24,7 @@ + #include "ap_drv_ops.h" + #include "mbo_ap.h" + #include "taxonomy.h" ++#include "ap/vlan.h" + + #ifdef CONFIG_CTRL_IFACE_MIB + +@@ -637,6 +638,164 @@ static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, + #endif /* CONFIG_P2P_MANAGER */ + + ++int hostapd_add_acl_maclist(struct mac_acl_entry **acl, int *num, ++ int vlan_id, const u8 *addr) ++{ ++ struct mac_acl_entry *newacl; ++ ++ newacl = os_realloc_array(*acl, *num + 1, sizeof(**acl)); ++ if (!newacl) { ++ wpa_printf(MSG_ERROR, "MAC list reallocation failed"); ++ return -1; ++ } ++ ++ *acl = newacl; ++ os_memcpy((*acl)[*num].addr, addr, ETH_ALEN); ++ os_memset(&(*acl)[*num].vlan_id, 0, sizeof((*acl)[*num].vlan_id)); ++ (*acl)[*num].vlan_id.untagged = vlan_id; ++ (*acl)[*num].vlan_id.notempty = !!vlan_id; ++ (*num)++; ++ ++ return 0; ++} ++ ++ ++void hostapd_remove_acl_mac(struct mac_acl_entry **acl, int *num, ++ const u8 *addr) ++{ ++ int i = 0; ++ ++ while (i < *num) { ++ if (os_memcmp((*acl)[i].addr, addr, ETH_ALEN) == 0) { ++ os_remove_in_array(*acl, *num, sizeof(**acl), i); ++ (*num)--; ++ } else { ++ i++; ++ } ++ } ++} ++ ++int hostapd_disassoc_accept_mac(struct hostapd_data *hapd) ++{ ++ struct sta_info *sta; ++ struct vlan_description vlan_id; ++ ++ if (hapd->conf->macaddr_acl != DENY_UNLESS_ACCEPTED) ++ return 0; ++ ++ for (sta = hapd->sta_list; sta; sta = sta->next) { ++ if (!hostapd_maclist_found(hapd->conf->accept_mac, ++ hapd->conf->num_accept_mac, ++ sta->addr, &vlan_id) || ++ (vlan_id.notempty && ++ vlan_compare(&vlan_id, sta->vlan_desc))) { ++#ifdef CONFIG_MESH ++ if (hapd->iface->mconf) ++ return 1; ++#endif /* CONFIG_MESH */ ++ ap_sta_disconnect(hapd, sta, sta->addr, ++ WLAN_REASON_UNSPECIFIED); ++ } ++ } ++ return 0; ++} ++ ++int hostapd_disassoc_deny_mac(struct hostapd_data *hapd) ++{ ++ struct sta_info *sta; ++ struct vlan_description vlan_id; ++ ++ for (sta = hapd->sta_list; sta; sta = sta->next) { ++ if (hostapd_maclist_found(hapd->conf->deny_mac, ++ hapd->conf->num_deny_mac, sta->addr, ++ &vlan_id) && ++ (!vlan_id.notempty || ++ !vlan_compare(&vlan_id, sta->vlan_desc))) { ++#ifdef CONFIG_MESH ++ if (hapd->iface->mconf) ++ return 1; ++#endif /* CONFIG_MESH */ ++ ap_sta_disconnect(hapd, sta, sta->addr, ++ WLAN_REASON_UNSPECIFIED); ++ } ++ } ++ ++ return 0; ++} ++ ++int hostapd_ctrl_iface_acl_del_mac(struct mac_acl_entry **acl, int *num, ++ const char *txtaddr) ++{ ++ u8 addr[ETH_ALEN]; ++ struct vlan_description vlan_id; ++ ++ if (!(*num)) ++ return 0; ++ ++ if (hwaddr_aton(txtaddr, addr)) ++ return -1; ++ ++ if (hostapd_maclist_found(*acl, *num, addr, &vlan_id)) ++ hostapd_remove_acl_mac(acl, num, addr); ++ ++ return 0; ++} ++ ++ ++void hostapd_ctrl_iface_acl_clear_list(struct mac_acl_entry **acl, ++ int *num) ++{ ++ while (*num) ++ hostapd_remove_acl_mac(acl, num, (*acl)[0].addr); ++} ++ ++ ++int hostapd_ctrl_iface_acl_show_mac(struct mac_acl_entry *acl, int num, ++ char *buf, size_t buflen) ++{ ++ int i = 0, len = 0, ret = 0; ++ ++ if (!acl) ++ return 0; ++ ++ while (i < num) { ++ ret = os_snprintf(buf + len, buflen - len, ++ MACSTR " VLAN_ID=%d\n", ++ MAC2STR(acl[i].addr), ++ acl[i].vlan_id.untagged); ++ if (ret < 0 || (size_t) ret >= buflen - len) ++ return len; ++ i++; ++ len += ret; ++ } ++ return len; ++} ++ ++ ++int hostapd_ctrl_iface_acl_add_mac(struct mac_acl_entry **acl, int *num, ++ const char *cmd) ++{ ++ u8 addr[ETH_ALEN]; ++ struct vlan_description vlan_id; ++ int ret = 0, vlanid = 0; ++ const char *pos; ++ ++ if (hwaddr_aton(cmd, addr)) ++ return -1; ++ ++ pos = os_strstr(cmd, "VLAN_ID="); ++ if (pos) ++ vlanid = atoi(pos + 8); ++ ++ if (!hostapd_maclist_found(*acl, *num, addr, &vlan_id)) { ++ ret = hostapd_add_acl_maclist(acl, num, vlanid, addr); ++ if (ret != -1 && *acl) ++ qsort(*acl, *num, sizeof(**acl), hostapd_acl_comp); ++ } ++ ++ return ret < 0 ? -1 : 0; ++} ++ + int hostapd_ctrl_iface_deauthenticate(struct hostapd_data *hapd, + const char *txtaddr) + { +diff --git a/src/ap/ctrl_iface_ap.h b/src/ap/ctrl_iface_ap.h +index d1dcebf..55f1c63 100644 +--- a/src/ap/ctrl_iface_ap.h ++++ b/src/ap/ctrl_iface_ap.h +@@ -36,5 +36,15 @@ int hostapd_ctrl_iface_pmksa_add(struct hostapd_data *hapd, char *cmd); + int hostapd_ctrl_iface_pmksa_list_mesh(struct hostapd_data *hapd, + const u8 *addr, char *buf, size_t len); + void * hostapd_ctrl_iface_pmksa_create_entry(const u8 *aa, char *cmd); ++int hostapd_ctrl_iface_acl_add_mac(struct mac_acl_entry **acl, int *num, ++ const char *cmd); ++int hostapd_ctrl_iface_acl_show_mac(struct mac_acl_entry *acl, int num, ++ char *buf, size_t buflen); ++void hostapd_ctrl_iface_acl_clear_list(struct mac_acl_entry **acl, ++ int *num); ++int hostapd_ctrl_iface_acl_del_mac(struct mac_acl_entry **acl, int *num, ++ const char *txtaddr); ++int hostapd_disassoc_accept_mac(struct hostapd_data *hapd); ++int hostapd_disassoc_deny_mac(struct hostapd_data *hapd); + + #endif /* CTRL_IFACE_AP_H */ +diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c +index 65a556e..0963b48 100644 +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -5650,6 +5650,87 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid) + } + + ++int hostapd_acl_comp(const void *a, const void *b) ++{ ++ const struct mac_acl_entry *aa = a; ++ const struct mac_acl_entry *bb = b; ++ ++ return os_memcmp(aa->addr, bb->addr, sizeof(macaddr)); ++} ++ ++int hostapd_config_read_maclist(const char *fname, ++ struct mac_acl_entry **acl, int *num) ++{ ++ FILE *f; ++ char buf[128], *pos; ++ int line = 0; ++ u8 addr[ETH_ALEN]; ++ int vlan_id; ++ ++ f = fopen(fname, "r"); ++ if (!f) { ++ wpa_printf(MSG_ERROR, "MAC list file '%s' not found.", fname); ++ return -1; ++ } ++ ++ while (fgets(buf, sizeof(buf), f)) { ++ int rem = 0; ++ ++ line++; ++ ++ if (buf[0] == '#') ++ continue; ++ pos = buf; ++ while (*pos != '\0') { ++ if (*pos == '\n') { ++ *pos = '\0'; ++ break; ++ } ++ pos++; ++ } ++ if (buf[0] == '\0') ++ continue; ++ pos = buf; ++ if (buf[0] == '-') { ++ rem = 1; ++ pos++; ++ } ++ ++ if (hwaddr_aton(pos, addr)) { ++ wpa_printf(MSG_ERROR, "Invalid MAC address '%s' at " ++ "line %d in '%s'", pos, line, fname); ++ fclose(f); ++ return -1; ++ } ++ ++ if (rem) { ++ hostapd_remove_acl_mac(acl, num, addr); ++ continue; ++ } ++ vlan_id = 0; ++ pos = buf; ++ while (*pos != '\0' && *pos != ' ' && *pos != '\t') ++ pos++; ++ while (*pos == ' ' || *pos == '\t') ++ pos++; ++ if (*pos != '\0') ++ vlan_id = atoi(pos); ++ ++ if (hostapd_add_acl_maclist(acl, num, vlan_id, addr) < 0) { ++ fclose(f); ++ return -1; ++ } ++ } ++ ++ fclose(f); ++ ++ if (*acl) ++ qsort(*acl, *num, sizeof(**acl), hostapd_acl_comp); ++ ++ return 0; ++} ++ ++ + static int hostapd_eid_multiple_bssid_chunk_len(struct hostapd_data *hapd, + int *count) + { +diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h +index 9ccfe6c..c02beae 100644 +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h +@@ -18,6 +18,7 @@ struct ieee80211_vht_capabilities; + struct ieee80211_mgmt; + struct radius_sta; + enum ieee80211_op_mode; ++struct mac_acl_entry; + + int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len, + struct hostapd_frame_info *fi); +@@ -25,6 +26,14 @@ void ieee802_11_mgmt_cb(struct hostapd_data *hapd, const u8 *buf, size_t len, + u16 stype, int ok); + void hostapd_2040_coex_action(struct hostapd_data *hapd, + const struct ieee80211_mgmt *mgmt, size_t len); ++ ++int hostapd_config_read_maclist(const char *fname, ++ struct mac_acl_entry **acl, int *num); ++int hostapd_acl_comp(const void *a, const void *b); ++int hostapd_add_acl_maclist(struct mac_acl_entry **acl, int *num, ++ int vlan_id, const u8 *addr); ++void hostapd_remove_acl_mac(struct mac_acl_entry **acl, int *num, ++ const u8 *addr); + #ifdef NEED_AP_MLME + int ieee802_11_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen); + int ieee802_11_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta, +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/f00-003-Extend-acl-config-support-to-mesh.patch b/feeds/wifi-ax/hostapd/patches/f00-003-Extend-acl-config-support-to-mesh.patch new file mode 100644 index 000000000..8c93a5a08 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/f00-003-Extend-acl-config-support-to-mesh.patch @@ -0,0 +1,232 @@ +From d3447cf20a26072d294cd74a8b3e5c676a7421e7 Mon Sep 17 00:00:00 2001 +From: Nishant Pandey +Date: Tue, 22 Sep 2020 14:19:41 +0530 +Subject: [PATCH] mesh: Add ACL logic support to mesh configuration + +Extend AP-STA accept and deny acl list support to +mesh peer connection as well. Here mesh node uses +macaddr_acl value either ACCEPT_UNLESS_DENIED or +DENY_UNLESS_ACCEPTED. + +Signed-off-by: Nishant Pandey +--- + wpa_supplicant/config.c | 21 ++++++++++++++++++++- + wpa_supplicant/config_file.c | 6 ++++++ + wpa_supplicant/config_ssid.h | 5 +++++ + wpa_supplicant/mesh.c | 22 ++++++++++++++++++++++ + wpa_supplicant/mesh_mpm.c | 15 +++++++++++++++ + wpa_supplicant/wpa_supplicant.conf | 14 ++++++++++++++ + 6 files changed, 82 insertions(+), 1 deletion(-) + +diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c +index aa9953b..aa6c493 100644 +--- a/wpa_supplicant/config.c ++++ b/wpa_supplicant/config.c +@@ -20,7 +20,9 @@ + #include "drivers/nl80211_copy.h" + #include "fst/fst.h" + #include "config.h" +- ++#ifdef CONFIG_MESH ++#include "ap/ap_config.h" ++#endif + + #if !defined(CONFIG_CTRL_IFACE) && defined(CONFIG_NO_CONFIG_WRITE) + #define NO_CONFIG_WRITE +@@ -2656,6 +2658,9 @@ static const struct parse_data ssid_fields[] = { + { INT(dot11MeshRetryTimeout) }, + { INT(dot11MeshConfirmTimeout) }, + { INT(dot11MeshHoldingTimeout) }, ++ { STR(accept_mac_file) }, ++ { STR(deny_mac_file) }, ++ { INT(macaddr_acl) }, + #endif /* CONFIG_MESH */ + { INT(wpa_ptk_rekey) }, + { INT_RANGE(wpa_deny_ptk0_rekey, 0, 2) }, +@@ -2928,6 +2933,8 @@ void wpa_config_free_ssid(struct wpa_ssid *ssid) + os_free(ssid->p2p_client_list); + os_free(ssid->bssid_blacklist); + os_free(ssid->bssid_whitelist); ++ os_free(ssid->accept_mac_file); ++ os_free(ssid->deny_mac_file); + #ifdef CONFIG_HT_OVERRIDES + os_free(ssid->ht_mcs); + #endif /* CONFIG_HT_OVERRIDES */ +@@ -3288,6 +3295,18 @@ int wpa_config_set(struct wpa_ssid *ssid, const char *var, const char *value, + } + ret = -1; + } ++#ifdef CONFIG_MESH ++ if (os_strcmp(var, "macaddr_acl") == 0) { ++ if (ssid->macaddr_acl != ACCEPT_UNLESS_DENIED && ++ ssid->macaddr_acl != DENY_UNLESS_ACCEPTED) { ++ wpa_printf(MSG_ERROR, ++ "Line %d: unknown macaddr_acl %d", ++ line, ssid->macaddr_acl); ++ ret = -1; ++ } ++ } ++#endif ++ + #ifdef CONFIG_SAE + if (os_strcmp(var, "ssid") == 0 || + os_strcmp(var, "psk") == 0 || +diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c +index 21e77f8..b185fd5 100644 +--- a/wpa_supplicant/config_file.c ++++ b/wpa_supplicant/config_file.c +@@ -18,6 +18,9 @@ + #include "common.h" + #include "config.h" + #include "base64.h" ++#ifdef CONFIG_MESH ++#include "ap/ap_config.h" ++#endif + #include "uuid.h" + #include "common/ieee802_1x_defs.h" + #include "p2p/p2p.h" +@@ -913,6 +916,9 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid) + write_int(f, "mac_addr", ssid->mac_addr, -1); + #ifdef CONFIG_MESH + STR(mesh_basic_rates); ++ STR(accept_mac_file); ++ STR(deny_mac_file); ++ INT_DEF(macaddr_acl, ACCEPT_UNLESS_DENIED); + INT_DEF(dot11MeshMaxRetries, DEFAULT_MESH_MAX_RETRIES); + INT_DEF(dot11MeshRetryTimeout, DEFAULT_MESH_RETRY_TIMEOUT); + INT_DEF(dot11MeshConfirmTimeout, DEFAULT_MESH_CONFIRM_TIMEOUT); +diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h +index 1fd94d8..1d9137e 100644 +--- a/wpa_supplicant/config_ssid.h ++++ b/wpa_supplicant/config_ssid.h +@@ -546,6 +546,11 @@ struct wpa_ssid { + int dot11MeshConfirmTimeout; /* msec */ + int dot11MeshHoldingTimeout; /* msec */ + ++ char *accept_mac_file; ++ char *deny_mac_file; ++ int macaddr_acl; ++ ++ + int ht; + int ht40; + +diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c +index c1630d0..176e922 100644 +--- a/wpa_supplicant/mesh.c ++++ b/wpa_supplicant/mesh.c +@@ -15,6 +15,7 @@ + #include "common/wpa_ctrl.h" + #include "ap/sta_info.h" + #include "ap/hostapd.h" ++#include "ap/ieee802_11_auth.h" + #include "ap/ieee802_11.h" + #include "config_ssid.h" + #include "config.h" +@@ -320,6 +321,17 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, + ifmsh->bss[0]->dot11RSNASAERetransPeriod = + wpa_s->conf->dot11RSNASAERetransPeriod; + os_strlcpy(bss->conf->iface, wpa_s->ifname, sizeof(bss->conf->iface)); ++ bss->conf->macaddr_acl = ssid->macaddr_acl; ++ ++ if (ssid->accept_mac_file) ++ hostapd_config_read_maclist(ssid->accept_mac_file, ++ &bss->conf->accept_mac, ++ &bss->conf->num_accept_mac); ++ ++ if (ssid->deny_mac_file) ++ hostapd_config_read_maclist(ssid->deny_mac_file, ++ &bss->conf->deny_mac, ++ &bss->conf->num_deny_mac); + + mconf = mesh_config_create(wpa_s, ssid); + if (!mconf) +@@ -417,6 +429,16 @@ void wpa_mesh_notify_peer(struct wpa_supplicant *wpa_s, const u8 *addr, + const u8 *ies, size_t ie_len) + { + struct ieee802_11_elems elems; ++ int acl_res; ++ struct hostapd_data *data = wpa_s->ifmsh->bss[0]; ++ struct radius_sta rad_info; ++ ++ acl_res = hostapd_allowed_address(data, addr, NULL, 0, &rad_info, 0); ++ if (acl_res == HOSTAPD_ACL_REJECT) { ++ wpa_printf(MSG_ERROR, "Ignore new peer notification\n"); ++ return; ++ ++ } + + wpa_msg(wpa_s, MSG_INFO, + "new peer notification for " MACSTR, MAC2STR(addr)); +diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c +index ea62abf..65bfa3a 100644 +--- a/wpa_supplicant/mesh_mpm.c ++++ b/wpa_supplicant/mesh_mpm.c +@@ -16,6 +16,7 @@ + #include "ap/hostapd.h" + #include "ap/sta_info.h" + #include "ap/ieee802_11.h" ++#include "ap/ieee802_11_auth.h" + #include "ap/wpa_auth.h" + #include "wpa_supplicant_i.h" + #include "driver_i.h" +@@ -1119,10 +1120,12 @@ void mesh_mpm_action_rx(struct wpa_supplicant *wpa_s, + enum plink_event event; + struct ieee802_11_elems elems; + struct mesh_peer_mgmt_ie peer_mgmt_ie; ++ struct radius_sta rad_info; + const u8 *ies; + size_t ie_len; + int ret; + u16 reason = 0; ++ int acl_res; + + if (mgmt->u.action.category != WLAN_ACTION_SELF_PROTECTED) + return; +@@ -1170,6 +1173,18 @@ void mesh_mpm_action_rx(struct wpa_supplicant *wpa_s, + return; + } + if (action_field != PLINK_CLOSE) { ++ if (action_field != PLINK_CLOSE) { ++ acl_res = hostapd_allowed_address(hapd, mgmt->sa, ++ (const u8 *) mgmt, ++ len, &rad_info, 0); ++ if (acl_res == HOSTAPD_ACL_REJECT) { ++ wpa_printf(MSG_DEBUG, ++ "MPM: Ignore action frame\n"); ++ return; ++ ++ } ++ } ++ + if (!elems.mesh_id || !elems.mesh_config) { + wpa_printf(MSG_DEBUG, + "MPM: No Mesh ID or Mesh Configuration element"); +diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf +index 4291244..674978a 100644 +--- a/wpa_supplicant/wpa_supplicant.conf ++++ b/wpa_supplicant/wpa_supplicant.conf +@@ -150,6 +150,20 @@ ap_scan=1 + # This timeout value is used in mesh STA to clean up inactive stations. + #mesh_max_inactivity=300 + ++# Mesh node address -based authentication ++# Please note that this kind of access control requires a driver that uses ++# wpa_supplicant to take care of management frame and mesh PLINK connection ++# processing and as such. ++# 0 = accept unless in deny list ++# 1 = deny unless in accept list ++macaddr_acl=0 ++ ++# Accept/deny lists are read from separate files (containing list of ++# MAC addresses, one per line). Use absolute path name to make sure that the ++# files can be read on SIGHUP configuration reloads. ++#accept_mac_file=/etc/hostapd.accept ++#deny_mac_file=/etc/hostapd.deny ++ + # cert_in_cb - Whether to include a peer certificate dump in events + # This controls whether peer certificates for authentication server and + # its certificate chain are included in EAP peer certificate events. This is +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/803-bss-coloring-disable-BSS-color-during-CCA.patch b/feeds/wifi-ax/hostapd/patches/f00-003-bss-coloring-disable-BSS-color-during-CCA.patch similarity index 82% rename from feeds/wifi-ax/hostapd/patches/803-bss-coloring-disable-BSS-color-during-CCA.patch rename to feeds/wifi-ax/hostapd/patches/f00-003-bss-coloring-disable-BSS-color-during-CCA.patch index 5d40cc7ef..ebc320f5b 100644 --- a/feeds/wifi-ax/hostapd/patches/803-bss-coloring-disable-BSS-color-during-CCA.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-003-bss-coloring-disable-BSS-color-during-CCA.patch @@ -1,7 +1,7 @@ -From fb8ecbc64dc2d85741605384e5e6515def0ca948 Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Wed, 17 Jun 2020 14:42:16 +0200 -Subject: [PATCH 803/813] bss coloring: disable BSS color during CCA +Subject: [PATCH V4 3/6] bss coloring: disable BSS color during CCA +Date: Wed, 26 Aug 2020 08:22:13 +0200 + While we are doing CCA the bss color disable bit inside the he oper field needs to be set. @@ -24,6 +24,3 @@ index 049ac7f0e..157f9e99a 100644 params |= HE_OPERATION_BSS_COLOR_DISABLED; if (hapd->iface->conf->he_op.he_bss_color_partial) params |= HE_OPERATION_BSS_COLOR_PARTIAL; --- -2.25.1 - diff --git a/feeds/wifi-ax/hostapd/patches/804-bss-coloring-add-the-switch_color-handler-to-the-nl8.patch b/feeds/wifi-ax/hostapd/patches/f00-004-bss-coloring-add-the-switch_color-handler-to-the-nl80211-driver.patch similarity index 62% rename from feeds/wifi-ax/hostapd/patches/804-bss-coloring-add-the-switch_color-handler-to-the-nl8.patch rename to feeds/wifi-ax/hostapd/patches/f00-004-bss-coloring-add-the-switch_color-handler-to-the-nl80211-driver.patch index 2dbd996aa..ba27f1b91 100644 --- a/feeds/wifi-ax/hostapd/patches/804-bss-coloring-add-the-switch_color-handler-to-the-nl8.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-004-bss-coloring-add-the-switch_color-handler-to-the-nl80211-driver.patch @@ -1,8 +1,8 @@ -From 528bfb6212177a206c6bb0800413c8012ef75799 Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Wed, 17 Jun 2020 14:40:31 +0200 -Subject: [PATCH 804/813] bss coloring: add the switch_color handler to the +Subject: [PATCH V4 4/6] bss coloring: add the switch_color handler to the nl80211 driver +Date: Wed, 26 Aug 2020 08:22:14 +0200 + In order to start the CCA process we need to send NL80211_CMD_COLOR_CHANGE to the kernel. This patch adds the required code. @@ -12,11 +12,9 @@ Signed-off-by: John Crispin src/drivers/driver_nl80211.c | 79 ++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index c648e46ae..36bff1de2 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -9614,6 +9614,82 @@ error: +@@ -9873,6 +9873,82 @@ error: } @@ -99,7 +97,7 @@ index c648e46ae..36bff1de2 100644 static int nl80211_add_ts(void *priv, u8 tsid, const u8 *addr, u8 user_priority, u16 admitted_time) { -@@ -11732,6 +11808,9 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = { +@@ -11992,6 +12068,9 @@ const struct wpa_driver_ops wpa_driver_n .get_survey = wpa_driver_nl80211_get_survey, .status = wpa_driver_nl80211_status, .switch_channel = nl80211_switch_channel, @@ -109,6 +107,51 @@ index c648e46ae..36bff1de2 100644 #ifdef ANDROID_P2P .set_noa = wpa_driver_set_p2p_noa, .get_noa = wpa_driver_get_p2p_noa, --- -2.25.1 - +--- a/src/drivers/nl80211_copy.h ++++ b/src/drivers/nl80211_copy.h +@@ -1406,6 +1406,13 @@ enum nl80211_commands { + NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS, + + NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS, ++ ++ NL80211_CMD_OBSS_COLOR_COLLISION, ++ ++ NL80211_CMD_COLOR_CHANGE, ++ NL80211_CMD_COLOR_CHANGE_ANNOUNCEMENT_STARTED, ++ NL80211_CMD_COLOR_CHANGE_ANNOUNCEMENT_ABORTED, ++ NL80211_CMD_COLOR_CHANGE_ANNOUNCEMENT_COMPLETED, + /* add new commands above here */ + + /* used to define NL80211_CMD_MAX below */ +@@ -2842,8 +2849,8 @@ enum nl80211_attrs { + NL80211_ATTR_CH_SWITCH_COUNT, + NL80211_ATTR_CH_SWITCH_BLOCK_TX, + NL80211_ATTR_CSA_IES, +- NL80211_ATTR_CSA_C_OFF_BEACON, +- NL80211_ATTR_CSA_C_OFF_PRESP, ++ NL80211_ATTR_CNTDWN_OFFS_BEACON, ++ NL80211_ATTR_CNTDWN_OFFS_PRESP, + + NL80211_ATTR_RXMGMT_FLAGS, + +@@ -3030,6 +3037,11 @@ enum nl80211_attrs { + NL80211_ATTR_MULTIPLE_BSSID_COUNT, + NL80211_ATTR_MULTIPLE_BSSID_IES, + ++ NL80211_ATTR_OBSS_COLOR_BITMAP, ++ ++ NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COUNT, ++ NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR, ++ NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES, + /* add attributes here, update the policy in nl80211.c */ + + __NL80211_ATTR_AFTER_LAST, +@@ -3042,6 +3054,8 @@ enum nl80211_attrs { + #define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG + #define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER + #define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA ++#define NL80211_ATTR_CSA_C_OFF_BEACON NL80211_ATTR_CNTDWN_OFFS_BEACON ++#define NL80211_ATTR_CSA_C_OFF_PRESP NL80211_ATTR_CNTDWN_OFFS_PRESP + + /* + * Allow user space programs to use #ifdef on new attributes by defining them diff --git a/feeds/wifi-ax/hostapd/patches/f00-004-mesh-Dynamic-MAC-ACL-management-over-control-interface.patch b/feeds/wifi-ax/hostapd/patches/f00-004-mesh-Dynamic-MAC-ACL-management-over-control-interface.patch new file mode 100644 index 000000000..a7b72a475 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/f00-004-mesh-Dynamic-MAC-ACL-management-over-control-interface.patch @@ -0,0 +1,310 @@ +From 2173e65aa098ab130bfdbc9b9cfe8ac2fc2ae086 Mon Sep 17 00:00:00 2001 +From: Nishant Pandey +Date: Tue, 22 Sep 2020 14:23:08 +0530 +Subject: [PATCH] mesh: Dynamic MAC ACL management over control interface + +Extend support to modify MAC ACL and displayed it through +new control interface + +commands: + +ACCEPT_ACL [argument] +DENY_ACL [argument] +subcmd: ADD_MAC |DEL_MAC |SHOW|CLEAR + +Signed-off-by: Nishant Pandey +--- + wpa_supplicant/ap.c | 68 +++++++++++++++++++++++++++++++++++++++++ + wpa_supplicant/ap.h | 5 +++ + wpa_supplicant/ctrl_iface.c | 45 +++++++++++++++++++++++++++ + wpa_supplicant/events.c | 1 + + wpa_supplicant/mesh.c | 1 + + wpa_supplicant/wpa_cli.c | 19 ++++++++++++ + wpa_supplicant/wpa_supplicant.c | 3 +- + wpa_supplicant/wps_supplicant.c | 2 ++ + 8 files changed, 143 insertions(+), 1 deletion(-) + +diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c +index 0a0bc22..4756a28 100644 +--- a/wpa_supplicant/ap.c ++++ b/wpa_supplicant/ap.c +@@ -6,6 +6,7 @@ + * This software may be distributed under the terms of the BSD license. + * See README for more details. + */ ++#include + + #include "utils/includes.h" + +@@ -1609,6 +1610,73 @@ void wpas_ap_pmksa_cache_flush(struct wpa_supplicant *wpa_s) + hostapd_ctrl_iface_pmksa_flush(wpa_s->ifmsh->bss[0]); + } + ++#ifdef CONFIG_MESH ++ ++int wpas_ap_acl_del_mac(struct wpa_supplicant *wpa_s, char *buf, bool accept) ++{ ++ struct hostapd_data *hapd = wpa_s->ifmsh->bss[0]; ++ ++ if (accept) { ++ if (!hostapd_ctrl_iface_acl_del_mac(&hapd->conf->accept_mac, ++ &hapd->conf->num_accept_mac, ++ buf)) ++ if (hostapd_disassoc_accept_mac(hapd)) ++ return 1; ++ } ++ ++ return hostapd_ctrl_iface_acl_del_mac(&hapd->conf->deny_mac, ++ &hapd->conf->num_deny_mac, ++ buf); ++} ++ ++int wpas_ap_acl_add_mac(struct wpa_supplicant *wpa_s, char *buf, bool accept) ++{ ++ struct hostapd_data *hapd = wpa_s->ifmsh->bss[0]; ++ ++ if (accept) { ++ return hostapd_ctrl_iface_acl_add_mac(&hapd->conf->accept_mac, ++ &hapd->conf->num_accept_mac, ++ buf); ++ } else { ++ if (!hostapd_ctrl_iface_acl_add_mac(&hapd->conf->deny_mac, ++ &hapd->conf->num_deny_mac, buf)) { ++ if (hostapd_disassoc_deny_mac(hapd)) ++ return 1; ++ return 0; ++ } ++ } ++ ++ return -1; ++} ++ ++int wpas_ap_acl_show_mac(struct wpa_supplicant *wpa_s, char *reply, ++ const int reply_size, bool accept) ++{ ++ struct hostapd_data *hapd = wpa_s->ifmsh->bss[0]; ++ ++ if (accept) ++ return hostapd_ctrl_iface_acl_show_mac( ++ hapd->conf->accept_mac, ++ hapd->conf->num_accept_mac, ++ reply, reply_size); ++ ++ return hostapd_ctrl_iface_acl_show_mac( ++ hapd->conf->deny_mac, ++ hapd->conf->num_deny_mac, ++ reply, reply_size); ++} ++ ++void wpas_ap_deny_acl_clear_list(struct wpa_supplicant *wpa_s) ++{ ++ struct hostapd_data *hapd = wpa_s->ifmsh->bss[0]; ++ ++ ++ return hostapd_ctrl_iface_acl_clear_list(&hapd->conf->deny_mac, ++ &hapd->conf->num_deny_mac); ++} ++ ++#endif /* CONFIG_MESH */ ++ + + #ifdef CONFIG_PMKSA_CACHE_EXTERNAL + #ifdef CONFIG_MESH +diff --git a/wpa_supplicant/ap.h b/wpa_supplicant/ap.h +index 6c6e94c..340eb29 100644 +--- a/wpa_supplicant/ap.h ++++ b/wpa_supplicant/ap.h +@@ -99,6 +99,11 @@ void wpas_ap_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, + struct dfs_event *radar); + void wpas_ap_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, + struct dfs_event *radar); ++int wpas_ap_acl_del_mac(struct wpa_supplicant *wpa_s, char *buf, bool accept); ++int wpas_ap_acl_add_mac(struct wpa_supplicant *wpa_s, char *buf, bool accept); ++int wpas_ap_acl_show_mac(struct wpa_supplicant *wpa_s, char *reply, ++ const int reply_size, bool accept); ++void wpas_ap_deny_acl_clear_list(struct wpa_supplicant *wpa_s); + + void ap_periodic(struct wpa_supplicant *wpa_s); + +diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c +index d769796..7e89bbc 100644 +--- a/wpa_supplicant/ctrl_iface.c ++++ b/wpa_supplicant/ctrl_iface.c +@@ -5,6 +5,7 @@ + * This software may be distributed under the terms of the BSD license. + * See README for more details. + */ ++#include + + #include "utils/includes.h" + #ifdef CONFIG_TESTING_OPTIONS +@@ -3268,6 +3269,18 @@ static int wpa_supplicant_ctrl_iface_mesh_peer_remove( + return wpas_mesh_peer_remove(wpa_s, addr); + } + ++static void wpas_ap_accept_acl_clear_list(struct wpa_supplicant *wpa_s) ++{ ++ struct hostapd_data *hapd = wpa_s->ifmsh->bss[0]; ++ struct mac_acl_entry **acl = &hapd->conf->accept_mac; ++ int *num = &hapd->conf->num_accept_mac; ++ ++ while (*num) { ++ wpas_mesh_peer_remove(wpa_s, (*acl)[0].addr); ++ hostapd_remove_acl_mac(acl, num, (*acl)[0].addr); ++ } ++} ++ + + static int wpa_supplicant_ctrl_iface_mesh_peer_add( + struct wpa_supplicant *wpa_s, char *cmd) +@@ -10564,6 +10577,38 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, + reply_len = -1; + #endif /* CONFIG_IBSS_RSN */ + #ifdef CONFIG_MESH ++ } else if (os_strncmp(buf, "ACCEPT_ACL ", 11) == 0) { ++ if (os_strncmp(buf + 11, "ADD_MAC ", 8) == 0) { ++ wpas_ap_acl_add_mac(wpa_s, buf + 19, 1); ++ } else if (os_strncmp((buf + 11), "DEL_MAC ", 8) == 0) { ++ reply_len = wpas_ap_acl_del_mac(wpa_s, buf + 19, 1); ++ if (reply_len == 1) ++ wpa_supplicant_ctrl_iface_mesh_peer_remove( ++ wpa_s, buf + 19); ++ else if (reply_len) ++ reply_len = -1; ++ } else if (os_strcmp(buf + 11, "SHOW") == 0) { ++ reply_len = wpas_ap_acl_show_mac(wpa_s, reply, ++ reply_size, 1); ++ } else if (os_strcmp(buf + 11, "CLEAR") == 0) { ++ wpas_ap_accept_acl_clear_list(wpa_s); ++ } ++ } else if (os_strncmp(buf, "DENY_ACL ", 9) == 0) { ++ if (os_strncmp(buf + 9, "ADD_MAC ", 8) == 0) { ++ reply_len = wpas_ap_acl_add_mac(wpa_s, buf + 17, 0); ++ if (reply_len == 1) ++ wpa_supplicant_ctrl_iface_mesh_peer_remove( ++ wpa_s, buf + 17); ++ else if (reply_len) ++ reply_len = -1; ++ } else if (os_strncmp(buf + 9, "DEL_MAC ", 8) == 0) { ++ wpas_ap_acl_del_mac(wpa_s, buf + 17, 0); ++ } else if (os_strcmp(buf + 9, "SHOW") == 0) { ++ reply_len = wpas_ap_acl_show_mac(wpa_s, reply, ++ reply_size, 0); ++ } else if (os_strcmp(buf + 9, "CLEAR") == 0) { ++ wpas_ap_deny_acl_clear_list(wpa_s); ++ } + } else if (os_strncmp(buf, "MESH_INTERFACE_ADD ", 19) == 0) { + reply_len = wpa_supplicant_ctrl_iface_mesh_interface_add( + wpa_s, buf + 19, reply, reply_size); +diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c +index 3041b81..505c92c 100644 +--- a/wpa_supplicant/events.c ++++ b/wpa_supplicant/events.c +@@ -5,6 +5,7 @@ + * This software may be distributed under the terms of the BSD license. + * See README for more details. + */ ++#include + + #include "includes.h" + +diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c +index 176e922..e101b42 100644 +--- a/wpa_supplicant/mesh.c ++++ b/wpa_supplicant/mesh.c +@@ -5,6 +5,7 @@ + * This software may be distributed under the terms of the BSD license. + * See README for more details. + */ ++#include + + #include "utils/includes.h" + +diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c +index 26d7df1..b32ebd8 100644 +--- a/wpa_supplicant/wpa_cli.c ++++ b/wpa_supplicant/wpa_cli.c +@@ -2113,6 +2113,19 @@ static int wpa_cli_cmd_mesh_link_probe(struct wpa_ctrl *ctrl, int argc, + return wpa_cli_cmd(ctrl, "MESH_LINK_PROBE", 1, argc, argv); + } + ++static int wpa_cli_cmd_accept_macacl(struct wpa_ctrl *ctrl, int argc, ++ char *argv[]) ++{ ++ return wpa_cli_cmd(ctrl, "ACCEPT_ACL", 1, argc, argv); ++} ++ ++ ++static int wpa_cli_cmd_deny_macacl(struct wpa_ctrl *ctrl, int argc, ++ char *argv[]) ++{ ++ return wpa_cli_cmd(ctrl, "DENY_ACL", 1, argc, argv); ++} ++ + #endif /* CONFIG_MESH */ + + +@@ -3508,6 +3521,12 @@ static const struct wpa_cli_cmd wpa_cli_commands[] = { + { "mesh_link_probe", wpa_cli_cmd_mesh_link_probe, NULL, + cli_cmd_flag_none, + " [payload=] = Probe a mesh link for a given peer by injecting a frame." }, ++ { "accept_acl", wpa_cli_cmd_accept_macacl, NULL, ++ cli_cmd_flag_none, ++ "=Add/Delete/Show/Clear accept MAC ACL" }, ++ { "deny_acl", wpa_cli_cmd_deny_macacl, NULL, ++ cli_cmd_flag_none, ++ "=Add/Delete/Show/Clear deny MAC ACL" }, + #endif /* CONFIG_MESH */ + #ifdef CONFIG_P2P + { "p2p_find", wpa_cli_cmd_p2p_find, wpa_cli_complete_p2p_find, +diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c +index 5cf0a51..e0df6c2 100644 +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c +@@ -9,6 +9,7 @@ + * %wpa_supplicant interfaces. In addition, this file contains number of + * functions for managing network connections. + */ ++#include + + #include "includes.h" + #ifdef CONFIG_MATCH_IFACE +@@ -49,7 +50,6 @@ + #include "ibss_rsn.h" + #include "sme.h" + #include "gas_query.h" +-#include "ap.h" + #include "p2p_supplicant.h" + #include "wifi_display.h" + #include "notify.h" +@@ -67,6 +67,7 @@ + #include "ap/ap_config.h" + #include "ap/hostapd.h" + #endif /* CONFIG_MESH */ ++#include "ap.h" + + const char *const wpa_supplicant_version = + "wpa_supplicant v" VERSION_STR "\n" +diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c +index b7680f0..df765e5 100644 +--- a/wpa_supplicant/wps_supplicant.c ++++ b/wpa_supplicant/wps_supplicant.c +@@ -5,6 +5,7 @@ + * This software may be distributed under the terms of the BSD license. + * See README for more details. + */ ++#include + + #include "includes.h" + +@@ -21,6 +22,7 @@ + #include "eap_peer/eap.h" + #include "eapol_supp/eapol_supp_sm.h" + #include "rsn_supp/wpa.h" ++#include "ap/hostapd.h" + #include "wps/wps_attr_parse.h" + #include "config.h" + #include "wpa_supplicant_i.h" +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/805-bss-coloring-handle-the-collision-and-CCA-events-com.patch b/feeds/wifi-ax/hostapd/patches/f00-005-bss-coloring-handle-the-collision-and-CCA-events-coming-from-the-kernel.patch similarity index 72% rename from feeds/wifi-ax/hostapd/patches/805-bss-coloring-handle-the-collision-and-CCA-events-com.patch rename to feeds/wifi-ax/hostapd/patches/f00-005-bss-coloring-handle-the-collision-and-CCA-events-coming-from-the-kernel.patch index 0cbf705a9..9f9551e51 100644 --- a/feeds/wifi-ax/hostapd/patches/805-bss-coloring-handle-the-collision-and-CCA-events-com.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-005-bss-coloring-handle-the-collision-and-CCA-events-coming-from-the-kernel.patch @@ -1,8 +1,8 @@ -From 5d637bafbf774879983d146bbb9cb2b0c3ffffaa Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Wed, 17 Jun 2020 14:35:56 +0200 -Subject: [PATCH 805/813] bss coloring: handle the collision and CCA events +Subject: [PATCH V4 5/6] bss coloring: handle the collision and CCA events coming from the kernel +Date: Wed, 26 Aug 2020 08:22:15 +0200 + This patch activates the functionality of the previous patches by handling the actual events that will trigger the CCA process. @@ -15,11 +15,9 @@ Signed-off-by: John Crispin src/drivers/driver_nl80211_event.c | 64 +++++++++++++++++++++++++++++- 4 files changed, 138 insertions(+), 2 deletions(-) -diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c -index 36678e7a3..f7d2b6ee5 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -43,7 +43,6 @@ +@@ -44,7 +44,6 @@ #include "fils_hlp.h" #include "neighbor_db.h" @@ -27,10 +25,10 @@ index 36678e7a3..f7d2b6ee5 100644 #ifdef CONFIG_FILS void hostapd_notify_assoc_fils_finish(struct hostapd_data *hapd, struct sta_info *sta) -@@ -1722,6 +1721,39 @@ static void hostapd_event_wds_sta_interface_status(struct hostapd_data *hapd, +@@ -1781,6 +1780,39 @@ static void hostapd_event_update_muedca_ + "Failed to update beacons with MU-EDCA parameters"); } - +#ifdef CONFIG_IEEE80211AX +static void hostapd_event_bss_color_collision(struct hostapd_data *hapd, + u64 bitmap) @@ -46,15 +44,15 @@ index 36678e7a3..f7d2b6ee5 100644 +{ + switch (event) { + case EVENT_CCA_STARTED_NOTIFY: -+ wpa_printf(MSG_DEBUG, "CCA started on on %s", hapd->conf->iface); ++ wpa_printf(MSG_DEBUG, "CCA started on %s", hapd->conf->iface); + break; + case EVENT_CCA_NOTIFY: -+ wpa_printf(MSG_DEBUG, "CCA finished on on %s", hapd->conf->iface); ++ wpa_printf(MSG_DEBUG, "CCA finished on %s (new color: %d)", hapd->conf->iface, hapd->cca_color); + hapd->iface->conf->he_op.he_bss_color = hapd->cca_color; + hostapd_cleanup_cca_params(hapd); + break; + case EVENT_CCA_ABORTED_NOTIFY: -+ wpa_printf(MSG_DEBUG, "CCA aborted on on %s", hapd->conf->iface); ++ wpa_printf(MSG_DEBUG, "CCA aborted on %s for cca_color: %d", hapd->conf->iface, hapd->cca_color); + hostapd_cleanup_cca_params(hapd); + break; + default: @@ -67,9 +65,9 @@ index 36678e7a3..f7d2b6ee5 100644 #ifdef CONFIG_OWE static int hostapd_notif_update_dh_ie(struct hostapd_data *hapd, const u8 *peer, const u8 *ie, -@@ -2028,6 +2060,17 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, - data->wds_sta_interface.ifname, - data->wds_sta_interface.sta_addr); +@@ -2091,6 +2123,17 @@ void hostapd_wpa_event(void *ctx, enum w + case EVENT_UPDATE_MUEDCA_PARAMS: + hostapd_event_update_muedca_params(hapd, &data->update_muedca); break; +#ifdef CONFIG_IEEE80211AX + case EVENT_BSS_COLOR_COLLISION: @@ -85,18 +83,16 @@ index 36678e7a3..f7d2b6ee5 100644 default: wpa_printf(MSG_DEBUG, "Unknown event %d", event); break; -diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index 2a2bc29db..938245f50 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5088,6 +5088,26 @@ enum wpa_event_type { - * is required to provide more details of the frame. +@@ -5165,6 +5165,26 @@ enum wpa_event_type { + * beacon. */ - EVENT_UNPROT_BEACON, + EVENT_UPDATE_MUEDCA_PARAMS, + + /** -+ * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision -+ */ ++ * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision ++ */ + EVENT_BSS_COLOR_COLLISION, + + /** @@ -116,10 +112,10 @@ index 2a2bc29db..938245f50 100644 }; -@@ -5947,6 +5967,13 @@ union wpa_event_data { - struct unprot_beacon { - const u8 *sa; - } unprot_beacon; +@@ -6034,6 +6054,13 @@ union wpa_event_data { + u8 he_mu_ac_vi_param[3]; + u8 he_mu_ac_vo_param[3]; + } update_muedca; + + /** + * struct bss_color_collision - Data for EVENT_BSS_COLOR_COLLISION @@ -130,14 +126,12 @@ index 2a2bc29db..938245f50 100644 }; /** -diff --git a/src/drivers/driver_common.c b/src/drivers/driver_common.c -index a7ebe9566..0c0a23f09 100644 --- a/src/drivers/driver_common.c +++ b/src/drivers/driver_common.c -@@ -90,6 +90,10 @@ const char * event_to_string(enum wpa_event_type event) - E2S(WDS_STA_INTERFACE_STATUS); +@@ -91,6 +91,10 @@ const char * event_to_string(enum wpa_ev E2S(UPDATE_DH); E2S(UNPROT_BEACON); + E2S(UPDATE_MUEDCA_PARAMS); + E2S(BSS_COLOR_COLLISION); + E2S(CCA_STARTED_NOTIFY); + E2S(CCA_ABORTED_NOTIFY); @@ -145,11 +139,9 @@ index a7ebe9566..0c0a23f09 100644 } return "UNKNOWN"; -diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c -index ce95e9cd3..00a39a4ba 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c -@@ -145,7 +145,10 @@ static const char * nl80211_command_to_string(enum nl80211_commands cmd) +@@ -145,7 +145,10 @@ static const char * nl80211_command_to_s C2S(NL80211_CMD_UPDATE_OWE_INFO) C2S(NL80211_CMD_UNPROT_BEACON) C2S(NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS) @@ -161,8 +153,8 @@ index ce95e9cd3..00a39a4ba 100644 default: return "NL80211_CMD_UNKNOWN"; } -@@ -2597,6 +2600,51 @@ nl80211_control_port_frame_tx_status(struct wpa_driver_nl80211_data *drv, - wpa_supplicant_event(drv->ctx, EVENT_EAPOL_TX_STATUS, &event); +@@ -2603,6 +2606,51 @@ static void nl80211_control_port_frame(s + } } +#ifdef CONFIG_IEEE80211AX @@ -211,11 +203,11 @@ index ce95e9cd3..00a39a4ba 100644 +} +#endif - static void do_process_drv_event(struct i802_bss *bss, int cmd, - struct nlattr **tb) -@@ -2825,6 +2873,20 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, - tb[NL80211_ATTR_ACK], - tb[NL80211_ATTR_COOKIE]); + static void + nl80211_control_port_frame_tx_status(struct wpa_driver_nl80211_data *drv, +@@ -2856,6 +2904,20 @@ static void do_process_drv_event(struct + case NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS: + nl80211_update_muedca_params_event(drv, tb); break; +#ifdef CONFIG_IEEE80211AX + case NL80211_CMD_OBSS_COLOR_COLLISION: @@ -234,6 +226,3 @@ index ce95e9cd3..00a39a4ba 100644 default: wpa_dbg(drv->ctx, MSG_DEBUG, "nl80211: Ignored unknown event " "(cmd=%d)", cmd); --- -2.25.1 - diff --git a/feeds/wifi-ax/hostapd/patches/806-bss_coloring-allow-using-a-random-starting-color.patch b/feeds/wifi-ax/hostapd/patches/f00-006-bss_coloring-allow-using-a-random-starting-color.patch similarity index 87% rename from feeds/wifi-ax/hostapd/patches/806-bss_coloring-allow-using-a-random-starting-color.patch rename to feeds/wifi-ax/hostapd/patches/f00-006-bss_coloring-allow-using-a-random-starting-color.patch index c797f637c..a93fc2bf7 100644 --- a/feeds/wifi-ax/hostapd/patches/806-bss_coloring-allow-using-a-random-starting-color.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-006-bss_coloring-allow-using-a-random-starting-color.patch @@ -1,7 +1,7 @@ -From fcf80c8a089674dc03c2db435aca8a76dbc11fe8 Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Wed, 24 Jun 2020 14:47:40 +0200 -Subject: [PATCH 806/813] bss_coloring: allow using a random starting color +Subject: [PATCH V4 6/6] bss_coloring: allow using a random starting color +Date: Wed, 26 Aug 2020 08:22:16 +0200 + Enhance the possible values for he_bss_color. Anything greater than 63 will make hostapd choose a random color. @@ -13,7 +13,7 @@ Signed-off-by: John Crispin 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 9c1883d55..e66790303 100644 +index 97ded78aa..6c1f629cf 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -3439,8 +3439,11 @@ static int hostapd_config_fill(struct hostapd_config *conf, @@ -46,6 +46,3 @@ index 91ac96785..5fc4d5f86 100644 #he_bss_color=1 # he_bss_color_partial: BSS color AID equation --- -2.25.1 - diff --git a/feeds/wifi-ax/hostapd/patches/f00-007-bss_coloring-add-intelligence-color-choose-in-CCA.patch b/feeds/wifi-ax/hostapd/patches/f00-007-bss_coloring-add-intelligence-color-choose-in-CCA.patch new file mode 100644 index 000000000..6866191fc --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/f00-007-bss_coloring-add-intelligence-color-choose-in-CCA.patch @@ -0,0 +1,126 @@ +From d0d7cc4647ecad26b7bf04e39a4e9403cab68a48 Mon Sep 17 00:00:00 2001 +From: Karthikeyan Periyasamy +Date: Sat, 15 Aug 2020 18:47:26 +0530 +Subject: [PATCH] hostapd: Add intelligence color choose in CCA + +Gather color information of the neighbor APs and choose available +free color after go through the neighbor colors to minimise the color collision + +Signed-off-by: Karthikeyan Periyasamy +--- + src/ap/ap_list.c | 29 +++++++++++++++++++++++++ + src/ap/ap_list.h | 7 ++++++ + src/ap/hostapd.c | 66 +++++++++++++++++++++++++++++--------------------------- + 3 files changed, 70 insertions(+), 32 deletions(-) + +--- a/src/ap/ap_list.c ++++ b/src/ap/ap_list.c +@@ -174,6 +174,7 @@ void ap_list_process_beacon(struct hosta + struct ap_info *ap; + int new_ap = 0; + int set_beacon = 0; ++ u32 he_operation; + + if (iface->conf->ap_table_max_size < 1) + return; +@@ -210,6 +211,17 @@ void ap_list_process_beacon(struct hosta + else + ap->ht_support = 0; + ++ if (iface->conf->ieee80211ax && ++ elems->he_operation) { ++ he_operation = *(u32 *)elems->he_operation; ++ ++ if (!(he_operation & HE_OPERATION_BSS_COLOR_DISABLED)) ++ ap->color = (he_operation & HE_OPERATION_BSS_COLOR_MASK) >> ++ HE_OPERATION_BSS_COLOR_OFFSET; ++ else ++ ap->color = 0; ++ } ++ + os_get_reltime(&ap->last_beacon); + + if (!new_ap && ap != iface->ap_list) { +@@ -295,6 +307,21 @@ void ap_list_timer(struct hostapd_iface + ieee802_11_update_beacons(iface); + } + ++u64 ap_list_get_color(struct hostapd_iface *iface) ++{ ++ u64 used_color_bitmap = 0; ++ struct ap_info *ap; ++ ++ if (!iface->ap_list) ++ return used_color_bitmap; ++ ++ ap = iface->ap_list; ++ while (ap != NULL) { ++ used_color_bitmap |= (u64)1 << ap->color; ++ ap = ap->next; ++ } ++ return used_color_bitmap; ++} + + int ap_list_init(struct hostapd_iface *iface) + { +--- a/src/ap/ap_list.h ++++ b/src/ap/ap_list.h +@@ -25,6 +25,7 @@ struct ap_info { + int channel; + + int ht_support; ++ u8 color; + + struct os_reltime last_beacon; + }; +@@ -40,6 +41,7 @@ void ap_list_process_beacon(struct hosta + int ap_list_init(struct hostapd_iface *iface); + void ap_list_deinit(struct hostapd_iface *iface); + void ap_list_timer(struct hostapd_iface *iface); ++u64 ap_list_get_color(struct hostapd_iface *iface); + #else /* NEED_AP_MLME */ + static inline int ap_list_init(struct hostapd_iface *iface) + { +@@ -53,6 +55,11 @@ static inline void ap_list_deinit(struct + static inline void ap_list_timer(struct hostapd_iface *iface) + { + } ++ ++static u64 ap_list_get_color(struct hostapd_iface *iface) ++{ ++ return 0; ++} + #endif /* NEED_AP_MLME */ + + #endif /* AP_LIST_H */ +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -3757,6 +3757,7 @@ hostapd_switch_color_timeout_handler(voi + struct cca_settings settings; + struct os_time now; + int i, r, b, ret; ++ u64 neighbor_color; + + if (os_get_time(&now)) + return; +@@ -3765,11 +3766,16 @@ hostapd_switch_color_timeout_handler(voi + if (now.sec - hapd->last_color_collision.sec >= 10) + return; + +- r = os_random() % HE_OPERATION_BSS_COLOR_MAX; +- for (i = 0; i < HE_OPERATION_BSS_COLOR_MAX; i++) { +- if (r && (hapd->color_collision_bitmap & (1 << r)) == 0) ++ neighbor_color = ap_list_get_color(hapd->iface); ++ neighbor_color |= hapd->color_collision_bitmap; ++ ++ r = os_random() % HE_OPERATION_BSS_COLOR_MAX - 1; ++ r++; ++ for (i = 1; i < HE_OPERATION_BSS_COLOR_MAX; i++) { ++ if ((neighbor_color & (1 << r)) == 0) + break; +- r = (r + 1) % HE_OPERATION_BSS_COLOR_MAX; ++ r = r % HE_OPERATION_BSS_COLOR_MAX - 1; ++ r++; + } + if (i == HE_OPERATION_BSS_COLOR_MAX) { + /* there are no free colors so turn bss coloring off */ diff --git a/feeds/wifi-ax/hostapd/patches/f00-009-add-bcca-IE-with-countdown-zero-in-color-change-beacon.patch b/feeds/wifi-ax/hostapd/patches/f00-009-add-bcca-IE-with-countdown-zero-in-color-change-beacon.patch new file mode 100644 index 000000000..5f1e0253c --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/f00-009-add-bcca-IE-with-countdown-zero-in-color-change-beacon.patch @@ -0,0 +1,96 @@ +From f2cc86f874e09b0b1d1247de98f1720aa51080d8 Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Tue, 6 Oct 2020 21:37:04 +0530 +Subject: [PATCH] hostapd: Add BCCA IE with countdown zero + +During BCCA, BCCA IE with countdown zero has to be added +in the beacon in which new color is updated. Remove BCCA +IE in the beacon template after color change is +completed. + +Signed-off-by: Lavanya Suresh +--- + src/ap/drv_callbacks.c | 6 ++++++ + src/ap/hostapd.c | 10 ++++++++-- + src/ap/hostapd.h | 1 + + src/ap/ieee802_11_he.c | 2 +- + 4 files changed, 16 insertions(+), 3 deletions(-) + +--- a/src/ap/drv_callbacks.c ++++ b/src/ap/drv_callbacks.c +@@ -1793,14 +1793,29 @@ static void hostapd_event_bss_color_coll + + static void hostapd_event_cca(struct hostapd_data *hapd, enum wpa_event_type event) + { ++ int b, err; ++ + switch (event) { + case EVENT_CCA_STARTED_NOTIFY: + wpa_printf(MSG_DEBUG, "CCA started on %s", hapd->conf->iface); + break; + case EVENT_CCA_NOTIFY: + wpa_printf(MSG_DEBUG, "CCA finished on %s (new color: %d)", hapd->conf->iface, hapd->cca_color); +- hapd->iface->conf->he_op.he_bss_color = hapd->cca_color; +- hostapd_cleanup_cca_params(hapd); ++ ++ for (b = 0; b < hapd->iface->num_bss; b++) { ++ if (hapd->iface->bss[b]->cca_color != 0) { ++ hapd->iface->conf->he_op.he_bss_color = hapd->iface->bss[b]->cca_color; ++ hapd->iface->bss[b]->cca_in_progress = 0; ++ err = ieee802_11_set_beacon(hapd->iface->bss[b]); ++ if (err) { ++ wpa_printf(MSG_ERROR, "Failed to remove BCCA IE"); ++ hapd->iface->bss[b]->cca_in_progress = 1; ++ } ++ else ++ hostapd_cleanup_cca_params(hapd->iface->bss[b]); ++ } ++ } ++ + break; + case EVENT_CCA_ABORTED_NOTIFY: + wpa_printf(MSG_DEBUG, "CCA aborted on %s for cca_color: %d", hapd->conf->iface, hapd->cca_color); +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -3727,12 +3727,18 @@ int hostapd_fill_cca_settings(struct hos + + old_color = iface->conf->he_op.he_bss_color; + iface->conf->he_op.he_bss_color = hapd->cca_color; ++ ++ settings->cca_count = hapd->cca_count; ++ settings->cca_color = hapd->cca_color; ++ hapd->cca_count = 0; ++ hapd->cca_zero_count = 1; ++ + ret = hostapd_build_beacon_data(hapd, &settings->beacon_after); + iface->conf->he_op.he_bss_color = old_color; + +- settings->cca_count = hapd->cca_count; +- settings->cca_color = hapd->cca_color, ++ hapd->cca_count = settings->cca_count; + hapd->cca_in_progress = 1; ++ hapd->cca_zero_count = 0; + + ret = hostapd_build_beacon_data(hapd, &settings->beacon_cca); + if (ret) { +--- a/src/ap/hostapd.h ++++ b/src/ap/hostapd.h +@@ -298,6 +298,7 @@ struct hostapd_data { + + #ifdef CONFIG_IEEE80211AX + int cca_in_progress; ++ int cca_zero_count; + u8 cca_count; + u8 cca_color; + unsigned int cca_c_off_beacon; +--- a/src/ap/ieee802_11_he.c ++++ b/src/ap/ieee802_11_he.c +@@ -491,7 +491,7 @@ int hostapd_get_he_twt_responder(struct + + u8 * hostapd_eid_cca(struct hostapd_data *hapd, u8 *eid) + { +- if (!hapd->cca_in_progress) ++ if (!hapd->cca_in_progress && !hapd->cca_zero_count) + return eid; + *eid++ = WLAN_EID_EXTENSION; + *eid++ = 3; diff --git a/feeds/wifi-ax/hostapd/patches/f00-010-bss_coloring-check-free-color-periodically.patch b/feeds/wifi-ax/hostapd/patches/f00-010-bss_coloring-check-free-color-periodically.patch new file mode 100644 index 000000000..ff6f1e1b5 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/f00-010-bss_coloring-check-free-color-periodically.patch @@ -0,0 +1,77 @@ +From 7c0383bf8883e2bad9c7beb47712105be38b5427 Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Wed, 7 Oct 2020 13:29:03 +0530 +Subject: [PATCH] hostapd: Check free colors periodically if no new color is + available + +In case of collision, if all the colors are in use, start dot11APcollision +timer(50s) and check for new color after timeout. + +Signed-off-by: Lavanya Suresh +--- + src/ap/hostapd.c | 20 +++++++++++++++++--- + src/ap/hostapd.h | 1 + + 2 files changed, 18 insertions(+), 3 deletions(-) + +diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c +index 097db83..101178b 100644 +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -3766,11 +3766,12 @@ hostapd_switch_color_timeout_handler(void *eloop_data, void *user_ctx) + return; + + /* check if there has been a recent collision */ +- if (now.sec - hapd->last_color_collision.sec > 50) ++ if (now.sec - hapd->last_color_collision.sec > 50 && !hapd->no_free_color) + return; + + neighbor_color = ap_list_get_color(hapd->iface); +- neighbor_color |= hapd->color_collision_bitmap; ++ if (!hapd->no_free_color) ++ neighbor_color |= hapd->color_collision_bitmap; + + r = os_random() % HE_OPERATION_BSS_COLOR_MAX - 1; + r++; +@@ -3782,13 +3783,26 @@ hostapd_switch_color_timeout_handler(void *eloop_data, void *user_ctx) + } + if (i == HE_OPERATION_BSS_COLOR_MAX) { + /* there are no free colors so turn bss coloring off */ +- wpa_printf(MSG_INFO, "no free colors left, turning of BSS coloring"); ++ wpa_printf(MSG_INFO, "no free colors left, turning off BSS coloring"); + hapd->iface->conf->he_op.he_bss_color_disabled = 1; ++ hapd->no_free_color = 1; + for (b = 0; b < hapd->iface->num_bss; b++) + ieee802_11_set_beacon(hapd->iface->bss[b]); ++ ++ /* Enabling for next check after timeout*/ ++ hapd->iface->conf->he_op.he_bss_color_disabled = 0; ++ ++ /* start timer for DOT11BSS_COLOR_COLLISION_AP_PERIOD, and check free color on timeout */ ++ if (!eloop_is_timeout_registered(hostapd_switch_color_timeout_handler, hapd, NULL)) ++ eloop_register_timeout(DOT11BSS_COLOR_COLLISION_AP_PERIOD, 0, ++ hostapd_switch_color_timeout_handler, hapd, NULL); ++ + return; + } + ++ if (hapd->no_free_color) ++ hapd->no_free_color = 0; ++ + for (b = 0; b < hapd->iface->num_bss; b++) { + struct hostapd_data *bss = hapd->iface->bss[b]; + +diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h +index a229f80..1b3a87f 100644 +--- a/src/ap/hostapd.h ++++ b/src/ap/hostapd.h +@@ -299,6 +299,7 @@ struct hostapd_data { + #ifdef CONFIG_IEEE80211AX + int cca_in_progress; + int cca_zero_count; ++ int no_free_color; + u8 cca_count; + u8 cca_color; + unsigned int cca_c_off_beacon; +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/src/src/drivers/nl80211_copy.h b/feeds/wifi-ax/hostapd/src/src/drivers/nl80211_copy.h deleted file mode 100644 index 580a3b87f..000000000 --- a/feeds/wifi-ax/hostapd/src/src/drivers/nl80211_copy.h +++ /dev/null @@ -1,7029 +0,0 @@ -#ifndef __LINUX_NL80211_H -#define __LINUX_NL80211_H -/* - * 802.11 netlink interface public header - * - * Copyright 2006-2010 Johannes Berg - * Copyright 2008 Michael Wu - * Copyright 2008 Luis Carlos Cobo - * Copyright 2008 Michael Buesch - * Copyright 2008, 2009 Luis R. Rodriguez - * Copyright 2008 Jouni Malinen - * Copyright 2008 Colin McCabe - * Copyright 2015-2017 Intel Deutschland GmbH - * Copyright (C) 2018-2020 Intel Corporation - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - -/* - * This header file defines the userspace API to the wireless stack. Please - * be careful not to break things - i.e. don't move anything around or so - * unless you can demonstrate that it breaks neither API nor ABI. - * - * Additions to the API should be accompanied by actual implementations in - * an upstream driver, so that example implementations exist in case there - * are ever concerns about the precise semantics of the API or changes are - * needed, and to ensure that code for dead (no longer implemented) API - * can actually be identified and removed. - * Nonetheless, semantics should also be documented carefully in this file. - */ - -#include - -#define NL80211_GENL_NAME "nl80211" - -#define NL80211_MULTICAST_GROUP_CONFIG "config" -#define NL80211_MULTICAST_GROUP_SCAN "scan" -#define NL80211_MULTICAST_GROUP_REG "regulatory" -#define NL80211_MULTICAST_GROUP_MLME "mlme" -#define NL80211_MULTICAST_GROUP_VENDOR "vendor" -#define NL80211_MULTICAST_GROUP_NAN "nan" -#define NL80211_MULTICAST_GROUP_TESTMODE "testmode" - -#define NL80211_EDMG_BW_CONFIG_MIN 4 -#define NL80211_EDMG_BW_CONFIG_MAX 15 -#define NL80211_EDMG_CHANNELS_MIN 1 -#define NL80211_EDMG_CHANNELS_MAX 0x3c /* 0b00111100 */ - -/** - * DOC: Station handling - * - * Stations are added per interface, but a special case exists with VLAN - * interfaces. When a station is bound to an AP interface, it may be moved - * into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN). - * The station is still assumed to belong to the AP interface it was added - * to. - * - * Station handling varies per interface type and depending on the driver's - * capabilities. - * - * For drivers supporting TDLS with external setup (WIPHY_FLAG_SUPPORTS_TDLS - * and WIPHY_FLAG_TDLS_EXTERNAL_SETUP), the station lifetime is as follows: - * - a setup station entry is added, not yet authorized, without any rate - * or capability information, this just exists to avoid race conditions - * - when the TDLS setup is done, a single NL80211_CMD_SET_STATION is valid - * to add rate and capability information to the station and at the same - * time mark it authorized. - * - %NL80211_TDLS_ENABLE_LINK is then used - * - after this, the only valid operation is to remove it by tearing down - * the TDLS link (%NL80211_TDLS_DISABLE_LINK) - * - * TODO: need more info for other interface types - */ - -/** - * DOC: Frame transmission/registration support - * - * Frame transmission and registration support exists to allow userspace - * management entities such as wpa_supplicant react to management frames - * that are not being handled by the kernel. This includes, for example, - * certain classes of action frames that cannot be handled in the kernel - * for various reasons. - * - * Frame registration is done on a per-interface basis and registrations - * cannot be removed other than by closing the socket. It is possible to - * specify a registration filter to register, for example, only for a - * certain type of action frame. In particular with action frames, those - * that userspace registers for will not be returned as unhandled by the - * driver, so that the registered application has to take responsibility - * for doing that. - * - * The type of frame that can be registered for is also dependent on the - * driver and interface type. The frame types are advertised in wiphy - * attributes so applications know what to expect. - * - * NOTE: When an interface changes type while registrations are active, - * these registrations are ignored until the interface type is - * changed again. This means that changing the interface type can - * lead to a situation that couldn't otherwise be produced, but - * any such registrations will be dormant in the sense that they - * will not be serviced, i.e. they will not receive any frames. - * - * Frame transmission allows userspace to send for example the required - * responses to action frames. It is subject to some sanity checking, - * but many frames can be transmitted. When a frame was transmitted, its - * status is indicated to the sending socket. - * - * For more technical details, see the corresponding command descriptions - * below. - */ - -/** - * DOC: Virtual interface / concurrency capabilities - * - * Some devices are able to operate with virtual MACs, they can have - * more than one virtual interface. The capability handling for this - * is a bit complex though, as there may be a number of restrictions - * on the types of concurrency that are supported. - * - * To start with, each device supports the interface types listed in - * the %NL80211_ATTR_SUPPORTED_IFTYPES attribute, but by listing the - * types there no concurrency is implied. - * - * Once concurrency is desired, more attributes must be observed: - * To start with, since some interface types are purely managed in - * software, like the AP-VLAN type in mac80211 for example, there's - * an additional list of these, they can be added at any time and - * are only restricted by some semantic restrictions (e.g. AP-VLAN - * cannot be added without a corresponding AP interface). This list - * is exported in the %NL80211_ATTR_SOFTWARE_IFTYPES attribute. - * - * Further, the list of supported combinations is exported. This is - * in the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute. Basically, - * it exports a list of "groups", and at any point in time the - * interfaces that are currently active must fall into any one of - * the advertised groups. Within each group, there are restrictions - * on the number of interfaces of different types that are supported - * and also the number of different channels, along with potentially - * some other restrictions. See &enum nl80211_if_combination_attrs. - * - * All together, these attributes define the concurrency of virtual - * interfaces that a given device supports. - */ - -/** - * DOC: packet coalesce support - * - * In most cases, host that receives IPv4 and IPv6 multicast/broadcast - * packets does not do anything with these packets. Therefore the - * reception of these unwanted packets causes unnecessary processing - * and power consumption. - * - * Packet coalesce feature helps to reduce number of received interrupts - * to host by buffering these packets in firmware/hardware for some - * predefined time. Received interrupt will be generated when one of the - * following events occur. - * a) Expiration of hardware timer whose expiration time is set to maximum - * coalescing delay of matching coalesce rule. - * b) Coalescing buffer in hardware reaches it's limit. - * c) Packet doesn't match any of the configured coalesce rules. - * - * User needs to configure following parameters for creating a coalesce - * rule. - * a) Maximum coalescing delay - * b) List of packet patterns which needs to be matched - * c) Condition for coalescence. pattern 'match' or 'no match' - * Multiple such rules can be created. - */ - -/** - * DOC: WPA/WPA2 EAPOL handshake offload - * - * By setting @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK flag drivers - * can indicate they support offloading EAPOL handshakes for WPA/WPA2 - * preshared key authentication. In %NL80211_CMD_CONNECT the preshared - * key should be specified using %NL80211_ATTR_PMK. Drivers supporting - * this offload may reject the %NL80211_CMD_CONNECT when no preshared - * key material is provided, for example when that driver does not - * support setting the temporal keys through %CMD_NEW_KEY. - * - * Similarly @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X flag can be - * set by drivers indicating offload support of the PTK/GTK EAPOL - * handshakes during 802.1X authentication. In order to use the offload - * the %NL80211_CMD_CONNECT should have %NL80211_ATTR_WANT_1X_4WAY_HS - * attribute flag. Drivers supporting this offload may reject the - * %NL80211_CMD_CONNECT when the attribute flag is not present. - * - * For 802.1X the PMK or PMK-R0 are set by providing %NL80211_ATTR_PMK - * using %NL80211_CMD_SET_PMK. For offloaded FT support also - * %NL80211_ATTR_PMKR0_NAME must be provided. - */ - -/** - * DOC: FILS shared key authentication offload - * - * FILS shared key authentication offload can be advertized by drivers by - * setting @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD flag. The drivers that support - * FILS shared key authentication offload should be able to construct the - * authentication and association frames for FILS shared key authentication and - * eventually do a key derivation as per IEEE 802.11ai. The below additional - * parameters should be given to driver in %NL80211_CMD_CONNECT and/or in - * %NL80211_CMD_UPDATE_CONNECT_PARAMS. - * %NL80211_ATTR_FILS_ERP_USERNAME - used to construct keyname_nai - * %NL80211_ATTR_FILS_ERP_REALM - used to construct keyname_nai - * %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used to construct erp message - * %NL80211_ATTR_FILS_ERP_RRK - used to generate the rIK and rMSK - * rIK should be used to generate an authentication tag on the ERP message and - * rMSK should be used to derive a PMKSA. - * rIK, rMSK should be generated and keyname_nai, sequence number should be used - * as specified in IETF RFC 6696. - * - * When FILS shared key authentication is completed, driver needs to provide the - * below additional parameters to userspace, which can be either after setting - * up a connection or after roaming. - * %NL80211_ATTR_FILS_KEK - used for key renewal - * %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used in further EAP-RP exchanges - * %NL80211_ATTR_PMKID - used to identify the PMKSA used/generated - * %Nl80211_ATTR_PMK - used to update PMKSA cache in userspace - * The PMKSA can be maintained in userspace persistently so that it can be used - * later after reboots or wifi turn off/on also. - * - * %NL80211_ATTR_FILS_CACHE_ID is the cache identifier advertized by a FILS - * capable AP supporting PMK caching. It specifies the scope within which the - * PMKSAs are cached in an ESS. %NL80211_CMD_SET_PMKSA and - * %NL80211_CMD_DEL_PMKSA are enhanced to allow support for PMKSA caching based - * on FILS cache identifier. Additionally %NL80211_ATTR_PMK is used with - * %NL80211_SET_PMKSA to specify the PMK corresponding to a PMKSA for driver to - * use in a FILS shared key connection with PMKSA caching. - */ - -/** - * DOC: SAE authentication offload - * - * By setting @NL80211_EXT_FEATURE_SAE_OFFLOAD flag drivers can indicate they - * support offloading SAE authentication for WPA3-Personal networks. In - * %NL80211_CMD_CONNECT the password for SAE should be specified using - * %NL80211_ATTR_SAE_PASSWORD. - */ - -/** - * DOC: VLAN offload support for setting group keys and binding STAs to VLANs - * - * By setting @NL80211_EXT_FEATURE_VLAN_OFFLOAD flag drivers can indicate they - * support offloading VLAN functionality in a manner where the driver exposes a - * single netdev that uses VLAN tagged frames and separate VLAN-specific netdevs - * can then be added using RTM_NEWLINK/IFLA_VLAN_ID similarly to the Ethernet - * case. Frames received from stations that are not assigned to any VLAN are - * delivered on the main netdev and frames to such stations can be sent through - * that main netdev. - * - * %NL80211_CMD_NEW_KEY (for group keys), %NL80211_CMD_NEW_STATION, and - * %NL80211_CMD_SET_STATION will optionally specify vlan_id using - * %NL80211_ATTR_VLAN_ID. - */ - -/** - * DOC: TID configuration - * - * TID config support can be checked in the %NL80211_ATTR_TID_CONFIG - * attribute given in wiphy capabilities. - * - * The necessary configuration parameters are mentioned in - * &enum nl80211_tid_config_attr and it will be passed to the - * %NL80211_CMD_SET_TID_CONFIG command in %NL80211_ATTR_TID_CONFIG. - * - * If the configuration needs to be applied for specific peer then the MAC - * address of the peer needs to be passed in %NL80211_ATTR_MAC, otherwise the - * configuration will be applied for all the connected peers in the vif except - * any peers that have peer specific configuration for the TID by default; if - * the %NL80211_TID_CONFIG_ATTR_OVERRIDE flag is set, peer specific values - * will be overwritten. - * - * All this configuration is valid only for STA's current connection - * i.e. the configuration will be reset to default when the STA connects back - * after disconnection/roaming, and this configuration will be cleared when - * the interface goes down. - */ - -/** - * enum nl80211_commands - supported nl80211 commands - * - * @NL80211_CMD_UNSPEC: unspecified command to catch errors - * - * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request - * to get a list of all present wiphys. - * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or - * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, - * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, - * %NL80211_ATTR_WIPHY_FREQ_OFFSET (and the attributes determining the - * channel width; this is used for setting monitor mode channel), - * %NL80211_ATTR_WIPHY_RETRY_SHORT, %NL80211_ATTR_WIPHY_RETRY_LONG, - * %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, and/or - * %NL80211_ATTR_WIPHY_RTS_THRESHOLD. However, for setting the channel, - * see %NL80211_CMD_SET_CHANNEL instead, the support here is for backward - * compatibility only. - * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request - * or rename notification. Has attributes %NL80211_ATTR_WIPHY and - * %NL80211_ATTR_WIPHY_NAME. - * @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes - * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME. - * - * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration; - * either a dump request for all interfaces or a specific get with a - * single %NL80211_ATTR_IFINDEX is supported. - * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires - * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE. - * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response - * to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX, - * %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also - * be sent from userspace to request creation of a new virtual interface, - * then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and - * %NL80211_ATTR_IFNAME. - * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes - * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from - * userspace to request deletion of a virtual interface, then requires - * attribute %NL80211_ATTR_IFINDEX. - * - * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified - * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC. - * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT, - * %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD. - * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA, - * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC, %NL80211_ATTR_KEY_CIPHER, - * and %NL80211_ATTR_KEY_SEQ attributes. - * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX - * or %NL80211_ATTR_MAC. - * - * @NL80211_CMD_GET_BEACON: (not used) - * @NL80211_CMD_SET_BEACON: change the beacon on an access point interface - * using the %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL - * attributes. For drivers that generate the beacon and probe responses - * internally, the following attributes must be provided: %NL80211_ATTR_IE, - * %NL80211_ATTR_IE_PROBE_RESP and %NL80211_ATTR_IE_ASSOC_RESP. - * @NL80211_CMD_START_AP: Start AP operation on an AP interface, parameters - * are like for %NL80211_CMD_SET_BEACON, and additionally parameters that - * do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL, - * %NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID, - * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, - * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, - * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, - * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT, - * %NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS. - * The channel to use can be set on the interface or be given using the - * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_FREQ_OFFSET, and the - * attributes determining channel width. - * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP - * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface - * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP - * - * @NL80211_CMD_GET_STATION: Get station attributes for station identified by - * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX. - * @NL80211_CMD_SET_STATION: Set station attributes for station identified by - * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX. - * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the - * the interface identified by %NL80211_ATTR_IFINDEX. - * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC - * or, if no MAC address given, all stations, on the interface identified - * by %NL80211_ATTR_IFINDEX. %NL80211_ATTR_MGMT_SUBTYPE and - * %NL80211_ATTR_REASON_CODE can optionally be used to specify which type - * of disconnection indication should be sent to the station - * (Deauthentication or Disassociation frame and reason code for that - * frame). - * - * @NL80211_CMD_GET_MPATH: Get mesh path attributes for mesh path to - * destination %NL80211_ATTR_MAC on the interface identified by - * %NL80211_ATTR_IFINDEX. - * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to - * destination %NL80211_ATTR_MAC on the interface identified by - * %NL80211_ATTR_IFINDEX. - * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by - * %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP. - * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by - * %NL80211_ATTR_MAC. - * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the - * the interface identified by %NL80211_ATTR_IFINDEX. - * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC - * or, if no MAC address given, all mesh paths, on the interface identified - * by %NL80211_ATTR_IFINDEX. - * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by - * %NL80211_ATTR_IFINDEX. - * - * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set - * regulatory domain. If %NL80211_ATTR_WIPHY is specified and the device - * has a private regulatory domain, it will be returned. Otherwise, the - * global regdomain will be returned. - * A device will have a private regulatory domain if it uses the - * regulatory_hint() API. Even when a private regdomain is used the channel - * information will still be mended according to further hints from - * the regulatory core to help with compliance. A dump version of this API - * is now available which will returns the global regdomain as well as - * all private regdomains of present wiphys (for those that have it). - * If a wiphy is self-managed (%NL80211_ATTR_WIPHY_SELF_MANAGED_REG), then - * its private regdomain is the only valid one for it. The regulatory - * core is not used to help with compliance in this case. - * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command - * after being queried by the kernel. CRDA replies by sending a regulatory - * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our - * current alpha2 if it found a match. It also provides - * NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each - * regulatory rule is a nested set of attributes given by - * %NL80211_ATTR_REG_RULE_FREQ_[START|END] and - * %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by - * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and - * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP. - * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain - * to the specified ISO/IEC 3166-1 alpha2 country code. The core will - * store this as a valid request and then query userspace for it. - * - * @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the - * interface identified by %NL80211_ATTR_IFINDEX - * - * @NL80211_CMD_SET_MESH_CONFIG: Set mesh networking properties for the - * interface identified by %NL80211_ATTR_IFINDEX - * - * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The - * interface is identified with %NL80211_ATTR_IFINDEX and the management - * frame subtype with %NL80211_ATTR_MGMT_SUBTYPE. The extra IE data to be - * added to the end of the specified management frame is specified with - * %NL80211_ATTR_IE. If the command succeeds, the requested data will be - * added to all specified management frames generated by - * kernel/firmware/driver. - * Note: This command has been removed and it is only reserved at this - * point to avoid re-using existing command number. The functionality this - * command was planned for has been provided with cleaner design with the - * option to specify additional IEs in NL80211_CMD_TRIGGER_SCAN, - * NL80211_CMD_AUTHENTICATE, NL80211_CMD_ASSOCIATE, - * NL80211_CMD_DEAUTHENTICATE, and NL80211_CMD_DISASSOCIATE. - * - * @NL80211_CMD_GET_SCAN: get scan results - * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters - * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the - * probe requests at CCK rate or not. %NL80211_ATTR_BSSID can be used to - * specify a BSSID to scan for; if not included, the wildcard BSSID will - * be used. - * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to - * NL80211_CMD_GET_SCAN and on the "scan" multicast group) - * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, - * partial scan results may be available - * - * @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan at certain - * intervals and certain number of cycles, as specified by - * %NL80211_ATTR_SCHED_SCAN_PLANS. If %NL80211_ATTR_SCHED_SCAN_PLANS is - * not specified and only %NL80211_ATTR_SCHED_SCAN_INTERVAL is specified, - * scheduled scan will run in an infinite loop with the specified interval. - * These attributes are mutually exculsive, - * i.e. NL80211_ATTR_SCHED_SCAN_INTERVAL must not be passed if - * NL80211_ATTR_SCHED_SCAN_PLANS is defined. - * If for some reason scheduled scan is aborted by the driver, all scan - * plans are canceled (including scan plans that did not start yet). - * Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS) - * are passed, they are used in the probe requests. For - * broadcast, a broadcast SSID must be passed (ie. an empty - * string). If no SSID is passed, no probe requests are sent and - * a passive scan is performed. %NL80211_ATTR_SCAN_FREQUENCIES, - * if passed, define which channels should be scanned; if not - * passed, all channels allowed for the current regulatory domain - * are used. Extra IEs can also be passed from the userspace by - * using the %NL80211_ATTR_IE attribute. The first cycle of the - * scheduled scan can be delayed by %NL80211_ATTR_SCHED_SCAN_DELAY - * is supplied. If the device supports multiple concurrent scheduled - * scans, it will allow such when the caller provides the flag attribute - * %NL80211_ATTR_SCHED_SCAN_MULTI to indicate user-space support for it. - * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if - * scheduled scan is not running. The caller may assume that as soon - * as the call returns, it is safe to start a new scheduled scan again. - * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan - * results available. - * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has - * stopped. The driver may issue this event at any time during a - * scheduled scan. One reason for stopping the scan is if the hardware - * does not support starting an association or a normal scan while running - * a scheduled scan. This event is also sent when the - * %NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface - * is brought down while a scheduled scan was running. - * - * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation - * or noise level - * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to - * NL80211_CMD_GET_SURVEY and on the "scan" multicast group) - * - * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry using %NL80211_ATTR_MAC - * (for the BSSID), %NL80211_ATTR_PMKID, and optionally %NL80211_ATTR_PMK - * (PMK is used for PTKSA derivation in case of FILS shared key offload) or - * using %NL80211_ATTR_SSID, %NL80211_ATTR_FILS_CACHE_ID, - * %NL80211_ATTR_PMKID, and %NL80211_ATTR_PMK in case of FILS - * authentication where %NL80211_ATTR_FILS_CACHE_ID is the identifier - * advertized by a FILS capable AP identifying the scope of PMKSA in an - * ESS. - * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC - * (for the BSSID) and %NL80211_ATTR_PMKID or using %NL80211_ATTR_SSID, - * %NL80211_ATTR_FILS_CACHE_ID, and %NL80211_ATTR_PMKID in case of FILS - * authentication. - * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries. - * - * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain - * has been changed and provides details of the request information - * that caused the change such as who initiated the regulatory request - * (%NL80211_ATTR_REG_INITIATOR), the wiphy_idx - * (%NL80211_ATTR_REG_ALPHA2) on which the request was made from if - * the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or - * %NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain - * set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is - * %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on - * to (%NL80211_ATTR_REG_ALPHA2). - * @NL80211_CMD_REG_BEACON_HINT: indicates to userspace that an AP beacon - * has been found while world roaming thus enabling active scan or - * any mode of operation that initiates TX (beacons) on a channel - * where we would not have been able to do either before. As an example - * if you are world roaming (regulatory domain set to world or if your - * driver is using a custom world roaming regulatory domain) and while - * doing a passive scan on the 5 GHz band you find an AP there (if not - * on a DFS channel) you will now be able to actively scan for that AP - * or use AP mode on your card on that same channel. Note that this will - * never be used for channels 1-11 on the 2 GHz band as they are always - * enabled world wide. This beacon hint is only sent if your device had - * either disabled active scanning or beaconing on a channel. We send to - * userspace the wiphy on which we removed a restriction from - * (%NL80211_ATTR_WIPHY) and the channel on which this occurred - * before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER) - * the beacon hint was processed. - * - * @NL80211_CMD_AUTHENTICATE: authentication request and notification. - * This command is used both as a command (request to authenticate) and - * as an event on the "mlme" multicast group indicating completion of the - * authentication process. - * When used as a command, %NL80211_ATTR_IFINDEX is used to identify the - * interface. %NL80211_ATTR_MAC is used to specify PeerSTAAddress (and - * BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify - * the SSID (mainly for association, but is included in authentication - * request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ + - * %NL80211_ATTR_WIPHY_FREQ_OFFSET is used to specify the frequence of the - * channel in MHz. %NL80211_ATTR_AUTH_TYPE is used to specify the - * authentication type. %NL80211_ATTR_IE is used to define IEs - * (VendorSpecificInfo, but also including RSN IE and FT IEs) to be added - * to the frame. - * When used as an event, this reports reception of an Authentication - * frame in station and IBSS modes when the local MLME processed the - * frame, i.e., it was for the local STA and was received in correct - * state. This is similar to MLME-AUTHENTICATE.confirm primitive in the - * MLME SAP interface (kernel providing MLME, userspace SME). The - * included %NL80211_ATTR_FRAME attribute contains the management frame - * (including both the header and frame body, but not FCS). This event is - * also used to indicate if the authentication attempt timed out. In that - * case the %NL80211_ATTR_FRAME attribute is replaced with a - * %NL80211_ATTR_TIMED_OUT flag (and %NL80211_ATTR_MAC to indicate which - * pending authentication timed out). - * @NL80211_CMD_ASSOCIATE: association request and notification; like - * NL80211_CMD_AUTHENTICATE but for Association and Reassociation - * (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request, - * MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives). The - * %NL80211_ATTR_PREV_BSSID attribute is used to specify whether the - * request is for the initial association to an ESS (that attribute not - * included) or for reassociation within the ESS (that attribute is - * included). - * @NL80211_CMD_DEAUTHENTICATE: deauthentication request and notification; like - * NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to - * MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication - * primitives). - * @NL80211_CMD_DISASSOCIATE: disassociation request and notification; like - * NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to - * MLME-DISASSOCIATE.request and MLME-DISASSOCIATE.indication primitives). - * - * @NL80211_CMD_MICHAEL_MIC_FAILURE: notification of a locally detected Michael - * MIC (part of TKIP) failure; sent on the "mlme" multicast group; the - * event includes %NL80211_ATTR_MAC to describe the source MAC address of - * the frame with invalid MIC, %NL80211_ATTR_KEY_TYPE to show the key - * type, %NL80211_ATTR_KEY_IDX to indicate the key identifier, and - * %NL80211_ATTR_KEY_SEQ to indicate the TSC value of the frame; this - * event matches with MLME-MICHAELMICFAILURE.indication() primitive - * - * @NL80211_CMD_JOIN_IBSS: Join a new IBSS -- given at least an SSID and a - * FREQ attribute (for the initial frequency if no peer can be found) - * and optionally a MAC (as BSSID) and FREQ_FIXED attribute if those - * should be fixed rather than automatically determined. Can only be - * executed on a network interface that is UP, and fixed BSSID/FREQ - * may be rejected. Another optional parameter is the beacon interval, - * given in the %NL80211_ATTR_BEACON_INTERVAL attribute, which if not - * given defaults to 100 TU (102.4ms). - * @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is - * determined by the network interface. - * - * @NL80211_CMD_TESTMODE: testmode command, takes a wiphy (or ifindex) attribute - * to identify the device, and the TESTDATA blob attribute to pass through - * to the driver. - * - * @NL80211_CMD_CONNECT: connection request and notification; this command - * requests to connect to a specified network but without separating - * auth and assoc steps. For this, you need to specify the SSID in a - * %NL80211_ATTR_SSID attribute, and can optionally specify the association - * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, - * %NL80211_ATTR_USE_MFP, %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, - * %NL80211_ATTR_WIPHY_FREQ_OFFSET, %NL80211_ATTR_CONTROL_PORT, - * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, - * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, - * %NL80211_ATTR_CONTROL_PORT_OVER_NL80211, %NL80211_ATTR_MAC_HINT, and - * %NL80211_ATTR_WIPHY_FREQ_HINT. - * If included, %NL80211_ATTR_MAC and %NL80211_ATTR_WIPHY_FREQ are - * restrictions on BSS selection, i.e., they effectively prevent roaming - * within the ESS. %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT - * can be included to provide a recommendation of the initial BSS while - * allowing the driver to roam to other BSSes within the ESS and also to - * ignore this recommendation if the indicated BSS is not ideal. Only one - * set of BSSID,frequency parameters is used (i.e., either the enforcing - * %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict - * %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT). - * Driver shall not modify the IEs specified through %NL80211_ATTR_IE if - * %NL80211_ATTR_MAC is included. However, if %NL80211_ATTR_MAC_HINT is - * included, these IEs through %NL80211_ATTR_IE are specified by the user - * space based on the best possible BSS selected. Thus, if the driver ends - * up selecting a different BSS, it can modify these IEs accordingly (e.g. - * userspace asks the driver to perform PMKSA caching with BSS1 and the - * driver ends up selecting BSS2 with different PMKSA cache entry; RSNIE - * has to get updated with the apt PMKID). - * %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within - * the ESS in case the device is already associated and an association with - * a different BSS is desired. - * Background scan period can optionally be - * specified in %NL80211_ATTR_BG_SCAN_PERIOD, - * if not specified default background scan configuration - * in driver is used and if period value is 0, bg scan will be disabled. - * This attribute is ignored if driver does not support roam scan. - * It is also sent as an event, with the BSSID and response IEs when the - * connection is established or failed to be established. This can be - * determined by the %NL80211_ATTR_STATUS_CODE attribute (0 = success, - * non-zero = failure). If %NL80211_ATTR_TIMED_OUT is included in the - * event, the connection attempt failed due to not being able to initiate - * authentication/association or not receiving a response from the AP. - * Non-zero %NL80211_ATTR_STATUS_CODE value is indicated in that case as - * well to remain backwards compatible. - * When establishing a security association, drivers that support 4 way - * handshake offload should send %NL80211_CMD_PORT_AUTHORIZED event when - * the 4 way handshake is completed successfully. - * @NL80211_CMD_ROAM: Notification indicating the card/driver roamed by itself. - * When a security association was established with the new AP (e.g. if - * the FT protocol was used for roaming or the driver completed the 4 way - * handshake), this event should be followed by an - * %NL80211_CMD_PORT_AUTHORIZED event. - * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify - * userspace that a connection was dropped by the AP or due to other - * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and - * %NL80211_ATTR_REASON_CODE attributes are used. - * - * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices - * associated with this wiphy must be down and will follow. - * - * @NL80211_CMD_REMAIN_ON_CHANNEL: Request to remain awake on the specified - * channel for the specified amount of time. This can be used to do - * off-channel operations like transmit a Public Action frame and wait for - * a response while being associated to an AP on another channel. - * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus - * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the - * frequency for the operation. - * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds - * to remain on the channel. This command is also used as an event to - * notify when the requested duration starts (it may take a while for the - * driver to schedule this time due to other concurrent needs for the - * radio). - * When called, this operation returns a cookie (%NL80211_ATTR_COOKIE) - * that will be included with any events pertaining to this request; - * the cookie is also used to cancel the request. - * @NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL: This command can be used to cancel a - * pending remain-on-channel duration if the desired operation has been - * completed prior to expiration of the originally requested duration. - * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the - * radio. The %NL80211_ATTR_COOKIE attribute must be given as well to - * uniquely identify the request. - * This command is also used as an event to notify when a requested - * remain-on-channel duration has expired. - * - * @NL80211_CMD_SET_TX_BITRATE_MASK: Set the mask of rates to be used in TX - * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface - * and @NL80211_ATTR_TX_RATES the set of allowed rates. - * - * @NL80211_CMD_REGISTER_FRAME: Register for receiving certain mgmt frames - * (via @NL80211_CMD_FRAME) for processing in userspace. This command - * requires an interface index, a frame type attribute (optional for - * backward compatibility reasons, if not given assumes action frames) - * and a match attribute containing the first few bytes of the frame - * that should match, e.g. a single byte for only a category match or - * four bytes for vendor frames including the OUI. The registration - * cannot be dropped, but is removed automatically when the netlink - * socket is closed. Multiple registrations can be made. - * The %NL80211_ATTR_RECEIVE_MULTICAST flag attribute can be given if - * %NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS is available, in which - * case the registration can also be modified to include/exclude the - * flag, rather than requiring unregistration to change it. - * @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for - * backward compatibility - * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This - * command is used both as a request to transmit a management frame and - * as an event indicating reception of a frame that was not processed in - * kernel code, but is for us (i.e., which may need to be processed in a - * user space application). %NL80211_ATTR_FRAME is used to specify the - * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used - * to indicate on which channel the frame is to be transmitted or was - * received. If this channel is not the current channel (remain-on-channel - * or the operational channel) the device will switch to the given channel - * and transmit the frame, optionally waiting for a response for the time - * specified using %NL80211_ATTR_DURATION. When called, this operation - * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the - * TX status event pertaining to the TX request. - * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the - * management frames at CCK rate or not in 2GHz band. - * %NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA - * counters which will be updated to the current value. This attribute - * is used during CSA period. - * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this - * command may be used with the corresponding cookie to cancel the wait - * time if it is known that it is no longer necessary. This command is - * also sent as an event whenever the driver has completed the off-channel - * wait time. - * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility. - * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame - * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies - * the TX command and %NL80211_ATTR_FRAME includes the contents of the - * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged - * the frame. - * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for - * backward compatibility. - * - * @NL80211_CMD_SET_POWER_SAVE: Set powersave, using %NL80211_ATTR_PS_STATE - * @NL80211_CMD_GET_POWER_SAVE: Get powersave status in %NL80211_ATTR_PS_STATE - * - * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command - * is used to configure connection quality monitoring notification trigger - * levels. - * @NL80211_CMD_NOTIFY_CQM: Connection quality monitor notification. This - * command is used as an event to indicate the that a trigger level was - * reached. - * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ - * and the attributes determining channel width) the given interface - * (identifed by %NL80211_ATTR_IFINDEX) shall operate on. - * In case multiple channels are supported by the device, the mechanism - * with which it switches channels is implementation-defined. - * When a monitor interface is given, it can only switch channel while - * no other interfaces are operating to avoid disturbing the operation - * of any other interfaces, and other interfaces will again take - * precedence when they are used. - * - * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. - * - * @NL80211_CMD_SET_MULTICAST_TO_UNICAST: Configure if this AP should perform - * multicast to unicast conversion. When enabled, all multicast packets - * with ethertype ARP, IPv4 or IPv6 (possibly within an 802.1Q header) - * will be sent out to each station once with the destination (multicast) - * MAC address replaced by the station's MAC address. Note that this may - * break certain expectations of the receiver, e.g. the ability to drop - * unicast IP packets encapsulated in multicast L2 frames, or the ability - * to not send destination unreachable messages in such cases. - * This can only be toggled per BSS. Configure this on an interface of - * type %NL80211_IFTYPE_AP. It applies to all its VLAN interfaces - * (%NL80211_IFTYPE_AP_VLAN), except for those in 4addr (WDS) mode. - * If %NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED is not present with this - * command, the feature is disabled. - * - * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial - * mesh config parameters may be given. - * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the - * network is determined by the network interface. - * - * @NL80211_CMD_UNPROT_DEAUTHENTICATE: Unprotected deauthentication frame - * notification. This event is used to indicate that an unprotected - * deauthentication frame was dropped when MFP is in use. - * @NL80211_CMD_UNPROT_DISASSOCIATE: Unprotected disassociation frame - * notification. This event is used to indicate that an unprotected - * disassociation frame was dropped when MFP is in use. - * - * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a - * beacon or probe response from a compatible mesh peer. This is only - * sent while no station information (sta_info) exists for the new peer - * candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH, - * @NL80211_MESH_SETUP_USERSPACE_AMPE, or - * @NL80211_MESH_SETUP_USERSPACE_MPM is set. On reception of this - * notification, userspace may decide to create a new station - * (@NL80211_CMD_NEW_STATION). To stop this notification from - * reoccurring, the userspace authentication daemon may want to create the - * new station with the AUTHENTICATED flag unset and maybe change it later - * depending on the authentication result. - * - * @NL80211_CMD_GET_WOWLAN: get Wake-on-Wireless-LAN (WoWLAN) settings. - * @NL80211_CMD_SET_WOWLAN: set Wake-on-Wireless-LAN (WoWLAN) settings. - * Since wireless is more complex than wired ethernet, it supports - * various triggers. These triggers can be configured through this - * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For - * more background information, see - * https://wireless.wiki.kernel.org/en/users/Documentation/WoWLAN. - * The @NL80211_CMD_SET_WOWLAN command can also be used as a notification - * from the driver reporting the wakeup reason. In this case, the - * @NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason - * for the wakeup, if it was caused by wireless. If it is not present - * in the wakeup notification, the wireless device didn't cause the - * wakeup but reports that it was woken up. - * - * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver - * the necessary information for supporting GTK rekey offload. This - * feature is typically used during WoWLAN. The configuration data - * is contained in %NL80211_ATTR_REKEY_DATA (which is nested and - * contains the data in sub-attributes). After rekeying happened, - * this command may also be sent by the driver as an MLME event to - * inform userspace of the new replay counter. - * - * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace - * of PMKSA caching dandidates. - * - * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup). - * In addition, this can be used as an event to request userspace to take - * actions on TDLS links (set up a new link or tear down an existing one). - * In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested - * operation, %NL80211_ATTR_MAC contains the peer MAC address, and - * %NL80211_ATTR_REASON_CODE the reason code to be used (only with - * %NL80211_TDLS_TEARDOWN). - * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. The - * %NL80211_ATTR_TDLS_ACTION attribute determines the type of frame to be - * sent. Public Action codes (802.11-2012 8.1.5.1) will be sent as - * 802.11 management frames, while TDLS action codes (802.11-2012 - * 8.5.13.1) will be encapsulated and sent as data frames. The currently - * supported Public Action code is %WLAN_PUB_ACTION_TDLS_DISCOVER_RES - * and the currently supported TDLS actions codes are given in - * &enum ieee80211_tdls_actioncode. - * - * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP - * (or GO) interface (i.e. hostapd) to ask for unexpected frames to - * implement sending deauth to stations that send unexpected class 3 - * frames. Also used as the event sent by the kernel when such a frame - * is received. - * For the event, the %NL80211_ATTR_MAC attribute carries the TA and - * other attributes like the interface index are present. - * If used as the command it must have an interface index and you can - * only unsubscribe from the event by closing the socket. Subscription - * is also for %NL80211_CMD_UNEXPECTED_4ADDR_FRAME events. - * - * @NL80211_CMD_UNEXPECTED_4ADDR_FRAME: Sent as an event indicating that the - * associated station identified by %NL80211_ATTR_MAC sent a 4addr frame - * and wasn't already in a 4-addr VLAN. The event will be sent similarly - * to the %NL80211_CMD_UNEXPECTED_FRAME event, to the same listener. - * - * @NL80211_CMD_PROBE_CLIENT: Probe an associated station on an AP interface - * by sending a null data frame to it and reporting when the frame is - * acknowleged. This is used to allow timing out inactive clients. Uses - * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_MAC. The command returns a - * direct reply with an %NL80211_ATTR_COOKIE that is later used to match - * up the event with the request. The event includes the same data and - * has %NL80211_ATTR_ACK set if the frame was ACKed. - * - * @NL80211_CMD_REGISTER_BEACONS: Register this socket to receive beacons from - * other BSSes when any interfaces are in AP mode. This helps implement - * OLBC handling in hostapd. Beacons are reported in %NL80211_CMD_FRAME - * messages. Note that per PHY only one application may register. - * - * @NL80211_CMD_SET_NOACK_MAP: sets a bitmap for the individual TIDs whether - * No Acknowledgement Policy should be applied. - * - * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels - * independently of the userspace SME, send this event indicating - * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the - * attributes determining channel width. This indication may also be - * sent when a remotely-initiated switch (e.g., when a STA receives a CSA - * from the remote AP) is completed; - * - * @NL80211_CMD_CH_SWITCH_STARTED_NOTIFY: Notify that a channel switch - * has been started on an interface, regardless of the initiator - * (ie. whether it was requested from a remote device or - * initiated on our own). It indicates that - * %NL80211_ATTR_IFINDEX will be on %NL80211_ATTR_WIPHY_FREQ - * after %NL80211_ATTR_CH_SWITCH_COUNT TBTT's. The userspace may - * decide to react to this indication by requesting other - * interfaces to change channel as well. - * - * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by - * its %NL80211_ATTR_WDEV identifier. It must have been created with - * %NL80211_CMD_NEW_INTERFACE previously. After it has been started, the - * P2P Device can be used for P2P operations, e.g. remain-on-channel and - * public action frame TX. - * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by - * its %NL80211_ATTR_WDEV identifier. - * - * @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to - * notify userspace that AP has rejected the connection request from a - * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON - * is used for this. - * - * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames - * for IBSS or MESH vif. - * - * @NL80211_CMD_SET_MAC_ACL: sets ACL for MAC address based access control. - * This is to be used with the drivers advertising the support of MAC - * address based access control. List of MAC addresses is passed in - * %NL80211_ATTR_MAC_ADDRS and ACL policy is passed in - * %NL80211_ATTR_ACL_POLICY. Driver will enable ACL with this list, if it - * is not already done. The new list will replace any existing list. Driver - * will clear its ACL when the list of MAC addresses passed is empty. This - * command is used in AP/P2P GO mode. Driver has to make sure to clear its - * ACL list during %NL80211_CMD_STOP_AP. - * - * @NL80211_CMD_RADAR_DETECT: Start a Channel availability check (CAC). Once - * a radar is detected or the channel availability scan (CAC) has finished - * or was aborted, or a radar was detected, usermode will be notified with - * this event. This command is also used to notify userspace about radars - * while operating on this channel. - * %NL80211_ATTR_RADAR_EVENT is used to inform about the type of the - * event. - * - * @NL80211_CMD_GET_PROTOCOL_FEATURES: Get global nl80211 protocol features, - * i.e. features for the nl80211 protocol rather than device features. - * Returns the features in the %NL80211_ATTR_PROTOCOL_FEATURES bitmap. - * - * @NL80211_CMD_UPDATE_FT_IES: Pass down the most up-to-date Fast Transition - * Information Element to the WLAN driver - * - * @NL80211_CMD_FT_EVENT: Send a Fast transition event from the WLAN driver - * to the supplicant. This will carry the target AP's MAC address along - * with the relevant Information Elements. This event is used to report - * received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE). - * - * @NL80211_CMD_CRIT_PROTOCOL_START: Indicates user-space will start running - * a critical protocol that needs more reliability in the connection to - * complete. - * - * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can - * return back to normal. - * - * @NL80211_CMD_GET_COALESCE: Get currently supported coalesce rules. - * @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules. - * - * @NL80211_CMD_CHANNEL_SWITCH: Perform a channel switch by announcing the - * the new channel information (Channel Switch Announcement - CSA) - * in the beacon for some time (as defined in the - * %NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the - * new channel. Userspace provides the new channel information (using - * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel - * width). %NL80211_ATTR_CH_SWITCH_BLOCK_TX may be supplied to inform - * other station that transmission must be blocked until the channel - * switch is complete. - * - * @NL80211_CMD_VENDOR: Vendor-specified command/event. The command is specified - * by the %NL80211_ATTR_VENDOR_ID attribute and a sub-command in - * %NL80211_ATTR_VENDOR_SUBCMD. Parameter(s) can be transported in - * %NL80211_ATTR_VENDOR_DATA. - * For feature advertisement, the %NL80211_ATTR_VENDOR_DATA attribute is - * used in the wiphy data as a nested attribute containing descriptions - * (&struct nl80211_vendor_cmd_info) of the supported vendor commands. - * This may also be sent as an event with the same attributes. - * - * @NL80211_CMD_SET_QOS_MAP: Set Interworking QoS mapping for IP DSCP values. - * The QoS mapping information is included in %NL80211_ATTR_QOS_MAP. If - * that attribute is not included, QoS mapping is disabled. Since this - * QoS mapping is relevant for IP packets, it is only valid during an - * association. This is cleared on disassociation and AP restart. - * - * @NL80211_CMD_ADD_TX_TS: Ask the kernel to add a traffic stream for the given - * %NL80211_ATTR_TSID and %NL80211_ATTR_MAC with %NL80211_ATTR_USER_PRIO - * and %NL80211_ATTR_ADMITTED_TIME parameters. - * Note that the action frame handshake with the AP shall be handled by - * userspace via the normal management RX/TX framework, this only sets - * up the TX TS in the driver/device. - * If the admitted time attribute is not added then the request just checks - * if a subsequent setup could be successful, the intent is to use this to - * avoid setting up a session with the AP when local restrictions would - * make that impossible. However, the subsequent "real" setup may still - * fail even if the check was successful. - * @NL80211_CMD_DEL_TX_TS: Remove an existing TS with the %NL80211_ATTR_TSID - * and %NL80211_ATTR_MAC parameters. It isn't necessary to call this - * before removing a station entry entirely, or before disassociating - * or similar, cleanup will happen in the driver/device in this case. - * - * @NL80211_CMD_GET_MPP: Get mesh path attributes for mesh proxy path to - * destination %NL80211_ATTR_MAC on the interface identified by - * %NL80211_ATTR_IFINDEX. - * - * @NL80211_CMD_JOIN_OCB: Join the OCB network. The center frequency and - * bandwidth of a channel must be given. - * @NL80211_CMD_LEAVE_OCB: Leave the OCB network -- no special arguments, the - * network is determined by the network interface. - * - * @NL80211_CMD_TDLS_CHANNEL_SWITCH: Start channel-switching with a TDLS peer, - * identified by the %NL80211_ATTR_MAC parameter. A target channel is - * provided via %NL80211_ATTR_WIPHY_FREQ and other attributes determining - * channel width/type. The target operating class is given via - * %NL80211_ATTR_OPER_CLASS. - * The driver is responsible for continually initiating channel-switching - * operations and returning to the base channel for communication with the - * AP. - * @NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH: Stop channel-switching with a TDLS - * peer given by %NL80211_ATTR_MAC. Both peers must be on the base channel - * when this command completes. - * - * @NL80211_CMD_WIPHY_REG_CHANGE: Similar to %NL80211_CMD_REG_CHANGE, but used - * as an event to indicate changes for devices with wiphy-specific regdom - * management. - * - * @NL80211_CMD_ABORT_SCAN: Stop an ongoing scan. Returns -ENOENT if a scan is - * not running. The driver indicates the status of the scan through - * cfg80211_scan_done(). - * - * @NL80211_CMD_START_NAN: Start NAN operation, identified by its - * %NL80211_ATTR_WDEV interface. This interface must have been - * previously created with %NL80211_CMD_NEW_INTERFACE. After it - * has been started, the NAN interface will create or join a - * cluster. This command must have a valid - * %NL80211_ATTR_NAN_MASTER_PREF attribute and optional - * %NL80211_ATTR_BANDS attributes. If %NL80211_ATTR_BANDS is - * omitted or set to 0, it means don't-care and the device will - * decide what to use. After this command NAN functions can be - * added. - * @NL80211_CMD_STOP_NAN: Stop the NAN operation, identified by - * its %NL80211_ATTR_WDEV interface. - * @NL80211_CMD_ADD_NAN_FUNCTION: Add a NAN function. The function is defined - * with %NL80211_ATTR_NAN_FUNC nested attribute. When called, this - * operation returns the strictly positive and unique instance id - * (%NL80211_ATTR_NAN_FUNC_INST_ID) and a cookie (%NL80211_ATTR_COOKIE) - * of the function upon success. - * Since instance ID's can be re-used, this cookie is the right - * way to identify the function. This will avoid races when a termination - * event is handled by the user space after it has already added a new - * function that got the same instance id from the kernel as the one - * which just terminated. - * This cookie may be used in NAN events even before the command - * returns, so userspace shouldn't process NAN events until it processes - * the response to this command. - * Look at %NL80211_ATTR_SOCKET_OWNER as well. - * @NL80211_CMD_DEL_NAN_FUNCTION: Delete a NAN function by cookie. - * This command is also used as a notification sent when a NAN function is - * terminated. This will contain a %NL80211_ATTR_NAN_FUNC_INST_ID - * and %NL80211_ATTR_COOKIE attributes. - * @NL80211_CMD_CHANGE_NAN_CONFIG: Change current NAN - * configuration. NAN must be operational (%NL80211_CMD_START_NAN - * was executed). It must contain at least one of the following - * attributes: %NL80211_ATTR_NAN_MASTER_PREF, - * %NL80211_ATTR_BANDS. If %NL80211_ATTR_BANDS is omitted, the - * current configuration is not changed. If it is present but - * set to zero, the configuration is changed to don't-care - * (i.e. the device can decide what to do). - * @NL80211_CMD_NAN_FUNC_MATCH: Notification sent when a match is reported. - * This will contain a %NL80211_ATTR_NAN_MATCH nested attribute and - * %NL80211_ATTR_COOKIE. - * - * @NL80211_CMD_UPDATE_CONNECT_PARAMS: Update one or more connect parameters - * for subsequent roaming cases if the driver or firmware uses internal - * BSS selection. This command can be issued only while connected and it - * does not result in a change for the current association. Currently, - * only the %NL80211_ATTR_IE data is used and updated with this command. - * - * @NL80211_CMD_SET_PMK: For offloaded 4-Way handshake, set the PMK or PMK-R0 - * for the given authenticator address (specified with %NL80211_ATTR_MAC). - * When %NL80211_ATTR_PMKR0_NAME is set, %NL80211_ATTR_PMK specifies the - * PMK-R0, otherwise it specifies the PMK. - * @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously - * configured PMK for the authenticator address identified by - * %NL80211_ATTR_MAC. - * @NL80211_CMD_PORT_AUTHORIZED: An event that indicates that the 4 way - * handshake was completed successfully by the driver. The BSSID is - * specified with %NL80211_ATTR_MAC. Drivers that support 4 way handshake - * offload should send this event after indicating 802.11 association with - * %NL80211_CMD_CONNECT or %NL80211_CMD_ROAM. If the 4 way handshake failed - * %NL80211_CMD_DISCONNECT should be indicated instead. - * - * @NL80211_CMD_CONTROL_PORT_FRAME: Control Port (e.g. PAE) frame TX request - * and RX notification. This command is used both as a request to transmit - * a control port frame and as a notification that a control port frame - * has been received. %NL80211_ATTR_FRAME is used to specify the - * frame contents. The frame is the raw EAPoL data, without ethernet or - * 802.11 headers. - * When used as an event indication %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, - * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT and %NL80211_ATTR_MAC are added - * indicating the protocol type of the received frame; whether the frame - * was received unencrypted and the MAC address of the peer respectively. - * - * @NL80211_CMD_RELOAD_REGDB: Request that the regdb firmware file is reloaded. - * - * @NL80211_CMD_EXTERNAL_AUTH: This interface is exclusively defined for host - * drivers that do not define separate commands for authentication and - * association, but rely on user space for the authentication to happen. - * This interface acts both as the event request (driver to user space) - * to trigger the authentication and command response (userspace to - * driver) to indicate the authentication status. - * - * User space uses the %NL80211_CMD_CONNECT command to the host driver to - * trigger a connection. The host driver selects a BSS and further uses - * this interface to offload only the authentication part to the user - * space. Authentication frames are passed between the driver and user - * space through the %NL80211_CMD_FRAME interface. Host driver proceeds - * further with the association after getting successful authentication - * status. User space indicates the authentication status through - * %NL80211_ATTR_STATUS_CODE attribute in %NL80211_CMD_EXTERNAL_AUTH - * command interface. - * - * Host driver reports this status on an authentication failure to the - * user space through the connect result as the user space would have - * initiated the connection through the connect request. - * - * @NL80211_CMD_STA_OPMODE_CHANGED: An event that notify station's - * ht opmode or vht opmode changes using any of %NL80211_ATTR_SMPS_MODE, - * %NL80211_ATTR_CHANNEL_WIDTH,%NL80211_ATTR_NSS attributes with its - * address(specified in %NL80211_ATTR_MAC). - * - * @NL80211_CMD_GET_FTM_RESPONDER_STATS: Retrieve FTM responder statistics, in - * the %NL80211_ATTR_FTM_RESPONDER_STATS attribute. - * - * @NL80211_CMD_PEER_MEASUREMENT_START: start a (set of) peer measurement(s) - * with the given parameters, which are encapsulated in the nested - * %NL80211_ATTR_PEER_MEASUREMENTS attribute. Optionally, MAC address - * randomization may be enabled and configured by specifying the - * %NL80211_ATTR_MAC and %NL80211_ATTR_MAC_MASK attributes. - * If a timeout is requested, use the %NL80211_ATTR_TIMEOUT attribute. - * A u64 cookie for further %NL80211_ATTR_COOKIE use is is returned in - * the netlink extended ack message. - * - * To cancel a measurement, close the socket that requested it. - * - * Measurement results are reported to the socket that requested the - * measurement using @NL80211_CMD_PEER_MEASUREMENT_RESULT when they - * become available, so applications must ensure a large enough socket - * buffer size. - * - * Depending on driver support it may or may not be possible to start - * multiple concurrent measurements. - * @NL80211_CMD_PEER_MEASUREMENT_RESULT: This command number is used for the - * result notification from the driver to the requesting socket. - * @NL80211_CMD_PEER_MEASUREMENT_COMPLETE: Notification only, indicating that - * the measurement completed, using the measurement cookie - * (%NL80211_ATTR_COOKIE). - * - * @NL80211_CMD_NOTIFY_RADAR: Notify the kernel that a radar signal was - * detected and reported by a neighboring device on the channel - * indicated by %NL80211_ATTR_WIPHY_FREQ and other attributes - * determining the width and type. - * - * @NL80211_CMD_UPDATE_OWE_INFO: This interface allows the host driver to - * offload OWE processing to user space. This intends to support - * OWE AKM by the host drivers that implement SME but rely - * on the user space for the cryptographic/DH IE processing in AP mode. - * - * @NL80211_CMD_PROBE_MESH_LINK: The requirement for mesh link metric - * refreshing, is that from one mesh point we be able to send some data - * frames to other mesh points which are not currently selected as a - * primary traffic path, but which are only 1 hop away. The absence of - * the primary path to the chosen node makes it necessary to apply some - * form of marking on a chosen packet stream so that the packets can be - * properly steered to the selected node for testing, and not by the - * regular mesh path lookup. Further, the packets must be of type data - * so that the rate control (often embedded in firmware) is used for - * rate selection. - * - * Here attribute %NL80211_ATTR_MAC is used to specify connected mesh - * peer MAC address and %NL80211_ATTR_FRAME is used to specify the frame - * content. The frame is ethernet data. - * - * @NL80211_CMD_SET_TID_CONFIG: Data frame TID specific configuration - * is passed using %NL80211_ATTR_TID_CONFIG attribute. - * - * @NL80211_CMD_UNPROT_BEACON: Unprotected or incorrectly protected Beacon - * frame. This event is used to indicate that a received Beacon frame was - * dropped because it did not include a valid MME MIC while beacon - * protection was enabled (BIGTK configured in station mode). - * - * @NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS: Report TX status of a control - * port frame transmitted with %NL80211_CMD_CONTROL_PORT_FRAME. - * %NL80211_ATTR_COOKIE identifies the TX command and %NL80211_ATTR_FRAME - * includes the contents of the frame. %NL80211_ATTR_ACK flag is included - * if the recipient acknowledged the frame. - * - * @NL80211_CMD_OBSS_COLOR_COLLISION: This notification is sent out whenever a - * mac detects a bss color collision. - * - * @NL80211_CMD_COLOR_CHANGE: This command is used to indicate that we want to - * change the BSS color. - * - * @NL80211_CMD_COLOR_CHANGE_ANNOUNCEMENT_STARTED: Notify userland, that we color change has - * started - * - * @NL80211_CMD_COLOR_CHANGE_ANNOUNCEMENT_ABORTED: Notify userland, that we color change has - * been aborted - * - * @NL80211_CMD_COLOR_CHANGE_ANNOUNCEMENT_COMPLETED: Notify userland that ithe color change - * has completed - * - * @NL80211_CMD_MAX: highest used command number - * @__NL80211_CMD_AFTER_LAST: internal use - */ -enum nl80211_commands { -/* don't change the order or add anything between, this is ABI! */ - NL80211_CMD_UNSPEC, - - NL80211_CMD_GET_WIPHY, /* can dump */ - NL80211_CMD_SET_WIPHY, - NL80211_CMD_NEW_WIPHY, - NL80211_CMD_DEL_WIPHY, - - NL80211_CMD_GET_INTERFACE, /* can dump */ - NL80211_CMD_SET_INTERFACE, - NL80211_CMD_NEW_INTERFACE, - NL80211_CMD_DEL_INTERFACE, - - NL80211_CMD_GET_KEY, - NL80211_CMD_SET_KEY, - NL80211_CMD_NEW_KEY, - NL80211_CMD_DEL_KEY, - - NL80211_CMD_GET_BEACON, - NL80211_CMD_SET_BEACON, - NL80211_CMD_START_AP, - NL80211_CMD_NEW_BEACON = NL80211_CMD_START_AP, - NL80211_CMD_STOP_AP, - NL80211_CMD_DEL_BEACON = NL80211_CMD_STOP_AP, - - NL80211_CMD_GET_STATION, - NL80211_CMD_SET_STATION, - NL80211_CMD_NEW_STATION, - NL80211_CMD_DEL_STATION, - - NL80211_CMD_GET_MPATH, - NL80211_CMD_SET_MPATH, - NL80211_CMD_NEW_MPATH, - NL80211_CMD_DEL_MPATH, - - NL80211_CMD_SET_BSS, - - NL80211_CMD_SET_REG, - NL80211_CMD_REQ_SET_REG, - - NL80211_CMD_GET_MESH_CONFIG, - NL80211_CMD_SET_MESH_CONFIG, - - NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */, - - NL80211_CMD_GET_REG, - - NL80211_CMD_GET_SCAN, - NL80211_CMD_TRIGGER_SCAN, - NL80211_CMD_NEW_SCAN_RESULTS, - NL80211_CMD_SCAN_ABORTED, - - NL80211_CMD_REG_CHANGE, - - NL80211_CMD_AUTHENTICATE, - NL80211_CMD_ASSOCIATE, - NL80211_CMD_DEAUTHENTICATE, - NL80211_CMD_DISASSOCIATE, - - NL80211_CMD_MICHAEL_MIC_FAILURE, - - NL80211_CMD_REG_BEACON_HINT, - - NL80211_CMD_JOIN_IBSS, - NL80211_CMD_LEAVE_IBSS, - - NL80211_CMD_TESTMODE, - - NL80211_CMD_CONNECT, - NL80211_CMD_ROAM, - NL80211_CMD_DISCONNECT, - - NL80211_CMD_SET_WIPHY_NETNS, - - NL80211_CMD_GET_SURVEY, - NL80211_CMD_NEW_SURVEY_RESULTS, - - NL80211_CMD_SET_PMKSA, - NL80211_CMD_DEL_PMKSA, - NL80211_CMD_FLUSH_PMKSA, - - NL80211_CMD_REMAIN_ON_CHANNEL, - NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL, - - NL80211_CMD_SET_TX_BITRATE_MASK, - - NL80211_CMD_REGISTER_FRAME, - NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME, - NL80211_CMD_FRAME, - NL80211_CMD_ACTION = NL80211_CMD_FRAME, - NL80211_CMD_FRAME_TX_STATUS, - NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS, - - NL80211_CMD_SET_POWER_SAVE, - NL80211_CMD_GET_POWER_SAVE, - - NL80211_CMD_SET_CQM, - NL80211_CMD_NOTIFY_CQM, - - NL80211_CMD_SET_CHANNEL, - NL80211_CMD_SET_WDS_PEER, - - NL80211_CMD_FRAME_WAIT_CANCEL, - - NL80211_CMD_JOIN_MESH, - NL80211_CMD_LEAVE_MESH, - - NL80211_CMD_UNPROT_DEAUTHENTICATE, - NL80211_CMD_UNPROT_DISASSOCIATE, - - NL80211_CMD_NEW_PEER_CANDIDATE, - - NL80211_CMD_GET_WOWLAN, - NL80211_CMD_SET_WOWLAN, - - NL80211_CMD_START_SCHED_SCAN, - NL80211_CMD_STOP_SCHED_SCAN, - NL80211_CMD_SCHED_SCAN_RESULTS, - NL80211_CMD_SCHED_SCAN_STOPPED, - - NL80211_CMD_SET_REKEY_OFFLOAD, - - NL80211_CMD_PMKSA_CANDIDATE, - - NL80211_CMD_TDLS_OPER, - NL80211_CMD_TDLS_MGMT, - - NL80211_CMD_UNEXPECTED_FRAME, - - NL80211_CMD_PROBE_CLIENT, - - NL80211_CMD_REGISTER_BEACONS, - - NL80211_CMD_UNEXPECTED_4ADDR_FRAME, - - NL80211_CMD_SET_NOACK_MAP, - - NL80211_CMD_CH_SWITCH_NOTIFY, - - NL80211_CMD_START_P2P_DEVICE, - NL80211_CMD_STOP_P2P_DEVICE, - - NL80211_CMD_CONN_FAILED, - - NL80211_CMD_SET_MCAST_RATE, - - NL80211_CMD_SET_MAC_ACL, - - NL80211_CMD_RADAR_DETECT, - - NL80211_CMD_GET_PROTOCOL_FEATURES, - - NL80211_CMD_UPDATE_FT_IES, - NL80211_CMD_FT_EVENT, - - NL80211_CMD_CRIT_PROTOCOL_START, - NL80211_CMD_CRIT_PROTOCOL_STOP, - - NL80211_CMD_GET_COALESCE, - NL80211_CMD_SET_COALESCE, - - NL80211_CMD_CHANNEL_SWITCH, - - NL80211_CMD_VENDOR, - - NL80211_CMD_SET_QOS_MAP, - - NL80211_CMD_ADD_TX_TS, - NL80211_CMD_DEL_TX_TS, - - NL80211_CMD_GET_MPP, - - NL80211_CMD_JOIN_OCB, - NL80211_CMD_LEAVE_OCB, - - NL80211_CMD_CH_SWITCH_STARTED_NOTIFY, - - NL80211_CMD_TDLS_CHANNEL_SWITCH, - NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH, - - NL80211_CMD_WIPHY_REG_CHANGE, - - NL80211_CMD_ABORT_SCAN, - - NL80211_CMD_START_NAN, - NL80211_CMD_STOP_NAN, - NL80211_CMD_ADD_NAN_FUNCTION, - NL80211_CMD_DEL_NAN_FUNCTION, - NL80211_CMD_CHANGE_NAN_CONFIG, - NL80211_CMD_NAN_MATCH, - - NL80211_CMD_SET_MULTICAST_TO_UNICAST, - - NL80211_CMD_UPDATE_CONNECT_PARAMS, - - NL80211_CMD_SET_PMK, - NL80211_CMD_DEL_PMK, - - NL80211_CMD_PORT_AUTHORIZED, - - NL80211_CMD_RELOAD_REGDB, - - NL80211_CMD_EXTERNAL_AUTH, - - NL80211_CMD_STA_OPMODE_CHANGED, - - NL80211_CMD_CONTROL_PORT_FRAME, - - NL80211_CMD_GET_FTM_RESPONDER_STATS, - - NL80211_CMD_PEER_MEASUREMENT_START, - NL80211_CMD_PEER_MEASUREMENT_RESULT, - NL80211_CMD_PEER_MEASUREMENT_COMPLETE, - - NL80211_CMD_NOTIFY_RADAR, - - NL80211_CMD_UPDATE_OWE_INFO, - - NL80211_CMD_PROBE_MESH_LINK, - - NL80211_CMD_SET_TID_CONFIG, - - NL80211_CMD_UNPROT_BEACON, - - NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS, - - NL80211_CMD_OBSS_COLOR_COLLISION, - - NL80211_CMD_COLOR_CHANGE, - NL80211_CMD_COLOR_CHANGE_ANNOUNCEMENT_STARTED, - NL80211_CMD_COLOR_CHANGE_ANNOUNCEMENT_ABORTED, - NL80211_CMD_COLOR_CHANGE_ANNOUNCEMENT_COMPLETED, - - /* add new commands above here */ - - /* used to define NL80211_CMD_MAX below */ - __NL80211_CMD_AFTER_LAST, - NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 -}; - -/* - * Allow user space programs to use #ifdef on new commands by defining them - * here - */ -#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS -#define NL80211_CMD_SET_MGMT_EXTRA_IE NL80211_CMD_SET_MGMT_EXTRA_IE -#define NL80211_CMD_REG_CHANGE NL80211_CMD_REG_CHANGE -#define NL80211_CMD_AUTHENTICATE NL80211_CMD_AUTHENTICATE -#define NL80211_CMD_ASSOCIATE NL80211_CMD_ASSOCIATE -#define NL80211_CMD_DEAUTHENTICATE NL80211_CMD_DEAUTHENTICATE -#define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE -#define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT - -#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS - -/* source-level API compatibility */ -#define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG -#define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG -#define NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE NL80211_MESH_SETUP_IE - -/** - * enum nl80211_attrs - nl80211 netlink attributes - * - * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors - * - * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf. - * /sys/class/ieee80211//index - * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) - * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters - * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz, - * defines the channel together with the (deprecated) - * %NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes - * %NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1 - * and %NL80211_ATTR_CENTER_FREQ2 - * @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values - * of &enum nl80211_chan_width, describing the channel width. See the - * documentation of the enum for more information. - * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the - * channel, used for anything but 20 MHz bandwidth. In S1G this is the - * operating channel center frequency. - * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the - * channel, used only for 80+80 MHz bandwidth - * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ - * if HT20 or HT40 are to be used (i.e., HT disabled if not included): - * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including - * this attribute) - * NL80211_CHAN_HT20 = HT20 only - * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel - * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel - * This attribute is now deprecated. - * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is - * less than or equal to the RTS threshold; allowed range: 1..255; - * dot11ShortRetryLimit; u8 - * @NL80211_ATTR_WIPHY_RETRY_LONG: TX retry limit for frames whose length is - * greater than the RTS threshold; allowed range: 1..255; - * dot11ShortLongLimit; u8 - * @NL80211_ATTR_WIPHY_FRAG_THRESHOLD: fragmentation threshold, i.e., maximum - * length in octets for frames; allowed range: 256..8000, disable - * fragmentation with (u32)-1; dot11FragmentationThreshold; u32 - * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length - * larger than or equal to this use RTS/CTS handshake); allowed range: - * 0..65536, disable with (u32)-1; dot11RTSThreshold; u32 - * @NL80211_ATTR_WIPHY_COVERAGE_CLASS: Coverage Class as defined by IEEE 802.11 - * section 7.3.2.9; dot11CoverageClass; u8 - * - * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on - * @NL80211_ATTR_IFNAME: network interface name - * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype - * - * @NL80211_ATTR_WDEV: wireless device identifier, used for pseudo-devices - * that don't have a netdev (u64) - * - * @NL80211_ATTR_MAC: MAC address (various uses) - * - * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of - * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC - * keys - * @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3) - * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11 - * section 7.3.2.25.1, e.g. 0x000FAC04) - * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and - * CCMP keys, each six bytes in little endian - * @NL80211_ATTR_KEY_DEFAULT: Flag attribute indicating the key is default key - * @NL80211_ATTR_KEY_DEFAULT_MGMT: Flag attribute indicating the key is the - * default management key - * @NL80211_ATTR_CIPHER_SUITES_PAIRWISE: For crypto settings for connect or - * other commands, indicates which pairwise cipher suites are used - * @NL80211_ATTR_CIPHER_SUITE_GROUP: For crypto settings for connect or - * other commands, indicates which group cipher suite is used - * - * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU - * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing - * @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE - * @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE - * - * @NL80211_ATTR_STA_AID: Association ID for the station (u16) - * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of - * &enum nl80211_sta_flags (deprecated, use %NL80211_ATTR_STA_FLAGS2) - * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by - * IEEE 802.11 7.3.1.6 (u16). - * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported - * rates as defined by IEEE 802.11 7.3.2.2 but without the length - * restriction (at most %NL80211_MAX_SUPP_RATES). - * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station - * to, or the AP interface the station was originally added to to. - * @NL80211_ATTR_STA_INFO: information about a station, part of station info - * given for %NL80211_CMD_GET_STATION, nested attribute containing - * info as possible, see &enum nl80211_sta_info. - * - * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands, - * consisting of a nested array. - * - * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes). - * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link - * (see &enum nl80211_plink_action). - * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path. - * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path - * info given for %NL80211_CMD_GET_MPATH, nested attribute described at - * &enum nl80211_mpath_info. - * - * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of - * &enum nl80211_mntr_flags. - * - * @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the - * current regulatory domain should be set to or is already set to. - * For example, 'CR', for Costa Rica. This attribute is used by the kernel - * to query the CRDA to retrieve one regulatory domain. This attribute can - * also be used by userspace to query the kernel for the currently set - * regulatory domain. We chose an alpha2 as that is also used by the - * IEEE-802.11 country information element to identify a country. - * Users can also simply ask the wireless core to set regulatory domain - * to a specific alpha2. - * @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory - * rules. - * - * @NL80211_ATTR_BSS_CTS_PROT: whether CTS protection is enabled (u8, 0 or 1) - * @NL80211_ATTR_BSS_SHORT_PREAMBLE: whether short preamble is enabled - * (u8, 0 or 1) - * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled - * (u8, 0 or 1) - * @NL80211_ATTR_BSS_BASIC_RATES: basic rates, array of basic - * rates in format defined by IEEE 802.11 7.3.2.2 but without the length - * restriction (at most %NL80211_MAX_SUPP_RATES). - * - * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from - * association request when used with NL80211_CMD_NEW_STATION) - * - * @NL80211_ATTR_SUPPORTED_IFTYPES: nested attribute containing all - * supported interface types, each a flag attribute with the number - * of the interface mode. - * - * @NL80211_ATTR_MGMT_SUBTYPE: Management frame subtype for - * %NL80211_CMD_SET_MGMT_EXTRA_IE. - * - * @NL80211_ATTR_IE: Information element(s) data (used, e.g., with - * %NL80211_CMD_SET_MGMT_EXTRA_IE). - * - * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with - * a single scan request, a wiphy attribute. - * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS: number of SSIDs you can - * scan with a single scheduled scan request, a wiphy attribute. - * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements - * that can be added to a scan request - * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information - * elements that can be added to a scheduled scan request - * @NL80211_ATTR_MAX_MATCH_SETS: maximum number of sets that can be - * used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute. - * - * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) - * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive - * scanning and include a zero-length SSID (wildcard) for wildcard scan - * @NL80211_ATTR_BSS: scan result BSS - * - * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain - * currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_* - * @NL80211_ATTR_REG_TYPE: indicates the type of the regulatory domain currently - * set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*) - * - * @NL80211_ATTR_SUPPORTED_COMMANDS: wiphy attribute that specifies - * an array of command numbers (i.e. a mapping index to command number) - * that the driver for the given wiphy supports. - * - * @NL80211_ATTR_FRAME: frame data (binary attribute), including frame header - * and body, but not FCS; used, e.g., with NL80211_CMD_AUTHENTICATE and - * NL80211_CMD_ASSOCIATE events - * @NL80211_ATTR_SSID: SSID (binary attribute, 0..32 octets) - * @NL80211_ATTR_AUTH_TYPE: AuthenticationType, see &enum nl80211_auth_type, - * represented as a u32 - * @NL80211_ATTR_REASON_CODE: ReasonCode for %NL80211_CMD_DEAUTHENTICATE and - * %NL80211_CMD_DISASSOCIATE, u16 - * - * @NL80211_ATTR_KEY_TYPE: Key Type, see &enum nl80211_key_type, represented as - * a u32 - * - * @NL80211_ATTR_FREQ_BEFORE: A channel which has suffered a regulatory change - * due to considerations from a beacon hint. This attribute reflects - * the state of the channel _before_ the beacon hint processing. This - * attributes consists of a nested attribute containing - * NL80211_FREQUENCY_ATTR_* - * @NL80211_ATTR_FREQ_AFTER: A channel which has suffered a regulatory change - * due to considerations from a beacon hint. This attribute reflects - * the state of the channel _after_ the beacon hint processing. This - * attributes consists of a nested attribute containing - * NL80211_FREQUENCY_ATTR_* - * - * @NL80211_ATTR_CIPHER_SUITES: a set of u32 values indicating the supported - * cipher suites - * - * @NL80211_ATTR_FREQ_FIXED: a flag indicating the IBSS should not try to look - * for other networks on different channels - * - * @NL80211_ATTR_TIMED_OUT: a flag indicating than an operation timed out; this - * is used, e.g., with %NL80211_CMD_AUTHENTICATE event - * - * @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is - * used for the association (&enum nl80211_mfp, represented as a u32); - * this attribute can be used with %NL80211_CMD_ASSOCIATE and - * %NL80211_CMD_CONNECT requests. %NL80211_MFP_OPTIONAL is not allowed for - * %NL80211_CMD_ASSOCIATE since user space SME is expected and hence, it - * must have decided whether to use management frame protection or not. - * Setting %NL80211_MFP_OPTIONAL with a %NL80211_CMD_CONNECT request will - * let the driver (or the firmware) decide whether to use MFP or not. - * - * @NL80211_ATTR_STA_FLAGS2: Attribute containing a - * &struct nl80211_sta_flag_update. - * - * @NL80211_ATTR_CONTROL_PORT: A flag indicating whether user space controls - * IEEE 802.1X port, i.e., sets/clears %NL80211_STA_FLAG_AUTHORIZED, in - * station mode. If the flag is included in %NL80211_CMD_ASSOCIATE - * request, the driver will assume that the port is unauthorized until - * authorized by user space. Otherwise, port is marked authorized by - * default in station mode. - * @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the - * ethertype that will be used for key negotiation. It can be - * specified with the associate and connect commands. If it is not - * specified, the value defaults to 0x888E (PAE, 802.1X). This - * attribute is also used as a flag in the wiphy information to - * indicate that protocols other than PAE are supported. - * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with - * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom - * ethertype frames used for key negotiation must not be encrypted. - * @NL80211_ATTR_CONTROL_PORT_OVER_NL80211: A flag indicating whether control - * port frames (e.g. of type given in %NL80211_ATTR_CONTROL_PORT_ETHERTYPE) - * will be sent directly to the network interface or sent via the NL80211 - * socket. If this attribute is missing, then legacy behavior of sending - * control port frames directly to the network interface is used. If the - * flag is included, then control port frames are sent over NL80211 instead - * using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is - * to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER - * flag. When used with %NL80211_ATTR_CONTROL_PORT_NO_PREAUTH, pre-auth - * frames are not forwared over the control port. - * - * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. - * We recommend using nested, driver-specific attributes within this. - * - * @NL80211_ATTR_DISCONNECTED_BY_AP: A flag indicating that the DISCONNECT - * event was due to the AP disconnecting the station, and not due to - * a local disconnect request. - * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT - * event (u16) - * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating - * that protected APs should be used. This is also used with NEW_BEACON to - * indicate that the BSS is to use protection. - * - * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT, ASSOCIATE, and NEW_BEACON - * to indicate which unicast key ciphers will be used with the connection - * (an array of u32). - * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT, ASSOCIATE, and NEW_BEACON to - * indicate which group key cipher will be used with the connection (a - * u32). - * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT, ASSOCIATE, and NEW_BEACON to - * indicate which WPA version(s) the AP we want to associate with is using - * (a u32 with flags from &enum nl80211_wpa_versions). - * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to - * indicate which key management algorithm(s) to use (an array of u32). - * This attribute is also sent in response to @NL80211_CMD_GET_WIPHY, - * indicating the supported AKM suites, intended for specific drivers which - * implement SME and have constraints on which AKMs are supported and also - * the cases where an AKM support is offloaded to the driver/firmware. - * If there is no such notification from the driver, user space should - * assume the driver supports all the AKM suites. - * - * @NL80211_ATTR_REQ_IE: (Re)association request information elements as - * sent out by the card, for ROAM and successful CONNECT events. - * @NL80211_ATTR_RESP_IE: (Re)association response information elements as - * sent by peer, for ROAM and successful CONNECT events. - * - * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used in ASSOCIATE and CONNECT - * commands to specify a request to reassociate within an ESS, i.e., to use - * Reassociate Request frame (with the value of this attribute in the - * Current AP address field) instead of Association Request frame which is - * used for the initial association to an ESS. - * - * @NL80211_ATTR_KEY: key information in a nested attribute with - * %NL80211_KEY_* sub-attributes - * @NL80211_ATTR_KEYS: array of keys for static WEP keys for connect() - * and join_ibss(), key information is in a nested attribute each - * with %NL80211_KEY_* sub-attributes - * - * @NL80211_ATTR_PID: Process ID of a network namespace. - * - * @NL80211_ATTR_GENERATION: Used to indicate consistent snapshots for - * dumps. This number increases whenever the object list being - * dumped changes, and as such userspace can verify that it has - * obtained a complete and consistent snapshot by verifying that - * all dump messages contain the same generation number. If it - * changed then the list changed and the dump should be repeated - * completely from scratch. - * - * @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface - * - * @NL80211_ATTR_SURVEY_INFO: survey information about a channel, part of - * the survey response for %NL80211_CMD_GET_SURVEY, nested attribute - * containing info as possible, see &enum survey_info. - * - * @NL80211_ATTR_PMKID: PMK material for PMKSA caching. - * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can - * cache, a wiphy attribute. - * - * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32. - * @NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION: Device attribute that - * specifies the maximum duration that can be requested with the - * remain-on-channel operation, in milliseconds, u32. - * - * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects. - * - * @NL80211_ATTR_TX_RATES: Nested set of attributes - * (enum nl80211_tx_rate_attributes) describing TX rates per band. The - * enum nl80211_band value is used as the index (nla_type() of the nested - * data. If a band is not included, it will be configured to allow all - * rates based on negotiated supported rates information. This attribute - * is used with %NL80211_CMD_SET_TX_BITRATE_MASK and with starting AP, - * and joining mesh networks (not IBSS yet). In the later case, it must - * specify just a single bitrate, which is to be used for the beacon. - * The driver must also specify support for this with the extended - * features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, - * NL80211_EXT_FEATURE_BEACON_RATE_HT and - * NL80211_EXT_FEATURE_BEACON_RATE_VHT. - * - * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain - * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME. - * @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the - * @NL80211_CMD_REGISTER_FRAME command. - * @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a - * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing - * information about which frame types can be transmitted with - * %NL80211_CMD_FRAME. - * @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a - * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing - * information about which frame types can be registered for RX. - * - * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was - * acknowledged by the recipient. - * - * @NL80211_ATTR_PS_STATE: powersave state, using &enum nl80211_ps_state values. - * - * @NL80211_ATTR_CQM: connection quality monitor configuration in a - * nested attribute with %NL80211_ATTR_CQM_* sub-attributes. - * - * @NL80211_ATTR_LOCAL_STATE_CHANGE: Flag attribute to indicate that a command - * is requesting a local authentication/association state change without - * invoking actual management frame exchange. This can be used with - * NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE, - * NL80211_CMD_DISASSOCIATE. - * - * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations - * connected to this BSS. - * - * @NL80211_ATTR_WIPHY_TX_POWER_SETTING: Transmit power setting type. See - * &enum nl80211_tx_power_setting for possible values. - * @NL80211_ATTR_WIPHY_TX_POWER_LEVEL: Transmit power level in signed mBm units. - * This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING - * for non-automatic settings. - * - * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly - * means support for per-station GTKs. - * - * @NL80211_ATTR_WIPHY_ANTENNA_TX: Bitmap of allowed antennas for transmitting. - * This can be used to mask out antennas which are not attached or should - * not be used for transmitting. If an antenna is not selected in this - * bitmap the hardware is not allowed to transmit on this antenna. - * - * Each bit represents one antenna, starting with antenna 1 at the first - * bit. Depending on which antennas are selected in the bitmap, 802.11n - * drivers can derive which chainmasks to use (if all antennas belonging to - * a particular chain are disabled this chain should be disabled) and if - * a chain has diversity antennas wether diversity should be used or not. - * HT capabilities (STBC, TX Beamforming, Antenna selection) can be - * derived from the available chains after applying the antenna mask. - * Non-802.11n drivers can derive wether to use diversity or not. - * Drivers may reject configurations or RX/TX mask combinations they cannot - * support by returning -EINVAL. - * - * @NL80211_ATTR_WIPHY_ANTENNA_RX: Bitmap of allowed antennas for receiving. - * This can be used to mask out antennas which are not attached or should - * not be used for receiving. If an antenna is not selected in this bitmap - * the hardware should not be configured to receive on this antenna. - * For a more detailed description see @NL80211_ATTR_WIPHY_ANTENNA_TX. - * - * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available - * for configuration as TX antennas via the above parameters. - * - * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available - * for configuration as RX antennas via the above parameters. - * - * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS - * - * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be - * transmitted on another channel when the channel given doesn't match - * the current channel. If the current channel doesn't match and this - * flag isn't set, the frame will be rejected. This is also used as an - * nl80211 capability flag. - * - * @NL80211_ATTR_BSS_HT_OPMODE: HT operation mode (u16) - * - * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags - * attributes, specifying what a key should be set as default as. - * See &enum nl80211_key_default_types. - * - * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters. These cannot be - * changed once the mesh is active. - * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute - * containing attributes from &enum nl80211_meshconf_params. - * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver - * allows auth frames in a mesh to be passed to userspace for processing via - * the @NL80211_MESH_SETUP_USERSPACE_AUTH flag. - * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as defined in - * &enum nl80211_plink_state. Used when userspace is driving the peer link - * management state machine. @NL80211_MESH_SETUP_USERSPACE_AMPE or - * @NL80211_MESH_SETUP_USERSPACE_MPM must be enabled. - * - * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy - * capabilities, the supported WoWLAN triggers - * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to - * indicate which WoW triggers should be enabled. This is also - * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN - * triggers. - * - * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan - * cycles, in msecs. - * - * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more - * sets of attributes to match during scheduled scans. Only BSSs - * that match any of the sets will be reported. These are - * pass-thru filter rules. - * For a match to succeed, the BSS must match all attributes of a - * set. Since not every hardware supports matching all types of - * attributes, there is no guarantee that the reported BSSs are - * fully complying with the match sets and userspace needs to be - * able to ignore them by itself. - * Thus, the implementation is somewhat hardware-dependent, but - * this is only an optimization and the userspace application - * needs to handle all the non-filtered results anyway. - * If the match attributes don't make sense when combined with - * the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID - * is included in the probe request, but the match attributes - * will never let it go through), -EINVAL may be returned. - * If omitted, no filtering is done. - * - * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported - * interface combinations. In each nested item, it contains attributes - * defined in &enum nl80211_if_combination_attrs. - * @NL80211_ATTR_SOFTWARE_IFTYPES: Nested attribute (just like - * %NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that - * are managed in software: interfaces of these types aren't subject to - * any restrictions in their number or combinations. - * - * @NL80211_ATTR_REKEY_DATA: nested attribute containing the information - * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data. - * - * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan, - * nested array attribute containing an entry for each band, with the entry - * being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but - * without the length restriction (at most %NL80211_MAX_SUPP_RATES). - * - * @NL80211_ATTR_HIDDEN_SSID: indicates whether SSID is to be hidden from Beacon - * and Probe Response (when response to wildcard Probe Request); see - * &enum nl80211_hidden_ssid, represented as a u32 - * - * @NL80211_ATTR_IE_PROBE_RESP: Information element(s) for Probe Response frame. - * This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to - * provide extra IEs (e.g., WPS/P2P IE) into Probe Response frames when the - * driver (or firmware) replies to Probe Request frames. - * @NL80211_ATTR_IE_ASSOC_RESP: Information element(s) for (Re)Association - * Response frames. This is used with %NL80211_CMD_NEW_BEACON and - * %NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into - * (Re)Association Response frames when the driver (or firmware) replies to - * (Re)Association Request frames. - * - * @NL80211_ATTR_STA_WME: Nested attribute containing the wme configuration - * of the station, see &enum nl80211_sta_wme_attr. - * @NL80211_ATTR_SUPPORT_AP_UAPSD: the device supports uapsd when working - * as AP. - * - * @NL80211_ATTR_ROAM_SUPPORT: Indicates whether the firmware is capable of - * roaming to another AP in the same ESS if the signal lever is low. - * - * @NL80211_ATTR_PMKSA_CANDIDATE: Nested attribute containing the PMKSA caching - * candidate information, see &enum nl80211_pmksa_candidate_attr. - * - * @NL80211_ATTR_TX_NO_CCK_RATE: Indicates whether to use CCK rate or not - * for management frames transmission. In order to avoid p2p probe/action - * frames are being transmitted at CCK rate in 2GHz band, the user space - * applications use this attribute. - * This attribute is used with %NL80211_CMD_TRIGGER_SCAN and - * %NL80211_CMD_FRAME commands. - * - * @NL80211_ATTR_TDLS_ACTION: Low level TDLS action code (e.g. link setup - * request, link setup confirm, link teardown, etc.). Values are - * described in the TDLS (802.11z) specification. - * @NL80211_ATTR_TDLS_DIALOG_TOKEN: Non-zero token for uniquely identifying a - * TDLS conversation between two devices. - * @NL80211_ATTR_TDLS_OPERATION: High level TDLS operation; see - * &enum nl80211_tdls_operation, represented as a u8. - * @NL80211_ATTR_TDLS_SUPPORT: A flag indicating the device can operate - * as a TDLS peer sta. - * @NL80211_ATTR_TDLS_EXTERNAL_SETUP: The TDLS discovery/setup and teardown - * procedures should be performed by sending TDLS packets via - * %NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be - * used for asking the driver to perform a TDLS operation. - * - * @NL80211_ATTR_DEVICE_AP_SME: This u32 attribute may be listed for devices - * that have AP support to indicate that they have the AP SME integrated - * with support for the features listed in this attribute, see - * &enum nl80211_ap_sme_features. - * - * @NL80211_ATTR_DONT_WAIT_FOR_ACK: Used with %NL80211_CMD_FRAME, this tells - * the driver to not wait for an acknowledgement. Note that due to this, - * it will also not give a status callback nor return a cookie. This is - * mostly useful for probe responses to save airtime. - * - * @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from - * &enum nl80211_feature_flags and is advertised in wiphy information. - * @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe - * requests while operating in AP-mode. - * This attribute holds a bitmap of the supported protocols for - * offloading (see &enum nl80211_probe_resp_offload_support_attr). - * - * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire - * probe-response frame. The DA field in the 802.11 header is zero-ed out, - * to be filled by the FW. - * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable - * this feature. Currently, only supported in mac80211 drivers. - * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the - * ATTR_HT_CAPABILITY to which attention should be paid. - * Currently, only mac80211 NICs support this feature. - * The values that may be configured are: - * MCS rates, MAX-AMSDU, HT-20-40 and HT_CAP_SGI_40 - * AMPDU density and AMPDU factor. - * All values are treated as suggestions and may be ignored - * by the driver as required. The actual values may be seen in - * the station debugfs ht_caps file. - * - * @NL80211_ATTR_DFS_REGION: region for regulatory rules which this country - * abides to when initiating radiation on DFS channels. A country maps - * to one DFS region. - * - * @NL80211_ATTR_NOACK_MAP: This u16 bitmap contains the No Ack Policy of - * up to 16 TIDs. - * - * @NL80211_ATTR_INACTIVITY_TIMEOUT: timeout value in seconds, this can be - * used by the drivers which has MLME in firmware and does not have support - * to report per station tx/rx activity to free up the station entry from - * the list. This needs to be used when the driver advertises the - * capability to timeout the stations. - * - * @NL80211_ATTR_RX_SIGNAL_DBM: signal strength in dBm (as a 32-bit int); - * this attribute is (depending on the driver capabilities) added to - * received frames indicated with %NL80211_CMD_FRAME. - * - * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds - * or 0 to disable background scan. - * - * @NL80211_ATTR_USER_REG_HINT_TYPE: type of regulatory hint passed from - * userspace. If unset it is assumed the hint comes directly from - * a user. If set code could specify exactly what type of source - * was used to provide the hint. For the different types of - * allowed user regulatory hints see nl80211_user_reg_hint_type. - * - * @NL80211_ATTR_CONN_FAILED_REASON: The reason for which AP has rejected - * the connection request from a station. nl80211_connect_failed_reason - * enum has different reasons of connection failure. - * - * @NL80211_ATTR_AUTH_DATA: Fields and elements in Authentication frames. - * This contains the authentication frame body (non-IE and IE data), - * excluding the Authentication algorithm number, i.e., starting at the - * Authentication transaction sequence number field. It is used with - * authentication algorithms that need special fields to be added into - * the frames (SAE and FILS). Currently, only the SAE cases use the - * initial two fields (Authentication transaction sequence number and - * Status code). However, those fields are included in the attribute data - * for all authentication algorithms to keep the attribute definition - * consistent. - * - * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from - * association request when used with NL80211_CMD_NEW_STATION) - * - * @NL80211_ATTR_SCAN_FLAGS: scan request control flags (u32) - * - * @NL80211_ATTR_P2P_CTWINDOW: P2P GO Client Traffic Window (u8), used with - * the START_AP and SET_BSS commands - * @NL80211_ATTR_P2P_OPPPS: P2P GO opportunistic PS (u8), used with the - * START_AP and SET_BSS commands. This can have the values 0 or 1; - * if not given in START_AP 0 is assumed, if not given in SET_BSS - * no change is made. - * - * @NL80211_ATTR_LOCAL_MESH_POWER_MODE: local mesh STA link-specific power mode - * defined in &enum nl80211_mesh_power_mode. - * - * @NL80211_ATTR_ACL_POLICY: ACL policy, see &enum nl80211_acl_policy, - * carried in a u32 attribute - * - * @NL80211_ATTR_MAC_ADDRS: Array of nested MAC addresses, used for - * MAC ACL. - * - * @NL80211_ATTR_MAC_ACL_MAX: u32 attribute to advertise the maximum - * number of MAC addresses that a device can support for MAC - * ACL. - * - * @NL80211_ATTR_RADAR_EVENT: Type of radar event for notification to userspace, - * contains a value of enum nl80211_radar_event (u32). - * - * @NL80211_ATTR_EXT_CAPA: 802.11 extended capabilities that the kernel driver - * has and handles. The format is the same as the IE contents. See - * 802.11-2012 8.4.2.29 for more information. - * @NL80211_ATTR_EXT_CAPA_MASK: Extended capabilities that the kernel driver - * has set in the %NL80211_ATTR_EXT_CAPA value, for multibit fields. - * - * @NL80211_ATTR_STA_CAPABILITY: Station capabilities (u16) are advertised to - * the driver, e.g., to enable TDLS power save (PU-APSD). - * - * @NL80211_ATTR_STA_EXT_CAPABILITY: Station extended capabilities are - * advertised to the driver, e.g., to enable TDLS off channel operations - * and PU-APSD. - * - * @NL80211_ATTR_PROTOCOL_FEATURES: global nl80211 feature flags, see - * &enum nl80211_protocol_features, the attribute is a u32. - * - * @NL80211_ATTR_SPLIT_WIPHY_DUMP: flag attribute, userspace supports - * receiving the data for a single wiphy split across multiple - * messages, given with wiphy dump message - * - * @NL80211_ATTR_MDID: Mobility Domain Identifier - * - * @NL80211_ATTR_IE_RIC: Resource Information Container Information - * Element - * - * @NL80211_ATTR_CRIT_PROT_ID: critical protocol identifier requiring increased - * reliability, see &enum nl80211_crit_proto_id (u16). - * @NL80211_ATTR_MAX_CRIT_PROT_DURATION: duration in milliseconds in which - * the connection should have increased reliability (u16). - * - * @NL80211_ATTR_PEER_AID: Association ID for the peer TDLS station (u16). - * This is similar to @NL80211_ATTR_STA_AID but with a difference of being - * allowed to be used with the first @NL80211_CMD_SET_STATION command to - * update a TDLS peer STA entry. - * - * @NL80211_ATTR_COALESCE_RULE: Coalesce rule information. - * - * @NL80211_ATTR_CH_SWITCH_COUNT: u32 attribute specifying the number of TBTT's - * until the channel switch event. - * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission - * must be blocked on the current channel (before the channel switch - * operation). - * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information - * for the time while performing a channel switch. - * @NL80211_ATTR_CNTDWN_OFFS_BEACON: An array of offsets (u16) to the channel - * switch or color change counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL). - * @NL80211_ATTR_CNTDWN_OFFS_PRESP: An array of offsets (u16) to the channel - * switch or color change counters in the probe response (%NL80211_ATTR_PROBE_RESP). - * - * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32. - * As specified in the &enum nl80211_rxmgmt_flags. - * - * @NL80211_ATTR_STA_SUPPORTED_CHANNELS: array of supported channels. - * - * @NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES: array of supported - * supported operating classes. - * - * @NL80211_ATTR_HANDLE_DFS: A flag indicating whether user space - * controls DFS operation in IBSS mode. If the flag is included in - * %NL80211_CMD_JOIN_IBSS request, the driver will allow use of DFS - * channels and reports radar events to userspace. Userspace is required - * to react to radar events, e.g. initiate a channel switch or leave the - * IBSS network. - * - * @NL80211_ATTR_SUPPORT_5_MHZ: A flag indicating that the device supports - * 5 MHz channel bandwidth. - * @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports - * 10 MHz channel bandwidth. - * - * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode - * Notification Element based on association request when used with - * %NL80211_CMD_NEW_STATION or %NL80211_CMD_SET_STATION (only when - * %NL80211_FEATURE_FULL_AP_CLIENT_STATE is supported, or with TDLS); - * u8 attribute. - * - * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if - * %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet) - * @NL80211_ATTR_VENDOR_SUBCMD: vendor sub-command - * @NL80211_ATTR_VENDOR_DATA: data for the vendor command, if any; this - * attribute is also used for vendor command feature advertisement - * @NL80211_ATTR_VENDOR_EVENTS: used for event list advertising in the wiphy - * info, containing a nested array of possible events - * - * @NL80211_ATTR_QOS_MAP: IP DSCP mapping for Interworking QoS mapping. This - * data is in the format defined for the payload of the QoS Map Set element - * in IEEE Std 802.11-2012, 8.4.2.97. - * - * @NL80211_ATTR_MAC_HINT: MAC address recommendation as initial BSS - * @NL80211_ATTR_WIPHY_FREQ_HINT: frequency of the recommended initial BSS - * - * @NL80211_ATTR_MAX_AP_ASSOC_STA: Device attribute that indicates how many - * associated stations are supported in AP mode (including P2P GO); u32. - * Since drivers may not have a fixed limit on the maximum number (e.g., - * other concurrent operations may affect this), drivers are allowed to - * advertise values that cannot always be met. In such cases, an attempt - * to add a new station entry with @NL80211_CMD_NEW_STATION may fail. - * - * @NL80211_ATTR_CSA_C_OFFSETS_TX: An array of csa counter offsets (u16) which - * should be updated when the frame is transmitted. - * @NL80211_ATTR_MAX_CSA_COUNTERS: U8 attribute used to advertise the maximum - * supported number of csa counters. - * - * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32. - * As specified in the &enum nl80211_tdls_peer_capability. - * - * @NL80211_ATTR_SOCKET_OWNER: Flag attribute, if set during interface - * creation then the new interface will be owned by the netlink socket - * that created it and will be destroyed when the socket is closed. - * If set during scheduled scan start then the new scan req will be - * owned by the netlink socket that created it and the scheduled scan will - * be stopped when the socket is closed. - * If set during configuration of regulatory indoor operation then the - * regulatory indoor configuration would be owned by the netlink socket - * that configured the indoor setting, and the indoor operation would be - * cleared when the socket is closed. - * If set during NAN interface creation, the interface will be destroyed - * if the socket is closed just like any other interface. Moreover, NAN - * notifications will be sent in unicast to that socket. Without this - * attribute, the notifications will be sent to the %NL80211_MCGRP_NAN - * multicast group. - * If set during %NL80211_CMD_ASSOCIATE or %NL80211_CMD_CONNECT the - * station will deauthenticate when the socket is closed. - * If set during %NL80211_CMD_JOIN_IBSS the IBSS will be automatically - * torn down when the socket is closed. - * If set during %NL80211_CMD_JOIN_MESH the mesh setup will be - * automatically torn down when the socket is closed. - * If set during %NL80211_CMD_START_AP the AP will be automatically - * disabled when the socket is closed. - * - * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is - * the TDLS link initiator. - * - * @NL80211_ATTR_USE_RRM: flag for indicating whether the current connection - * shall support Radio Resource Measurements (11k). This attribute can be - * used with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests. - * User space applications are expected to use this flag only if the - * underlying device supports these minimal RRM features: - * %NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES, - * %NL80211_FEATURE_QUIET, - * Or, if global RRM is supported, see: - * %NL80211_EXT_FEATURE_RRM - * If this flag is used, driver must add the Power Capabilities IE to the - * association request. In addition, it must also set the RRM capability - * flag in the association request's Capability Info field. - * - * @NL80211_ATTR_WIPHY_DYN_ACK: flag attribute used to enable ACK timeout - * estimation algorithm (dynack). In order to activate dynack - * %NL80211_FEATURE_ACKTO_ESTIMATION feature flag must be set by lower - * drivers to indicate dynack capability. Dynack is automatically disabled - * setting valid value for coverage class. - * - * @NL80211_ATTR_TSID: a TSID value (u8 attribute) - * @NL80211_ATTR_USER_PRIO: user priority value (u8 attribute) - * @NL80211_ATTR_ADMITTED_TIME: admitted time in units of 32 microseconds - * (per second) (u16 attribute) - * - * @NL80211_ATTR_SMPS_MODE: SMPS mode to use (ap mode). see - * &enum nl80211_smps_mode. - * - * @NL80211_ATTR_OPER_CLASS: operating class - * - * @NL80211_ATTR_MAC_MASK: MAC address mask - * - * @NL80211_ATTR_WIPHY_SELF_MANAGED_REG: flag attribute indicating this device - * is self-managing its regulatory information and any regulatory domain - * obtained from it is coming from the device's wiphy and not the global - * cfg80211 regdomain. - * - * @NL80211_ATTR_EXT_FEATURES: extended feature flags contained in a byte - * array. The feature flags are identified by their bit index (see &enum - * nl80211_ext_feature_index). The bit index is ordered starting at the - * least-significant bit of the first byte in the array, ie. bit index 0 - * is located at bit 0 of byte 0. bit index 25 would be located at bit 1 - * of byte 3 (u8 array). - * - * @NL80211_ATTR_SURVEY_RADIO_STATS: Request overall radio statistics to be - * returned along with other survey data. If set, @NL80211_CMD_GET_SURVEY - * may return a survey entry without a channel indicating global radio - * statistics (only some values are valid and make sense.) - * For devices that don't return such an entry even then, the information - * should be contained in the result as the sum of the respective counters - * over all channels. - * - * @NL80211_ATTR_SCHED_SCAN_DELAY: delay before the first cycle of a - * scheduled scan is started. Or the delay before a WoWLAN - * net-detect scan is started, counting from the moment the - * system is suspended. This value is a u32, in seconds. - - * @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device - * is operating in an indoor environment. - * - * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS: maximum number of scan plans for - * scheduled scan supported by the device (u32), a wiphy attribute. - * @NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL: maximum interval (in seconds) for - * a scan plan (u32), a wiphy attribute. - * @NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS: maximum number of iterations in - * a scan plan (u32), a wiphy attribute. - * @NL80211_ATTR_SCHED_SCAN_PLANS: a list of scan plans for scheduled scan. - * Each scan plan defines the number of scan iterations and the interval - * between scans. The last scan plan will always run infinitely, - * thus it must not specify the number of iterations, only the interval - * between scans. The scan plans are executed sequentially. - * Each scan plan is a nested attribute of &enum nl80211_sched_scan_plan. - * @NL80211_ATTR_PBSS: flag attribute. If set it means operate - * in a PBSS. Specified in %NL80211_CMD_CONNECT to request - * connecting to a PCP, and in %NL80211_CMD_START_AP to start - * a PCP instead of AP. Relevant for DMG networks only. - * @NL80211_ATTR_BSS_SELECT: nested attribute for driver supporting the - * BSS selection feature. When used with %NL80211_CMD_GET_WIPHY it contains - * attributes according &enum nl80211_bss_select_attr to indicate what - * BSS selection behaviours are supported. When used with %NL80211_CMD_CONNECT - * it contains the behaviour-specific attribute containing the parameters for - * BSS selection to be done by driver and/or firmware. - * - * @NL80211_ATTR_STA_SUPPORT_P2P_PS: whether P2P PS mechanism supported - * or not. u8, one of the values of &enum nl80211_sta_p2p_ps_status - * - * @NL80211_ATTR_PAD: attribute used for padding for 64-bit alignment - * - * @NL80211_ATTR_IFTYPE_EXT_CAPA: Nested attribute of the following attributes: - * %NL80211_ATTR_IFTYPE, %NL80211_ATTR_EXT_CAPA, - * %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities per - * interface type. - * - * @NL80211_ATTR_MU_MIMO_GROUP_DATA: array of 24 bytes that defines a MU-MIMO - * groupID for monitor mode. - * The first 8 bytes are a mask that defines the membership in each - * group (there are 64 groups, group 0 and 63 are reserved), - * each bit represents a group and set to 1 for being a member in - * that group and 0 for not being a member. - * The remaining 16 bytes define the position in each group: 2 bits for - * each group. - * (smaller group numbers represented on most significant bits and bigger - * group numbers on least significant bits.) - * This attribute is used only if all interfaces are in monitor mode. - * Set this attribute in order to monitor packets using the given MU-MIMO - * groupID data. - * to turn off that feature set all the bits of the groupID to zero. - * @NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR: mac address for the sniffer to follow - * when using MU-MIMO air sniffer. - * to turn that feature off set an invalid mac address - * (e.g. FF:FF:FF:FF:FF:FF) - * - * @NL80211_ATTR_SCAN_START_TIME_TSF: The time at which the scan was actually - * started (u64). The time is the TSF of the BSS the interface that - * requested the scan is connected to (if available, otherwise this - * attribute must not be included). - * @NL80211_ATTR_SCAN_START_TIME_TSF_BSSID: The BSS according to which - * %NL80211_ATTR_SCAN_START_TIME_TSF is set. - * @NL80211_ATTR_MEASUREMENT_DURATION: measurement duration in TUs (u16). If - * %NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY is not set, this is the - * maximum measurement duration allowed. This attribute is used with - * measurement requests. It can also be used with %NL80211_CMD_TRIGGER_SCAN - * if the scan is used for beacon report radio measurement. - * @NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY: flag attribute that indicates - * that the duration specified with %NL80211_ATTR_MEASUREMENT_DURATION is - * mandatory. If this flag is not set, the duration is the maximum duration - * and the actual measurement duration may be shorter. - * - * @NL80211_ATTR_MESH_PEER_AID: Association ID for the mesh peer (u16). This is - * used to pull the stored data for mesh peer in power save state. - * - * @NL80211_ATTR_NAN_MASTER_PREF: the master preference to be used by - * %NL80211_CMD_START_NAN and optionally with - * %NL80211_CMD_CHANGE_NAN_CONFIG. Its type is u8 and it can't be 0. - * Also, values 1 and 255 are reserved for certification purposes and - * should not be used during a normal device operation. - * @NL80211_ATTR_BANDS: operating bands configuration. This is a u32 - * bitmask of BIT(NL80211_BAND_*) as described in %enum - * nl80211_band. For instance, for NL80211_BAND_2GHZ, bit 0 - * would be set. This attribute is used with - * %NL80211_CMD_START_NAN and %NL80211_CMD_CHANGE_NAN_CONFIG, and - * it is optional. If no bands are set, it means don't-care and - * the device will decide what to use. - * @NL80211_ATTR_NAN_FUNC: a function that can be added to NAN. See - * &enum nl80211_nan_func_attributes for description of this nested - * attribute. - * @NL80211_ATTR_NAN_MATCH: used to report a match. This is a nested attribute. - * See &enum nl80211_nan_match_attributes. - * @NL80211_ATTR_FILS_KEK: KEK for FILS (Re)Association Request/Response frame - * protection. - * @NL80211_ATTR_FILS_NONCES: Nonces (part of AAD) for FILS (Re)Association - * Request/Response frame protection. This attribute contains the 16 octet - * STA Nonce followed by 16 octets of AP Nonce. - * - * @NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED: Indicates whether or not multicast - * packets should be send out as unicast to all stations (flag attribute). - * - * @NL80211_ATTR_BSSID: The BSSID of the AP. Note that %NL80211_ATTR_MAC is also - * used in various commands/events for specifying the BSSID. - * - * @NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI: Relative RSSI threshold by which - * other BSSs has to be better or slightly worse than the current - * connected BSS so that they get reported to user space. - * This will give an opportunity to userspace to consider connecting to - * other matching BSSs which have better or slightly worse RSSI than - * the current connected BSS by using an offloaded operation to avoid - * unnecessary wakeups. - * - * @NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST: When present the RSSI level for BSSs in - * the specified band is to be adjusted before doing - * %NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI based comparison to figure out - * better BSSs. The attribute value is a packed structure - * value as specified by &struct nl80211_bss_select_rssi_adjust. - * - * @NL80211_ATTR_TIMEOUT_REASON: The reason for which an operation timed out. - * u32 attribute with an &enum nl80211_timeout_reason value. This is used, - * e.g., with %NL80211_CMD_CONNECT event. - * - * @NL80211_ATTR_FILS_ERP_USERNAME: EAP Re-authentication Protocol (ERP) - * username part of NAI used to refer keys rRK and rIK. This is used with - * %NL80211_CMD_CONNECT. - * - * @NL80211_ATTR_FILS_ERP_REALM: EAP Re-authentication Protocol (ERP) realm part - * of NAI specifying the domain name of the ER server. This is used with - * %NL80211_CMD_CONNECT. - * - * @NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM: Unsigned 16-bit ERP next sequence number - * to use in ERP messages. This is used in generating the FILS wrapped data - * for FILS authentication and is used with %NL80211_CMD_CONNECT. - * - * @NL80211_ATTR_FILS_ERP_RRK: ERP re-authentication Root Key (rRK) for the - * NAI specified by %NL80211_ATTR_FILS_ERP_USERNAME and - * %NL80211_ATTR_FILS_ERP_REALM. This is used for generating rIK and rMSK - * from successful FILS authentication and is used with - * %NL80211_CMD_CONNECT. - * - * @NL80211_ATTR_FILS_CACHE_ID: A 2-octet identifier advertized by a FILS AP - * identifying the scope of PMKSAs. This is used with - * @NL80211_CMD_SET_PMKSA and @NL80211_CMD_DEL_PMKSA. - * - * @NL80211_ATTR_PMK: attribute for passing PMK key material. Used with - * %NL80211_CMD_SET_PMKSA for the PMKSA identified by %NL80211_ATTR_PMKID. - * For %NL80211_CMD_CONNECT it is used to provide PSK for offloading 4-way - * handshake for WPA/WPA2-PSK networks. For 802.1X authentication it is - * used with %NL80211_CMD_SET_PMK. For offloaded FT support this attribute - * specifies the PMK-R0 if NL80211_ATTR_PMKR0_NAME is included as well. - * - * @NL80211_ATTR_SCHED_SCAN_MULTI: flag attribute which user-space shall use to - * indicate that it supports multiple active scheduled scan requests. - * @NL80211_ATTR_SCHED_SCAN_MAX_REQS: indicates maximum number of scheduled - * scan request that may be active for the device (u32). - * - * @NL80211_ATTR_WANT_1X_4WAY_HS: flag attribute which user-space can include - * in %NL80211_CMD_CONNECT to indicate that for 802.1X authentication it - * wants to use the supported offload of the 4-way handshake. - * @NL80211_ATTR_PMKR0_NAME: PMK-R0 Name for offloaded FT. - * @NL80211_ATTR_PORT_AUTHORIZED: (reserved) - * - * @NL80211_ATTR_EXTERNAL_AUTH_ACTION: Identify the requested external - * authentication operation (u32 attribute with an - * &enum nl80211_external_auth_action value). This is used with the - * %NL80211_CMD_EXTERNAL_AUTH request event. - * @NL80211_ATTR_EXTERNAL_AUTH_SUPPORT: Flag attribute indicating that the user - * space supports external authentication. This attribute shall be used - * with %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP request. The driver - * may offload authentication processing to user space if this capability - * is indicated in the respective requests from the user space. - * - * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this - * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED. - * - * @NL80211_ATTR_TXQ_STATS: TXQ statistics (nested attribute, see &enum - * nl80211_txq_stats) - * @NL80211_ATTR_TXQ_LIMIT: Total packet limit for the TXQ queues for this phy. - * The smaller of this and the memory limit is enforced. - * @NL80211_ATTR_TXQ_MEMORY_LIMIT: Total memory memory limit (in bytes) for the - * TXQ queues for this phy. The smaller of this and the packet limit is - * enforced. - * @NL80211_ATTR_TXQ_QUANTUM: TXQ scheduler quantum (bytes). Number of bytes - * a flow is assigned on each round of the DRR scheduler. - * @NL80211_ATTR_HE_CAPABILITY: HE Capability information element (from - * association request when used with NL80211_CMD_NEW_STATION). Can be set - * only if %NL80211_STA_FLAG_WME is set. - * - * @NL80211_ATTR_FTM_RESPONDER: nested attribute which user-space can include - * in %NL80211_CMD_START_AP or %NL80211_CMD_SET_BEACON for fine timing - * measurement (FTM) responder functionality and containing parameters as - * possible, see &enum nl80211_ftm_responder_attr - * - * @NL80211_ATTR_FTM_RESPONDER_STATS: Nested attribute with FTM responder - * statistics, see &enum nl80211_ftm_responder_stats. - * - * @NL80211_ATTR_TIMEOUT: Timeout for the given operation in milliseconds (u32), - * if the attribute is not given no timeout is requested. Note that 0 is an - * invalid value. - * - * @NL80211_ATTR_PEER_MEASUREMENTS: peer measurements request (and result) - * data, uses nested attributes specified in - * &enum nl80211_peer_measurement_attrs. - * This is also used for capability advertisement in the wiphy information, - * with the appropriate sub-attributes. - * - * @NL80211_ATTR_AIRTIME_WEIGHT: Station's weight when scheduled by the airtime - * scheduler. - * - * @NL80211_ATTR_STA_TX_POWER_SETTING: Transmit power setting type (u8) for - * station associated with the AP. See &enum nl80211_tx_power_setting for - * possible values. - * @NL80211_ATTR_STA_TX_POWER: Transmit power level (s16) in dBm units. This - * allows to set Tx power for a station. If this attribute is not included, - * the default per-interface tx power setting will be overriding. Driver - * should be picking up the lowest tx power, either tx power per-interface - * or per-station. - * - * @NL80211_ATTR_SAE_PASSWORD: attribute for passing SAE password material. It - * is used with %NL80211_CMD_CONNECT to provide password for offloading - * SAE authentication for WPA3-Personal networks. - * - * @NL80211_ATTR_TWT_RESPONDER: Enable target wait time responder support. - * - * @NL80211_ATTR_HE_OBSS_PD: nested attribute for OBSS Packet Detection - * functionality. - * - * @NL80211_ATTR_WIPHY_EDMG_CHANNELS: bitmap that indicates the 2.16 GHz - * channel(s) that are allowed to be used for EDMG transmissions. - * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251. (u8 attribute) - * @NL80211_ATTR_WIPHY_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes - * the allowed channel bandwidth configurations. (u8 attribute) - * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13. - * - * @NL80211_ATTR_VLAN_ID: VLAN ID (1..4094) for the station and VLAN group key - * (u16). - * - * @NL80211_ATTR_HE_BSS_COLOR: nested attribute for BSS Color Settings. - * - * @NL80211_ATTR_IFTYPE_AKM_SUITES: nested array attribute, with each entry - * using attributes from &enum nl80211_iftype_akm_attributes. This - * attribute is sent in a response to %NL80211_CMD_GET_WIPHY indicating - * supported AKM suites capability per interface. AKMs advertised in - * %NL80211_ATTR_AKM_SUITES are default capabilities if AKM suites not - * advertised for a specific interface type. - * - * @NL80211_ATTR_TID_CONFIG: TID specific configuration in a - * nested attribute with &enum nl80211_tid_config_attr sub-attributes; - * on output (in wiphy attributes) it contains only the feature sub- - * attributes. - * - * @NL80211_ATTR_CONTROL_PORT_NO_PREAUTH: disable preauth frame rx on control - * port in order to forward/receive them as ordinary data frames. - * - * @NL80211_ATTR_PMK_LIFETIME: Maximum lifetime for PMKSA in seconds (u32, - * dot11RSNAConfigPMKReauthThreshold; 0 is not a valid value). - * An optional parameter configured through %NL80211_CMD_SET_PMKSA. - * Drivers that trigger roaming need to know the lifetime of the - * configured PMKSA for triggering the full vs. PMKSA caching based - * authentication. This timeout helps authentication methods like SAE, - * where PMK gets updated only by going through a full (new SAE) - * authentication instead of getting updated during an association for EAP - * authentication. No new full authentication within the PMK expiry shall - * result in a disassociation at the end of the lifetime. - * - * @NL80211_ATTR_PMK_REAUTH_THRESHOLD: Reauthentication threshold time, in - * terms of percentage of %NL80211_ATTR_PMK_LIFETIME - * (u8, dot11RSNAConfigPMKReauthThreshold, 1..100). This is an optional - * parameter configured through %NL80211_CMD_SET_PMKSA. Requests the - * driver to trigger a full authentication roam (without PMKSA caching) - * after the reauthentication threshold time, but before the PMK lifetime - * has expired. - * - * Authentication methods like SAE need to be able to generate a new PMKSA - * entry without having to force a disconnection after the PMK timeout. If - * no roaming occurs between the reauth threshold and PMK expiration, - * disassociation is still forced. - * @NL80211_ATTR_RECEIVE_MULTICAST: multicast flag for the - * %NL80211_CMD_REGISTER_FRAME command, see the description there. - * @NL80211_ATTR_WIPHY_FREQ_OFFSET: offset of the associated - * %NL80211_ATTR_WIPHY_FREQ in positive KHz. Only valid when supplied with - * an %NL80211_ATTR_WIPHY_FREQ_OFFSET. - * @NL80211_ATTR_CENTER_FREQ1_OFFSET: Center frequency offset in KHz for the - * first channel segment specified in %NL80211_ATTR_CENTER_FREQ1. - * @NL80211_ATTR_SCAN_FREQ_KHZ: nested attribute with KHz frequencies - * - * @NL80211_ATTR_HE_6GHZ_CAPABILITY: HE 6 GHz Band Capability element (from - * association request when used with NL80211_CMD_NEW_STATION). - * - * @NL80211_ATTR_MULTIPLE_BSSID_PARENT: If this is a Non-Transmitted BSSID, define - * the parent (transmitting) interface. - * - * @NL80211_ATTR_MULTIPLE_BSSID_INDEX: The index of this BSS inside the multi bssid - * element. - * - * @NL80211_ATTR_MULTIPLE_BSSID_COUNT: The number of BSSs inside the multi bssid element. - * - * @NL80211_ATTR_MULTIPLE_BSSID_IES: The Elements that describe our multiple BSS group. - * these get passed separately as the kernel might need to split them up for EMA VAP. - * - * @NL80211_ATTR_MULTIPLE_BSSID_EMA: Shall the multiple BSS beacons be sent out in EMA mode. - * - * @NL80211_ATTR_OBSS_COLOR_BITMAP: bitmap of the u64 BSS colors for the - * %NL80211_CMD_OBSS_COLOR_COLLISION event. - * - * @NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COUNT: u8 attribute specifying the number of TBTT's - * until the color switch event. - * @NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR: u8 attribute specifying the color that we are - * switching to - * @NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES: Nested set of attributes containing the IE - * information for the time while performing a color switch. - * @NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_C_OFF_BEACON: An array of offsets (u16) to the color - * switch counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL). - * @NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_C_OFF_PRESP: An array of offsets (u16) to the color - * switch counters in the probe response (%NL80211_ATTR_PROBE_RESP). - * - * @NUM_NL80211_ATTR: total number of nl80211_attrs available - * @NL80211_ATTR_MAX: highest attribute number currently defined - * @__NL80211_ATTR_AFTER_LAST: internal use - */ -enum nl80211_attrs { -/* don't change the order or add anything between, this is ABI! */ - NL80211_ATTR_UNSPEC, - - NL80211_ATTR_WIPHY, - NL80211_ATTR_WIPHY_NAME, - - NL80211_ATTR_IFINDEX, - NL80211_ATTR_IFNAME, - NL80211_ATTR_IFTYPE, - - NL80211_ATTR_MAC, - - NL80211_ATTR_KEY_DATA, - NL80211_ATTR_KEY_IDX, - NL80211_ATTR_KEY_CIPHER, - NL80211_ATTR_KEY_SEQ, - NL80211_ATTR_KEY_DEFAULT, - - NL80211_ATTR_BEACON_INTERVAL, - NL80211_ATTR_DTIM_PERIOD, - NL80211_ATTR_BEACON_HEAD, - NL80211_ATTR_BEACON_TAIL, - - NL80211_ATTR_STA_AID, - NL80211_ATTR_STA_FLAGS, - NL80211_ATTR_STA_LISTEN_INTERVAL, - NL80211_ATTR_STA_SUPPORTED_RATES, - NL80211_ATTR_STA_VLAN, - NL80211_ATTR_STA_INFO, - - NL80211_ATTR_WIPHY_BANDS, - - NL80211_ATTR_MNTR_FLAGS, - - NL80211_ATTR_MESH_ID, - NL80211_ATTR_STA_PLINK_ACTION, - NL80211_ATTR_MPATH_NEXT_HOP, - NL80211_ATTR_MPATH_INFO, - - NL80211_ATTR_BSS_CTS_PROT, - NL80211_ATTR_BSS_SHORT_PREAMBLE, - NL80211_ATTR_BSS_SHORT_SLOT_TIME, - - NL80211_ATTR_HT_CAPABILITY, - - NL80211_ATTR_SUPPORTED_IFTYPES, - - NL80211_ATTR_REG_ALPHA2, - NL80211_ATTR_REG_RULES, - - NL80211_ATTR_MESH_CONFIG, - - NL80211_ATTR_BSS_BASIC_RATES, - - NL80211_ATTR_WIPHY_TXQ_PARAMS, - NL80211_ATTR_WIPHY_FREQ, - NL80211_ATTR_WIPHY_CHANNEL_TYPE, - - NL80211_ATTR_KEY_DEFAULT_MGMT, - - NL80211_ATTR_MGMT_SUBTYPE, - NL80211_ATTR_IE, - - NL80211_ATTR_MAX_NUM_SCAN_SSIDS, - - NL80211_ATTR_SCAN_FREQUENCIES, - NL80211_ATTR_SCAN_SSIDS, - NL80211_ATTR_GENERATION, /* replaces old SCAN_GENERATION */ - NL80211_ATTR_BSS, - - NL80211_ATTR_REG_INITIATOR, - NL80211_ATTR_REG_TYPE, - - NL80211_ATTR_SUPPORTED_COMMANDS, - - NL80211_ATTR_FRAME, - NL80211_ATTR_SSID, - NL80211_ATTR_AUTH_TYPE, - NL80211_ATTR_REASON_CODE, - - NL80211_ATTR_KEY_TYPE, - - NL80211_ATTR_MAX_SCAN_IE_LEN, - NL80211_ATTR_CIPHER_SUITES, - - NL80211_ATTR_FREQ_BEFORE, - NL80211_ATTR_FREQ_AFTER, - - NL80211_ATTR_FREQ_FIXED, - - - NL80211_ATTR_WIPHY_RETRY_SHORT, - NL80211_ATTR_WIPHY_RETRY_LONG, - NL80211_ATTR_WIPHY_FRAG_THRESHOLD, - NL80211_ATTR_WIPHY_RTS_THRESHOLD, - - NL80211_ATTR_TIMED_OUT, - - NL80211_ATTR_USE_MFP, - - NL80211_ATTR_STA_FLAGS2, - - NL80211_ATTR_CONTROL_PORT, - - NL80211_ATTR_TESTDATA, - - NL80211_ATTR_PRIVACY, - - NL80211_ATTR_DISCONNECTED_BY_AP, - NL80211_ATTR_STATUS_CODE, - - NL80211_ATTR_CIPHER_SUITES_PAIRWISE, - NL80211_ATTR_CIPHER_SUITE_GROUP, - NL80211_ATTR_WPA_VERSIONS, - NL80211_ATTR_AKM_SUITES, - - NL80211_ATTR_REQ_IE, - NL80211_ATTR_RESP_IE, - - NL80211_ATTR_PREV_BSSID, - - NL80211_ATTR_KEY, - NL80211_ATTR_KEYS, - - NL80211_ATTR_PID, - - NL80211_ATTR_4ADDR, - - NL80211_ATTR_SURVEY_INFO, - - NL80211_ATTR_PMKID, - NL80211_ATTR_MAX_NUM_PMKIDS, - - NL80211_ATTR_DURATION, - - NL80211_ATTR_COOKIE, - - NL80211_ATTR_WIPHY_COVERAGE_CLASS, - - NL80211_ATTR_TX_RATES, - - NL80211_ATTR_FRAME_MATCH, - - NL80211_ATTR_ACK, - - NL80211_ATTR_PS_STATE, - - NL80211_ATTR_CQM, - - NL80211_ATTR_LOCAL_STATE_CHANGE, - - NL80211_ATTR_AP_ISOLATE, - - NL80211_ATTR_WIPHY_TX_POWER_SETTING, - NL80211_ATTR_WIPHY_TX_POWER_LEVEL, - - NL80211_ATTR_TX_FRAME_TYPES, - NL80211_ATTR_RX_FRAME_TYPES, - NL80211_ATTR_FRAME_TYPE, - - NL80211_ATTR_CONTROL_PORT_ETHERTYPE, - NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, - - NL80211_ATTR_SUPPORT_IBSS_RSN, - - NL80211_ATTR_WIPHY_ANTENNA_TX, - NL80211_ATTR_WIPHY_ANTENNA_RX, - - NL80211_ATTR_MCAST_RATE, - - NL80211_ATTR_OFFCHANNEL_TX_OK, - - NL80211_ATTR_BSS_HT_OPMODE, - - NL80211_ATTR_KEY_DEFAULT_TYPES, - - NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION, - - NL80211_ATTR_MESH_SETUP, - - NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX, - NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX, - - NL80211_ATTR_SUPPORT_MESH_AUTH, - NL80211_ATTR_STA_PLINK_STATE, - - NL80211_ATTR_WOWLAN_TRIGGERS, - NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, - - NL80211_ATTR_SCHED_SCAN_INTERVAL, - - NL80211_ATTR_INTERFACE_COMBINATIONS, - NL80211_ATTR_SOFTWARE_IFTYPES, - - NL80211_ATTR_REKEY_DATA, - - NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS, - NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN, - - NL80211_ATTR_SCAN_SUPP_RATES, - - NL80211_ATTR_HIDDEN_SSID, - - NL80211_ATTR_IE_PROBE_RESP, - NL80211_ATTR_IE_ASSOC_RESP, - - NL80211_ATTR_STA_WME, - NL80211_ATTR_SUPPORT_AP_UAPSD, - - NL80211_ATTR_ROAM_SUPPORT, - - NL80211_ATTR_SCHED_SCAN_MATCH, - NL80211_ATTR_MAX_MATCH_SETS, - - NL80211_ATTR_PMKSA_CANDIDATE, - - NL80211_ATTR_TX_NO_CCK_RATE, - - NL80211_ATTR_TDLS_ACTION, - NL80211_ATTR_TDLS_DIALOG_TOKEN, - NL80211_ATTR_TDLS_OPERATION, - NL80211_ATTR_TDLS_SUPPORT, - NL80211_ATTR_TDLS_EXTERNAL_SETUP, - - NL80211_ATTR_DEVICE_AP_SME, - - NL80211_ATTR_DONT_WAIT_FOR_ACK, - - NL80211_ATTR_FEATURE_FLAGS, - - NL80211_ATTR_PROBE_RESP_OFFLOAD, - - NL80211_ATTR_PROBE_RESP, - - NL80211_ATTR_DFS_REGION, - - NL80211_ATTR_DISABLE_HT, - NL80211_ATTR_HT_CAPABILITY_MASK, - - NL80211_ATTR_NOACK_MAP, - - NL80211_ATTR_INACTIVITY_TIMEOUT, - - NL80211_ATTR_RX_SIGNAL_DBM, - - NL80211_ATTR_BG_SCAN_PERIOD, - - NL80211_ATTR_WDEV, - - NL80211_ATTR_USER_REG_HINT_TYPE, - - NL80211_ATTR_CONN_FAILED_REASON, - - NL80211_ATTR_AUTH_DATA, - - NL80211_ATTR_VHT_CAPABILITY, - - NL80211_ATTR_SCAN_FLAGS, - - NL80211_ATTR_CHANNEL_WIDTH, - NL80211_ATTR_CENTER_FREQ1, - NL80211_ATTR_CENTER_FREQ2, - - NL80211_ATTR_P2P_CTWINDOW, - NL80211_ATTR_P2P_OPPPS, - - NL80211_ATTR_LOCAL_MESH_POWER_MODE, - - NL80211_ATTR_ACL_POLICY, - - NL80211_ATTR_MAC_ADDRS, - - NL80211_ATTR_MAC_ACL_MAX, - - NL80211_ATTR_RADAR_EVENT, - - NL80211_ATTR_EXT_CAPA, - NL80211_ATTR_EXT_CAPA_MASK, - - NL80211_ATTR_STA_CAPABILITY, - NL80211_ATTR_STA_EXT_CAPABILITY, - - NL80211_ATTR_PROTOCOL_FEATURES, - NL80211_ATTR_SPLIT_WIPHY_DUMP, - - NL80211_ATTR_DISABLE_VHT, - NL80211_ATTR_VHT_CAPABILITY_MASK, - - NL80211_ATTR_MDID, - NL80211_ATTR_IE_RIC, - - NL80211_ATTR_CRIT_PROT_ID, - NL80211_ATTR_MAX_CRIT_PROT_DURATION, - - NL80211_ATTR_PEER_AID, - - NL80211_ATTR_COALESCE_RULE, - - NL80211_ATTR_CH_SWITCH_COUNT, - NL80211_ATTR_CH_SWITCH_BLOCK_TX, - NL80211_ATTR_CSA_IES, - NL80211_ATTR_CNTDWN_OFFS_BEACON, - NL80211_ATTR_CNTDWN_OFFS_PRESP, - - NL80211_ATTR_RXMGMT_FLAGS, - - NL80211_ATTR_STA_SUPPORTED_CHANNELS, - - NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES, - - NL80211_ATTR_HANDLE_DFS, - - NL80211_ATTR_SUPPORT_5_MHZ, - NL80211_ATTR_SUPPORT_10_MHZ, - - NL80211_ATTR_OPMODE_NOTIF, - - NL80211_ATTR_VENDOR_ID, - NL80211_ATTR_VENDOR_SUBCMD, - NL80211_ATTR_VENDOR_DATA, - NL80211_ATTR_VENDOR_EVENTS, - - NL80211_ATTR_QOS_MAP, - - NL80211_ATTR_MAC_HINT, - NL80211_ATTR_WIPHY_FREQ_HINT, - - NL80211_ATTR_MAX_AP_ASSOC_STA, - - NL80211_ATTR_TDLS_PEER_CAPABILITY, - - NL80211_ATTR_SOCKET_OWNER, - - NL80211_ATTR_CSA_C_OFFSETS_TX, - NL80211_ATTR_MAX_CSA_COUNTERS, - - NL80211_ATTR_TDLS_INITIATOR, - - NL80211_ATTR_USE_RRM, - - NL80211_ATTR_WIPHY_DYN_ACK, - - NL80211_ATTR_TSID, - NL80211_ATTR_USER_PRIO, - NL80211_ATTR_ADMITTED_TIME, - - NL80211_ATTR_SMPS_MODE, - - NL80211_ATTR_OPER_CLASS, - - NL80211_ATTR_MAC_MASK, - - NL80211_ATTR_WIPHY_SELF_MANAGED_REG, - - NL80211_ATTR_EXT_FEATURES, - - NL80211_ATTR_SURVEY_RADIO_STATS, - - NL80211_ATTR_NETNS_FD, - - NL80211_ATTR_SCHED_SCAN_DELAY, - - NL80211_ATTR_REG_INDOOR, - - NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS, - NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL, - NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS, - NL80211_ATTR_SCHED_SCAN_PLANS, - - NL80211_ATTR_PBSS, - - NL80211_ATTR_BSS_SELECT, - - NL80211_ATTR_STA_SUPPORT_P2P_PS, - - NL80211_ATTR_PAD, - - NL80211_ATTR_IFTYPE_EXT_CAPA, - - NL80211_ATTR_MU_MIMO_GROUP_DATA, - NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR, - - NL80211_ATTR_SCAN_START_TIME_TSF, - NL80211_ATTR_SCAN_START_TIME_TSF_BSSID, - NL80211_ATTR_MEASUREMENT_DURATION, - NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY, - - NL80211_ATTR_MESH_PEER_AID, - - NL80211_ATTR_NAN_MASTER_PREF, - NL80211_ATTR_BANDS, - NL80211_ATTR_NAN_FUNC, - NL80211_ATTR_NAN_MATCH, - - NL80211_ATTR_FILS_KEK, - NL80211_ATTR_FILS_NONCES, - - NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED, - - NL80211_ATTR_BSSID, - - NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI, - NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST, - - NL80211_ATTR_TIMEOUT_REASON, - - NL80211_ATTR_FILS_ERP_USERNAME, - NL80211_ATTR_FILS_ERP_REALM, - NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM, - NL80211_ATTR_FILS_ERP_RRK, - NL80211_ATTR_FILS_CACHE_ID, - - NL80211_ATTR_PMK, - - NL80211_ATTR_SCHED_SCAN_MULTI, - NL80211_ATTR_SCHED_SCAN_MAX_REQS, - - NL80211_ATTR_WANT_1X_4WAY_HS, - NL80211_ATTR_PMKR0_NAME, - NL80211_ATTR_PORT_AUTHORIZED, - - NL80211_ATTR_EXTERNAL_AUTH_ACTION, - NL80211_ATTR_EXTERNAL_AUTH_SUPPORT, - - NL80211_ATTR_NSS, - NL80211_ATTR_ACK_SIGNAL, - - NL80211_ATTR_CONTROL_PORT_OVER_NL80211, - - NL80211_ATTR_TXQ_STATS, - NL80211_ATTR_TXQ_LIMIT, - NL80211_ATTR_TXQ_MEMORY_LIMIT, - NL80211_ATTR_TXQ_QUANTUM, - - NL80211_ATTR_HE_CAPABILITY, - - NL80211_ATTR_FTM_RESPONDER, - - NL80211_ATTR_FTM_RESPONDER_STATS, - - NL80211_ATTR_TIMEOUT, - - NL80211_ATTR_PEER_MEASUREMENTS, - - NL80211_ATTR_AIRTIME_WEIGHT, - NL80211_ATTR_STA_TX_POWER_SETTING, - NL80211_ATTR_STA_TX_POWER, - - NL80211_ATTR_SAE_PASSWORD, - - NL80211_ATTR_TWT_RESPONDER, - - NL80211_ATTR_HE_OBSS_PD, - - NL80211_ATTR_WIPHY_EDMG_CHANNELS, - NL80211_ATTR_WIPHY_EDMG_BW_CONFIG, - - NL80211_ATTR_VLAN_ID, - - NL80211_ATTR_HE_BSS_COLOR, - - NL80211_ATTR_IFTYPE_AKM_SUITES, - - NL80211_ATTR_TID_CONFIG, - - NL80211_ATTR_CONTROL_PORT_NO_PREAUTH, - - NL80211_ATTR_PMK_LIFETIME, - NL80211_ATTR_PMK_REAUTH_THRESHOLD, - - NL80211_ATTR_RECEIVE_MULTICAST, - NL80211_ATTR_WIPHY_FREQ_OFFSET, - NL80211_ATTR_CENTER_FREQ1_OFFSET, - NL80211_ATTR_SCAN_FREQ_KHZ, - - NL80211_ATTR_HE_6GHZ_CAPABILITY, - - NL80211_ATTR_MULTIPLE_BSSID_PARENT, - NL80211_ATTR_MULTIPLE_BSSID_INDEX, - NL80211_ATTR_MULTIPLE_BSSID_COUNT, - NL80211_ATTR_MULTIPLE_BSSID_IES, - NL80211_ATTR_MULTIPLE_BSSID_EMA, - - NL80211_ATTR_OBSS_COLOR_BITMAP, - - NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COUNT, - NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR, - NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES, - - /* add attributes here, update the policy in nl80211.c */ - - __NL80211_ATTR_AFTER_LAST, - NUM_NL80211_ATTR = __NL80211_ATTR_AFTER_LAST, - NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 -}; - -/* source-level API compatibility */ -#define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION -#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG -#define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER -#define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA -#define NL80211_ATTR_CSA_C_OFF_BEACON NL80211_ATTR_CNTDWN_OFFS_BEACON -#define NL80211_ATTR_CSA_C_OFF_PRESP NL80211_ATTR_CNTDWN_OFFS_PRESP - -/* - * Allow user space programs to use #ifdef on new attributes by defining them - * here - */ -#define NL80211_CMD_CONNECT NL80211_CMD_CONNECT -#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY -#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES -#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS -#define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ -#define NL80211_ATTR_WIPHY_CHANNEL_TYPE NL80211_ATTR_WIPHY_CHANNEL_TYPE -#define NL80211_ATTR_MGMT_SUBTYPE NL80211_ATTR_MGMT_SUBTYPE -#define NL80211_ATTR_IE NL80211_ATTR_IE -#define NL80211_ATTR_REG_INITIATOR NL80211_ATTR_REG_INITIATOR -#define NL80211_ATTR_REG_TYPE NL80211_ATTR_REG_TYPE -#define NL80211_ATTR_FRAME NL80211_ATTR_FRAME -#define NL80211_ATTR_SSID NL80211_ATTR_SSID -#define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE -#define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE -#define NL80211_ATTR_CIPHER_SUITES_PAIRWISE NL80211_ATTR_CIPHER_SUITES_PAIRWISE -#define NL80211_ATTR_CIPHER_SUITE_GROUP NL80211_ATTR_CIPHER_SUITE_GROUP -#define NL80211_ATTR_WPA_VERSIONS NL80211_ATTR_WPA_VERSIONS -#define NL80211_ATTR_AKM_SUITES NL80211_ATTR_AKM_SUITES -#define NL80211_ATTR_KEY NL80211_ATTR_KEY -#define NL80211_ATTR_KEYS NL80211_ATTR_KEYS -#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS - -#define NL80211_WIPHY_NAME_MAXLEN 64 - -#define NL80211_MAX_SUPP_RATES 32 -#define NL80211_MAX_SUPP_HT_RATES 77 -#define NL80211_MAX_SUPP_REG_RULES 128 -#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 -#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 -#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 -#define NL80211_HT_CAPABILITY_LEN 26 -#define NL80211_VHT_CAPABILITY_LEN 12 -#define NL80211_HE_MIN_CAPABILITY_LEN 16 -#define NL80211_HE_MAX_CAPABILITY_LEN 54 -#define NL80211_MAX_NR_CIPHER_SUITES 5 -#define NL80211_MAX_NR_AKM_SUITES 2 - -#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10 - -/* default RSSI threshold for scan results if none specified. */ -#define NL80211_SCAN_RSSI_THOLD_OFF -300 - -#define NL80211_CQM_TXE_MAX_INTVL 1800 - -#define NL80211_MULTIPLE_BSSID_IES_MAX 8 - -/** - * enum nl80211_iftype - (virtual) interface types - * - * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides - * @NL80211_IFTYPE_ADHOC: independent BSS member - * @NL80211_IFTYPE_STATION: managed BSS member - * @NL80211_IFTYPE_AP: access point - * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points; VLAN interfaces - * are a bit special in that they must always be tied to a pre-existing - * AP type interface. - * @NL80211_IFTYPE_WDS: wireless distribution interface - * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames - * @NL80211_IFTYPE_MESH_POINT: mesh point - * @NL80211_IFTYPE_P2P_CLIENT: P2P client - * @NL80211_IFTYPE_P2P_GO: P2P group owner - * @NL80211_IFTYPE_P2P_DEVICE: P2P device interface type, this is not a netdev - * and therefore can't be created in the normal ways, use the - * %NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE - * commands to create and destroy one - * @NL80211_IF_TYPE_OCB: Outside Context of a BSS - * This mode corresponds to the MIB variable dot11OCBActivated=true - * @NL80211_IFTYPE_NAN: NAN device interface type (not a netdev) - * @NL80211_IFTYPE_MAX: highest interface type number currently defined - * @NUM_NL80211_IFTYPES: number of defined interface types - * - * These values are used with the %NL80211_ATTR_IFTYPE - * to set the type of an interface. - * - */ -enum nl80211_iftype { - NL80211_IFTYPE_UNSPECIFIED, - NL80211_IFTYPE_ADHOC, - NL80211_IFTYPE_STATION, - NL80211_IFTYPE_AP, - NL80211_IFTYPE_AP_VLAN, - NL80211_IFTYPE_WDS, - NL80211_IFTYPE_MONITOR, - NL80211_IFTYPE_MESH_POINT, - NL80211_IFTYPE_P2P_CLIENT, - NL80211_IFTYPE_P2P_GO, - NL80211_IFTYPE_P2P_DEVICE, - NL80211_IFTYPE_OCB, - NL80211_IFTYPE_NAN, - - /* keep last */ - NUM_NL80211_IFTYPES, - NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1 -}; - -/** - * enum nl80211_sta_flags - station flags - * - * Station flags. When a station is added to an AP interface, it is - * assumed to be already associated (and hence authenticated.) - * - * @__NL80211_STA_FLAG_INVALID: attribute number 0 is reserved - * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X) - * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames - * with short barker preamble - * @NL80211_STA_FLAG_WME: station is WME/QoS capable - * @NL80211_STA_FLAG_MFP: station uses management frame protection - * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated - * @NL80211_STA_FLAG_TDLS_PEER: station is a TDLS peer -- this flag should - * only be used in managed mode (even in the flags mask). Note that the - * flag can't be changed, it is only valid while adding a station, and - * attempts to change it will silently be ignored (rather than rejected - * as errors.) - * @NL80211_STA_FLAG_ASSOCIATED: station is associated; used with drivers - * that support %NL80211_FEATURE_FULL_AP_CLIENT_STATE to transition a - * previously added station into associated state - * @NL80211_STA_FLAG_MAX: highest station flag number currently defined - * @__NL80211_STA_FLAG_AFTER_LAST: internal use - */ -enum nl80211_sta_flags { - __NL80211_STA_FLAG_INVALID, - NL80211_STA_FLAG_AUTHORIZED, - NL80211_STA_FLAG_SHORT_PREAMBLE, - NL80211_STA_FLAG_WME, - NL80211_STA_FLAG_MFP, - NL80211_STA_FLAG_AUTHENTICATED, - NL80211_STA_FLAG_TDLS_PEER, - NL80211_STA_FLAG_ASSOCIATED, - - /* keep last */ - __NL80211_STA_FLAG_AFTER_LAST, - NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1 -}; - -/** - * enum nl80211_sta_p2p_ps_status - station support of P2P PS - * - * @NL80211_P2P_PS_UNSUPPORTED: station doesn't support P2P PS mechanism - * @@NL80211_P2P_PS_SUPPORTED: station supports P2P PS mechanism - * @NUM_NL80211_P2P_PS_STATUS: number of values - */ -enum nl80211_sta_p2p_ps_status { - NL80211_P2P_PS_UNSUPPORTED = 0, - NL80211_P2P_PS_SUPPORTED, - - NUM_NL80211_P2P_PS_STATUS, -}; - -#define NL80211_STA_FLAG_MAX_OLD_API NL80211_STA_FLAG_TDLS_PEER - -/** - * struct nl80211_sta_flag_update - station flags mask/set - * @mask: mask of station flags to set - * @set: which values to set them to - * - * Both mask and set contain bits as per &enum nl80211_sta_flags. - */ -struct nl80211_sta_flag_update { - __u32 mask; - __u32 set; -} __attribute__((packed)); - -/** - * enum nl80211_he_gi - HE guard interval - * @NL80211_RATE_INFO_HE_GI_0_8: 0.8 usec - * @NL80211_RATE_INFO_HE_GI_1_6: 1.6 usec - * @NL80211_RATE_INFO_HE_GI_3_2: 3.2 usec - */ -enum nl80211_he_gi { - NL80211_RATE_INFO_HE_GI_0_8, - NL80211_RATE_INFO_HE_GI_1_6, - NL80211_RATE_INFO_HE_GI_3_2, -}; - -/** - * enum nl80211_he_ltf - HE long training field - * @NL80211_RATE_INFO_HE_1xLTF: 3.2 usec - * @NL80211_RATE_INFO_HE_2xLTF: 6.4 usec - * @NL80211_RATE_INFO_HE_4xLTF: 12.8 usec - */ -enum nl80211_he_ltf { - NL80211_RATE_INFO_HE_1XLTF, - NL80211_RATE_INFO_HE_2XLTF, - NL80211_RATE_INFO_HE_4XLTF, -}; - -/** - * enum nl80211_he_ru_alloc - HE RU allocation values - * @NL80211_RATE_INFO_HE_RU_ALLOC_26: 26-tone RU allocation - * @NL80211_RATE_INFO_HE_RU_ALLOC_52: 52-tone RU allocation - * @NL80211_RATE_INFO_HE_RU_ALLOC_106: 106-tone RU allocation - * @NL80211_RATE_INFO_HE_RU_ALLOC_242: 242-tone RU allocation - * @NL80211_RATE_INFO_HE_RU_ALLOC_484: 484-tone RU allocation - * @NL80211_RATE_INFO_HE_RU_ALLOC_996: 996-tone RU allocation - * @NL80211_RATE_INFO_HE_RU_ALLOC_2x996: 2x996-tone RU allocation - */ -enum nl80211_he_ru_alloc { - NL80211_RATE_INFO_HE_RU_ALLOC_26, - NL80211_RATE_INFO_HE_RU_ALLOC_52, - NL80211_RATE_INFO_HE_RU_ALLOC_106, - NL80211_RATE_INFO_HE_RU_ALLOC_242, - NL80211_RATE_INFO_HE_RU_ALLOC_484, - NL80211_RATE_INFO_HE_RU_ALLOC_996, - NL80211_RATE_INFO_HE_RU_ALLOC_2x996, -}; - -/** - * enum nl80211_rate_info - bitrate information - * - * These attribute types are used with %NL80211_STA_INFO_TXRATE - * when getting information about the bitrate of a station. - * There are 2 attributes for bitrate, a legacy one that represents - * a 16-bit value, and new one that represents a 32-bit value. - * If the rate value fits into 16 bit, both attributes are reported - * with the same value. If the rate is too high to fit into 16 bits - * (>6.5535Gbps) only 32-bit attribute is included. - * User space tools encouraged to use the 32-bit attribute and fall - * back to the 16-bit one for compatibility with older kernels. - * - * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved - * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) - * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) - * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate - * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval - * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s) - * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined - * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8) - * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8) - * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate - * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: unused - 80+80 is treated the - * same as 160 for purposes of the bitrates - * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate - * @NL80211_RATE_INFO_10_MHZ_WIDTH: 10 MHz width - note that this is - * a legacy rate and will be reported as the actual bitrate, i.e. - * half the base (20 MHz) rate - * @NL80211_RATE_INFO_5_MHZ_WIDTH: 5 MHz width - note that this is - * a legacy rate and will be reported as the actual bitrate, i.e. - * a quarter of the base (20 MHz) rate - * @NL80211_RATE_INFO_HE_MCS: HE MCS index (u8, 0-11) - * @NL80211_RATE_INFO_HE_NSS: HE NSS value (u8, 1-8) - * @NL80211_RATE_INFO_HE_GI: HE guard interval identifier - * (u8, see &enum nl80211_he_gi) - * @NL80211_RATE_INFO_HE_DCM: HE DCM value (u8, 0/1) - * @NL80211_RATE_INFO_RU_ALLOC: HE RU allocation, if not present then - * non-OFDMA was used (u8, see &enum nl80211_he_ru_alloc) - * @__NL80211_RATE_INFO_AFTER_LAST: internal use - */ -enum nl80211_rate_info { - __NL80211_RATE_INFO_INVALID, - NL80211_RATE_INFO_BITRATE, - NL80211_RATE_INFO_MCS, - NL80211_RATE_INFO_40_MHZ_WIDTH, - NL80211_RATE_INFO_SHORT_GI, - NL80211_RATE_INFO_BITRATE32, - NL80211_RATE_INFO_VHT_MCS, - NL80211_RATE_INFO_VHT_NSS, - NL80211_RATE_INFO_80_MHZ_WIDTH, - NL80211_RATE_INFO_80P80_MHZ_WIDTH, - NL80211_RATE_INFO_160_MHZ_WIDTH, - NL80211_RATE_INFO_10_MHZ_WIDTH, - NL80211_RATE_INFO_5_MHZ_WIDTH, - NL80211_RATE_INFO_HE_MCS, - NL80211_RATE_INFO_HE_NSS, - NL80211_RATE_INFO_HE_GI, - NL80211_RATE_INFO_HE_DCM, - NL80211_RATE_INFO_HE_RU_ALLOC, - - /* keep last */ - __NL80211_RATE_INFO_AFTER_LAST, - NL80211_RATE_INFO_MAX = __NL80211_RATE_INFO_AFTER_LAST - 1 -}; - -/** - * enum nl80211_sta_bss_param - BSS information collected by STA - * - * These attribute types are used with %NL80211_STA_INFO_BSS_PARAM - * when getting information about the bitrate of a station. - * - * @__NL80211_STA_BSS_PARAM_INVALID: attribute number 0 is reserved - * @NL80211_STA_BSS_PARAM_CTS_PROT: whether CTS protection is enabled (flag) - * @NL80211_STA_BSS_PARAM_SHORT_PREAMBLE: whether short preamble is enabled - * (flag) - * @NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME: whether short slot time is enabled - * (flag) - * @NL80211_STA_BSS_PARAM_DTIM_PERIOD: DTIM period for beaconing (u8) - * @NL80211_STA_BSS_PARAM_BEACON_INTERVAL: Beacon interval (u16) - * @NL80211_STA_BSS_PARAM_MAX: highest sta_bss_param number currently defined - * @__NL80211_STA_BSS_PARAM_AFTER_LAST: internal use - */ -enum nl80211_sta_bss_param { - __NL80211_STA_BSS_PARAM_INVALID, - NL80211_STA_BSS_PARAM_CTS_PROT, - NL80211_STA_BSS_PARAM_SHORT_PREAMBLE, - NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME, - NL80211_STA_BSS_PARAM_DTIM_PERIOD, - NL80211_STA_BSS_PARAM_BEACON_INTERVAL, - - /* keep last */ - __NL80211_STA_BSS_PARAM_AFTER_LAST, - NL80211_STA_BSS_PARAM_MAX = __NL80211_STA_BSS_PARAM_AFTER_LAST - 1 -}; - -/** - * enum nl80211_sta_info - station information - * - * These attribute types are used with %NL80211_ATTR_STA_INFO - * when getting information about a station. - * - * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved - * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) - * @NL80211_STA_INFO_RX_BYTES: total received bytes (MPDU length) - * (u32, from this station) - * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (MPDU length) - * (u32, to this station) - * @NL80211_STA_INFO_RX_BYTES64: total received bytes (MPDU length) - * (u64, from this station) - * @NL80211_STA_INFO_TX_BYTES64: total transmitted bytes (MPDU length) - * (u64, to this station) - * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) - * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute - * containing info as possible, see &enum nl80211_rate_info - * @NL80211_STA_INFO_RX_PACKETS: total received packet (MSDUs and MMPDUs) - * (u32, from this station) - * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (MSDUs and MMPDUs) - * (u32, to this station) - * @NL80211_STA_INFO_TX_RETRIES: total retries (MPDUs) (u32, to this station) - * @NL80211_STA_INFO_TX_FAILED: total failed packets (MPDUs) - * (u32, to this station) - * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm) - * @NL80211_STA_INFO_LLID: the station's mesh LLID - * @NL80211_STA_INFO_PLID: the station's mesh PLID - * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station - * (see %enum nl80211_plink_state) - * @NL80211_STA_INFO_RX_BITRATE: last unicast data frame rx rate, nested - * attribute, like NL80211_STA_INFO_TX_BITRATE. - * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute - * containing info as possible, see &enum nl80211_sta_bss_param - * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected - * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update. - * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32) - * @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64) - * @NL80211_STA_INFO_LOCAL_PM: local mesh STA link-specific power mode - * @NL80211_STA_INFO_PEER_PM: peer mesh STA link-specific power mode - * @NL80211_STA_INFO_NONPEER_PM: neighbor mesh STA power save mode towards - * non-peer STA - * @NL80211_STA_INFO_CHAIN_SIGNAL: per-chain signal strength of last PPDU - * Contains a nested array of signal strength attributes (u8, dBm) - * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average - * Same format as NL80211_STA_INFO_CHAIN_SIGNAL. - * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the - * 802.11 header (u32, kbps) - * @NL80211_STA_INFO_RX_DROP_MISC: RX packets dropped for unspecified reasons - * (u64) - * @NL80211_STA_INFO_BEACON_RX: number of beacons received from this peer (u64) - * @NL80211_STA_INFO_BEACON_SIGNAL_AVG: signal strength average - * for beacons only (u8, dBm) - * @NL80211_STA_INFO_TID_STATS: per-TID statistics (see &enum nl80211_tid_stats) - * This is a nested attribute where each the inner attribute number is the - * TID+1 and the special TID 16 (i.e. value 17) is used for non-QoS frames; - * each one of those is again nested with &enum nl80211_tid_stats - * attributes carrying the actual values. - * @NL80211_STA_INFO_RX_DURATION: aggregate PPDU duration for all frames - * received from the station (u64, usec) - * @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment - * @NL80211_STA_INFO_ACK_SIGNAL: signal strength of the last ACK frame(u8, dBm) - * @NL80211_STA_INFO_ACK_SIGNAL_AVG: avg signal strength of ACK frames (s8, dBm) - * @NL80211_STA_INFO_RX_MPDUS: total number of received packets (MPDUs) - * (u32, from this station) - * @NL80211_STA_INFO_FCS_ERROR_COUNT: total number of packets (MPDUs) received - * with an FCS error (u32, from this station). This count may not include - * some packets with an FCS error due to TA corruption. Hence this counter - * might not be fully accurate. - * @NL80211_STA_INFO_CONNECTED_TO_GATE: set to true if STA has a path to a - * mesh gate (u8, 0 or 1) - * @NL80211_STA_INFO_TX_DURATION: aggregate PPDU duration for all frames - * sent to the station (u64, usec) - * @NL80211_STA_INFO_AIRTIME_WEIGHT: current airtime weight for station (u16) - * @NL80211_STA_INFO_AIRTIME_LINK_METRIC: airtime link metric for mesh station - * @NL80211_STA_INFO_ASSOC_AT_BOOTTIME: Timestamp (CLOCK_BOOTTIME, nanoseconds) - * of STA's association - * @__NL80211_STA_INFO_AFTER_LAST: internal - * @NL80211_STA_INFO_MAX: highest possible station info attribute - */ -enum nl80211_sta_info { - __NL80211_STA_INFO_INVALID, - NL80211_STA_INFO_INACTIVE_TIME, - NL80211_STA_INFO_RX_BYTES, - NL80211_STA_INFO_TX_BYTES, - NL80211_STA_INFO_LLID, - NL80211_STA_INFO_PLID, - NL80211_STA_INFO_PLINK_STATE, - NL80211_STA_INFO_SIGNAL, - NL80211_STA_INFO_TX_BITRATE, - NL80211_STA_INFO_RX_PACKETS, - NL80211_STA_INFO_TX_PACKETS, - NL80211_STA_INFO_TX_RETRIES, - NL80211_STA_INFO_TX_FAILED, - NL80211_STA_INFO_SIGNAL_AVG, - NL80211_STA_INFO_RX_BITRATE, - NL80211_STA_INFO_BSS_PARAM, - NL80211_STA_INFO_CONNECTED_TIME, - NL80211_STA_INFO_STA_FLAGS, - NL80211_STA_INFO_BEACON_LOSS, - NL80211_STA_INFO_T_OFFSET, - NL80211_STA_INFO_LOCAL_PM, - NL80211_STA_INFO_PEER_PM, - NL80211_STA_INFO_NONPEER_PM, - NL80211_STA_INFO_RX_BYTES64, - NL80211_STA_INFO_TX_BYTES64, - NL80211_STA_INFO_CHAIN_SIGNAL, - NL80211_STA_INFO_CHAIN_SIGNAL_AVG, - NL80211_STA_INFO_EXPECTED_THROUGHPUT, - NL80211_STA_INFO_RX_DROP_MISC, - NL80211_STA_INFO_BEACON_RX, - NL80211_STA_INFO_BEACON_SIGNAL_AVG, - NL80211_STA_INFO_TID_STATS, - NL80211_STA_INFO_RX_DURATION, - NL80211_STA_INFO_PAD, - NL80211_STA_INFO_ACK_SIGNAL, - NL80211_STA_INFO_ACK_SIGNAL_AVG, - NL80211_STA_INFO_RX_MPDUS, - NL80211_STA_INFO_FCS_ERROR_COUNT, - NL80211_STA_INFO_CONNECTED_TO_GATE, - NL80211_STA_INFO_TX_DURATION, - NL80211_STA_INFO_AIRTIME_WEIGHT, - NL80211_STA_INFO_AIRTIME_LINK_METRIC, - NL80211_STA_INFO_ASSOC_AT_BOOTTIME, - - /* keep last */ - __NL80211_STA_INFO_AFTER_LAST, - NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1 -}; - -/* we renamed this - stay compatible */ -#define NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG NL80211_STA_INFO_ACK_SIGNAL_AVG - - -/** - * enum nl80211_tid_stats - per TID statistics attributes - * @__NL80211_TID_STATS_INVALID: attribute number 0 is reserved - * @NL80211_TID_STATS_RX_MSDU: number of MSDUs received (u64) - * @NL80211_TID_STATS_TX_MSDU: number of MSDUs transmitted (or - * attempted to transmit; u64) - * @NL80211_TID_STATS_TX_MSDU_RETRIES: number of retries for - * transmitted MSDUs (not counting the first attempt; u64) - * @NL80211_TID_STATS_TX_MSDU_FAILED: number of failed transmitted - * MSDUs (u64) - * @NL80211_TID_STATS_PAD: attribute used for padding for 64-bit alignment - * @NL80211_TID_STATS_TXQ_STATS: TXQ stats (nested attribute) - * @NUM_NL80211_TID_STATS: number of attributes here - * @NL80211_TID_STATS_MAX: highest numbered attribute here - */ -enum nl80211_tid_stats { - __NL80211_TID_STATS_INVALID, - NL80211_TID_STATS_RX_MSDU, - NL80211_TID_STATS_TX_MSDU, - NL80211_TID_STATS_TX_MSDU_RETRIES, - NL80211_TID_STATS_TX_MSDU_FAILED, - NL80211_TID_STATS_PAD, - NL80211_TID_STATS_TXQ_STATS, - - /* keep last */ - NUM_NL80211_TID_STATS, - NL80211_TID_STATS_MAX = NUM_NL80211_TID_STATS - 1 -}; - -/** - * enum nl80211_txq_stats - per TXQ statistics attributes - * @__NL80211_TXQ_STATS_INVALID: attribute number 0 is reserved - * @NUM_NL80211_TXQ_STATS: number of attributes here - * @NL80211_TXQ_STATS_BACKLOG_BYTES: number of bytes currently backlogged - * @NL80211_TXQ_STATS_BACKLOG_PACKETS: number of packets currently - * backlogged - * @NL80211_TXQ_STATS_FLOWS: total number of new flows seen - * @NL80211_TXQ_STATS_DROPS: total number of packet drops - * @NL80211_TXQ_STATS_ECN_MARKS: total number of packet ECN marks - * @NL80211_TXQ_STATS_OVERLIMIT: number of drops due to queue space overflow - * @NL80211_TXQ_STATS_OVERMEMORY: number of drops due to memory limit overflow - * (only for per-phy stats) - * @NL80211_TXQ_STATS_COLLISIONS: number of hash collisions - * @NL80211_TXQ_STATS_TX_BYTES: total number of bytes dequeued from TXQ - * @NL80211_TXQ_STATS_TX_PACKETS: total number of packets dequeued from TXQ - * @NL80211_TXQ_STATS_MAX_FLOWS: number of flow buckets for PHY - * @NL80211_TXQ_STATS_MAX: highest numbered attribute here - */ -enum nl80211_txq_stats { - __NL80211_TXQ_STATS_INVALID, - NL80211_TXQ_STATS_BACKLOG_BYTES, - NL80211_TXQ_STATS_BACKLOG_PACKETS, - NL80211_TXQ_STATS_FLOWS, - NL80211_TXQ_STATS_DROPS, - NL80211_TXQ_STATS_ECN_MARKS, - NL80211_TXQ_STATS_OVERLIMIT, - NL80211_TXQ_STATS_OVERMEMORY, - NL80211_TXQ_STATS_COLLISIONS, - NL80211_TXQ_STATS_TX_BYTES, - NL80211_TXQ_STATS_TX_PACKETS, - NL80211_TXQ_STATS_MAX_FLOWS, - - /* keep last */ - NUM_NL80211_TXQ_STATS, - NL80211_TXQ_STATS_MAX = NUM_NL80211_TXQ_STATS - 1 -}; - -/** - * enum nl80211_mpath_flags - nl80211 mesh path flags - * - * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active - * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running - * @NL80211_MPATH_FLAG_SN_VALID: the mesh path contains a valid SN - * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set - * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded - */ -enum nl80211_mpath_flags { - NL80211_MPATH_FLAG_ACTIVE = 1<<0, - NL80211_MPATH_FLAG_RESOLVING = 1<<1, - NL80211_MPATH_FLAG_SN_VALID = 1<<2, - NL80211_MPATH_FLAG_FIXED = 1<<3, - NL80211_MPATH_FLAG_RESOLVED = 1<<4, -}; - -/** - * enum nl80211_mpath_info - mesh path information - * - * These attribute types are used with %NL80211_ATTR_MPATH_INFO when getting - * information about a mesh path. - * - * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved - * @NL80211_MPATH_INFO_FRAME_QLEN: number of queued frames for this destination - * @NL80211_MPATH_INFO_SN: destination sequence number - * @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path - * @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now - * @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in - * &enum nl80211_mpath_flags; - * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec - * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries - * @NL80211_MPATH_INFO_HOP_COUNT: hop count to destination - * @NL80211_MPATH_INFO_PATH_CHANGE: total number of path changes to destination - * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number - * currently defined - * @__NL80211_MPATH_INFO_AFTER_LAST: internal use - */ -enum nl80211_mpath_info { - __NL80211_MPATH_INFO_INVALID, - NL80211_MPATH_INFO_FRAME_QLEN, - NL80211_MPATH_INFO_SN, - NL80211_MPATH_INFO_METRIC, - NL80211_MPATH_INFO_EXPTIME, - NL80211_MPATH_INFO_FLAGS, - NL80211_MPATH_INFO_DISCOVERY_TIMEOUT, - NL80211_MPATH_INFO_DISCOVERY_RETRIES, - NL80211_MPATH_INFO_HOP_COUNT, - NL80211_MPATH_INFO_PATH_CHANGE, - - /* keep last */ - __NL80211_MPATH_INFO_AFTER_LAST, - NL80211_MPATH_INFO_MAX = __NL80211_MPATH_INFO_AFTER_LAST - 1 -}; - -/** - * enum nl80211_band_iftype_attr - Interface type data attributes - * - * @__NL80211_BAND_IFTYPE_ATTR_INVALID: attribute number 0 is reserved - * @NL80211_BAND_IFTYPE_ATTR_IFTYPES: nested attribute containing a flag attribute - * for each interface type that supports the band data - * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_MAC: HE MAC capabilities as in HE - * capabilities IE - * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY: HE PHY capabilities as in HE - * capabilities IE - * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET: HE supported NSS/MCS as in HE - * capabilities IE - * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE: HE PPE thresholds information as - * defined in HE capabilities IE - * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band HE capability attribute currently - * defined - * @NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA: HE 6GHz band capabilities (__le16), - * given for all 6 GHz band channels - * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use - */ -enum nl80211_band_iftype_attr { - __NL80211_BAND_IFTYPE_ATTR_INVALID, - - NL80211_BAND_IFTYPE_ATTR_IFTYPES, - NL80211_BAND_IFTYPE_ATTR_HE_CAP_MAC, - NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY, - NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET, - NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE, - NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA, - - /* keep last */ - __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST, - NL80211_BAND_IFTYPE_ATTR_MAX = __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST - 1 -}; - -/** - * enum nl80211_band_attr - band attributes - * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved - * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band, - * an array of nested frequency attributes - * @NL80211_BAND_ATTR_RATES: supported bitrates in this band, - * an array of nested bitrate attributes - * @NL80211_BAND_ATTR_HT_MCS_SET: 16-byte attribute containing the MCS set as - * defined in 802.11n - * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE - * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n - * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n - * @NL80211_BAND_ATTR_VHT_MCS_SET: 32-byte attribute containing the MCS set as - * defined in 802.11ac - * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE - * @NL80211_BAND_ATTR_IFTYPE_DATA: nested array attribute, with each entry using - * attributes from &enum nl80211_band_iftype_attr - * @NL80211_BAND_ATTR_EDMG_CHANNELS: bitmap that indicates the 2.16 GHz - * channel(s) that are allowed to be used for EDMG transmissions. - * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251. - * @NL80211_BAND_ATTR_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes - * the allowed channel bandwidth configurations. - * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13. - * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined - * @__NL80211_BAND_ATTR_AFTER_LAST: internal use - */ -enum nl80211_band_attr { - __NL80211_BAND_ATTR_INVALID, - NL80211_BAND_ATTR_FREQS, - NL80211_BAND_ATTR_RATES, - - NL80211_BAND_ATTR_HT_MCS_SET, - NL80211_BAND_ATTR_HT_CAPA, - NL80211_BAND_ATTR_HT_AMPDU_FACTOR, - NL80211_BAND_ATTR_HT_AMPDU_DENSITY, - - NL80211_BAND_ATTR_VHT_MCS_SET, - NL80211_BAND_ATTR_VHT_CAPA, - NL80211_BAND_ATTR_IFTYPE_DATA, - - NL80211_BAND_ATTR_EDMG_CHANNELS, - NL80211_BAND_ATTR_EDMG_BW_CONFIG, - - /* keep last */ - __NL80211_BAND_ATTR_AFTER_LAST, - NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 -}; - -#define NL80211_BAND_ATTR_HT_CAPA NL80211_BAND_ATTR_HT_CAPA - -/** - * enum nl80211_wmm_rule - regulatory wmm rule - * - * @__NL80211_WMMR_INVALID: attribute number 0 is reserved - * @NL80211_WMMR_CW_MIN: Minimum contention window slot. - * @NL80211_WMMR_CW_MAX: Maximum contention window slot. - * @NL80211_WMMR_AIFSN: Arbitration Inter Frame Space. - * @NL80211_WMMR_TXOP: Maximum allowed tx operation time. - * @nl80211_WMMR_MAX: highest possible wmm rule. - * @__NL80211_WMMR_LAST: Internal use. - */ -enum nl80211_wmm_rule { - __NL80211_WMMR_INVALID, - NL80211_WMMR_CW_MIN, - NL80211_WMMR_CW_MAX, - NL80211_WMMR_AIFSN, - NL80211_WMMR_TXOP, - - /* keep last */ - __NL80211_WMMR_LAST, - NL80211_WMMR_MAX = __NL80211_WMMR_LAST - 1 -}; - -/** - * enum nl80211_frequency_attr - frequency attributes - * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved - * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz - * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current - * regulatory domain. - * @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation - * are permitted on this channel, this includes sending probe - * requests, or modes of operation that require beaconing. - * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory - * on this channel in current regulatory domain. - * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm - * (100 * dBm). - * @NL80211_FREQUENCY_ATTR_DFS_STATE: current state for DFS - * (enum nl80211_dfs_state) - * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in miliseconds for how long - * this channel is in this DFS state. - * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this - * channel as the control channel - * @NL80211_FREQUENCY_ATTR_NO_HT40_PLUS: HT40+ isn't possible with this - * channel as the control channel - * @NL80211_FREQUENCY_ATTR_NO_80MHZ: any 80 MHz channel using this channel - * as the primary or any of the secondary channels isn't possible, - * this includes 80+80 channels - * @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel - * using this channel as the primary or any of the secondary channels - * isn't possible - * @NL80211_FREQUENCY_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds. - * @NL80211_FREQUENCY_ATTR_INDOOR_ONLY: Only indoor use is permitted on this - * channel. A channel that has the INDOOR_ONLY attribute can only be - * used when there is a clear assessment that the device is operating in - * an indoor surroundings, i.e., it is connected to AC power (and not - * through portable DC inverters) or is under the control of a master - * that is acting as an AP and is connected to AC power. - * @NL80211_FREQUENCY_ATTR_IR_CONCURRENT: IR operation is allowed on this - * channel if it's connected concurrently to a BSS on the same channel on - * the 2 GHz band or to a channel in the same UNII band (on the 5 GHz - * band), and IEEE80211_CHAN_RADAR is not set. Instantiating a GO or TDLS - * off-channel on a channel that has the IR_CONCURRENT attribute set can be - * done when there is a clear assessment that the device is operating under - * the guidance of an authorized master, i.e., setting up a GO or TDLS - * off-channel while the device is also connected to an AP with DFS and - * radar detection on the UNII band (it is up to user-space, i.e., - * wpa_supplicant to perform the required verifications). Using this - * attribute for IR is disallowed for master interfaces (IBSS, AP). - * @NL80211_FREQUENCY_ATTR_NO_20MHZ: 20 MHz operation is not allowed - * on this channel in current regulatory domain. - * @NL80211_FREQUENCY_ATTR_NO_10MHZ: 10 MHz operation is not allowed - * on this channel in current regulatory domain. - * @NL80211_FREQUENCY_ATTR_WMM: this channel has wmm limitations. - * This is a nested attribute that contains the wmm limitation per AC. - * (see &enum nl80211_wmm_rule) - * @NL80211_FREQUENCY_ATTR_NO_HE: HE operation is not allowed on this channel - * in current regulatory domain. - * @NL80211_FREQUENCY_ATTR_OFFSET: frequency offset in KHz - * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number - * currently defined - * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use - * - * See https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122 - * for more information on the FCC description of the relaxations allowed - * by NL80211_FREQUENCY_ATTR_INDOOR_ONLY and - * NL80211_FREQUENCY_ATTR_IR_CONCURRENT. - */ -enum nl80211_frequency_attr { - __NL80211_FREQUENCY_ATTR_INVALID, - NL80211_FREQUENCY_ATTR_FREQ, - NL80211_FREQUENCY_ATTR_DISABLED, - NL80211_FREQUENCY_ATTR_NO_IR, - __NL80211_FREQUENCY_ATTR_NO_IBSS, - NL80211_FREQUENCY_ATTR_RADAR, - NL80211_FREQUENCY_ATTR_MAX_TX_POWER, - NL80211_FREQUENCY_ATTR_DFS_STATE, - NL80211_FREQUENCY_ATTR_DFS_TIME, - NL80211_FREQUENCY_ATTR_NO_HT40_MINUS, - NL80211_FREQUENCY_ATTR_NO_HT40_PLUS, - NL80211_FREQUENCY_ATTR_NO_80MHZ, - NL80211_FREQUENCY_ATTR_NO_160MHZ, - NL80211_FREQUENCY_ATTR_DFS_CAC_TIME, - NL80211_FREQUENCY_ATTR_INDOOR_ONLY, - NL80211_FREQUENCY_ATTR_IR_CONCURRENT, - NL80211_FREQUENCY_ATTR_NO_20MHZ, - NL80211_FREQUENCY_ATTR_NO_10MHZ, - NL80211_FREQUENCY_ATTR_WMM, - NL80211_FREQUENCY_ATTR_NO_HE, - NL80211_FREQUENCY_ATTR_OFFSET, - - /* keep last */ - __NL80211_FREQUENCY_ATTR_AFTER_LAST, - NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1 -}; - -#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER -#define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR -#define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR -#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR -#define NL80211_FREQUENCY_ATTR_GO_CONCURRENT \ - NL80211_FREQUENCY_ATTR_IR_CONCURRENT - -/** - * enum nl80211_bitrate_attr - bitrate attributes - * @__NL80211_BITRATE_ATTR_INVALID: attribute number 0 is reserved - * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps - * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported - * in 2.4 GHz band. - * @NL80211_BITRATE_ATTR_MAX: highest bitrate attribute number - * currently defined - * @__NL80211_BITRATE_ATTR_AFTER_LAST: internal use - */ -enum nl80211_bitrate_attr { - __NL80211_BITRATE_ATTR_INVALID, - NL80211_BITRATE_ATTR_RATE, - NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE, - - /* keep last */ - __NL80211_BITRATE_ATTR_AFTER_LAST, - NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1 -}; - -/** - * enum nl80211_initiator - Indicates the initiator of a reg domain request - * @NL80211_REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world - * regulatory domain. - * @NL80211_REGDOM_SET_BY_USER: User asked the wireless core to set the - * regulatory domain. - * @NL80211_REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the - * wireless core it thinks its knows the regulatory domain we should be in. - * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an - * 802.11 country information element with regulatory information it - * thinks we should consider. cfg80211 only processes the country - * code from the IE, and relies on the regulatory domain information - * structure passed by userspace (CRDA) from our wireless-regdb. - * If a channel is enabled but the country code indicates it should - * be disabled we disable the channel and re-enable it upon disassociation. - */ -enum nl80211_reg_initiator { - NL80211_REGDOM_SET_BY_CORE, - NL80211_REGDOM_SET_BY_USER, - NL80211_REGDOM_SET_BY_DRIVER, - NL80211_REGDOM_SET_BY_COUNTRY_IE, -}; - -/** - * enum nl80211_reg_type - specifies the type of regulatory domain - * @NL80211_REGDOM_TYPE_COUNTRY: the regulatory domain set is one that pertains - * to a specific country. When this is set you can count on the - * ISO / IEC 3166 alpha2 country code being valid. - * @NL80211_REGDOM_TYPE_WORLD: the regulatory set domain is the world regulatory - * domain. - * @NL80211_REGDOM_TYPE_CUSTOM_WORLD: the regulatory domain set is a custom - * driver specific world regulatory domain. These do not apply system-wide - * and are only applicable to the individual devices which have requested - * them to be applied. - * @NL80211_REGDOM_TYPE_INTERSECTION: the regulatory domain set is the product - * of an intersection between two regulatory domains -- the previously - * set regulatory domain on the system and the last accepted regulatory - * domain request to be processed. - */ -enum nl80211_reg_type { - NL80211_REGDOM_TYPE_COUNTRY, - NL80211_REGDOM_TYPE_WORLD, - NL80211_REGDOM_TYPE_CUSTOM_WORLD, - NL80211_REGDOM_TYPE_INTERSECTION, -}; - -/** - * enum nl80211_reg_rule_attr - regulatory rule attributes - * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved - * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional - * considerations for a given frequency range. These are the - * &enum nl80211_reg_rule_flags. - * @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory - * rule in KHz. This is not a center of frequency but an actual regulatory - * band edge. - * @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule - * in KHz. This is not a center a frequency but an actual regulatory - * band edge. - * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this - * frequency range, in KHz. - * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain - * for a given frequency range. The value is in mBi (100 * dBi). - * If you don't have one then don't send this. - * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for - * a given frequency range. The value is in mBm (100 * dBm). - * @NL80211_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds. - * If not present or 0 default CAC time will be used. - * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number - * currently defined - * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use - */ -enum nl80211_reg_rule_attr { - __NL80211_REG_RULE_ATTR_INVALID, - NL80211_ATTR_REG_RULE_FLAGS, - - NL80211_ATTR_FREQ_RANGE_START, - NL80211_ATTR_FREQ_RANGE_END, - NL80211_ATTR_FREQ_RANGE_MAX_BW, - - NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN, - NL80211_ATTR_POWER_RULE_MAX_EIRP, - - NL80211_ATTR_DFS_CAC_TIME, - - /* keep last */ - __NL80211_REG_RULE_ATTR_AFTER_LAST, - NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1 -}; - -/** - * enum nl80211_sched_scan_match_attr - scheduled scan match attributes - * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved - * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching, - * only report BSS with matching SSID. - * (This cannot be used together with BSSID.) - * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a - * BSS in scan results. Filtering is turned off if not specified. Note that - * if this attribute is in a match set of its own, then it is treated as - * the default value for all matchsets with an SSID, rather than being a - * matchset of its own without an RSSI filter. This is due to problems with - * how this API was implemented in the past. Also, due to the same problem, - * the only way to create a matchset with only an RSSI filter (with this - * attribute) is if there's only a single matchset with the RSSI attribute. - * @NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI: Flag indicating whether - * %NL80211_SCHED_SCAN_MATCH_ATTR_RSSI to be used as absolute RSSI or - * relative to current bss's RSSI. - * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST: When present the RSSI level for - * BSS-es in the specified band is to be adjusted before doing - * RSSI-based BSS selection. The attribute value is a packed structure - * value as specified by &struct nl80211_bss_select_rssi_adjust. - * @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching - * (this cannot be used together with SSID). - * @NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI: Nested attribute that carries the - * band specific minimum rssi thresholds for the bands defined in - * enum nl80211_band. The minimum rssi threshold value(s32) specific to a - * band shall be encapsulated in attribute with type value equals to one - * of the NL80211_BAND_* defined in enum nl80211_band. For example, the - * minimum rssi threshold value for 2.4GHZ band shall be encapsulated - * within an attribute of type NL80211_BAND_2GHZ. And one or more of such - * attributes will be nested within this attribute. - * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter - * attribute number currently defined - * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use - */ -enum nl80211_sched_scan_match_attr { - __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID, - - NL80211_SCHED_SCAN_MATCH_ATTR_SSID, - NL80211_SCHED_SCAN_MATCH_ATTR_RSSI, - NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI, - NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST, - NL80211_SCHED_SCAN_MATCH_ATTR_BSSID, - NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI, - - /* keep last */ - __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, - NL80211_SCHED_SCAN_MATCH_ATTR_MAX = - __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1 -}; - -/* only for backward compatibility */ -#define NL80211_ATTR_SCHED_SCAN_MATCH_SSID NL80211_SCHED_SCAN_MATCH_ATTR_SSID - -/** - * enum nl80211_reg_rule_flags - regulatory rule flags - * - * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed - * @NL80211_RRF_NO_CCK: CCK modulation not allowed - * @NL80211_RRF_NO_INDOOR: indoor operation not allowed - * @NL80211_RRF_NO_OUTDOOR: outdoor operation not allowed - * @NL80211_RRF_DFS: DFS support is required to be used - * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links - * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links - * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed, - * this includes probe requests or modes of operation that require - * beaconing. - * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated - * base on contiguous rules and wider channels will be allowed to cross - * multiple contiguous/overlapping frequency ranges. - * @NL80211_RRF_IR_CONCURRENT: See %NL80211_FREQUENCY_ATTR_IR_CONCURRENT - * @NL80211_RRF_NO_HT40MINUS: channels can't be used in HT40- operation - * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation - * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed - * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed - * @NL80211_RRF_NO_HE: HE operation not allowed - */ -enum nl80211_reg_rule_flags { - NL80211_RRF_NO_OFDM = 1<<0, - NL80211_RRF_NO_CCK = 1<<1, - NL80211_RRF_NO_INDOOR = 1<<2, - NL80211_RRF_NO_OUTDOOR = 1<<3, - NL80211_RRF_DFS = 1<<4, - NL80211_RRF_PTP_ONLY = 1<<5, - NL80211_RRF_PTMP_ONLY = 1<<6, - NL80211_RRF_NO_IR = 1<<7, - __NL80211_RRF_NO_IBSS = 1<<8, - NL80211_RRF_AUTO_BW = 1<<11, - NL80211_RRF_IR_CONCURRENT = 1<<12, - NL80211_RRF_NO_HT40MINUS = 1<<13, - NL80211_RRF_NO_HT40PLUS = 1<<14, - NL80211_RRF_NO_80MHZ = 1<<15, - NL80211_RRF_NO_160MHZ = 1<<16, - NL80211_RRF_NO_HE = 1<<17, -}; - -#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR -#define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR -#define NL80211_RRF_NO_IR NL80211_RRF_NO_IR -#define NL80211_RRF_NO_HT40 (NL80211_RRF_NO_HT40MINUS |\ - NL80211_RRF_NO_HT40PLUS) -#define NL80211_RRF_GO_CONCURRENT NL80211_RRF_IR_CONCURRENT - -/* For backport compatibility with older userspace */ -#define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS) - -/** - * enum nl80211_dfs_regions - regulatory DFS regions - * - * @NL80211_DFS_UNSET: Country has no DFS master region specified - * @NL80211_DFS_FCC: Country follows DFS master rules from FCC - * @NL80211_DFS_ETSI: Country follows DFS master rules from ETSI - * @NL80211_DFS_JP: Country follows DFS master rules from JP/MKK/Telec - */ -enum nl80211_dfs_regions { - NL80211_DFS_UNSET = 0, - NL80211_DFS_FCC = 1, - NL80211_DFS_ETSI = 2, - NL80211_DFS_JP = 3, -}; - -/** - * enum nl80211_user_reg_hint_type - type of user regulatory hint - * - * @NL80211_USER_REG_HINT_USER: a user sent the hint. This is always - * assumed if the attribute is not set. - * @NL80211_USER_REG_HINT_CELL_BASE: the hint comes from a cellular - * base station. Device drivers that have been tested to work - * properly to support this type of hint can enable these hints - * by setting the NL80211_FEATURE_CELL_BASE_REG_HINTS feature - * capability on the struct wiphy. The wireless core will - * ignore all cell base station hints until at least one device - * present has been registered with the wireless core that - * has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a - * supported feature. - * @NL80211_USER_REG_HINT_INDOOR: a user sent an hint indicating that the - * platform is operating in an indoor environment. - */ -enum nl80211_user_reg_hint_type { - NL80211_USER_REG_HINT_USER = 0, - NL80211_USER_REG_HINT_CELL_BASE = 1, - NL80211_USER_REG_HINT_INDOOR = 2, -}; - -/** - * enum nl80211_survey_info - survey information - * - * These attribute types are used with %NL80211_ATTR_SURVEY_INFO - * when getting information about a survey. - * - * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved - * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel - * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) - * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used - * @NL80211_SURVEY_INFO_TIME: amount of time (in ms) that the radio - * was turned on (on channel or globally) - * @NL80211_SURVEY_INFO_TIME_BUSY: amount of the time the primary - * channel was sensed busy (either due to activity or energy detect) - * @NL80211_SURVEY_INFO_TIME_EXT_BUSY: amount of time the extension - * channel was sensed busy - * @NL80211_SURVEY_INFO_TIME_RX: amount of time the radio spent - * receiving data (on channel or globally) - * @NL80211_SURVEY_INFO_TIME_TX: amount of time the radio spent - * transmitting data (on channel or globally) - * @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan - * (on this channel or globally) - * @NL80211_SURVEY_INFO_PAD: attribute used for padding for 64-bit alignment - * @NL80211_SURVEY_INFO_TIME_BSS_RX: amount of time the radio spent - * receiving frames destined to the local BSS - * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number - * currently defined - * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use - */ -enum nl80211_survey_info { - __NL80211_SURVEY_INFO_INVALID, - NL80211_SURVEY_INFO_FREQUENCY, - NL80211_SURVEY_INFO_NOISE, - NL80211_SURVEY_INFO_IN_USE, - NL80211_SURVEY_INFO_TIME, - NL80211_SURVEY_INFO_TIME_BUSY, - NL80211_SURVEY_INFO_TIME_EXT_BUSY, - NL80211_SURVEY_INFO_TIME_RX, - NL80211_SURVEY_INFO_TIME_TX, - NL80211_SURVEY_INFO_TIME_SCAN, - NL80211_SURVEY_INFO_PAD, - NL80211_SURVEY_INFO_TIME_BSS_RX, - - /* keep last */ - __NL80211_SURVEY_INFO_AFTER_LAST, - NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1 -}; - -/* keep old names for compatibility */ -#define NL80211_SURVEY_INFO_CHANNEL_TIME NL80211_SURVEY_INFO_TIME -#define NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY NL80211_SURVEY_INFO_TIME_BUSY -#define NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY NL80211_SURVEY_INFO_TIME_EXT_BUSY -#define NL80211_SURVEY_INFO_CHANNEL_TIME_RX NL80211_SURVEY_INFO_TIME_RX -#define NL80211_SURVEY_INFO_CHANNEL_TIME_TX NL80211_SURVEY_INFO_TIME_TX - -/** - * enum nl80211_mntr_flags - monitor configuration flags - * - * Monitor configuration flags. - * - * @__NL80211_MNTR_FLAG_INVALID: reserved - * - * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS - * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP - * @NL80211_MNTR_FLAG_CONTROL: pass control frames - * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering - * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing. - * overrides all other flags. - * @NL80211_MNTR_FLAG_ACTIVE: use the configured MAC address - * and ACK incoming unicast packets. - * - * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use - * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag - */ -enum nl80211_mntr_flags { - __NL80211_MNTR_FLAG_INVALID, - NL80211_MNTR_FLAG_FCSFAIL, - NL80211_MNTR_FLAG_PLCPFAIL, - NL80211_MNTR_FLAG_CONTROL, - NL80211_MNTR_FLAG_OTHER_BSS, - NL80211_MNTR_FLAG_COOK_FRAMES, - NL80211_MNTR_FLAG_ACTIVE, - - /* keep last */ - __NL80211_MNTR_FLAG_AFTER_LAST, - NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1 -}; - -/** - * enum nl80211_mesh_power_mode - mesh power save modes - * - * @NL80211_MESH_POWER_UNKNOWN: The mesh power mode of the mesh STA is - * not known or has not been set yet. - * @NL80211_MESH_POWER_ACTIVE: Active mesh power mode. The mesh STA is - * in Awake state all the time. - * @NL80211_MESH_POWER_LIGHT_SLEEP: Light sleep mode. The mesh STA will - * alternate between Active and Doze states, but will wake up for - * neighbor's beacons. - * @NL80211_MESH_POWER_DEEP_SLEEP: Deep sleep mode. The mesh STA will - * alternate between Active and Doze states, but may not wake up - * for neighbor's beacons. - * - * @__NL80211_MESH_POWER_AFTER_LAST - internal use - * @NL80211_MESH_POWER_MAX - highest possible power save level - */ - -enum nl80211_mesh_power_mode { - NL80211_MESH_POWER_UNKNOWN, - NL80211_MESH_POWER_ACTIVE, - NL80211_MESH_POWER_LIGHT_SLEEP, - NL80211_MESH_POWER_DEEP_SLEEP, - - __NL80211_MESH_POWER_AFTER_LAST, - NL80211_MESH_POWER_MAX = __NL80211_MESH_POWER_AFTER_LAST - 1 -}; - -/** - * enum nl80211_meshconf_params - mesh configuration parameters - * - * Mesh configuration parameters. These can be changed while the mesh is - * active. - * - * @__NL80211_MESHCONF_INVALID: internal use - * - * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in - * millisecond units, used by the Peer Link Open message - * - * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in - * millisecond units, used by the peer link management to close a peer link - * - * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in - * millisecond units - * - * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed - * on this mesh interface - * - * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link - * open retries that can be sent to establish a new peer link instance in a - * mesh - * - * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh - * point. - * - * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically open - * peer links when we detect compatible mesh peers. Disabled if - * @NL80211_MESH_SETUP_USERSPACE_MPM or @NL80211_MESH_SETUP_USERSPACE_AMPE are - * set. - * - * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames - * containing a PREQ that an MP can send to a particular destination (path - * target) - * - * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths - * (in milliseconds) - * - * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait - * until giving up on a path discovery (in milliseconds) - * - * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh - * points receiving a PREQ shall consider the forwarding information from - * the root to be valid. (TU = time unit) - * - * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in - * TUs) during which an MP can send only one action frame containing a PREQ - * reference element - * - * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) - * that it takes for an HWMP information element to propagate across the - * mesh - * - * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not - * - * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a - * source mesh point for path selection elements. - * - * @NL80211_MESHCONF_HWMP_RANN_INTERVAL: The interval of time (in TUs) between - * root announcements are transmitted. - * - * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has - * access to a broader network beyond the MBSS. This is done via Root - * Announcement frames. - * - * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in - * TUs) during which a mesh STA can send only one Action frame containing a - * PERR element. - * - * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding - * or forwarding entity (default is TRUE - forwarding entity) - * - * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the - * threshold for average signal strength of candidate station to establish - * a peer link. - * - * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors - * to synchronize to for 11s default synchronization method - * (see 11C.12.2.2) - * - * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode. - * - * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute - * - * @NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT: The time (in TUs) for - * which mesh STAs receiving a proactive PREQ shall consider the forwarding - * information to the root mesh STA to be valid. - * - * @NL80211_MESHCONF_HWMP_ROOT_INTERVAL: The interval of time (in TUs) between - * proactive PREQs are transmitted. - * - * @NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL: The minimum interval of time - * (in TUs) during which a mesh STA can send only one Action frame - * containing a PREQ element for root path confirmation. - * - * @NL80211_MESHCONF_POWER_MODE: Default mesh power mode for new peer links. - * type &enum nl80211_mesh_power_mode (u32) - * - * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs) - * - * @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've - * established peering with for longer than this time (in seconds), then - * remove it from the STA's list of peers. You may set this to 0 to disable - * the removal of the STA. Default is 30 minutes. - * - * @NL80211_MESHCONF_CONNECTED_TO_GATE: If set to true then this mesh STA - * will advertise that it is connected to a gate in the mesh formation - * field. If left unset then the mesh formation field will only - * advertise such if there is an active root mesh path. - * - * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use - */ -enum nl80211_meshconf_params { - __NL80211_MESHCONF_INVALID, - NL80211_MESHCONF_RETRY_TIMEOUT, - NL80211_MESHCONF_CONFIRM_TIMEOUT, - NL80211_MESHCONF_HOLDING_TIMEOUT, - NL80211_MESHCONF_MAX_PEER_LINKS, - NL80211_MESHCONF_MAX_RETRIES, - NL80211_MESHCONF_TTL, - NL80211_MESHCONF_AUTO_OPEN_PLINKS, - NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES, - NL80211_MESHCONF_PATH_REFRESH_TIME, - NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT, - NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT, - NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, - NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, - NL80211_MESHCONF_HWMP_ROOTMODE, - NL80211_MESHCONF_ELEMENT_TTL, - NL80211_MESHCONF_HWMP_RANN_INTERVAL, - NL80211_MESHCONF_GATE_ANNOUNCEMENTS, - NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL, - NL80211_MESHCONF_FORWARDING, - NL80211_MESHCONF_RSSI_THRESHOLD, - NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR, - NL80211_MESHCONF_HT_OPMODE, - NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, - NL80211_MESHCONF_HWMP_ROOT_INTERVAL, - NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, - NL80211_MESHCONF_POWER_MODE, - NL80211_MESHCONF_AWAKE_WINDOW, - NL80211_MESHCONF_PLINK_TIMEOUT, - NL80211_MESHCONF_CONNECTED_TO_GATE, - - /* keep last */ - __NL80211_MESHCONF_ATTR_AFTER_LAST, - NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1 -}; - -/** - * enum nl80211_mesh_setup_params - mesh setup parameters - * - * Mesh setup parameters. These are used to start/join a mesh and cannot be - * changed while the mesh is active. - * - * @__NL80211_MESH_SETUP_INVALID: Internal use - * - * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a - * vendor specific path selection algorithm or disable it to use the - * default HWMP. - * - * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a - * vendor specific path metric or disable it to use the default Airtime - * metric. - * - * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a - * robust security network ie, or a vendor specific information element - * that vendors will use to identify the path selection methods and - * metrics in use. - * - * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication - * daemon will be authenticating mesh candidates. - * - * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication - * daemon will be securing peer link frames. AMPE is a secured version of - * Mesh Peering Management (MPM) and is implemented with the assistance of - * a userspace daemon. When this flag is set, the kernel will send peer - * management frames to a userspace daemon that will implement AMPE - * functionality (security capabilities selection, key confirmation, and - * key management). When the flag is unset (default), the kernel can - * autonomously complete (unsecured) mesh peering without the need of a - * userspace daemon. - * - * @NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC: Enable this option to use a - * vendor specific synchronization method or disable it to use the default - * neighbor offset synchronization - * - * @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will - * implement an MPM which handles peer allocation and state. - * - * @NL80211_MESH_SETUP_AUTH_PROTOCOL: Inform the kernel of the authentication - * method (u8, as defined in IEEE 8.4.2.100.6, e.g. 0x1 for SAE). - * Default is no authentication method required. - * - * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number - * - * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use - */ -enum nl80211_mesh_setup_params { - __NL80211_MESH_SETUP_INVALID, - NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL, - NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC, - NL80211_MESH_SETUP_IE, - NL80211_MESH_SETUP_USERSPACE_AUTH, - NL80211_MESH_SETUP_USERSPACE_AMPE, - NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC, - NL80211_MESH_SETUP_USERSPACE_MPM, - NL80211_MESH_SETUP_AUTH_PROTOCOL, - - /* keep last */ - __NL80211_MESH_SETUP_ATTR_AFTER_LAST, - NL80211_MESH_SETUP_ATTR_MAX = __NL80211_MESH_SETUP_ATTR_AFTER_LAST - 1 -}; - -/** - * enum nl80211_txq_attr - TX queue parameter attributes - * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved - * @NL80211_TXQ_ATTR_AC: AC identifier (NL80211_AC_*) - * @NL80211_TXQ_ATTR_TXOP: Maximum burst time in units of 32 usecs, 0 meaning - * disabled - * @NL80211_TXQ_ATTR_CWMIN: Minimum contention window [a value of the form - * 2^n-1 in the range 1..32767] - * @NL80211_TXQ_ATTR_CWMAX: Maximum contention window [a value of the form - * 2^n-1 in the range 1..32767] - * @NL80211_TXQ_ATTR_AIFS: Arbitration interframe space [0..255] - * @__NL80211_TXQ_ATTR_AFTER_LAST: Internal - * @NL80211_TXQ_ATTR_MAX: Maximum TXQ attribute number - */ -enum nl80211_txq_attr { - __NL80211_TXQ_ATTR_INVALID, - NL80211_TXQ_ATTR_AC, - NL80211_TXQ_ATTR_TXOP, - NL80211_TXQ_ATTR_CWMIN, - NL80211_TXQ_ATTR_CWMAX, - NL80211_TXQ_ATTR_AIFS, - - /* keep last */ - __NL80211_TXQ_ATTR_AFTER_LAST, - NL80211_TXQ_ATTR_MAX = __NL80211_TXQ_ATTR_AFTER_LAST - 1 -}; - -enum nl80211_ac { - NL80211_AC_VO, - NL80211_AC_VI, - NL80211_AC_BE, - NL80211_AC_BK, - NL80211_NUM_ACS -}; - -/* backward compat */ -#define NL80211_TXQ_ATTR_QUEUE NL80211_TXQ_ATTR_AC -#define NL80211_TXQ_Q_VO NL80211_AC_VO -#define NL80211_TXQ_Q_VI NL80211_AC_VI -#define NL80211_TXQ_Q_BE NL80211_AC_BE -#define NL80211_TXQ_Q_BK NL80211_AC_BK - -/** - * enum nl80211_channel_type - channel type - * @NL80211_CHAN_NO_HT: 20 MHz, non-HT channel - * @NL80211_CHAN_HT20: 20 MHz HT channel - * @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel - * below the control channel - * @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel - * above the control channel - */ -enum nl80211_channel_type { - NL80211_CHAN_NO_HT, - NL80211_CHAN_HT20, - NL80211_CHAN_HT40MINUS, - NL80211_CHAN_HT40PLUS -}; - -/** - * enum nl80211_key_mode - Key mode - * - * @NL80211_KEY_RX_TX: (Default) - * Key can be used for Rx and Tx immediately - * - * The following modes can only be selected for unicast keys and when the - * driver supports @NL80211_EXT_FEATURE_EXT_KEY_ID: - * - * @NL80211_KEY_NO_TX: Only allowed in combination with @NL80211_CMD_NEW_KEY: - * Unicast key can only be used for Rx, Tx not allowed, yet - * @NL80211_KEY_SET_TX: Only allowed in combination with @NL80211_CMD_SET_KEY: - * The unicast key identified by idx and mac is cleared for Tx and becomes - * the preferred Tx key for the station. - */ -enum nl80211_key_mode { - NL80211_KEY_RX_TX, - NL80211_KEY_NO_TX, - NL80211_KEY_SET_TX -}; - -/** - * enum nl80211_chan_width - channel width definitions - * - * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH - * attribute. - * - * @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel - * @NL80211_CHAN_WIDTH_20: 20 MHz HT channel - * @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 - * attribute must be provided as well - * @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 - * attribute must be provided as well - * @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 - * and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well - * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 - * attribute must be provided as well - * @NL80211_CHAN_WIDTH_5: 5 MHz OFDM channel - * @NL80211_CHAN_WIDTH_10: 10 MHz OFDM channel - */ -enum nl80211_chan_width { - NL80211_CHAN_WIDTH_20_NOHT, - NL80211_CHAN_WIDTH_20, - NL80211_CHAN_WIDTH_40, - NL80211_CHAN_WIDTH_80, - NL80211_CHAN_WIDTH_80P80, - NL80211_CHAN_WIDTH_160, - NL80211_CHAN_WIDTH_5, - NL80211_CHAN_WIDTH_10, -}; - -/** - * enum nl80211_bss_scan_width - control channel width for a BSS - * - * These values are used with the %NL80211_BSS_CHAN_WIDTH attribute. - * - * @NL80211_BSS_CHAN_WIDTH_20: control channel is 20 MHz wide or compatible - * @NL80211_BSS_CHAN_WIDTH_10: control channel is 10 MHz wide - * @NL80211_BSS_CHAN_WIDTH_5: control channel is 5 MHz wide - */ -enum nl80211_bss_scan_width { - NL80211_BSS_CHAN_WIDTH_20, - NL80211_BSS_CHAN_WIDTH_10, - NL80211_BSS_CHAN_WIDTH_5, -}; - -/** - * enum nl80211_bss - netlink attributes for a BSS - * - * @__NL80211_BSS_INVALID: invalid - * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets) - * @NL80211_BSS_FREQUENCY: frequency in MHz (u32) - * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64) - * (if @NL80211_BSS_PRESP_DATA is present then this is known to be - * from a probe response, otherwise it may be from the same beacon - * that the NL80211_BSS_BEACON_TSF will be from) - * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) - * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16) - * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the - * raw information elements from the probe response/beacon (bin); - * if the %NL80211_BSS_BEACON_IES attribute is present and the data is - * different then the IEs here are from a Probe Response frame; otherwise - * they are from a Beacon frame. - * However, if the driver does not indicate the source of the IEs, these - * IEs may be from either frame subtype. - * If present, the @NL80211_BSS_PRESP_DATA attribute indicates that the - * data here is known to be from a probe response, without any heuristics. - * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon - * in mBm (100 * dBm) (s32) - * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon - * in unspecified units, scaled to 0..100 (u8) - * @NL80211_BSS_STATUS: status, if this BSS is "used" - * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms - * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information - * elements from a Beacon frame (bin); not present if no Beacon frame has - * yet been received - * @NL80211_BSS_CHAN_WIDTH: channel width of the control channel - * (u32, enum nl80211_bss_scan_width) - * @NL80211_BSS_BEACON_TSF: TSF of the last received beacon (u64) - * (not present if no beacon frame has been received yet) - * @NL80211_BSS_PRESP_DATA: the data in @NL80211_BSS_INFORMATION_ELEMENTS and - * @NL80211_BSS_TSF is known to be from a probe response (flag attribute) - * @NL80211_BSS_LAST_SEEN_BOOTTIME: CLOCK_BOOTTIME timestamp when this entry - * was last updated by a received frame. The value is expected to be - * accurate to about 10ms. (u64, nanoseconds) - * @NL80211_BSS_PAD: attribute used for padding for 64-bit alignment - * @NL80211_BSS_PARENT_TSF: the time at the start of reception of the first - * octet of the timestamp field of the last beacon/probe received for - * this BSS. The time is the TSF of the BSS specified by - * @NL80211_BSS_PARENT_BSSID. (u64). - * @NL80211_BSS_PARENT_BSSID: the BSS according to which @NL80211_BSS_PARENT_TSF - * is set. - * @NL80211_BSS_CHAIN_SIGNAL: per-chain signal strength of last BSS update. - * Contains a nested array of signal strength attributes (u8, dBm), - * using the nesting index as the antenna number. - * @NL80211_BSS_FREQUENCY_OFFSET: frequency offset in KHz - * @__NL80211_BSS_AFTER_LAST: internal - * @NL80211_BSS_MAX: highest BSS attribute - */ -enum nl80211_bss { - __NL80211_BSS_INVALID, - NL80211_BSS_BSSID, - NL80211_BSS_FREQUENCY, - NL80211_BSS_TSF, - NL80211_BSS_BEACON_INTERVAL, - NL80211_BSS_CAPABILITY, - NL80211_BSS_INFORMATION_ELEMENTS, - NL80211_BSS_SIGNAL_MBM, - NL80211_BSS_SIGNAL_UNSPEC, - NL80211_BSS_STATUS, - NL80211_BSS_SEEN_MS_AGO, - NL80211_BSS_BEACON_IES, - NL80211_BSS_CHAN_WIDTH, - NL80211_BSS_BEACON_TSF, - NL80211_BSS_PRESP_DATA, - NL80211_BSS_LAST_SEEN_BOOTTIME, - NL80211_BSS_PAD, - NL80211_BSS_PARENT_TSF, - NL80211_BSS_PARENT_BSSID, - NL80211_BSS_CHAIN_SIGNAL, - NL80211_BSS_FREQUENCY_OFFSET, - - /* keep last */ - __NL80211_BSS_AFTER_LAST, - NL80211_BSS_MAX = __NL80211_BSS_AFTER_LAST - 1 -}; - -/** - * enum nl80211_bss_status - BSS "status" - * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS. - * Note that this is no longer used since cfg80211 no longer - * keeps track of whether or not authentication was done with - * a given BSS. - * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS. - * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS. - * - * The BSS status is a BSS attribute in scan dumps, which - * indicates the status the interface has wrt. this BSS. - */ -enum nl80211_bss_status { - NL80211_BSS_STATUS_AUTHENTICATED, - NL80211_BSS_STATUS_ASSOCIATED, - NL80211_BSS_STATUS_IBSS_JOINED, -}; - -/** - * enum nl80211_auth_type - AuthenticationType - * - * @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication - * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) - * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) - * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) - * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals - * @NL80211_AUTHTYPE_FILS_SK: Fast Initial Link Setup shared key - * @NL80211_AUTHTYPE_FILS_SK_PFS: Fast Initial Link Setup shared key with PFS - * @NL80211_AUTHTYPE_FILS_PK: Fast Initial Link Setup public key - * @__NL80211_AUTHTYPE_NUM: internal - * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm - * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by - * trying multiple times); this is invalid in netlink -- leave out - * the attribute for this on CONNECT commands. - */ -enum nl80211_auth_type { - NL80211_AUTHTYPE_OPEN_SYSTEM, - NL80211_AUTHTYPE_SHARED_KEY, - NL80211_AUTHTYPE_FT, - NL80211_AUTHTYPE_NETWORK_EAP, - NL80211_AUTHTYPE_SAE, - NL80211_AUTHTYPE_FILS_SK, - NL80211_AUTHTYPE_FILS_SK_PFS, - NL80211_AUTHTYPE_FILS_PK, - - /* keep last */ - __NL80211_AUTHTYPE_NUM, - NL80211_AUTHTYPE_MAX = __NL80211_AUTHTYPE_NUM - 1, - NL80211_AUTHTYPE_AUTOMATIC -}; - -/** - * enum nl80211_key_type - Key Type - * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key - * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key - * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS) - * @NUM_NL80211_KEYTYPES: number of defined key types - */ -enum nl80211_key_type { - NL80211_KEYTYPE_GROUP, - NL80211_KEYTYPE_PAIRWISE, - NL80211_KEYTYPE_PEERKEY, - - NUM_NL80211_KEYTYPES -}; - -/** - * enum nl80211_mfp - Management frame protection state - * @NL80211_MFP_NO: Management frame protection not used - * @NL80211_MFP_REQUIRED: Management frame protection required - * @NL80211_MFP_OPTIONAL: Management frame protection is optional - */ -enum nl80211_mfp { - NL80211_MFP_NO, - NL80211_MFP_REQUIRED, - NL80211_MFP_OPTIONAL, -}; - -enum nl80211_wpa_versions { - NL80211_WPA_VERSION_1 = 1 << 0, - NL80211_WPA_VERSION_2 = 1 << 1, - NL80211_WPA_VERSION_3 = 1 << 2, -}; - -/** - * enum nl80211_key_default_types - key default types - * @__NL80211_KEY_DEFAULT_TYPE_INVALID: invalid - * @NL80211_KEY_DEFAULT_TYPE_UNICAST: key should be used as default - * unicast key - * @NL80211_KEY_DEFAULT_TYPE_MULTICAST: key should be used as default - * multicast key - * @NUM_NL80211_KEY_DEFAULT_TYPES: number of default types - */ -enum nl80211_key_default_types { - __NL80211_KEY_DEFAULT_TYPE_INVALID, - NL80211_KEY_DEFAULT_TYPE_UNICAST, - NL80211_KEY_DEFAULT_TYPE_MULTICAST, - - NUM_NL80211_KEY_DEFAULT_TYPES -}; - -/** - * enum nl80211_key_attributes - key attributes - * @__NL80211_KEY_INVALID: invalid - * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of - * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC - * keys - * @NL80211_KEY_IDX: key ID (u8, 0-3) - * @NL80211_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11 - * section 7.3.2.25.1, e.g. 0x000FAC04) - * @NL80211_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and - * CCMP keys, each six bytes in little endian - * @NL80211_KEY_DEFAULT: flag indicating default key - * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key - * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not - * specified the default depends on whether a MAC address was - * given with the command using the key or not (u32) - * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags - * attributes, specifying what a key should be set as default as. - * See &enum nl80211_key_default_types. - * @NL80211_KEY_MODE: the mode from enum nl80211_key_mode. - * Defaults to @NL80211_KEY_RX_TX. - * @NL80211_KEY_DEFAULT_BEACON: flag indicating default Beacon frame key - * - * @__NL80211_KEY_AFTER_LAST: internal - * @NL80211_KEY_MAX: highest key attribute - */ -enum nl80211_key_attributes { - __NL80211_KEY_INVALID, - NL80211_KEY_DATA, - NL80211_KEY_IDX, - NL80211_KEY_CIPHER, - NL80211_KEY_SEQ, - NL80211_KEY_DEFAULT, - NL80211_KEY_DEFAULT_MGMT, - NL80211_KEY_TYPE, - NL80211_KEY_DEFAULT_TYPES, - NL80211_KEY_MODE, - NL80211_KEY_DEFAULT_BEACON, - - /* keep last */ - __NL80211_KEY_AFTER_LAST, - NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1 -}; - -/** - * enum nl80211_tx_rate_attributes - TX rate set attributes - * @__NL80211_TXRATE_INVALID: invalid - * @NL80211_TXRATE_LEGACY: Legacy (non-MCS) rates allowed for TX rate selection - * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with - * 1 = 500 kbps) but without the IE length restriction (at most - * %NL80211_MAX_SUPP_RATES in a single array). - * @NL80211_TXRATE_HT: HT (MCS) rates allowed for TX rate selection - * in an array of MCS numbers. - * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection, - * see &struct nl80211_txrate_vht - * @NL80211_TXRATE_GI: configure GI, see &enum nl80211_txrate_gi - * @NL80211_TXRATE_HE: HE rates allowed for TX rate selection, - * see &struct nl80211_txrate_he - * @NL80211_TXRATE_HE_GI: configure HE GI, 0.8us, 1.6us and 3.2us. - * @NL80211_TXRATE_HE_LTF: configure HE LTF, 1XLTF, 2XLTF and 4XLTF. - * @__NL80211_TXRATE_AFTER_LAST: internal - * @NL80211_TXRATE_MAX: highest TX rate attribute - */ -enum nl80211_tx_rate_attributes { - __NL80211_TXRATE_INVALID, - NL80211_TXRATE_LEGACY, - NL80211_TXRATE_HT, - NL80211_TXRATE_VHT, - NL80211_TXRATE_GI, - NL80211_TXRATE_HE, - NL80211_TXRATE_HE_GI, - NL80211_TXRATE_HE_LTF, - - /* keep last */ - __NL80211_TXRATE_AFTER_LAST, - NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1 -}; - -#define NL80211_TXRATE_MCS NL80211_TXRATE_HT -#define NL80211_VHT_NSS_MAX 8 - -/** - * struct nl80211_txrate_vht - VHT MCS/NSS txrate bitmap - * @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.) - */ -struct nl80211_txrate_vht { - __u16 mcs[NL80211_VHT_NSS_MAX]; -}; - -#define NL80211_HE_NSS_MAX 8 -/** - * struct nl80211_txrate_he - HE MCS/NSS txrate bitmap - * @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.) - */ -struct nl80211_txrate_he { - __u16 mcs[NL80211_HE_NSS_MAX]; -}; - -enum nl80211_txrate_gi { - NL80211_TXRATE_DEFAULT_GI, - NL80211_TXRATE_FORCE_SGI, - NL80211_TXRATE_FORCE_LGI, -}; - -/** - * enum nl80211_band - Frequency band - * @NL80211_BAND_2GHZ: 2.4 GHz ISM band - * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz) - * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 69.12 GHz) - * @NL80211_BAND_6GHZ: around 6 GHz band (5.9 - 7.2 GHz) - * @NUM_NL80211_BANDS: number of bands, avoid using this in userspace - * since newer kernel versions may support more bands - */ -enum nl80211_band { - NL80211_BAND_2GHZ, - NL80211_BAND_5GHZ, - NL80211_BAND_60GHZ, - NL80211_BAND_6GHZ, - - NUM_NL80211_BANDS, -}; - -/** - * enum nl80211_ps_state - powersave state - * @NL80211_PS_DISABLED: powersave is disabled - * @NL80211_PS_ENABLED: powersave is enabled - */ -enum nl80211_ps_state { - NL80211_PS_DISABLED, - NL80211_PS_ENABLED, -}; - -/** - * enum nl80211_attr_cqm - connection quality monitor attributes - * @__NL80211_ATTR_CQM_INVALID: invalid - * @NL80211_ATTR_CQM_RSSI_THOLD: RSSI threshold in dBm. This value specifies - * the threshold for the RSSI level at which an event will be sent. Zero - * to disable. Alternatively, if %NL80211_EXT_FEATURE_CQM_RSSI_LIST is - * set, multiple values can be supplied as a low-to-high sorted array of - * threshold values in dBm. Events will be sent when the RSSI value - * crosses any of the thresholds. - * @NL80211_ATTR_CQM_RSSI_HYST: RSSI hysteresis in dBm. This value specifies - * the minimum amount the RSSI level must change after an event before a - * new event may be issued (to reduce effects of RSSI oscillation). - * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event - * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many - * consecutive packets were not acknowledged by the peer - * @NL80211_ATTR_CQM_TXE_RATE: TX error rate in %. Minimum % of TX failures - * during the given %NL80211_ATTR_CQM_TXE_INTVL before an - * %NL80211_CMD_NOTIFY_CQM with reported %NL80211_ATTR_CQM_TXE_RATE and - * %NL80211_ATTR_CQM_TXE_PKTS is generated. - * @NL80211_ATTR_CQM_TXE_PKTS: number of attempted packets in a given - * %NL80211_ATTR_CQM_TXE_INTVL before %NL80211_ATTR_CQM_TXE_RATE is - * checked. - * @NL80211_ATTR_CQM_TXE_INTVL: interval in seconds. Specifies the periodic - * interval in which %NL80211_ATTR_CQM_TXE_PKTS and - * %NL80211_ATTR_CQM_TXE_RATE must be satisfied before generating an - * %NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting. - * @NL80211_ATTR_CQM_BEACON_LOSS_EVENT: flag attribute that's set in a beacon - * loss event - * @NL80211_ATTR_CQM_RSSI_LEVEL: the RSSI value in dBm that triggered the - * RSSI threshold event. - * @__NL80211_ATTR_CQM_AFTER_LAST: internal - * @NL80211_ATTR_CQM_MAX: highest key attribute - */ -enum nl80211_attr_cqm { - __NL80211_ATTR_CQM_INVALID, - NL80211_ATTR_CQM_RSSI_THOLD, - NL80211_ATTR_CQM_RSSI_HYST, - NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, - NL80211_ATTR_CQM_PKT_LOSS_EVENT, - NL80211_ATTR_CQM_TXE_RATE, - NL80211_ATTR_CQM_TXE_PKTS, - NL80211_ATTR_CQM_TXE_INTVL, - NL80211_ATTR_CQM_BEACON_LOSS_EVENT, - NL80211_ATTR_CQM_RSSI_LEVEL, - - /* keep last */ - __NL80211_ATTR_CQM_AFTER_LAST, - NL80211_ATTR_CQM_MAX = __NL80211_ATTR_CQM_AFTER_LAST - 1 -}; - -/** - * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event - * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: The RSSI level is lower than the - * configured threshold - * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the - * configured threshold - * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: (reserved, never sent) - */ -enum nl80211_cqm_rssi_threshold_event { - NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, - NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, - NL80211_CQM_RSSI_BEACON_LOSS_EVENT, -}; - - -/** - * enum nl80211_tx_power_setting - TX power adjustment - * @NL80211_TX_POWER_AUTOMATIC: automatically determine transmit power - * @NL80211_TX_POWER_LIMITED: limit TX power by the mBm parameter - * @NL80211_TX_POWER_FIXED: fix TX power to the mBm parameter - */ -enum nl80211_tx_power_setting { - NL80211_TX_POWER_AUTOMATIC, - NL80211_TX_POWER_LIMITED, - NL80211_TX_POWER_FIXED, -}; - -/** - * enum nl80211_tid_config - TID config state - * @NL80211_TID_CONFIG_ENABLE: Enable config for the TID - * @NL80211_TID_CONFIG_DISABLE: Disable config for the TID - */ -enum nl80211_tid_config { - NL80211_TID_CONFIG_ENABLE, - NL80211_TID_CONFIG_DISABLE, -}; - -/* enum nl80211_tx_rate_setting - TX rate configuration type - * @NL80211_TX_RATE_AUTOMATIC: automatically determine TX rate - * @NL80211_TX_RATE_LIMITED: limit the TX rate by the TX rate parameter - * @NL80211_TX_RATE_FIXED: fix TX rate to the TX rate parameter - */ -enum nl80211_tx_rate_setting { - NL80211_TX_RATE_AUTOMATIC, - NL80211_TX_RATE_LIMITED, - NL80211_TX_RATE_FIXED, -}; - -/* enum nl80211_tid_config_attr - TID specific configuration. - * @NL80211_TID_CONFIG_ATTR_PAD: pad attribute for 64-bit values - * @NL80211_TID_CONFIG_ATTR_VIF_SUPP: a bitmap (u64) of attributes supported - * for per-vif configuration; doesn't list the ones that are generic - * (%NL80211_TID_CONFIG_ATTR_TIDS, %NL80211_TID_CONFIG_ATTR_OVERRIDE). - * @NL80211_TID_CONFIG_ATTR_PEER_SUPP: same as the previous per-vif one, but - * per peer instead. - * @NL80211_TID_CONFIG_ATTR_OVERRIDE: flag attribue, if set indicates - * that the new configuration overrides all previous peer - * configurations, otherwise previous peer specific configurations - * should be left untouched. - * @NL80211_TID_CONFIG_ATTR_TIDS: a bitmask value of TIDs (bit 0 to 7) - * Its type is u16. - * @NL80211_TID_CONFIG_ATTR_NOACK: Configure ack policy for the TID. - * specified in %NL80211_TID_CONFIG_ATTR_TID. see %enum nl80211_tid_config. - * Its type is u8. - * @NL80211_TID_CONFIG_ATTR_RETRY_SHORT: Number of retries used with data frame - * transmission, user-space sets this configuration in - * &NL80211_CMD_SET_TID_CONFIG. It is u8 type, min value is 1 and - * the max value is advertised by the driver in this attribute on - * output in wiphy capabilities. - * @NL80211_TID_CONFIG_ATTR_RETRY_LONG: Number of retries used with data frame - * transmission, user-space sets this configuration in - * &NL80211_CMD_SET_TID_CONFIG. Its type is u8, min value is 1 and - * the max value is advertised by the driver in this attribute on - * output in wiphy capabilities. - * @NL80211_TID_CONFIG_ATTR_AMPDU_CTRL: Enable/Disable MPDU aggregation - * for the TIDs specified in %NL80211_TID_CONFIG_ATTR_TIDS. - * Its type is u8, using the values from &nl80211_tid_config. - * @NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL: Enable/Disable RTS_CTS for the TIDs - * specified in %NL80211_TID_CONFIG_ATTR_TIDS. It is u8 type, using - * the values from &nl80211_tid_config. - * @NL80211_TID_CONFIG_ATTR_AMSDU_CTRL: Enable/Disable MSDU aggregation - * for the TIDs specified in %NL80211_TID_CONFIG_ATTR_TIDS. - * Its type is u8, using the values from &nl80211_tid_config. - * @NL80211_TID_CONFIG_ATTR_TX_RATE_TYPE: This attribute will be useful - * to notfiy the driver that what type of txrate should be used - * for the TIDs specified in %NL80211_TID_CONFIG_ATTR_TIDS. using - * the values form &nl80211_tx_rate_setting. - * @NL80211_TID_CONFIG_ATTR_TX_RATE: Data frame TX rate mask should be applied - * with the parameters passed through %NL80211_ATTR_TX_RATES. - * configuration is applied to the data frame for the tid to that connected - * station. - */ -enum nl80211_tid_config_attr { - __NL80211_TID_CONFIG_ATTR_INVALID, - NL80211_TID_CONFIG_ATTR_PAD, - NL80211_TID_CONFIG_ATTR_VIF_SUPP, - NL80211_TID_CONFIG_ATTR_PEER_SUPP, - NL80211_TID_CONFIG_ATTR_OVERRIDE, - NL80211_TID_CONFIG_ATTR_TIDS, - NL80211_TID_CONFIG_ATTR_NOACK, - NL80211_TID_CONFIG_ATTR_RETRY_SHORT, - NL80211_TID_CONFIG_ATTR_RETRY_LONG, - NL80211_TID_CONFIG_ATTR_AMPDU_CTRL, - NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL, - NL80211_TID_CONFIG_ATTR_AMSDU_CTRL, - NL80211_TID_CONFIG_ATTR_TX_RATE_TYPE, - NL80211_TID_CONFIG_ATTR_TX_RATE, - - /* keep last */ - __NL80211_TID_CONFIG_ATTR_AFTER_LAST, - NL80211_TID_CONFIG_ATTR_MAX = __NL80211_TID_CONFIG_ATTR_AFTER_LAST - 1 -}; - -/** - * enum nl80211_packet_pattern_attr - packet pattern attribute - * @__NL80211_PKTPAT_INVALID: invalid number for nested attribute - * @NL80211_PKTPAT_PATTERN: the pattern, values where the mask has - * a zero bit are ignored - * @NL80211_PKTPAT_MASK: pattern mask, must be long enough to have - * a bit for each byte in the pattern. The lowest-order bit corresponds - * to the first byte of the pattern, but the bytes of the pattern are - * in a little-endian-like format, i.e. the 9th byte of the pattern - * corresponds to the lowest-order bit in the second byte of the mask. - * For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where - * xx indicates "don't care") would be represented by a pattern of - * twelve zero bytes, and a mask of "0xed,0x01". - * Note that the pattern matching is done as though frames were not - * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked - * first (including SNAP header unpacking) and then matched. - * @NL80211_PKTPAT_OFFSET: packet offset, pattern is matched after - * these fixed number of bytes of received packet - * @NUM_NL80211_PKTPAT: number of attributes - * @MAX_NL80211_PKTPAT: max attribute number - */ -enum nl80211_packet_pattern_attr { - __NL80211_PKTPAT_INVALID, - NL80211_PKTPAT_MASK, - NL80211_PKTPAT_PATTERN, - NL80211_PKTPAT_OFFSET, - - NUM_NL80211_PKTPAT, - MAX_NL80211_PKTPAT = NUM_NL80211_PKTPAT - 1, -}; - -/** - * struct nl80211_pattern_support - packet pattern support information - * @max_patterns: maximum number of patterns supported - * @min_pattern_len: minimum length of each pattern - * @max_pattern_len: maximum length of each pattern - * @max_pkt_offset: maximum Rx packet offset - * - * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when - * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED or in - * %NL80211_ATTR_COALESCE_RULE_PKT_PATTERN when that is part of - * %NL80211_ATTR_COALESCE_RULE in the capability information given - * by the kernel to userspace. - */ -struct nl80211_pattern_support { - __u32 max_patterns; - __u32 min_pattern_len; - __u32 max_pattern_len; - __u32 max_pkt_offset; -} __attribute__((packed)); - -/* only for backward compatibility */ -#define __NL80211_WOWLAN_PKTPAT_INVALID __NL80211_PKTPAT_INVALID -#define NL80211_WOWLAN_PKTPAT_MASK NL80211_PKTPAT_MASK -#define NL80211_WOWLAN_PKTPAT_PATTERN NL80211_PKTPAT_PATTERN -#define NL80211_WOWLAN_PKTPAT_OFFSET NL80211_PKTPAT_OFFSET -#define NUM_NL80211_WOWLAN_PKTPAT NUM_NL80211_PKTPAT -#define MAX_NL80211_WOWLAN_PKTPAT MAX_NL80211_PKTPAT -#define nl80211_wowlan_pattern_support nl80211_pattern_support - -/** - * enum nl80211_wowlan_triggers - WoWLAN trigger definitions - * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes - * @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put - * the chip into a special state -- works best with chips that have - * support for low-power operation already (flag) - * Note that this mode is incompatible with all of the others, if - * any others are even supported by the device. - * @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect - * is detected is implementation-specific (flag) - * @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed - * by 16 repetitions of MAC addr, anywhere in payload) (flag) - * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns - * which are passed in an array of nested attributes, each nested attribute - * defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern. - * Each pattern defines a wakeup packet. Packet offset is associated with - * each pattern which is used while matching the pattern. The matching is - * done on the MSDU, i.e. as though the packet was an 802.3 packet, so the - * pattern matching is done after the packet is converted to the MSDU. - * - * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute - * carrying a &struct nl80211_pattern_support. - * - * When reporting wakeup. it is a u32 attribute containing the 0-based - * index of the pattern that caused the wakeup, in the patterns passed - * to the kernel when configuring. - * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be - * used when setting, used only to indicate that GTK rekeying is supported - * by the device (flag) - * @NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE: wake up on GTK rekey failure (if - * done by the device) (flag) - * @NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST: wake up on EAP Identity Request - * packet (flag) - * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag) - * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released - * (on devices that have rfkill in the device) (flag) - * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211: For wakeup reporting only, contains - * the 802.11 packet that caused the wakeup, e.g. a deauth frame. The frame - * may be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN - * attribute contains the original length. - * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN: Original length of the 802.11 - * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211 - * attribute if the packet was truncated somewhere. - * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023: For wakeup reporting only, contains the - * 802.11 packet that caused the wakeup, e.g. a magic packet. The frame may - * be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN attribute - * contains the original length. - * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN: Original length of the 802.3 - * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023 - * attribute if the packet was truncated somewhere. - * @NL80211_WOWLAN_TRIG_TCP_CONNECTION: TCP connection wake, see DOC section - * "TCP connection wakeup" for more details. This is a nested attribute - * containing the exact information for establishing and keeping alive - * the TCP connection. - * @NL80211_WOWLAN_TRIG_TCP_WAKEUP_MATCH: For wakeup reporting only, the - * wakeup packet was received on the TCP connection - * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST: For wakeup reporting only, the - * TCP connection was lost or failed to be established - * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS: For wakeup reporting only, - * the TCP connection ran out of tokens to use for data to send to the - * service - * @NL80211_WOWLAN_TRIG_NET_DETECT: wake up when a configured network - * is detected. This is a nested attribute that contains the - * same attributes used with @NL80211_CMD_START_SCHED_SCAN. It - * specifies how the scan is performed (e.g. the interval, the - * channels to scan and the initial delay) as well as the scan - * results that will trigger a wake (i.e. the matchsets). This - * attribute is also sent in a response to - * @NL80211_CMD_GET_WIPHY, indicating the number of match sets - * supported by the driver (u32). - * @NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS: nested attribute - * containing an array with information about what triggered the - * wake up. If no elements are present in the array, it means - * that the information is not available. If more than one - * element is present, it means that more than one match - * occurred. - * Each element in the array is a nested attribute that contains - * one optional %NL80211_ATTR_SSID attribute and one optional - * %NL80211_ATTR_SCAN_FREQUENCIES attribute. At least one of - * these attributes must be present. If - * %NL80211_ATTR_SCAN_FREQUENCIES contains more than one - * frequency, it means that the match occurred in more than one - * channel. - * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers - * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number - * - * These nested attributes are used to configure the wakeup triggers and - * to report the wakeup reason(s). - */ -enum nl80211_wowlan_triggers { - __NL80211_WOWLAN_TRIG_INVALID, - NL80211_WOWLAN_TRIG_ANY, - NL80211_WOWLAN_TRIG_DISCONNECT, - NL80211_WOWLAN_TRIG_MAGIC_PKT, - NL80211_WOWLAN_TRIG_PKT_PATTERN, - NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED, - NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE, - NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST, - NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE, - NL80211_WOWLAN_TRIG_RFKILL_RELEASE, - NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211, - NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN, - NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023, - NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN, - NL80211_WOWLAN_TRIG_TCP_CONNECTION, - NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH, - NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST, - NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS, - NL80211_WOWLAN_TRIG_NET_DETECT, - NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS, - - /* keep last */ - NUM_NL80211_WOWLAN_TRIG, - MAX_NL80211_WOWLAN_TRIG = NUM_NL80211_WOWLAN_TRIG - 1 -}; - -/** - * DOC: TCP connection wakeup - * - * Some devices can establish a TCP connection in order to be woken up by a - * packet coming in from outside their network segment, or behind NAT. If - * configured, the device will establish a TCP connection to the given - * service, and periodically send data to that service. The first data - * packet is usually transmitted after SYN/ACK, also ACKing the SYN/ACK. - * The data packets can optionally include a (little endian) sequence - * number (in the TCP payload!) that is generated by the device, and, also - * optionally, a token from a list of tokens. This serves as a keep-alive - * with the service, and for NATed connections, etc. - * - * During this keep-alive period, the server doesn't send any data to the - * client. When receiving data, it is compared against the wakeup pattern - * (and mask) and if it matches, the host is woken up. Similarly, if the - * connection breaks or cannot be established to start with, the host is - * also woken up. - * - * Developer's note: ARP offload is required for this, otherwise TCP - * response packets might not go through correctly. - */ - -/** - * struct nl80211_wowlan_tcp_data_seq - WoWLAN TCP data sequence - * @start: starting value - * @offset: offset of sequence number in packet - * @len: length of the sequence value to write, 1 through 4 - * - * Note: don't confuse with the TCP sequence number(s), this is for the - * keepalive packet payload. The actual value is written into the packet - * in little endian. - */ -struct nl80211_wowlan_tcp_data_seq { - __u32 start, offset, len; -}; - -/** - * struct nl80211_wowlan_tcp_data_token - WoWLAN TCP data token config - * @offset: offset of token in packet - * @len: length of each token - * @token_stream: stream of data to be used for the tokens, the length must - * be a multiple of @len for this to make sense - */ -struct nl80211_wowlan_tcp_data_token { - __u32 offset, len; - __u8 token_stream[]; -}; - -/** - * struct nl80211_wowlan_tcp_data_token_feature - data token features - * @min_len: minimum token length - * @max_len: maximum token length - * @bufsize: total available token buffer size (max size of @token_stream) - */ -struct nl80211_wowlan_tcp_data_token_feature { - __u32 min_len, max_len, bufsize; -}; - -/** - * enum nl80211_wowlan_tcp_attrs - WoWLAN TCP connection parameters - * @__NL80211_WOWLAN_TCP_INVALID: invalid number for nested attributes - * @NL80211_WOWLAN_TCP_SRC_IPV4: source IPv4 address (in network byte order) - * @NL80211_WOWLAN_TCP_DST_IPV4: destination IPv4 address - * (in network byte order) - * @NL80211_WOWLAN_TCP_DST_MAC: destination MAC address, this is given because - * route lookup when configured might be invalid by the time we suspend, - * and doing a route lookup when suspending is no longer possible as it - * might require ARP querying. - * @NL80211_WOWLAN_TCP_SRC_PORT: source port (u16); optional, if not given a - * socket and port will be allocated - * @NL80211_WOWLAN_TCP_DST_PORT: destination port (u16) - * @NL80211_WOWLAN_TCP_DATA_PAYLOAD: data packet payload, at least one byte. - * For feature advertising, a u32 attribute holding the maximum length - * of the data payload. - * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ: data packet sequence configuration - * (if desired), a &struct nl80211_wowlan_tcp_data_seq. For feature - * advertising it is just a flag - * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN: data packet token configuration, - * see &struct nl80211_wowlan_tcp_data_token and for advertising see - * &struct nl80211_wowlan_tcp_data_token_feature. - * @NL80211_WOWLAN_TCP_DATA_INTERVAL: data interval in seconds, maximum - * interval in feature advertising (u32) - * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a - * u32 attribute holding the maximum length - * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for - * feature advertising. The mask works like @NL80211_PKTPAT_MASK - * but on the TCP payload only. - * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes - * @MAX_NL80211_WOWLAN_TCP: highest attribute number - */ -enum nl80211_wowlan_tcp_attrs { - __NL80211_WOWLAN_TCP_INVALID, - NL80211_WOWLAN_TCP_SRC_IPV4, - NL80211_WOWLAN_TCP_DST_IPV4, - NL80211_WOWLAN_TCP_DST_MAC, - NL80211_WOWLAN_TCP_SRC_PORT, - NL80211_WOWLAN_TCP_DST_PORT, - NL80211_WOWLAN_TCP_DATA_PAYLOAD, - NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ, - NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN, - NL80211_WOWLAN_TCP_DATA_INTERVAL, - NL80211_WOWLAN_TCP_WAKE_PAYLOAD, - NL80211_WOWLAN_TCP_WAKE_MASK, - - /* keep last */ - NUM_NL80211_WOWLAN_TCP, - MAX_NL80211_WOWLAN_TCP = NUM_NL80211_WOWLAN_TCP - 1 -}; - -/** - * struct nl80211_coalesce_rule_support - coalesce rule support information - * @max_rules: maximum number of rules supported - * @pat: packet pattern support information - * @max_delay: maximum supported coalescing delay in msecs - * - * This struct is carried in %NL80211_ATTR_COALESCE_RULE in the - * capability information given by the kernel to userspace. - */ -struct nl80211_coalesce_rule_support { - __u32 max_rules; - struct nl80211_pattern_support pat; - __u32 max_delay; -} __attribute__((packed)); - -/** - * enum nl80211_attr_coalesce_rule - coalesce rule attribute - * @__NL80211_COALESCE_RULE_INVALID: invalid number for nested attribute - * @NL80211_ATTR_COALESCE_RULE_DELAY: delay in msecs used for packet coalescing - * @NL80211_ATTR_COALESCE_RULE_CONDITION: condition for packet coalescence, - * see &enum nl80211_coalesce_condition. - * @NL80211_ATTR_COALESCE_RULE_PKT_PATTERN: packet offset, pattern is matched - * after these fixed number of bytes of received packet - * @NUM_NL80211_ATTR_COALESCE_RULE: number of attributes - * @NL80211_ATTR_COALESCE_RULE_MAX: max attribute number - */ -enum nl80211_attr_coalesce_rule { - __NL80211_COALESCE_RULE_INVALID, - NL80211_ATTR_COALESCE_RULE_DELAY, - NL80211_ATTR_COALESCE_RULE_CONDITION, - NL80211_ATTR_COALESCE_RULE_PKT_PATTERN, - - /* keep last */ - NUM_NL80211_ATTR_COALESCE_RULE, - NL80211_ATTR_COALESCE_RULE_MAX = NUM_NL80211_ATTR_COALESCE_RULE - 1 -}; - -/** - * enum nl80211_coalesce_condition - coalesce rule conditions - * @NL80211_COALESCE_CONDITION_MATCH: coalaesce Rx packets when patterns - * in a rule are matched. - * @NL80211_COALESCE_CONDITION_NO_MATCH: coalesce Rx packets when patterns - * in a rule are not matched. - */ -enum nl80211_coalesce_condition { - NL80211_COALESCE_CONDITION_MATCH, - NL80211_COALESCE_CONDITION_NO_MATCH -}; - -/** - * enum nl80211_iface_limit_attrs - limit attributes - * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) - * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that - * can be chosen from this set of interface types (u32) - * @NL80211_IFACE_LIMIT_TYPES: nested attribute containing a - * flag attribute for each interface type in this set - * @NUM_NL80211_IFACE_LIMIT: number of attributes - * @MAX_NL80211_IFACE_LIMIT: highest attribute number - */ -enum nl80211_iface_limit_attrs { - NL80211_IFACE_LIMIT_UNSPEC, - NL80211_IFACE_LIMIT_MAX, - NL80211_IFACE_LIMIT_TYPES, - - /* keep last */ - NUM_NL80211_IFACE_LIMIT, - MAX_NL80211_IFACE_LIMIT = NUM_NL80211_IFACE_LIMIT - 1 -}; - -/** - * enum nl80211_if_combination_attrs -- interface combination attributes - * - * @NL80211_IFACE_COMB_UNSPEC: (reserved) - * @NL80211_IFACE_COMB_LIMITS: Nested attributes containing the limits - * for given interface types, see &enum nl80211_iface_limit_attrs. - * @NL80211_IFACE_COMB_MAXNUM: u32 attribute giving the total number of - * interfaces that can be created in this group. This number doesn't - * apply to interfaces purely managed in software, which are listed - * in a separate attribute %NL80211_ATTR_INTERFACES_SOFTWARE. - * @NL80211_IFACE_COMB_STA_AP_BI_MATCH: flag attribute specifying that - * beacon intervals within this group must be all the same even for - * infrastructure and AP/GO combinations, i.e. the GO(s) must adopt - * the infrastructure network's beacon interval. - * @NL80211_IFACE_COMB_NUM_CHANNELS: u32 attribute specifying how many - * different channels may be used within this group. - * @NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS: u32 attribute containing the bitmap - * of supported channel widths for radar detection. - * @NL80211_IFACE_COMB_RADAR_DETECT_REGIONS: u32 attribute containing the bitmap - * of supported regulatory regions for radar detection. - * @NL80211_IFACE_COMB_BI_MIN_GCD: u32 attribute specifying the minimum GCD of - * different beacon intervals supported by all the interface combinations - * in this group (if not present, all beacon intervals be identical). - * @NUM_NL80211_IFACE_COMB: number of attributes - * @MAX_NL80211_IFACE_COMB: highest attribute number - * - * Examples: - * limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2 - * => allows an AP and a STA that must match BIs - * - * numbers = [ #{AP, P2P-GO} <= 8 ], BI min gcd, channels = 1, max = 8, - * => allows 8 of AP/GO that can have BI gcd >= min gcd - * - * numbers = [ #{STA} <= 2 ], channels = 2, max = 2 - * => allows two STAs on different channels - * - * numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4 - * => allows a STA plus three P2P interfaces - * - * The list of these four possibilities could completely be contained - * within the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute to indicate - * that any of these groups must match. - * - * "Combinations" of just a single interface will not be listed here, - * a single interface of any valid interface type is assumed to always - * be possible by itself. This means that implicitly, for each valid - * interface type, the following group always exists: - * numbers = [ #{} <= 1 ], channels = 1, max = 1 - */ -enum nl80211_if_combination_attrs { - NL80211_IFACE_COMB_UNSPEC, - NL80211_IFACE_COMB_LIMITS, - NL80211_IFACE_COMB_MAXNUM, - NL80211_IFACE_COMB_STA_AP_BI_MATCH, - NL80211_IFACE_COMB_NUM_CHANNELS, - NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, - NL80211_IFACE_COMB_RADAR_DETECT_REGIONS, - NL80211_IFACE_COMB_BI_MIN_GCD, - - /* keep last */ - NUM_NL80211_IFACE_COMB, - MAX_NL80211_IFACE_COMB = NUM_NL80211_IFACE_COMB - 1 -}; - - -/** - * enum nl80211_plink_state - state of a mesh peer link finite state machine - * - * @NL80211_PLINK_LISTEN: initial state, considered the implicit - * state of non existent mesh peer links - * @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to - * this mesh peer - * @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received - * from this mesh peer - * @NL80211_PLINK_CNF_RCVD: mesh plink confirm frame has been - * received from this mesh peer - * @NL80211_PLINK_ESTAB: mesh peer link is established - * @NL80211_PLINK_HOLDING: mesh peer link is being closed or cancelled - * @NL80211_PLINK_BLOCKED: all frames transmitted from this mesh - * plink are discarded - * @NUM_NL80211_PLINK_STATES: number of peer link states - * @MAX_NL80211_PLINK_STATES: highest numerical value of plink states - */ -enum nl80211_plink_state { - NL80211_PLINK_LISTEN, - NL80211_PLINK_OPN_SNT, - NL80211_PLINK_OPN_RCVD, - NL80211_PLINK_CNF_RCVD, - NL80211_PLINK_ESTAB, - NL80211_PLINK_HOLDING, - NL80211_PLINK_BLOCKED, - - /* keep last */ - NUM_NL80211_PLINK_STATES, - MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1 -}; - -/** - * enum nl80211_plink_action - actions to perform in mesh peers - * - * @NL80211_PLINK_ACTION_NO_ACTION: perform no action - * @NL80211_PLINK_ACTION_OPEN: start mesh peer link establishment - * @NL80211_PLINK_ACTION_BLOCK: block traffic from this mesh peer - * @NUM_NL80211_PLINK_ACTIONS: number of possible actions - */ -enum plink_actions { - NL80211_PLINK_ACTION_NO_ACTION, - NL80211_PLINK_ACTION_OPEN, - NL80211_PLINK_ACTION_BLOCK, - - NUM_NL80211_PLINK_ACTIONS, -}; - - -#define NL80211_KCK_LEN 16 -#define NL80211_KEK_LEN 16 -#define NL80211_KCK_EXT_LEN 24 -#define NL80211_KEK_EXT_LEN 32 -#define NL80211_REPLAY_CTR_LEN 8 - -/** - * enum nl80211_rekey_data - attributes for GTK rekey offload - * @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes - * @NL80211_REKEY_DATA_KEK: key encryption key (binary) - * @NL80211_REKEY_DATA_KCK: key confirmation key (binary) - * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary) - * @NL80211_REKEY_DATA_AKM: AKM data (OUI, suite type) - * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal) - * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal) - */ -enum nl80211_rekey_data { - __NL80211_REKEY_DATA_INVALID, - NL80211_REKEY_DATA_KEK, - NL80211_REKEY_DATA_KCK, - NL80211_REKEY_DATA_REPLAY_CTR, - NL80211_REKEY_DATA_AKM, - - /* keep last */ - NUM_NL80211_REKEY_DATA, - MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1 -}; - -/** - * enum nl80211_hidden_ssid - values for %NL80211_ATTR_HIDDEN_SSID - * @NL80211_HIDDEN_SSID_NOT_IN_USE: do not hide SSID (i.e., broadcast it in - * Beacon frames) - * @NL80211_HIDDEN_SSID_ZERO_LEN: hide SSID by using zero-length SSID element - * in Beacon frames - * @NL80211_HIDDEN_SSID_ZERO_CONTENTS: hide SSID by using correct length of SSID - * element in Beacon frames but zero out each byte in the SSID - */ -enum nl80211_hidden_ssid { - NL80211_HIDDEN_SSID_NOT_IN_USE, - NL80211_HIDDEN_SSID_ZERO_LEN, - NL80211_HIDDEN_SSID_ZERO_CONTENTS -}; - -/** - * enum nl80211_sta_wme_attr - station WME attributes - * @__NL80211_STA_WME_INVALID: invalid number for nested attribute - * @NL80211_STA_WME_UAPSD_QUEUES: bitmap of uapsd queues. the format - * is the same as the AC bitmap in the QoS info field. - * @NL80211_STA_WME_MAX_SP: max service period. the format is the same - * as the MAX_SP field in the QoS info field (but already shifted down). - * @__NL80211_STA_WME_AFTER_LAST: internal - * @NL80211_STA_WME_MAX: highest station WME attribute - */ -enum nl80211_sta_wme_attr { - __NL80211_STA_WME_INVALID, - NL80211_STA_WME_UAPSD_QUEUES, - NL80211_STA_WME_MAX_SP, - - /* keep last */ - __NL80211_STA_WME_AFTER_LAST, - NL80211_STA_WME_MAX = __NL80211_STA_WME_AFTER_LAST - 1 -}; - -/** - * enum nl80211_pmksa_candidate_attr - attributes for PMKSA caching candidates - * @__NL80211_PMKSA_CANDIDATE_INVALID: invalid number for nested attributes - * @NL80211_PMKSA_CANDIDATE_INDEX: candidate index (u32; the smaller, the higher - * priority) - * @NL80211_PMKSA_CANDIDATE_BSSID: candidate BSSID (6 octets) - * @NL80211_PMKSA_CANDIDATE_PREAUTH: RSN pre-authentication supported (flag) - * @NUM_NL80211_PMKSA_CANDIDATE: number of PMKSA caching candidate attributes - * (internal) - * @MAX_NL80211_PMKSA_CANDIDATE: highest PMKSA caching candidate attribute - * (internal) - */ -enum nl80211_pmksa_candidate_attr { - __NL80211_PMKSA_CANDIDATE_INVALID, - NL80211_PMKSA_CANDIDATE_INDEX, - NL80211_PMKSA_CANDIDATE_BSSID, - NL80211_PMKSA_CANDIDATE_PREAUTH, - - /* keep last */ - NUM_NL80211_PMKSA_CANDIDATE, - MAX_NL80211_PMKSA_CANDIDATE = NUM_NL80211_PMKSA_CANDIDATE - 1 -}; - -/** - * enum nl80211_tdls_operation - values for %NL80211_ATTR_TDLS_OPERATION - * @NL80211_TDLS_DISCOVERY_REQ: Send a TDLS discovery request - * @NL80211_TDLS_SETUP: Setup TDLS link - * @NL80211_TDLS_TEARDOWN: Teardown a TDLS link which is already established - * @NL80211_TDLS_ENABLE_LINK: Enable TDLS link - * @NL80211_TDLS_DISABLE_LINK: Disable TDLS link - */ -enum nl80211_tdls_operation { - NL80211_TDLS_DISCOVERY_REQ, - NL80211_TDLS_SETUP, - NL80211_TDLS_TEARDOWN, - NL80211_TDLS_ENABLE_LINK, - NL80211_TDLS_DISABLE_LINK, -}; - -/* - * enum nl80211_ap_sme_features - device-integrated AP features - * Reserved for future use, no bits are defined in - * NL80211_ATTR_DEVICE_AP_SME yet. -enum nl80211_ap_sme_features { -}; - */ - -/** - * enum nl80211_feature_flags - device/driver features - * @NL80211_FEATURE_SK_TX_STATUS: This driver supports reflecting back - * TX status to the socket error queue when requested with the - * socket option. - * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates. - * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up - * the connected inactive stations in AP mode. - * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested - * to work properly to suppport receiving regulatory hints from - * cellular base stations. - * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: (no longer available, only - * here to reserve the value for API/ABI compatibility) - * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of - * equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station - * mode - * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan - * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported - * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif - * @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting - * @NL80211_FEATURE_NEED_OBSS_SCAN: The driver expects userspace to perform - * OBSS scans and generate 20/40 BSS coex reports. This flag is used only - * for drivers implementing the CONNECT API, for AUTH/ASSOC it is implied. - * @NL80211_FEATURE_P2P_GO_CTWIN: P2P GO implementation supports CT Window - * setting - * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic - * powersave - * @NL80211_FEATURE_FULL_AP_CLIENT_STATE: The driver supports full state - * transitions for AP clients. Without this flag (and if the driver - * doesn't have the AP SME in the device) the driver supports adding - * stations only when they're associated and adds them in associated - * state (to later be transitioned into authorized), with this flag - * they should be added before even sending the authentication reply - * and then transitioned into authenticated, associated and authorized - * states using station flags. - * Note that even for drivers that support this, the default is to add - * stations in authenticated/associated state, so to add unauthenticated - * stations the authenticated/associated bits have to be set in the mask. - * @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits - * (HT40, VHT 80/160 MHz) if this flag is set - * @NL80211_FEATURE_USERSPACE_MPM: This driver supports a userspace Mesh - * Peering Management entity which may be implemented by registering for - * beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is - * still generated by the driver. - * @NL80211_FEATURE_ACTIVE_MONITOR: This driver supports an active monitor - * interface. An active monitor interface behaves like a normal monitor - * interface, but gets added to the driver. It ensures that incoming - * unicast packets directed at the configured interface address get ACKed. - * @NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE: This driver supports dynamic - * channel bandwidth change (e.g., HT 20 <-> 40 MHz channel) during the - * lifetime of a BSS. - * @NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES: This device adds a DS Parameter - * Set IE to probe requests. - * @NL80211_FEATURE_WFA_TPC_IE_IN_PROBES: This device adds a WFA TPC Report IE - * to probe requests. - * @NL80211_FEATURE_QUIET: This device, in client mode, supports Quiet Period - * requests sent to it by an AP. - * @NL80211_FEATURE_TX_POWER_INSERTION: This device is capable of inserting the - * current tx power value into the TPC Report IE in the spectrum - * management TPC Report action frame, and in the Radio Measurement Link - * Measurement Report action frame. - * @NL80211_FEATURE_ACKTO_ESTIMATION: This driver supports dynamic ACK timeout - * estimation (dynack). %NL80211_ATTR_WIPHY_DYN_ACK flag attribute is used - * to enable dynack. - * @NL80211_FEATURE_STATIC_SMPS: Device supports static spatial - * multiplexing powersave, ie. can turn off all but one chain - * even on HT connections that should be using more chains. - * @NL80211_FEATURE_DYNAMIC_SMPS: Device supports dynamic spatial - * multiplexing powersave, ie. can turn off all but one chain - * and then wake the rest up as required after, for example, - * rts/cts handshake. - * @NL80211_FEATURE_SUPPORTS_WMM_ADMISSION: the device supports setting up WMM - * TSPEC sessions (TID aka TSID 0-7) with the %NL80211_CMD_ADD_TX_TS - * command. Standard IEEE 802.11 TSPEC setup is not yet supported, it - * needs to be able to handle Block-Ack agreements and other things. - * @NL80211_FEATURE_MAC_ON_CREATE: Device supports configuring - * the vif's MAC address upon creation. - * See 'macaddr' field in the vif_params (cfg80211.h). - * @NL80211_FEATURE_TDLS_CHANNEL_SWITCH: Driver supports channel switching when - * operating as a TDLS peer. - * @NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR: This device/driver supports using a - * random MAC address during scan (if the device is unassociated); the - * %NL80211_SCAN_FLAG_RANDOM_ADDR flag may be set for scans and the MAC - * address mask/value will be used. - * @NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR: This device/driver supports - * using a random MAC address for every scan iteration during scheduled - * scan (while not associated), the %NL80211_SCAN_FLAG_RANDOM_ADDR may - * be set for scheduled scan and the MAC address mask/value will be used. - * @NL80211_FEATURE_ND_RANDOM_MAC_ADDR: This device/driver supports using a - * random MAC address for every scan iteration during "net detect", i.e. - * scan in unassociated WoWLAN, the %NL80211_SCAN_FLAG_RANDOM_ADDR may - * be set for scheduled scan and the MAC address mask/value will be used. - */ -enum nl80211_feature_flags { - NL80211_FEATURE_SK_TX_STATUS = 1 << 0, - NL80211_FEATURE_HT_IBSS = 1 << 1, - NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, - NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, - NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4, - NL80211_FEATURE_SAE = 1 << 5, - NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6, - NL80211_FEATURE_SCAN_FLUSH = 1 << 7, - NL80211_FEATURE_AP_SCAN = 1 << 8, - NL80211_FEATURE_VIF_TXPOWER = 1 << 9, - NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10, - NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11, - NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12, - /* bit 13 is reserved */ - NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14, - NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15, - NL80211_FEATURE_USERSPACE_MPM = 1 << 16, - NL80211_FEATURE_ACTIVE_MONITOR = 1 << 17, - NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE = 1 << 18, - NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES = 1 << 19, - NL80211_FEATURE_WFA_TPC_IE_IN_PROBES = 1 << 20, - NL80211_FEATURE_QUIET = 1 << 21, - NL80211_FEATURE_TX_POWER_INSERTION = 1 << 22, - NL80211_FEATURE_ACKTO_ESTIMATION = 1 << 23, - NL80211_FEATURE_STATIC_SMPS = 1 << 24, - NL80211_FEATURE_DYNAMIC_SMPS = 1 << 25, - NL80211_FEATURE_SUPPORTS_WMM_ADMISSION = 1 << 26, - NL80211_FEATURE_MAC_ON_CREATE = 1 << 27, - NL80211_FEATURE_TDLS_CHANNEL_SWITCH = 1 << 28, - NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR = 1 << 29, - NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR = 1 << 30, - NL80211_FEATURE_ND_RANDOM_MAC_ADDR = 1U << 31, -}; - -/** - * enum nl80211_ext_feature_index - bit index of extended features. - * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates. - * @NL80211_EXT_FEATURE_RRM: This driver supports RRM. When featured, user can - * can request to use RRM (see %NL80211_ATTR_USE_RRM) with - * %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set - * the ASSOC_REQ_USE_RRM flag in the association request even if - * NL80211_FEATURE_QUIET is not advertized. - * @NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER: This device supports MU-MIMO air - * sniffer which means that it can be configured to hear packets from - * certain groups which can be configured by the - * %NL80211_ATTR_MU_MIMO_GROUP_DATA attribute, - * or can be configured to follow a station by configuring the - * %NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR attribute. - * @NL80211_EXT_FEATURE_SCAN_START_TIME: This driver includes the actual - * time the scan started in scan results event. The time is the TSF of - * the BSS that the interface that requested the scan is connected to - * (if available). - * @NL80211_EXT_FEATURE_BSS_PARENT_TSF: Per BSS, this driver reports the - * time the last beacon/probe was received. The time is the TSF of the - * BSS that the interface that requested the scan is connected to - * (if available). - * @NL80211_EXT_FEATURE_SET_SCAN_DWELL: This driver supports configuration of - * channel dwell time. - * @NL80211_EXT_FEATURE_BEACON_RATE_LEGACY: Driver supports beacon rate - * configuration (AP/mesh), supporting a legacy (non HT/VHT) rate. - * @NL80211_EXT_FEATURE_BEACON_RATE_HT: Driver supports beacon rate - * configuration (AP/mesh) with HT rates. - * @NL80211_EXT_FEATURE_BEACON_RATE_VHT: Driver supports beacon rate - * configuration (AP/mesh) with VHT rates. - * @NL80211_EXT_FEATURE_FILS_STA: This driver supports Fast Initial Link Setup - * with user space SME (NL80211_CMD_AUTHENTICATE) in station mode. - * @NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA: This driver supports randomized TA - * in @NL80211_CMD_FRAME while not associated. - * @NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA_CONNECTED: This driver supports - * randomized TA in @NL80211_CMD_FRAME while associated. - * @NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI: The driver supports sched_scan - * for reporting BSSs with better RSSI than the current connected BSS - * (%NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI). - * @NL80211_EXT_FEATURE_CQM_RSSI_LIST: With this driver the - * %NL80211_ATTR_CQM_RSSI_THOLD attribute accepts a list of zero or more - * RSSI threshold values to monitor rather than exactly one threshold. - * @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD: Driver SME supports FILS shared key - * authentication with %NL80211_CMD_CONNECT. - * @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK: Device wants to do 4-way - * handshake with PSK in station mode (PSK is passed as part of the connect - * and associate commands), doing it in the host might not be supported. - * @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X: Device wants to do doing 4-way - * handshake with 802.1X in station mode (will pass EAP frames to the host - * and accept the set_pmk/del_pmk commands), doing it in the host might not - * be supported. - * @NL80211_EXT_FEATURE_FILS_MAX_CHANNEL_TIME: Driver is capable of overriding - * the max channel attribute in the FILS request params IE with the - * actual dwell time. - * @NL80211_EXT_FEATURE_ACCEPT_BCAST_PROBE_RESP: Driver accepts broadcast probe - * response - * @NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE: Driver supports sending - * the first probe request in each channel at rate of at least 5.5Mbps. - * @NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION: Driver supports - * probe request tx deferral and suppression - * @NL80211_EXT_FEATURE_MFP_OPTIONAL: Driver supports the %NL80211_MFP_OPTIONAL - * value in %NL80211_ATTR_USE_MFP. - * @NL80211_EXT_FEATURE_LOW_SPAN_SCAN: Driver supports low span scan. - * @NL80211_EXT_FEATURE_LOW_POWER_SCAN: Driver supports low power scan. - * @NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN: Driver supports high accuracy scan. - * @NL80211_EXT_FEATURE_DFS_OFFLOAD: HW/driver will offload DFS actions. - * Device or driver will do all DFS-related actions by itself, - * informing user-space about CAC progress, radar detection event, - * channel change triggered by radar detection event. - * No need to start CAC from user-space, no need to react to - * "radar detected" event. - * @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211: Driver supports sending and - * receiving control port frames over nl80211 instead of the netdevice. - * @NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT: This driver/device supports - * (average) ACK signal strength reporting. - * @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate - * TXQs. - * @NL80211_EXT_FEATURE_SCAN_RANDOM_SN: Driver/device supports randomizing the - * SN in probe request frames if requested by %NL80211_SCAN_FLAG_RANDOM_SN. - * @NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT: Driver/device can omit all data - * except for supported rates from the probe request content if requested - * by the %NL80211_SCAN_FLAG_MIN_PREQ_CONTENT flag. - * @NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER: Driver supports enabling fine - * timing measurement responder role. - * - * @NL80211_EXT_FEATURE_CAN_REPLACE_PTK0: Driver/device confirm that they are - * able to rekey an in-use key correctly. Userspace must not rekey PTK keys - * if this flag is not set. Ignoring this can leak clear text packets and/or - * freeze the connection. - * @NL80211_EXT_FEATURE_EXT_KEY_ID: Driver supports "Extended Key ID for - * Individually Addressed Frames" from IEEE802.11-2016. - * - * @NL80211_EXT_FEATURE_AIRTIME_FAIRNESS: Driver supports getting airtime - * fairness for transmitted packets and has enabled airtime fairness - * scheduling. - * - * @NL80211_EXT_FEATURE_AP_PMKSA_CACHING: Driver/device supports PMKSA caching - * (set/del PMKSA operations) in AP mode. - * - * @NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD: Driver supports - * filtering of sched scan results using band specific RSSI thresholds. - * - * @NL80211_EXT_FEATURE_STA_TX_PWR: This driver supports controlling tx power - * to a station. - * - * @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in - * station mode (SAE password is passed as part of the connect command). - * - * @NL80211_EXT_FEATURE_VLAN_OFFLOAD: The driver supports a single netdev - * with VLAN tagged frames and separate VLAN-specific netdevs added using - * vconfig similarly to the Ethernet case. - * - * @NL80211_EXT_FEATURE_AQL: The driver supports the Airtime Queue Limit (AQL) - * feature, which prevents bufferbloat by using the expected transmission - * time to limit the amount of data buffered in the hardware. - * - * @NL80211_EXT_FEATURE_BEACON_PROTECTION: The driver supports Beacon protection - * and can receive key configuration for BIGTK using key indexes 6 and 7. - * @NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT: The driver supports Beacon - * protection as a client only and cannot transmit protected beacons. - * - * @NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH: The driver can disable the - * forwarding of preauth frames over the control port. They are then - * handled as ordinary data frames. - * - * @NL80211_EXT_FEATURE_PROTECTED_TWT: Driver supports protected TWT frames - * - * @NL80211_EXT_FEATURE_DEL_IBSS_STA: The driver supports removing stations - * in IBSS mode, essentially by dropping their state. - * - * @NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS: management frame registrations - * are possible for multicast frames and those will be reported properly. - * - * @NL80211_EXT_FEATURE_SCAN_FREQ_KHZ: This driver supports receiving and - * reporting scan request with %NL80211_ATTR_SCAN_FREQ_KHZ. In order to - * report %NL80211_ATTR_SCAN_FREQ_KHZ, %NL80211_SCAN_FLAG_FREQ_KHZ must be - * included in the scan request. - * - * @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_TX_STATUS: The driver - * can report tx status for control port over nl80211 tx operations. - * - * @NL80211_EXT_FEATURE_WIDE_BAND_SCAN: Driver/device supports wide band scan - * on a frequency along with its corresponding phymode (40Mhz, 80Mhz) - * - * @NL80211_EXT_FEATURE_BSS_COLOR: The driver supports BSS color collision - * detection and change announcemnts. - * - * @NUM_NL80211_EXT_FEATURES: number of extended features. - * @MAX_NL80211_EXT_FEATURES: highest extended feature index. - */ -enum nl80211_ext_feature_index { - NL80211_EXT_FEATURE_VHT_IBSS, - NL80211_EXT_FEATURE_RRM, - NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER, - NL80211_EXT_FEATURE_SCAN_START_TIME, - NL80211_EXT_FEATURE_BSS_PARENT_TSF, - NL80211_EXT_FEATURE_SET_SCAN_DWELL, - NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, - NL80211_EXT_FEATURE_BEACON_RATE_HT, - NL80211_EXT_FEATURE_BEACON_RATE_VHT, - NL80211_EXT_FEATURE_FILS_STA, - NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA, - NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA_CONNECTED, - NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI, - NL80211_EXT_FEATURE_CQM_RSSI_LIST, - NL80211_EXT_FEATURE_FILS_SK_OFFLOAD, - NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK, - NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X, - NL80211_EXT_FEATURE_FILS_MAX_CHANNEL_TIME, - NL80211_EXT_FEATURE_ACCEPT_BCAST_PROBE_RESP, - NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE, - NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION, - NL80211_EXT_FEATURE_MFP_OPTIONAL, - NL80211_EXT_FEATURE_LOW_SPAN_SCAN, - NL80211_EXT_FEATURE_LOW_POWER_SCAN, - NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN, - NL80211_EXT_FEATURE_DFS_OFFLOAD, - NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211, - NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT, - /* we renamed this - stay compatible */ - NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT = NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT, - NL80211_EXT_FEATURE_TXQS, - NL80211_EXT_FEATURE_SCAN_RANDOM_SN, - NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT, - NL80211_EXT_FEATURE_CAN_REPLACE_PTK0, - NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER, - NL80211_EXT_FEATURE_AIRTIME_FAIRNESS, - NL80211_EXT_FEATURE_AP_PMKSA_CACHING, - NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD, - NL80211_EXT_FEATURE_EXT_KEY_ID, - NL80211_EXT_FEATURE_STA_TX_PWR, - NL80211_EXT_FEATURE_SAE_OFFLOAD, - NL80211_EXT_FEATURE_VLAN_OFFLOAD, - NL80211_EXT_FEATURE_AQL, - NL80211_EXT_FEATURE_BEACON_PROTECTION, - NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH, - NL80211_EXT_FEATURE_PROTECTED_TWT, - NL80211_EXT_FEATURE_DEL_IBSS_STA, - NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS, - NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT, - NL80211_EXT_FEATURE_SCAN_FREQ_KHZ, - NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_TX_STATUS, - NL80211_EXT_FEATURE_WIDE_BAND_SCAN, - NL80211_EXT_FEATURE_BSS_COLOR, - - /* add new features before the definition below */ - NUM_NL80211_EXT_FEATURES, - MAX_NL80211_EXT_FEATURES = NUM_NL80211_EXT_FEATURES - 1 -}; - -/** - * enum nl80211_probe_resp_offload_support_attr - optional supported - * protocols for probe-response offloading by the driver/FW. - * To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute. - * Each enum value represents a bit in the bitmap of supported - * protocols. Typically a subset of probe-requests belonging to a - * supported protocol will be excluded from offload and uploaded - * to the host. - * - * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS: Support for WPS ver. 1 - * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2: Support for WPS ver. 2 - * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P: Support for P2P - * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U: Support for 802.11u - */ -enum nl80211_probe_resp_offload_support_attr { - NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS = 1<<0, - NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 = 1<<1, - NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P = 1<<2, - NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3, -}; - -/** - * enum nl80211_connect_failed_reason - connection request failed reasons - * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be - * handled by the AP is reached. - * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Connection request is rejected due to ACL. - */ -enum nl80211_connect_failed_reason { - NL80211_CONN_FAIL_MAX_CLIENTS, - NL80211_CONN_FAIL_BLOCKED_CLIENT, -}; - -/** - * enum nl80211_timeout_reason - timeout reasons - * - * @NL80211_TIMEOUT_UNSPECIFIED: Timeout reason unspecified. - * @NL80211_TIMEOUT_SCAN: Scan (AP discovery) timed out. - * @NL80211_TIMEOUT_AUTH: Authentication timed out. - * @NL80211_TIMEOUT_ASSOC: Association timed out. - */ -enum nl80211_timeout_reason { - NL80211_TIMEOUT_UNSPECIFIED, - NL80211_TIMEOUT_SCAN, - NL80211_TIMEOUT_AUTH, - NL80211_TIMEOUT_ASSOC, -}; - -/** - * enum nl80211_scan_flags - scan request control flags - * - * Scan request control flags are used to control the handling - * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN - * requests. - * - * NL80211_SCAN_FLAG_LOW_SPAN, NL80211_SCAN_FLAG_LOW_POWER, and - * NL80211_SCAN_FLAG_HIGH_ACCURACY flags are exclusive of each other, i.e., only - * one of them can be used in the request. - * - * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority - * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning - * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured - * as AP and the beaconing has already been configured. This attribute is - * dangerous because will destroy stations performance as a lot of frames - * will be lost while scanning off-channel, therefore it must be used only - * when really needed - * @NL80211_SCAN_FLAG_RANDOM_ADDR: use a random MAC address for this scan (or - * for scheduled scan: a different one for every scan iteration). When the - * flag is set, depending on device capabilities the @NL80211_ATTR_MAC and - * @NL80211_ATTR_MAC_MASK attributes may also be given in which case only - * the masked bits will be preserved from the MAC address and the remainder - * randomised. If the attributes are not given full randomisation (46 bits, - * locally administered 1, multicast 0) is assumed. - * This flag must not be requested when the feature isn't supported, check - * the nl80211 feature flags for the device. - * @NL80211_SCAN_FLAG_FILS_MAX_CHANNEL_TIME: fill the dwell time in the FILS - * request parameters IE in the probe request - * @NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP: accept broadcast probe responses - * @NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE: send probe request frames at - * rate of at least 5.5M. In case non OCE AP is discovered in the channel, - * only the first probe req in the channel will be sent in high rate. - * @NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION: allow probe request - * tx deferral (dot11FILSProbeDelay shall be set to 15ms) - * and suppression (if it has received a broadcast Probe Response frame, - * Beacon frame or FILS Discovery frame from an AP that the STA considers - * a suitable candidate for (re-)association - suitable in terms of - * SSID and/or RSSI. - * @NL80211_SCAN_FLAG_LOW_SPAN: Span corresponds to the total time taken to - * accomplish the scan. Thus, this flag intends the driver to perform the - * scan request with lesser span/duration. It is specific to the driver - * implementations on how this is accomplished. Scan accuracy may get - * impacted with this flag. - * @NL80211_SCAN_FLAG_LOW_POWER: This flag intends the scan attempts to consume - * optimal possible power. Drivers can resort to their specific means to - * optimize the power. Scan accuracy may get impacted with this flag. - * @NL80211_SCAN_FLAG_HIGH_ACCURACY: Accuracy here intends to the extent of scan - * results obtained. Thus HIGH_ACCURACY scan flag aims to get maximum - * possible scan results. This flag hints the driver to use the best - * possible scan configuration to improve the accuracy in scanning. - * Latency and power use may get impacted with this flag. - * @NL80211_SCAN_FLAG_RANDOM_SN: randomize the sequence number in probe - * request frames from this scan to avoid correlation/tracking being - * possible. - * @NL80211_SCAN_FLAG_MIN_PREQ_CONTENT: minimize probe request content to - * only have supported rates and no additional capabilities (unless - * added by userspace explicitly.) - * @NL80211_SCAN_FLAG_FREQ_KHZ: report scan results with - * %NL80211_ATTR_SCAN_FREQ_KHZ. This also means - * %NL80211_ATTR_SCAN_FREQUENCIES will not be included. - * @NL80211_SCAN_FLAG_WIDE_BAND_SCAN: This flag intends the driver to perform - * wide band scan only if the driver supports it. - */ -enum nl80211_scan_flags { - NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0, - NL80211_SCAN_FLAG_FLUSH = 1<<1, - NL80211_SCAN_FLAG_AP = 1<<2, - NL80211_SCAN_FLAG_RANDOM_ADDR = 1<<3, - NL80211_SCAN_FLAG_FILS_MAX_CHANNEL_TIME = 1<<4, - NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP = 1<<5, - NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE = 1<<6, - NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION = 1<<7, - NL80211_SCAN_FLAG_LOW_SPAN = 1<<8, - NL80211_SCAN_FLAG_LOW_POWER = 1<<9, - NL80211_SCAN_FLAG_HIGH_ACCURACY = 1<<10, - NL80211_SCAN_FLAG_RANDOM_SN = 1<<11, - NL80211_SCAN_FLAG_MIN_PREQ_CONTENT = 1<<12, - NL80211_SCAN_FLAG_FREQ_KHZ = 1<<13, - NL80211_SCAN_FLAG_WIDE_BAND_SCAN = 1<<14, -}; - -/** - * enum nl80211_acl_policy - access control policy - * - * Access control policy is applied on a MAC list set by - * %NL80211_CMD_START_AP and %NL80211_CMD_SET_MAC_ACL, to - * be used with %NL80211_ATTR_ACL_POLICY. - * - * @NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED: Deny stations which are - * listed in ACL, i.e. allow all the stations which are not listed - * in ACL to authenticate. - * @NL80211_ACL_POLICY_DENY_UNLESS_LISTED: Allow the stations which are listed - * in ACL, i.e. deny all the stations which are not listed in ACL. - */ -enum nl80211_acl_policy { - NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED, - NL80211_ACL_POLICY_DENY_UNLESS_LISTED, -}; - -/** - * enum nl80211_smps_mode - SMPS mode - * - * Requested SMPS mode (for AP mode) - * - * @NL80211_SMPS_OFF: SMPS off (use all antennas). - * @NL80211_SMPS_STATIC: static SMPS (use a single antenna) - * @NL80211_SMPS_DYNAMIC: dynamic smps (start with a single antenna and - * turn on other antennas after CTS/RTS). - */ -enum nl80211_smps_mode { - NL80211_SMPS_OFF, - NL80211_SMPS_STATIC, - NL80211_SMPS_DYNAMIC, - - __NL80211_SMPS_AFTER_LAST, - NL80211_SMPS_MAX = __NL80211_SMPS_AFTER_LAST - 1 -}; - -/** - * enum nl80211_radar_event - type of radar event for DFS operation - * - * Type of event to be used with NL80211_ATTR_RADAR_EVENT to inform userspace - * about detected radars or success of the channel available check (CAC) - * - * @NL80211_RADAR_DETECTED: A radar pattern has been detected. The channel is - * now unusable. - * @NL80211_RADAR_CAC_FINISHED: Channel Availability Check has been finished, - * the channel is now available. - * @NL80211_RADAR_CAC_ABORTED: Channel Availability Check has been aborted, no - * change to the channel status. - * @NL80211_RADAR_NOP_FINISHED: The Non-Occupancy Period for this channel is - * over, channel becomes usable. - * @NL80211_RADAR_PRE_CAC_EXPIRED: Channel Availability Check done on this - * non-operating channel is expired and no longer valid. New CAC must - * be done on this channel before starting the operation. This is not - * applicable for ETSI dfs domain where pre-CAC is valid for ever. - * @NL80211_RADAR_CAC_STARTED: Channel Availability Check has been started, - * should be generated by HW if NL80211_EXT_FEATURE_DFS_OFFLOAD is enabled. - */ -enum nl80211_radar_event { - NL80211_RADAR_DETECTED, - NL80211_RADAR_CAC_FINISHED, - NL80211_RADAR_CAC_ABORTED, - NL80211_RADAR_NOP_FINISHED, - NL80211_RADAR_PRE_CAC_EXPIRED, - NL80211_RADAR_CAC_STARTED, -}; - -/** - * enum nl80211_dfs_state - DFS states for channels - * - * Channel states used by the DFS code. - * - * @NL80211_DFS_USABLE: The channel can be used, but channel availability - * check (CAC) must be performed before using it for AP or IBSS. - * @NL80211_DFS_UNAVAILABLE: A radar has been detected on this channel, it - * is therefore marked as not available. - * @NL80211_DFS_AVAILABLE: The channel has been CAC checked and is available. - */ -enum nl80211_dfs_state { - NL80211_DFS_USABLE, - NL80211_DFS_UNAVAILABLE, - NL80211_DFS_AVAILABLE, -}; - -/** - * enum enum nl80211_protocol_features - nl80211 protocol features - * @NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP: nl80211 supports splitting - * wiphy dumps (if requested by the application with the attribute - * %NL80211_ATTR_SPLIT_WIPHY_DUMP. Also supported is filtering the - * wiphy dump by %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFINDEX or - * %NL80211_ATTR_WDEV. - */ -enum nl80211_protocol_features { - NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP = 1 << 0, -}; - -/** - * enum nl80211_crit_proto_id - nl80211 critical protocol identifiers - * - * @NL80211_CRIT_PROTO_UNSPEC: protocol unspecified. - * @NL80211_CRIT_PROTO_DHCP: BOOTP or DHCPv6 protocol. - * @NL80211_CRIT_PROTO_EAPOL: EAPOL protocol. - * @NL80211_CRIT_PROTO_APIPA: APIPA protocol. - * @NUM_NL80211_CRIT_PROTO: must be kept last. - */ -enum nl80211_crit_proto_id { - NL80211_CRIT_PROTO_UNSPEC, - NL80211_CRIT_PROTO_DHCP, - NL80211_CRIT_PROTO_EAPOL, - NL80211_CRIT_PROTO_APIPA, - /* add other protocols before this one */ - NUM_NL80211_CRIT_PROTO -}; - -/* maximum duration for critical protocol measures */ -#define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */ - -/** - * enum nl80211_rxmgmt_flags - flags for received management frame. - * - * Used by cfg80211_rx_mgmt() - * - * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver. - * @NL80211_RXMGMT_FLAG_EXTERNAL_AUTH: Host driver intends to offload - * the authentication. Exclusively defined for host drivers that - * advertises the SME functionality but would like the userspace - * to handle certain authentication algorithms (e.g. SAE). - */ -enum nl80211_rxmgmt_flags { - NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0, - NL80211_RXMGMT_FLAG_EXTERNAL_AUTH = 1 << 1, -}; - -/* - * If this flag is unset, the lower 24 bits are an OUI, if set - * a Linux nl80211 vendor ID is used (no such IDs are allocated - * yet, so that's not valid so far) - */ -#define NL80211_VENDOR_ID_IS_LINUX 0x80000000 - -/** - * struct nl80211_vendor_cmd_info - vendor command data - * @vendor_id: If the %NL80211_VENDOR_ID_IS_LINUX flag is clear, then the - * value is a 24-bit OUI; if it is set then a separately allocated ID - * may be used, but no such IDs are allocated yet. New IDs should be - * added to this file when needed. - * @subcmd: sub-command ID for the command - */ -struct nl80211_vendor_cmd_info { - __u32 vendor_id; - __u32 subcmd; -}; - -/** - * enum nl80211_tdls_peer_capability - TDLS peer flags. - * - * Used by tdls_mgmt() to determine which conditional elements need - * to be added to TDLS Setup frames. - * - * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable. - * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable. - * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable. - */ -enum nl80211_tdls_peer_capability { - NL80211_TDLS_PEER_HT = 1<<0, - NL80211_TDLS_PEER_VHT = 1<<1, - NL80211_TDLS_PEER_WMM = 1<<2, -}; - -/** - * enum nl80211_sched_scan_plan - scanning plan for scheduled scan - * @__NL80211_SCHED_SCAN_PLAN_INVALID: attribute number 0 is reserved - * @NL80211_SCHED_SCAN_PLAN_INTERVAL: interval between scan iterations. In - * seconds (u32). - * @NL80211_SCHED_SCAN_PLAN_ITERATIONS: number of scan iterations in this - * scan plan (u32). The last scan plan must not specify this attribute - * because it will run infinitely. A value of zero is invalid as it will - * make the scan plan meaningless. - * @NL80211_SCHED_SCAN_PLAN_MAX: highest scheduled scan plan attribute number - * currently defined - * @__NL80211_SCHED_SCAN_PLAN_AFTER_LAST: internal use - */ -enum nl80211_sched_scan_plan { - __NL80211_SCHED_SCAN_PLAN_INVALID, - NL80211_SCHED_SCAN_PLAN_INTERVAL, - NL80211_SCHED_SCAN_PLAN_ITERATIONS, - - /* keep last */ - __NL80211_SCHED_SCAN_PLAN_AFTER_LAST, - NL80211_SCHED_SCAN_PLAN_MAX = - __NL80211_SCHED_SCAN_PLAN_AFTER_LAST - 1 -}; - -/** - * struct nl80211_bss_select_rssi_adjust - RSSI adjustment parameters. - * - * @band: band of BSS that must match for RSSI value adjustment. The value - * of this field is according to &enum nl80211_band. - * @delta: value used to adjust the RSSI value of matching BSS in dB. - */ -struct nl80211_bss_select_rssi_adjust { - __u8 band; - __s8 delta; -} __attribute__((packed)); - -/** - * enum nl80211_bss_select_attr - attributes for bss selection. - * - * @__NL80211_BSS_SELECT_ATTR_INVALID: reserved. - * @NL80211_BSS_SELECT_ATTR_RSSI: Flag indicating only RSSI-based BSS selection - * is requested. - * @NL80211_BSS_SELECT_ATTR_BAND_PREF: attribute indicating BSS - * selection should be done such that the specified band is preferred. - * When there are multiple BSS-es in the preferred band, the driver - * shall use RSSI-based BSS selection as a second step. The value of - * this attribute is according to &enum nl80211_band (u32). - * @NL80211_BSS_SELECT_ATTR_RSSI_ADJUST: When present the RSSI level for - * BSS-es in the specified band is to be adjusted before doing - * RSSI-based BSS selection. The attribute value is a packed structure - * value as specified by &struct nl80211_bss_select_rssi_adjust. - * @NL80211_BSS_SELECT_ATTR_MAX: highest bss select attribute number. - * @__NL80211_BSS_SELECT_ATTR_AFTER_LAST: internal use. - * - * One and only one of these attributes are found within %NL80211_ATTR_BSS_SELECT - * for %NL80211_CMD_CONNECT. It specifies the required BSS selection behaviour - * which the driver shall use. - */ -enum nl80211_bss_select_attr { - __NL80211_BSS_SELECT_ATTR_INVALID, - NL80211_BSS_SELECT_ATTR_RSSI, - NL80211_BSS_SELECT_ATTR_BAND_PREF, - NL80211_BSS_SELECT_ATTR_RSSI_ADJUST, - - /* keep last */ - __NL80211_BSS_SELECT_ATTR_AFTER_LAST, - NL80211_BSS_SELECT_ATTR_MAX = __NL80211_BSS_SELECT_ATTR_AFTER_LAST - 1 -}; - -/** - * enum nl80211_nan_function_type - NAN function type - * - * Defines the function type of a NAN function - * - * @NL80211_NAN_FUNC_PUBLISH: function is publish - * @NL80211_NAN_FUNC_SUBSCRIBE: function is subscribe - * @NL80211_NAN_FUNC_FOLLOW_UP: function is follow-up - */ -enum nl80211_nan_function_type { - NL80211_NAN_FUNC_PUBLISH, - NL80211_NAN_FUNC_SUBSCRIBE, - NL80211_NAN_FUNC_FOLLOW_UP, - - /* keep last */ - __NL80211_NAN_FUNC_TYPE_AFTER_LAST, - NL80211_NAN_FUNC_MAX_TYPE = __NL80211_NAN_FUNC_TYPE_AFTER_LAST - 1, -}; - -/** - * enum nl80211_nan_publish_type - NAN publish tx type - * - * Defines how to send publish Service Discovery Frames - * - * @NL80211_NAN_SOLICITED_PUBLISH: publish function is solicited - * @NL80211_NAN_UNSOLICITED_PUBLISH: publish function is unsolicited - */ -enum nl80211_nan_publish_type { - NL80211_NAN_SOLICITED_PUBLISH = 1 << 0, - NL80211_NAN_UNSOLICITED_PUBLISH = 1 << 1, -}; - -/** - * enum nl80211_nan_func_term_reason - NAN functions termination reason - * - * Defines termination reasons of a NAN function - * - * @NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST: requested by user - * @NL80211_NAN_FUNC_TERM_REASON_TTL_EXPIRED: timeout - * @NL80211_NAN_FUNC_TERM_REASON_ERROR: errored - */ -enum nl80211_nan_func_term_reason { - NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST, - NL80211_NAN_FUNC_TERM_REASON_TTL_EXPIRED, - NL80211_NAN_FUNC_TERM_REASON_ERROR, -}; - -#define NL80211_NAN_FUNC_SERVICE_ID_LEN 6 -#define NL80211_NAN_FUNC_SERVICE_SPEC_INFO_MAX_LEN 0xff -#define NL80211_NAN_FUNC_SRF_MAX_LEN 0xff - -/** - * enum nl80211_nan_func_attributes - NAN function attributes - * @__NL80211_NAN_FUNC_INVALID: invalid - * @NL80211_NAN_FUNC_TYPE: &enum nl80211_nan_function_type (u8). - * @NL80211_NAN_FUNC_SERVICE_ID: 6 bytes of the service ID hash as - * specified in NAN spec. This is a binary attribute. - * @NL80211_NAN_FUNC_PUBLISH_TYPE: relevant if the function's type is - * publish. Defines the transmission type for the publish Service Discovery - * Frame, see &enum nl80211_nan_publish_type. Its type is u8. - * @NL80211_NAN_FUNC_PUBLISH_BCAST: relevant if the function is a solicited - * publish. Should the solicited publish Service Discovery Frame be sent to - * the NAN Broadcast address. This is a flag. - * @NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE: relevant if the function's type is - * subscribe. Is the subscribe active. This is a flag. - * @NL80211_NAN_FUNC_FOLLOW_UP_ID: relevant if the function's type is follow up. - * The instance ID for the follow up Service Discovery Frame. This is u8. - * @NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID: relevant if the function's type - * is follow up. This is a u8. - * The requestor instance ID for the follow up Service Discovery Frame. - * @NL80211_NAN_FUNC_FOLLOW_UP_DEST: the MAC address of the recipient of the - * follow up Service Discovery Frame. This is a binary attribute. - * @NL80211_NAN_FUNC_CLOSE_RANGE: is this function limited for devices in a - * close range. The range itself (RSSI) is defined by the device. - * This is a flag. - * @NL80211_NAN_FUNC_TTL: strictly positive number of DWs this function should - * stay active. If not present infinite TTL is assumed. This is a u32. - * @NL80211_NAN_FUNC_SERVICE_INFO: array of bytes describing the service - * specific info. This is a binary attribute. - * @NL80211_NAN_FUNC_SRF: Service Receive Filter. This is a nested attribute. - * See &enum nl80211_nan_srf_attributes. - * @NL80211_NAN_FUNC_RX_MATCH_FILTER: Receive Matching filter. This is a nested - * attribute. It is a list of binary values. - * @NL80211_NAN_FUNC_TX_MATCH_FILTER: Transmit Matching filter. This is a - * nested attribute. It is a list of binary values. - * @NL80211_NAN_FUNC_INSTANCE_ID: The instance ID of the function. - * Its type is u8 and it cannot be 0. - * @NL80211_NAN_FUNC_TERM_REASON: NAN function termination reason. - * See &enum nl80211_nan_func_term_reason. - * - * @NUM_NL80211_NAN_FUNC_ATTR: internal - * @NL80211_NAN_FUNC_ATTR_MAX: highest NAN function attribute - */ -enum nl80211_nan_func_attributes { - __NL80211_NAN_FUNC_INVALID, - NL80211_NAN_FUNC_TYPE, - NL80211_NAN_FUNC_SERVICE_ID, - NL80211_NAN_FUNC_PUBLISH_TYPE, - NL80211_NAN_FUNC_PUBLISH_BCAST, - NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE, - NL80211_NAN_FUNC_FOLLOW_UP_ID, - NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID, - NL80211_NAN_FUNC_FOLLOW_UP_DEST, - NL80211_NAN_FUNC_CLOSE_RANGE, - NL80211_NAN_FUNC_TTL, - NL80211_NAN_FUNC_SERVICE_INFO, - NL80211_NAN_FUNC_SRF, - NL80211_NAN_FUNC_RX_MATCH_FILTER, - NL80211_NAN_FUNC_TX_MATCH_FILTER, - NL80211_NAN_FUNC_INSTANCE_ID, - NL80211_NAN_FUNC_TERM_REASON, - - /* keep last */ - NUM_NL80211_NAN_FUNC_ATTR, - NL80211_NAN_FUNC_ATTR_MAX = NUM_NL80211_NAN_FUNC_ATTR - 1 -}; - -/** - * enum nl80211_nan_srf_attributes - NAN Service Response filter attributes - * @__NL80211_NAN_SRF_INVALID: invalid - * @NL80211_NAN_SRF_INCLUDE: present if the include bit of the SRF set. - * This is a flag. - * @NL80211_NAN_SRF_BF: Bloom Filter. Present if and only if - * %NL80211_NAN_SRF_MAC_ADDRS isn't present. This attribute is binary. - * @NL80211_NAN_SRF_BF_IDX: index of the Bloom Filter. Mandatory if - * %NL80211_NAN_SRF_BF is present. This is a u8. - * @NL80211_NAN_SRF_MAC_ADDRS: list of MAC addresses for the SRF. Present if - * and only if %NL80211_NAN_SRF_BF isn't present. This is a nested - * attribute. Each nested attribute is a MAC address. - * @NUM_NL80211_NAN_SRF_ATTR: internal - * @NL80211_NAN_SRF_ATTR_MAX: highest NAN SRF attribute - */ -enum nl80211_nan_srf_attributes { - __NL80211_NAN_SRF_INVALID, - NL80211_NAN_SRF_INCLUDE, - NL80211_NAN_SRF_BF, - NL80211_NAN_SRF_BF_IDX, - NL80211_NAN_SRF_MAC_ADDRS, - - /* keep last */ - NUM_NL80211_NAN_SRF_ATTR, - NL80211_NAN_SRF_ATTR_MAX = NUM_NL80211_NAN_SRF_ATTR - 1, -}; - -/** - * enum nl80211_nan_match_attributes - NAN match attributes - * @__NL80211_NAN_MATCH_INVALID: invalid - * @NL80211_NAN_MATCH_FUNC_LOCAL: the local function that had the - * match. This is a nested attribute. - * See &enum nl80211_nan_func_attributes. - * @NL80211_NAN_MATCH_FUNC_PEER: the peer function - * that caused the match. This is a nested attribute. - * See &enum nl80211_nan_func_attributes. - * - * @NUM_NL80211_NAN_MATCH_ATTR: internal - * @NL80211_NAN_MATCH_ATTR_MAX: highest NAN match attribute - */ -enum nl80211_nan_match_attributes { - __NL80211_NAN_MATCH_INVALID, - NL80211_NAN_MATCH_FUNC_LOCAL, - NL80211_NAN_MATCH_FUNC_PEER, - - /* keep last */ - NUM_NL80211_NAN_MATCH_ATTR, - NL80211_NAN_MATCH_ATTR_MAX = NUM_NL80211_NAN_MATCH_ATTR - 1 -}; - -/** - * nl80211_external_auth_action - Action to perform with external - * authentication request. Used by NL80211_ATTR_EXTERNAL_AUTH_ACTION. - * @NL80211_EXTERNAL_AUTH_START: Start the authentication. - * @NL80211_EXTERNAL_AUTH_ABORT: Abort the ongoing authentication. - */ -enum nl80211_external_auth_action { - NL80211_EXTERNAL_AUTH_START, - NL80211_EXTERNAL_AUTH_ABORT, -}; - -/** - * enum nl80211_ftm_responder_attributes - fine timing measurement - * responder attributes - * @__NL80211_FTM_RESP_ATTR_INVALID: Invalid - * @NL80211_FTM_RESP_ATTR_ENABLED: FTM responder is enabled - * @NL80211_FTM_RESP_ATTR_LCI: The content of Measurement Report Element - * (9.4.2.22 in 802.11-2016) with type 8 - LCI (9.4.2.22.10), - * i.e. starting with the measurement token - * @NL80211_FTM_RESP_ATTR_CIVIC: The content of Measurement Report Element - * (9.4.2.22 in 802.11-2016) with type 11 - Civic (Section 9.4.2.22.13), - * i.e. starting with the measurement token - * @__NL80211_FTM_RESP_ATTR_LAST: Internal - * @NL80211_FTM_RESP_ATTR_MAX: highest FTM responder attribute. - */ -enum nl80211_ftm_responder_attributes { - __NL80211_FTM_RESP_ATTR_INVALID, - - NL80211_FTM_RESP_ATTR_ENABLED, - NL80211_FTM_RESP_ATTR_LCI, - NL80211_FTM_RESP_ATTR_CIVICLOC, - - /* keep last */ - __NL80211_FTM_RESP_ATTR_LAST, - NL80211_FTM_RESP_ATTR_MAX = __NL80211_FTM_RESP_ATTR_LAST - 1, -}; - -/* - * enum nl80211_ftm_responder_stats - FTM responder statistics - * - * These attribute types are used with %NL80211_ATTR_FTM_RESPONDER_STATS - * when getting FTM responder statistics. - * - * @__NL80211_FTM_STATS_INVALID: attribute number 0 is reserved - * @NL80211_FTM_STATS_SUCCESS_NUM: number of FTM sessions in which all frames - * were ssfully answered (u32) - * @NL80211_FTM_STATS_PARTIAL_NUM: number of FTM sessions in which part of the - * frames were successfully answered (u32) - * @NL80211_FTM_STATS_FAILED_NUM: number of failed FTM sessions (u32) - * @NL80211_FTM_STATS_ASAP_NUM: number of ASAP sessions (u32) - * @NL80211_FTM_STATS_NON_ASAP_NUM: number of non-ASAP sessions (u32) - * @NL80211_FTM_STATS_TOTAL_DURATION_MSEC: total sessions durations - gives an - * indication of how much time the responder was busy (u64, msec) - * @NL80211_FTM_STATS_UNKNOWN_TRIGGERS_NUM: number of unknown FTM triggers - - * triggers from initiators that didn't finish successfully the negotiation - * phase with the responder (u32) - * @NL80211_FTM_STATS_RESCHEDULE_REQUESTS_NUM: number of FTM reschedule requests - * - initiator asks for a new scheduling although it already has scheduled - * FTM slot (u32) - * @NL80211_FTM_STATS_OUT_OF_WINDOW_TRIGGERS_NUM: number of FTM triggers out of - * scheduled window (u32) - * @NL80211_FTM_STATS_PAD: used for padding, ignore - * @__NL80211_TXQ_ATTR_AFTER_LAST: Internal - * @NL80211_FTM_STATS_MAX: highest possible FTM responder stats attribute - */ -enum nl80211_ftm_responder_stats { - __NL80211_FTM_STATS_INVALID, - NL80211_FTM_STATS_SUCCESS_NUM, - NL80211_FTM_STATS_PARTIAL_NUM, - NL80211_FTM_STATS_FAILED_NUM, - NL80211_FTM_STATS_ASAP_NUM, - NL80211_FTM_STATS_NON_ASAP_NUM, - NL80211_FTM_STATS_TOTAL_DURATION_MSEC, - NL80211_FTM_STATS_UNKNOWN_TRIGGERS_NUM, - NL80211_FTM_STATS_RESCHEDULE_REQUESTS_NUM, - NL80211_FTM_STATS_OUT_OF_WINDOW_TRIGGERS_NUM, - NL80211_FTM_STATS_PAD, - - /* keep last */ - __NL80211_FTM_STATS_AFTER_LAST, - NL80211_FTM_STATS_MAX = __NL80211_FTM_STATS_AFTER_LAST - 1 -}; - -/** - * enum nl80211_preamble - frame preamble types - * @NL80211_PREAMBLE_LEGACY: legacy (HR/DSSS, OFDM, ERP PHY) preamble - * @NL80211_PREAMBLE_HT: HT preamble - * @NL80211_PREAMBLE_VHT: VHT preamble - * @NL80211_PREAMBLE_DMG: DMG preamble - * @NL80211_PREAMBLE_HE: HE preamble - */ -enum nl80211_preamble { - NL80211_PREAMBLE_LEGACY, - NL80211_PREAMBLE_HT, - NL80211_PREAMBLE_VHT, - NL80211_PREAMBLE_DMG, - NL80211_PREAMBLE_HE, -}; - -/** - * enum nl80211_peer_measurement_type - peer measurement types - * @NL80211_PMSR_TYPE_INVALID: invalid/unused, needed as we use - * these numbers also for attributes - * - * @NL80211_PMSR_TYPE_FTM: flight time measurement - * - * @NUM_NL80211_PMSR_TYPES: internal - * @NL80211_PMSR_TYPE_MAX: highest type number - */ -enum nl80211_peer_measurement_type { - NL80211_PMSR_TYPE_INVALID, - - NL80211_PMSR_TYPE_FTM, - - NUM_NL80211_PMSR_TYPES, - NL80211_PMSR_TYPE_MAX = NUM_NL80211_PMSR_TYPES - 1 -}; - -/** - * enum nl80211_peer_measurement_status - peer measurement status - * @NL80211_PMSR_STATUS_SUCCESS: measurement completed successfully - * @NL80211_PMSR_STATUS_REFUSED: measurement was locally refused - * @NL80211_PMSR_STATUS_TIMEOUT: measurement timed out - * @NL80211_PMSR_STATUS_FAILURE: measurement failed, a type-dependent - * reason may be available in the response data - */ -enum nl80211_peer_measurement_status { - NL80211_PMSR_STATUS_SUCCESS, - NL80211_PMSR_STATUS_REFUSED, - NL80211_PMSR_STATUS_TIMEOUT, - NL80211_PMSR_STATUS_FAILURE, -}; - -/** - * enum nl80211_peer_measurement_req - peer measurement request attributes - * @__NL80211_PMSR_REQ_ATTR_INVALID: invalid - * - * @NL80211_PMSR_REQ_ATTR_DATA: This is a nested attribute with measurement - * type-specific request data inside. The attributes used are from the - * enums named nl80211_peer_measurement__req. - * @NL80211_PMSR_REQ_ATTR_GET_AP_TSF: include AP TSF timestamp, if supported - * (flag attribute) - * - * @NUM_NL80211_PMSR_REQ_ATTRS: internal - * @NL80211_PMSR_REQ_ATTR_MAX: highest attribute number - */ -enum nl80211_peer_measurement_req { - __NL80211_PMSR_REQ_ATTR_INVALID, - - NL80211_PMSR_REQ_ATTR_DATA, - NL80211_PMSR_REQ_ATTR_GET_AP_TSF, - - /* keep last */ - NUM_NL80211_PMSR_REQ_ATTRS, - NL80211_PMSR_REQ_ATTR_MAX = NUM_NL80211_PMSR_REQ_ATTRS - 1 -}; - -/** - * enum nl80211_peer_measurement_resp - peer measurement response attributes - * @__NL80211_PMSR_RESP_ATTR_INVALID: invalid - * - * @NL80211_PMSR_RESP_ATTR_DATA: This is a nested attribute with measurement - * type-specific results inside. The attributes used are from the enums - * named nl80211_peer_measurement__resp. - * @NL80211_PMSR_RESP_ATTR_STATUS: u32 value with the measurement status - * (using values from &enum nl80211_peer_measurement_status.) - * @NL80211_PMSR_RESP_ATTR_HOST_TIME: host time (%CLOCK_BOOTTIME) when the - * result was measured; this value is not expected to be accurate to - * more than 20ms. (u64, nanoseconds) - * @NL80211_PMSR_RESP_ATTR_AP_TSF: TSF of the AP that the interface - * doing the measurement is connected to when the result was measured. - * This shall be accurately reported if supported and requested - * (u64, usec) - * @NL80211_PMSR_RESP_ATTR_FINAL: If results are sent to the host partially - * (*e.g. with FTM per-burst data) this flag will be cleared on all but - * the last result; if all results are combined it's set on the single - * result. - * @NL80211_PMSR_RESP_ATTR_PAD: padding for 64-bit attributes, ignore - * - * @NUM_NL80211_PMSR_RESP_ATTRS: internal - * @NL80211_PMSR_RESP_ATTR_MAX: highest attribute number - */ -enum nl80211_peer_measurement_resp { - __NL80211_PMSR_RESP_ATTR_INVALID, - - NL80211_PMSR_RESP_ATTR_DATA, - NL80211_PMSR_RESP_ATTR_STATUS, - NL80211_PMSR_RESP_ATTR_HOST_TIME, - NL80211_PMSR_RESP_ATTR_AP_TSF, - NL80211_PMSR_RESP_ATTR_FINAL, - NL80211_PMSR_RESP_ATTR_PAD, - - /* keep last */ - NUM_NL80211_PMSR_RESP_ATTRS, - NL80211_PMSR_RESP_ATTR_MAX = NUM_NL80211_PMSR_RESP_ATTRS - 1 -}; - -/** - * enum nl80211_peer_measurement_peer_attrs - peer attributes for measurement - * @__NL80211_PMSR_PEER_ATTR_INVALID: invalid - * - * @NL80211_PMSR_PEER_ATTR_ADDR: peer's MAC address - * @NL80211_PMSR_PEER_ATTR_CHAN: channel definition, nested, using top-level - * attributes like %NL80211_ATTR_WIPHY_FREQ etc. - * @NL80211_PMSR_PEER_ATTR_REQ: This is a nested attribute indexed by - * measurement type, with attributes from the - * &enum nl80211_peer_measurement_req inside. - * @NL80211_PMSR_PEER_ATTR_RESP: This is a nested attribute indexed by - * measurement type, with attributes from the - * &enum nl80211_peer_measurement_resp inside. - * - * @NUM_NL80211_PMSR_PEER_ATTRS: internal - * @NL80211_PMSR_PEER_ATTR_MAX: highest attribute number - */ -enum nl80211_peer_measurement_peer_attrs { - __NL80211_PMSR_PEER_ATTR_INVALID, - - NL80211_PMSR_PEER_ATTR_ADDR, - NL80211_PMSR_PEER_ATTR_CHAN, - NL80211_PMSR_PEER_ATTR_REQ, - NL80211_PMSR_PEER_ATTR_RESP, - - /* keep last */ - NUM_NL80211_PMSR_PEER_ATTRS, - NL80211_PMSR_PEER_ATTR_MAX = NUM_NL80211_PMSR_PEER_ATTRS - 1, -}; - -/** - * enum nl80211_peer_measurement_attrs - peer measurement attributes - * @__NL80211_PMSR_ATTR_INVALID: invalid - * - * @NL80211_PMSR_ATTR_MAX_PEERS: u32 attribute used for capability - * advertisement only, indicates the maximum number of peers - * measurements can be done with in a single request - * @NL80211_PMSR_ATTR_REPORT_AP_TSF: flag attribute in capability - * indicating that the connected AP's TSF can be reported in - * measurement results - * @NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR: flag attribute in capability - * indicating that MAC address randomization is supported. - * @NL80211_PMSR_ATTR_TYPE_CAPA: capabilities reported by the device, - * this contains a nesting indexed by measurement type, and - * type-specific capabilities inside, which are from the enums - * named nl80211_peer_measurement__capa. - * @NL80211_PMSR_ATTR_PEERS: nested attribute, the nesting index is - * meaningless, just a list of peers to measure with, with the - * sub-attributes taken from - * &enum nl80211_peer_measurement_peer_attrs. - * - * @NUM_NL80211_PMSR_ATTR: internal - * @NL80211_PMSR_ATTR_MAX: highest attribute number - */ -enum nl80211_peer_measurement_attrs { - __NL80211_PMSR_ATTR_INVALID, - - NL80211_PMSR_ATTR_MAX_PEERS, - NL80211_PMSR_ATTR_REPORT_AP_TSF, - NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR, - NL80211_PMSR_ATTR_TYPE_CAPA, - NL80211_PMSR_ATTR_PEERS, - - /* keep last */ - NUM_NL80211_PMSR_ATTR, - NL80211_PMSR_ATTR_MAX = NUM_NL80211_PMSR_ATTR - 1 -}; - -/** - * enum nl80211_peer_measurement_ftm_capa - FTM capabilities - * @__NL80211_PMSR_FTM_CAPA_ATTR_INVALID: invalid - * - * @NL80211_PMSR_FTM_CAPA_ATTR_ASAP: flag attribute indicating ASAP mode - * is supported - * @NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP: flag attribute indicating non-ASAP - * mode is supported - * @NL80211_PMSR_FTM_CAPA_ATTR_REQ_LCI: flag attribute indicating if LCI - * data can be requested during the measurement - * @NL80211_PMSR_FTM_CAPA_ATTR_REQ_CIVICLOC: flag attribute indicating if civic - * location data can be requested during the measurement - * @NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES: u32 bitmap attribute of bits - * from &enum nl80211_preamble. - * @NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS: bitmap of values from - * &enum nl80211_chan_width indicating the supported channel - * bandwidths for FTM. Note that a higher channel bandwidth may be - * configured to allow for other measurements types with different - * bandwidth requirement in the same measurement. - * @NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT: u32 attribute indicating - * the maximum bursts exponent that can be used (if not present anything - * is valid) - * @NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST: u32 attribute indicating - * the maximum FTMs per burst (if not present anything is valid) - * @NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED: flag attribute indicating if - * trigger based ranging measurement is supported - * @NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED: flag attribute indicating - * if non trigger based ranging measurement is supported - * - * @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal - * @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number - */ -enum nl80211_peer_measurement_ftm_capa { - __NL80211_PMSR_FTM_CAPA_ATTR_INVALID, - - NL80211_PMSR_FTM_CAPA_ATTR_ASAP, - NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP, - NL80211_PMSR_FTM_CAPA_ATTR_REQ_LCI, - NL80211_PMSR_FTM_CAPA_ATTR_REQ_CIVICLOC, - NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES, - NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS, - NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT, - NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST, - NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED, - NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED, - - /* keep last */ - NUM_NL80211_PMSR_FTM_CAPA_ATTR, - NL80211_PMSR_FTM_CAPA_ATTR_MAX = NUM_NL80211_PMSR_FTM_CAPA_ATTR - 1 -}; - -/** - * enum nl80211_peer_measurement_ftm_req - FTM request attributes - * @__NL80211_PMSR_FTM_REQ_ATTR_INVALID: invalid - * - * @NL80211_PMSR_FTM_REQ_ATTR_ASAP: ASAP mode requested (flag) - * @NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE: preamble type (see - * &enum nl80211_preamble), optional for DMG (u32) - * @NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP: number of bursts exponent as in - * 802.11-2016 9.4.2.168 "Fine Timing Measurement Parameters element" - * (u8, 0-15, optional with default 15 i.e. "no preference") - * @NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD: interval between bursts in units - * of 100ms (u16, optional with default 0) - * @NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION: burst duration, as in 802.11-2016 - * Table 9-257 "Burst Duration field encoding" (u8, 0-15, optional with - * default 15 i.e. "no preference") - * @NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST: number of successful FTM frames - * requested per burst - * (u8, 0-31, optional with default 0 i.e. "no preference") - * @NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES: number of FTMR frame retries - * (u8, default 3) - * @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI: request LCI data (flag) - * @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC: request civic location data - * (flag) - * @NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED: request trigger based ranging - * measurement (flag). - * This attribute and %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED are - * mutually exclusive. - * if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor - * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based - * ranging will be used. - * @NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED: request non trigger based - * ranging measurement (flag) - * This attribute and %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED are - * mutually exclusive. - * if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor - * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based - * ranging will be used. - * - * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal - * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number - */ -enum nl80211_peer_measurement_ftm_req { - __NL80211_PMSR_FTM_REQ_ATTR_INVALID, - - NL80211_PMSR_FTM_REQ_ATTR_ASAP, - NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE, - NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP, - NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD, - NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION, - NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST, - NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES, - NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI, - NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC, - NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED, - NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED, - - /* keep last */ - NUM_NL80211_PMSR_FTM_REQ_ATTR, - NL80211_PMSR_FTM_REQ_ATTR_MAX = NUM_NL80211_PMSR_FTM_REQ_ATTR - 1 -}; - -/** - * enum nl80211_peer_measurement_ftm_failure_reasons - FTM failure reasons - * @NL80211_PMSR_FTM_FAILURE_UNSPECIFIED: unspecified failure, not used - * @NL80211_PMSR_FTM_FAILURE_NO_RESPONSE: no response from the FTM responder - * @NL80211_PMSR_FTM_FAILURE_REJECTED: FTM responder rejected measurement - * @NL80211_PMSR_FTM_FAILURE_WRONG_CHANNEL: we already know the peer is - * on a different channel, so can't measure (if we didn't know, we'd - * try and get no response) - * @NL80211_PMSR_FTM_FAILURE_PEER_NOT_CAPABLE: peer can't actually do FTM - * @NL80211_PMSR_FTM_FAILURE_INVALID_TIMESTAMP: invalid T1/T4 timestamps - * received - * @NL80211_PMSR_FTM_FAILURE_PEER_BUSY: peer reports busy, you may retry - * later (see %NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME) - * @NL80211_PMSR_FTM_FAILURE_BAD_CHANGED_PARAMS: parameters were changed - * by the peer and are no longer supported - */ -enum nl80211_peer_measurement_ftm_failure_reasons { - NL80211_PMSR_FTM_FAILURE_UNSPECIFIED, - NL80211_PMSR_FTM_FAILURE_NO_RESPONSE, - NL80211_PMSR_FTM_FAILURE_REJECTED, - NL80211_PMSR_FTM_FAILURE_WRONG_CHANNEL, - NL80211_PMSR_FTM_FAILURE_PEER_NOT_CAPABLE, - NL80211_PMSR_FTM_FAILURE_INVALID_TIMESTAMP, - NL80211_PMSR_FTM_FAILURE_PEER_BUSY, - NL80211_PMSR_FTM_FAILURE_BAD_CHANGED_PARAMS, -}; - -/** - * enum nl80211_peer_measurement_ftm_resp - FTM response attributes - * @__NL80211_PMSR_FTM_RESP_ATTR_INVALID: invalid - * - * @NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON: FTM-specific failure reason - * (u32, optional) - * @NL80211_PMSR_FTM_RESP_ATTR_BURST_INDEX: optional, if bursts are reported - * as separate results then it will be the burst index 0...(N-1) and - * the top level will indicate partial results (u32) - * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS: number of FTM Request frames - * transmitted (u32, optional) - * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES: number of FTM Request frames - * that were acknowleged (u32, optional) - * @NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME: retry time received from the - * busy peer (u32, seconds) - * @NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP: actual number of bursts exponent - * used by the responder (similar to request, u8) - * @NL80211_PMSR_FTM_RESP_ATTR_BURST_DURATION: actual burst duration used by - * the responder (similar to request, u8) - * @NL80211_PMSR_FTM_RESP_ATTR_FTMS_PER_BURST: actual FTMs per burst used - * by the responder (similar to request, u8) - * @NL80211_PMSR_FTM_RESP_ATTR_RSSI_AVG: average RSSI across all FTM action - * frames (optional, s32, 1/2 dBm) - * @NL80211_PMSR_FTM_RESP_ATTR_RSSI_SPREAD: RSSI spread across all FTM action - * frames (optional, s32, 1/2 dBm) - * @NL80211_PMSR_FTM_RESP_ATTR_TX_RATE: bitrate we used for the response to the - * FTM action frame (optional, nested, using &enum nl80211_rate_info - * attributes) - * @NL80211_PMSR_FTM_RESP_ATTR_RX_RATE: bitrate the responder used for the FTM - * action frame (optional, nested, using &enum nl80211_rate_info attrs) - * @NL80211_PMSR_FTM_RESP_ATTR_RTT_AVG: average RTT (s64, picoseconds, optional - * but one of RTT/DIST must be present) - * @NL80211_PMSR_FTM_RESP_ATTR_RTT_VARIANCE: RTT variance (u64, ps^2, note that - * standard deviation is the square root of variance, optional) - * @NL80211_PMSR_FTM_RESP_ATTR_RTT_SPREAD: RTT spread (u64, picoseconds, - * optional) - * @NL80211_PMSR_FTM_RESP_ATTR_DIST_AVG: average distance (s64, mm, optional - * but one of RTT/DIST must be present) - * @NL80211_PMSR_FTM_RESP_ATTR_DIST_VARIANCE: distance variance (u64, mm^2, note - * that standard deviation is the square root of variance, optional) - * @NL80211_PMSR_FTM_RESP_ATTR_DIST_SPREAD: distance spread (u64, mm, optional) - * @NL80211_PMSR_FTM_RESP_ATTR_LCI: LCI data from peer (binary, optional); - * this is the contents of the Measurement Report Element (802.11-2016 - * 9.4.2.22.1) starting with the Measurement Token, with Measurement - * Type 8. - * @NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC: civic location data from peer - * (binary, optional); - * this is the contents of the Measurement Report Element (802.11-2016 - * 9.4.2.22.1) starting with the Measurement Token, with Measurement - * Type 11. - * @NL80211_PMSR_FTM_RESP_ATTR_PAD: ignore, for u64/s64 padding only - * - * @NUM_NL80211_PMSR_FTM_RESP_ATTR: internal - * @NL80211_PMSR_FTM_RESP_ATTR_MAX: highest attribute number - */ -enum nl80211_peer_measurement_ftm_resp { - __NL80211_PMSR_FTM_RESP_ATTR_INVALID, - - NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON, - NL80211_PMSR_FTM_RESP_ATTR_BURST_INDEX, - NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS, - NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES, - NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME, - NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP, - NL80211_PMSR_FTM_RESP_ATTR_BURST_DURATION, - NL80211_PMSR_FTM_RESP_ATTR_FTMS_PER_BURST, - NL80211_PMSR_FTM_RESP_ATTR_RSSI_AVG, - NL80211_PMSR_FTM_RESP_ATTR_RSSI_SPREAD, - NL80211_PMSR_FTM_RESP_ATTR_TX_RATE, - NL80211_PMSR_FTM_RESP_ATTR_RX_RATE, - NL80211_PMSR_FTM_RESP_ATTR_RTT_AVG, - NL80211_PMSR_FTM_RESP_ATTR_RTT_VARIANCE, - NL80211_PMSR_FTM_RESP_ATTR_RTT_SPREAD, - NL80211_PMSR_FTM_RESP_ATTR_DIST_AVG, - NL80211_PMSR_FTM_RESP_ATTR_DIST_VARIANCE, - NL80211_PMSR_FTM_RESP_ATTR_DIST_SPREAD, - NL80211_PMSR_FTM_RESP_ATTR_LCI, - NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC, - NL80211_PMSR_FTM_RESP_ATTR_PAD, - - /* keep last */ - NUM_NL80211_PMSR_FTM_RESP_ATTR, - NL80211_PMSR_FTM_RESP_ATTR_MAX = NUM_NL80211_PMSR_FTM_RESP_ATTR - 1 -}; - -/** - * enum nl80211_obss_pd_attributes - OBSS packet detection attributes - * @__NL80211_HE_OBSS_PD_ATTR_INVALID: Invalid - * - * @NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET: the OBSS PD minimum tx power offset. - * @NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET: the OBSS PD maximum tx power offset. - * - * @__NL80211_HE_OBSS_PD_ATTR_LAST: Internal - * @NL80211_HE_OBSS_PD_ATTR_MAX: highest OBSS PD attribute. - */ -enum nl80211_obss_pd_attributes { - __NL80211_HE_OBSS_PD_ATTR_INVALID, - - NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET, - NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET, - - /* keep last */ - __NL80211_HE_OBSS_PD_ATTR_LAST, - NL80211_HE_OBSS_PD_ATTR_MAX = __NL80211_HE_OBSS_PD_ATTR_LAST - 1, -}; - -/** - * enum nl80211_bss_color_attributes - BSS Color attributes - * @__NL80211_HE_BSS_COLOR_ATTR_INVALID: Invalid - * - * @NL80211_HE_BSS_COLOR_ATTR_COLOR: the current BSS Color. - * @NL80211_HE_BSS_COLOR_ATTR_DISABLED: is BSS coloring disabled. - * @NL80211_HE_BSS_COLOR_ATTR_PARTIAL: the AID equation to be used.. - * - * @__NL80211_HE_BSS_COLOR_ATTR_LAST: Internal - * @NL80211_HE_BSS_COLOR_ATTR_MAX: highest BSS Color attribute. - */ -enum nl80211_bss_color_attributes { - __NL80211_HE_BSS_COLOR_ATTR_INVALID, - - NL80211_HE_BSS_COLOR_ATTR_COLOR, - NL80211_HE_BSS_COLOR_ATTR_DISABLED, - NL80211_HE_BSS_COLOR_ATTR_PARTIAL, - - /* keep last */ - __NL80211_HE_BSS_COLOR_ATTR_LAST, - NL80211_HE_BSS_COLOR_ATTR_MAX = __NL80211_HE_BSS_COLOR_ATTR_LAST - 1, -}; - -/** - * enum nl80211_iftype_akm_attributes - interface type AKM attributes - * @__NL80211_IFTYPE_AKM_ATTR_INVALID: Invalid - * - * @NL80211_IFTYPE_AKM_ATTR_IFTYPES: nested attribute containing a flag - * attribute for each interface type that supports AKM suites specified in - * %NL80211_IFTYPE_AKM_ATTR_SUITES - * @NL80211_IFTYPE_AKM_ATTR_SUITES: an array of u32. Used to indicate supported - * AKM suites for the specified interface types. - * - * @__NL80211_IFTYPE_AKM_ATTR_LAST: Internal - * @NL80211_IFTYPE_AKM_ATTR_MAX: highest interface type AKM attribute. - */ -enum nl80211_iftype_akm_attributes { - __NL80211_IFTYPE_AKM_ATTR_INVALID, - - NL80211_IFTYPE_AKM_ATTR_IFTYPES, - NL80211_IFTYPE_AKM_ATTR_SUITES, - - /* keep last */ - __NL80211_IFTYPE_AKM_ATTR_LAST, - NL80211_IFTYPE_AKM_ATTR_MAX = __NL80211_IFTYPE_AKM_ATTR_LAST - 1, -}; - -#endif /* __LINUX_NL80211_H */