Browse Source

mac80211, hostapd: use upstream fix for AP+11s VIF combinations

Matthias Schiffer 7 years ago
parent
commit
a7ea424214

+ 0 - 84
patches/lede/0011-mac80211-revert-upstream-change-breaking-AP-11s-VIF-combinations.patch

@@ -1,84 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Sat, 11 Mar 2017 06:15:18 +0100
-Subject: mac80211: revert upstream change breaking AP+11s VIF combinations
-
-Fixes FS#619.
-
-Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
-
-diff --git a/package/kernel/mac80211/patches/323-Revert-mac80211-validate-new-interface-s-beacon-inte.patch b/package/kernel/mac80211/patches/323-Revert-mac80211-validate-new-interface-s-beacon-inte.patch
-new file mode 100644
-index 0000000000000000000000000000000000000000..60d0e9181ef34560613b6cdb88c87441fd16143f
---- /dev/null
-+++ b/package/kernel/mac80211/patches/323-Revert-mac80211-validate-new-interface-s-beacon-inte.patch
-@@ -0,0 +1,48 @@
-+From: Matthias Schiffer <mschiffer@universe-factory.net>
-+Date: Sat, 11 Mar 2017 06:07:03 +0100
-+Subject: [PATCH] Revert "mac80211: validate new interface's beacon intervals"
-+
-+This reverts commit ac668afe414b1d41366f92a33b4d32428335db54, as it
-+prevents simultaneous operation of AP and mesh point VIFs.
-+
-+Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
-+---
-+
-+--- a/net/mac80211/cfg.c
-++++ b/net/mac80211/cfg.c
-+@@ -864,8 +864,6 @@ static int ieee80211_start_ap(struct wip
-+ 	}
-+ 	sdata->needed_rx_chains = sdata->local->rx_chains;
-+ 
-+-	sdata->vif.bss_conf.beacon_int = params->beacon_interval;
-+-
-+ 	mutex_lock(&local->mtx);
-+ 	err = ieee80211_vif_use_channel(sdata, &params->chandef,
-+ 					IEEE80211_CHANCTX_SHARED);
-+@@ -896,6 +894,7 @@ static int ieee80211_start_ap(struct wip
-+ 					      vlan->vif.type);
-+ 	}
-+ 
-++	sdata->vif.bss_conf.beacon_int = params->beacon_interval;
-+ 	sdata->vif.bss_conf.dtim_period = params->dtim_period;
-+ 	sdata->vif.bss_conf.enable_beacon = true;
-+ 	sdata->vif.bss_conf.allow_p2p_go_ps = sdata->vif.p2p;
-+--- a/net/mac80211/util.c
-++++ b/net/mac80211/util.c
-+@@ -3330,16 +3330,6 @@ int ieee80211_check_combinations(struct
-+ 	if (WARN_ON(iftype >= NUM_NL80211_IFTYPES))
-+ 		return -EINVAL;
-+ 
-+-	if (sdata->vif.type == NL80211_IFTYPE_AP ||
-+-	    sdata->vif.type == NL80211_IFTYPE_MESH_POINT) {
-+-		/*
-+-		 * always passing this is harmless, since it'll be the
-+-		 * same value that cfg80211 finds if it finds the same
-+-		 * interface ... and that's always allowed
-+-		 */
-+-		params.new_beacon_int = sdata->vif.bss_conf.beacon_int;
-+-	}
-+-
-+ 	/* Always allow software iftypes */
-+ 	if (local->hw.wiphy->software_iftypes & BIT(iftype)) {
-+ 		if (radar_detect)
-diff --git a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch
-index 9a0f6f5dbd9f669174d65133c427ecfba533f950..6856d6919d474e817596f972a8bb6cf4c898d795 100644
---- a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch
-+++ b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch
-@@ -57,7 +57,7 @@
-  	__NL80211_ATTR_AFTER_LAST,
- --- a/net/mac80211/cfg.c
- +++ b/net/mac80211/cfg.c
--@@ -2396,6 +2396,19 @@ static int ieee80211_get_tx_power(struct
-+@@ -2395,6 +2395,19 @@ static int ieee80211_get_tx_power(struct
-  	return 0;
-  }
-  
-@@ -77,7 +77,7 @@
-  static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev,
-  				  const u8 *addr)
-  {
--@@ -3627,6 +3640,7 @@ const struct cfg80211_ops mac80211_confi
-+@@ -3626,6 +3639,7 @@ const struct cfg80211_ops mac80211_confi
-  	.set_wiphy_params = ieee80211_set_wiphy_params,
-  	.set_tx_power = ieee80211_set_tx_power,
-  	.get_tx_power = ieee80211_get_tx_power,

+ 0 - 0
patches/lede/0012-netifd-ubus-add-interface-method-to-trigger-renew-event.patch → patches/lede/0011-netifd-ubus-add-interface-method-to-trigger-renew-event.patch


+ 21 - 0
patches/lede/0012-hostapd-remove-unused-variable-declarations-in-hostapd.sh.patch

@@ -0,0 +1,21 @@
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Sat, 13 May 2017 16:16:01 +0200
+Subject: hostapd: remove unused variable declarations in hostapd.sh
+
+None of the variables in this "local" declaration are actually set in
+wpa_supplicant_add_network().
+
+Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
+
+diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
+index 988ebc7757fedfba3eba464a973824622c3af8c3..195b6ec45ac4def6484b322703be04433b209c7b 100644
+--- a/package/network/services/hostapd/files/hostapd.sh
++++ b/package/network/services/hostapd/files/hostapd.sh
+@@ -696,7 +696,6 @@ wpa_supplicant_add_network() {
+ 			;;
+ 		esac
+ 	}
+-	local beacon_int brates mrate
+ 	[ -n "$bssid" ] && append network_data "bssid=$bssid" "$N$T"
+ 	[ -n "$beacon_int" ] && append network_data "beacon_int=$beacon_int" "$N$T"
+ 

+ 116 - 0
patches/lede/0013-mac80211-hostapd-always-explicitly-set-beacon-interval.patch

@@ -0,0 +1,116 @@
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Sat, 13 May 2017 16:17:44 +0200
+Subject: mac80211, hostapd: always explicitly set beacon interval
+
+One of the latest mac80211 updates added sanity checks, requiring the
+beacon intervals of all VIFs of the same radio to match. This often broke
+AP+11s setups, as these modes use different default intervals, at least in
+some configurations (observed on ath9k).
+
+Instead of relying on driver or hostapd defaults, change the scripts to
+always explicitly set the beacon interval, defaulting to 100. This also
+applies the beacon interval to 11s interfaces, which had been forgotten
+before. VIF-specific beacon_int setting is removed from hostapd.sh.
+
+Fixes FS#619.
+
+Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
+
+diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
+index 7d7065d4ecaa4bd9eec8fedfd8f16f27d826e8aa..a326965016f35d2a7fcc061eb5dc4fd2060a3261 100644
+--- a/package/kernel/mac80211/Makefile
++++ b/package/kernel/mac80211/Makefile
+@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
+ PKG_NAME:=mac80211
+ 
+ PKG_VERSION:=2017-01-31
+-PKG_RELEASE:=1
++PKG_RELEASE:=2
+ PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
+ PKG_BACKPORT_VERSION:=
+ PKG_HASH:=75e6d39e34cf156212a2509172a4a62b673b69eb4a1d9aaa565f7fa719fa2317
+diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+index baa023ecf63ba3515e1458064e1b14bc5c74a8bc..82c374353ec98259e57c2568843ca9ef6b3a4ca2 100644
+--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
++++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+@@ -268,7 +268,7 @@ mac80211_hostapd_setup_base() {
+ 			vht_max_mpdu_hw=11454
+ 		[ "$vht_max_mpdu_hw" != 3895 ] && \
+ 			vht_capab="$vht_capab[MAX-MPDU-$vht_max_mpdu_hw]"
+-			
++
+ 		# maximum A-MPDU length exponent
+ 		vht_max_a_mpdu_len_exp_hw=0
+ 		[ "$(($vht_cap & 58720256))" -ge 8388608 -a 1 -le "$vht_max_a_mpdu_len_exp" ] && \
+@@ -566,7 +566,7 @@ mac80211_setup_adhoc() {
+ 	[ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate"
+ 
+ 	iw dev "$ifname" ibss join "$ssid" $freq $ibss_htmode fixed-freq $bssid \
+-		${beacon_int:+beacon-interval $beacon_int} \
++		beacon-interval $beacon_int \
+ 		${brstr:+basic-rates $brstr} \
+ 		${mcval:+mcast-rate $mcval} \
+ 		${keyspec:+keys $keyspec}
+@@ -646,7 +646,9 @@ mac80211_setup_vif() {
+ 				esac
+ 
+ 				freq="$(get_freq "$phy" "$channel")"
+-				iw dev "$ifname" mesh join "$mesh_id" freq $freq $mesh_htmode ${mcval:+mcast-rate $mcval}
++				iw dev "$ifname" mesh join "$mesh_id" freq $freq $mesh_htmode \
++					${mcval:+mcast-rate $mcval} \
++					beacon-interval $beacon_int
+ 			fi
+ 
+ 			for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do
+@@ -698,7 +700,7 @@ drv_mac80211_setup() {
+ 		country chanbw distance \
+ 		txpower antenna_gain \
+ 		rxantenna txantenna \
+-		frag rts beacon_int htmode
++		frag rts beacon_int:100 htmode
+ 	json_get_values basic_rate_list basic_rate
+ 	json_select ..
+ 
+diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
+index f3aa94b6eaf1d3370f69b21e8e4bd22dfc1f5931..b7cc6b9c34f67685b92c89de310aedbf8462cb62 100644
+--- a/package/network/services/hostapd/Makefile
++++ b/package/network/services/hostapd/Makefile
+@@ -7,7 +7,7 @@
+ include $(TOPDIR)/rules.mk
+ 
+ PKG_NAME:=hostapd
+-PKG_RELEASE:=2
++PKG_RELEASE:=3
+ 
+ PKG_SOURCE_URL:=http://w1.fi/hostap.git
+ PKG_SOURCE_PROTO:=git
+diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
+index 195b6ec45ac4def6484b322703be04433b209c7b..a937baa4d8442acc292ced3c1a3c896dba2c813e 100644
+--- a/package/network/services/hostapd/files/hostapd.sh
++++ b/package/network/services/hostapd/files/hostapd.sh
+@@ -75,7 +75,7 @@ hostapd_prepare_device_config() {
+ 	local base="${config%%.conf}"
+ 	local base_cfg=
+ 
+-	json_get_vars country country_ie beacon_int doth require_mode
++	json_get_vars country country_ie beacon_int:100 doth require_mode
+ 
+ 	hostapd_set_log_options base_cfg
+ 
+@@ -109,7 +109,7 @@ hostapd_prepare_device_config() {
+ 
+ 	[ -n "$rlist" ] && append base_cfg "supported_rates=$rlist" "$N"
+ 	[ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N"
+-	[ -n "$beacon_int" ] && append base_cfg "beacon_int=$beacon_int" "$N"
++	append base_cfg "beacon_int=$beacon_int" "$N"
+ 
+ 	cat > "$config" <<EOF
+ driver=$driver
+@@ -697,7 +697,6 @@ wpa_supplicant_add_network() {
+ 		esac
+ 	}
+ 	[ -n "$bssid" ] && append network_data "bssid=$bssid" "$N$T"
+-	[ -n "$beacon_int" ] && append network_data "beacon_int=$beacon_int" "$N$T"
+ 
+ 	local bssid_blacklist bssid_whitelist
+ 	json_get_values bssid_blacklist bssid_blacklist