From 63fc7ab93da22ef7cbad29732cc3fff12783e914 Mon Sep 17 00:00:00 2001 From: Alexandros Couloumbis Date: Wed, 11 Nov 2020 13:15:54 +0200 Subject: [PATCH] wifi ozonet updates --- .../files/lib/netifd/wireless/mac80211.sh | 6 +- package/kernel/madwifi/Makefile | 8 +- .../hostapd/files/hostapd-full.config | 2 +- .../network/services/hostapd/files/hostapd.sh | 123 +++++++++++++++--- .../hostapd/patches/999-extend-channels.patch | 10 +- package/network/utils/hostap-utils/Makefile | 1 - 6 files changed, 115 insertions(+), 35 deletions(-) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 17095b7205..6ca12084cf 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -34,6 +34,7 @@ drv_mac80211_init_device_config() { config_add_boolean noscan ht_coex acs_exclude_dfs config_add_array ht_capab config_add_array channels + config_add_array scan_list config_add_boolean \ rxldpc \ short_gi_80 \ @@ -371,7 +372,7 @@ mac80211_hostapd_setup_bss() { hostapd_cfg= append hostapd_cfg "$type=$ifname" "$N" - hostapd_set_bss_options hostapd_cfg "$vif" || return 1 + hostapd_set_bss_options hostapd_cfg "$phy" "$vif" || return 1 json_get_vars wds wds_bridge dtim_period max_listen_int start_disabled set_default wds 0 @@ -626,7 +627,7 @@ mac80211_setup_supplicant() { local spobj="$(ubus -S list | grep wpa_supplicant.${ifname})" [ "$enable" = 0 ] && { - ubus call wpa_supplicant.${phy} config_del "{\"iface\":\"$ifname\"}" + ubus call wpa_supplicant.${phy} config_remove "{\"iface\":\"$ifname\"}" ip link set dev "$ifname" down iw dev "$ifname" del return 0 @@ -897,6 +898,7 @@ drv_mac80211_setup() { rxantenna txantenna \ frag rts beacon_int:100 htmode json_get_values basic_rate_list basic_rate + json_get_values scan_list scan_list json_select .. find_phy || { diff --git a/package/kernel/madwifi/Makefile b/package/kernel/madwifi/Makefile index a79c03ae3c..511085c9ad 100644 --- a/package/kernel/madwifi/Makefile +++ b/package/kernel/madwifi/Makefile @@ -128,12 +128,8 @@ ifneq ($(CONFIG_MADWIFI_SINGLE_MODULE),) MADWIFI_AUTOLOAD:= ath_hal else MADWIFI_AUTOLOAD:= \ - ath_hal \ - wlan \ ath_rate_$(RATE_CONTROL) \ - wlan_scan_ap \ - wlan_scan_sta \ - wlan_acl + wlan_scan_sta endif ifeq ($(findstring AHB,$(BUS)),AHB) @@ -153,7 +149,7 @@ define KernelPackage/madwifi URL:=http://madwifi-project.org/ DEPENDS:=+wireless-tools @(!(TARGET_avr32||TARGET_brcm63xx||TARGET_cobalt||TARGET_ep93xx||TARGET_etrax||TARGET_octeon||TARGET_pxcab||TARGET_sibyte)||BROKEN) +@DRIVER_WEXT_SUPPORT FILES:=$(MADWIFI_FILES) - AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD)) + AUTOLOAD:=$(call AutoProbe,$(MADWIFI_AUTOLOAD)) MENU:=1 endef diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index ab9d13aae7..fee4479dfa 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -313,7 +313,7 @@ CONFIG_INTERNAL_LIBTOMMATH=y # Interworking (IEEE 802.11u) # This can be used to enable functionality to improve interworking with # external networks. -#CONFIG_INTERWORKING=y +CONFIG_INTERWORKING=y # Hotspot 2.0 #CONFIG_HS20=y diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 7a22ec39ce..a62e921dad 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -119,7 +119,7 @@ hostapd_prepare_device_config() { set_default country_ie 1 set_default spectrum_mgmt_required 0 - set_default doth 0 + set_default doth 1 set_default legacy_rates 1 set_default airtime_mode 0 @@ -239,12 +239,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 @@ -266,6 +269,13 @@ hostapd_common_add_bss_config() { 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_boolean hs20 disable_dgaf osen config_add_int anqp_domain_id config_add_int hs20_deauth_req_timeout @@ -311,6 +321,34 @@ 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_hs20_oper_friendly_name() { append bss_conf "hs20_oper_friendly_name=$1" "$N" } @@ -610,30 +648,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 @@ -770,6 +809,49 @@ 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 + + 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" + + 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 json_get_vars hs20 disable_dgaf osen anqp_domain_id hs20_deauth_req_timeout \ @@ -896,6 +978,7 @@ wpa_supplicant_prepare_interface() { fi wpa_supplicant_teardown_interface "$ifname" cat > "$_config" <= 5180 && freq <= 5240) { -+ if (freq >= 5010 && freq <= 5240) { ++ if (freq >= 5000 && freq <= 5240) { if ((freq - 5000) % 5) return NUM_HOSTAPD_MODES; @@ -25,7 +25,7 @@ index a081f87..b9b772e 100644 case 119: /* channels 52,60; 40 MHz; dfs */ case 120: /* channels 56,64; 40 MHz; dfs */ - if (chan < 36 || chan > 64) -+ if (chan < 2 || chan > 64) ++ if (chan < 1 || chan > 64) return -1; return 5000 + 5 * chan; case 121: /* channels 100-140 */ @@ -39,18 +39,18 @@ index a081f87..b9b772e 100644 case 126: /* channels 149,157; 40 MHz */ case 127: /* channels 153,161; 40 MHz */ - if (chan < 149 || chan > 161) -+ if (chan < 141 || chan > 186) ++ if (chan < 141 || chan > 220) return -1; return 5000 + 5 * chan; case 125: /* channels 149,153,157,161,165,169 */ - if (chan < 149 || chan > 169) -+ if (chan < 141 || chan > 186) ++ if (chan < 141 || chan > 220) return -1; return 5000 + 5 * chan; case 128: /* center freqs 42, 58, 106, 122, 138, 155; 80 MHz */ case 130: /* center freqs 42, 58, 106, 122, 138, 155; 80 MHz */ - if (chan < 36 || chan > 161) -+ if (chan < 36 || chan > 186) ++ if (chan < 36 || chan > 220) return -1; return 5000 + 5 * chan; case 129: /* center freqs 50, 114; 160 MHz */ diff --git a/package/network/utils/hostap-utils/Makefile b/package/network/utils/hostap-utils/Makefile index 7051f6ad0e..16e1b156c0 100644 --- a/package/network/utils/hostap-utils/Makefile +++ b/package/network/utils/hostap-utils/Makefile @@ -19,7 +19,6 @@ include $(INCLUDE_DIR)/package.mk define Package/hostap-utils SECTION:=net CATEGORY:=Network - DEPENDS:=kmod-hostap TITLE:=Host AP driver utility programs URL:=http://hostap.epitest.fi/ endef -- 2.35.1