[PATCH v9] Support batman-adv meshing over 802.11s

Tim Niemeyer tim at tn-x.org
So Okt 15 18:27:39 CEST 2017


Hi

Am Sonntag, den 15.10.2017, 11:27 +0200 schrieb Adrian Schmutzler:
> > From: Fabian Blaese <fabian at blaese.de>
> 
> > Signed-off-by: Fabian Bläse <fabian at blaese.de>
> > Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> 
> Update in v2:
> - Add parentheses
> - Rename mesh_type variable
> 
> Update in v3:
> - nothing
> 
> Update in v4:
> - Fix wrong variable assignment introduced in v2
> 
> Update in v5:
> - Add returns to wifiAddMesh
> 
> Update in v6:
> - Rename json mesh_type variable
> 
> Update in v7:
> - Remove ath10k-ct
> - Remove changes to community file
> 
> Update in v8:
> - Revert removing ath10k-ct kmod
> 
> Update in v9:
> - Rebase
> - Use 11s as initial interface during boot (merge with
>   remainder of initial setup patch)
> ---
>  bsp/ar71xx/.config                                 |  4 +--
>  .../fff/fff-hoods/files/usr/sbin/configurehood     | 22 +++++++++---
>  .../files/etc/uci-defaults/60-fff-wireless         |  8 ++---
>  .../fff-wireless/files/lib/functions/fff/wireless  | 40 ++++++++++++++++++++--
>  4 files changed, 61 insertions(+), 13 deletions(-)
> 
> diff --git a/bsp/ar71xx/.config b/bsp/ar71xx/.config
> index b407f7d..0a5b9b9 100644
> --- a/bsp/ar71xx/.config
> +++ b/bsp/ar71xx/.config
> @@ -7,9 +7,9 @@ CONFIG_TARGET_MULTI_PROFILE=y
>  CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_gl-ar150=y
>  CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_gl-ar150=""
>  CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_archer-c25-v1=y
> -CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_archer-c25-v1="-kmod-ath10k kmod-ath10k-ct -ath10k-firmware-qca9887 ath10k-firmware-qca9887-ct"
> +CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_archer-c25-v1="-kmod-ath10k kmod-ath10k-ct"
Es braucht kein Firmware Package? Wie auch immer dies zu lesen ist, ich
hätte stumpf die Invertierung erwartet:

CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_archer-c25-v1="kmod-ath10k -kmod-ath10k-ct ath10k-firmware-qca9887 -ath10k-firmware-qca9887-ct"

Warum ist meine Annahme falsch?

>  CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_archer-c7-v2=y
> -CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_archer-c7-v2="-kmod-ath10k kmod-ath10k-ct -ath10k-firmware-qca988x ath10k-firmware-qca988x-ct"
> +CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_archer-c7-v2="-kmod-ath10k kmod-ath10k-ct"
s.o.

>  CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_cpe210-220=y
>  CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_cpe210-220=""
>  CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_cpe510-520=y
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index 63580b1..8ce9133 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -119,6 +119,7 @@ if [ -s /tmp/keyxchangev2data ]; then
> >  		json_select hood
>  
> >  		json_get_var hood name
> > +		json_get_var mesh_id mesh_id
> >  		json_get_var mesh_bssid mesh_bssid
> >  		json_get_var mesh_essid mesh_essid
> >  		json_get_var essid essid
> @@ -126,10 +127,10 @@ if [ -s /tmp/keyxchangev2data ]; then
> >  		# i think the next things we don't active this in the first version! we can do it later
> >  		#json_get_var channel2 channel2
> >  		#json_get_var mode2 mode2
> > -		#json_get_var type2 type2
> > +		json_get_var mesh_type2 mesh_type2
> >  		#json_get_var channel5 channel5
> >  		#json_get_var mode5 mode5
> > -		#json_get_var type5 type5
> > +		json_get_var mesh_type5 mesh_type5
> >  		#json_get_var protocol protocol
>  		
> >  		json_select ".." # back to root
> @@ -155,9 +156,20 @@ if [ -s /tmp/keyxchangev2data ]; then
> >  			# here we set a bit for add hidden AP
> >  			touch /tmp/hiddenapflag
>  
> > -			if ! wifiAddAdHocMesh "$radio" "$mesh_essid" "$mesh_bssid"; then
> > -				echo "Can't add AP interface on $radio."
> > -				exit 1
> > +			# add 802.11s mesh if type == "802.11s"
> > +			if ( [ -n "$radio5" ] && [ "$mesh_type5" == "802.11s" ] ) || [ "$mesh_type2" == "802.11s" ]; then
> > +				if ! wifiAddMesh "$radio" "$mesh_id"; then
> > +					echo "Can't add Mesh interface on $radio."
> > +					exit 1
> > +				fi
> > +			fi
> +
> +			# add IBSS mesh if type == "ibss"
Das würde in dem Fall der ath10k Geräte nicht funktionieren. Man sollte
mal testen, was dann konkret passiert. Wenn durch das Aktivieren von
ibss auf einem ath10k mit 11s Firmware irgendwelche Nebeneffekte
passieren wäre das hinlänglich doof.

Wäre das der Fall, müsste man hier die Kompatibilität prüfen!

> +			if ( [ -n "$radio5" ] && [ "$mesh_type5" == "ibss" ] ) || [ "$mesh_type2" == "ibss" ]; then
> > +				if ! wifiAddAdHocMesh "$radio" "$mesh_essid" "$mesh_bssid"; then
> > +					echo "Can't add AdHocMesh interface on $radio."
> > +					exit 1
> > +				fi
> >  			fi
> >  		done
>  
> diff --git a/src/packages/fff/fff-wireless/files/etc/uci-defaults/60-fff-wireless b/src/packages/fff/fff-wireless/files/etc/uci-defaults/60-fff-wireless
> index 8070cb4..7e2fcf9 100644
> --- a/src/packages/fff/fff-wireless/files/etc/uci-defaults/60-fff-wireless
> +++ b/src/packages/fff/fff-wireless/files/etc/uci-defaults/60-fff-wireless
> @@ -13,18 +13,18 @@ for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do
> >  	radio="$(wifiAddPhyCond "$phy" "2" "1")"
> >  	radio5="$(wifiAddPhyCond "$phy" "5" "36")"
> >  	[ -n "$radio5" ] && radio="$radio5"
> > -	if [ -z "$radio" ]; then
> +	if [ -z "$radio" ] ; then
Das ist eine nutzlose Änderung..

>  		echo "Can't create radio for $phy"
> >  		exit 1
> >  	fi
>  
> > -	if ! wifiAddAP "$radio" "do.not.use" "mesh" "ap" "0"; then
> +	if ! wifiAddAP "$radio" "do.not.use" "mesh" "ap" "0" ; then
Das ist eine nutzlose Änderung..

Tim

>  		echo "Can't add AP interface on $radio."
> >  		exit 1
> >  	fi
>  
> > -	if ! wifiAddAdHocMesh "$radio" "batman.do.not.use" "02:CA:FF:EE:BA:BE"; then
> > -		echo "Can't add AdHocMesh interface on $radio."
> > +	if ! wifiAddMesh "$radio" "mesh.do.not.use" ; then
> > +		echo "Can't add Mesh interface on $radio."
> >  		exit 1
> >  	fi
>  done
> diff --git a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless
> index 71f566a..7e418c2 100644
> --- a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless
> +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless
> @@ -84,9 +84,9 @@ wifiAddAdHocMesh() {
> >  	local bssid=$3
>  
> >  	local channel=$(uci get "wireless.${radio}.channel")
> > -	local iface="w2mesh"
> > +	local iface="w2ibss"
> >  	if [ "$channel" -gt "14" ]; then
> > -		iface="w5mesh"
> > +		iface="w5ibss"
> >  	fi
>  
> >  	uci batch <<-__EOF__
> @@ -178,4 +178,40 @@ wifiAddSta() {
> >  	return 0
>  }
>  
> +wifiAddMesh() {
> > +	if [ $# -ne "2" ]
> > +	then
> > +		echo "Usage: wifiAddMesh <radio> <mesh-id>"
> > +		return 1
> > +	fi
> +
> > +	local radio=$1
> > +	local mesh_id=$2
> +
> > +	local channel=$(uci get "wireless.${radio}.channel")
> > +	local iface="w2mesh"
> > +	if [ "$channel" -gt "14" ]; then
> > +		iface="w5mesh"
> > +	fi
> > +	uci batch <<-__EOF__
> > +		set wireless.${iface}='wifi-iface'
> > +		set wireless.${iface}.device='${radio}'
> > +		set wireless.${iface}.network='${iface}'
> > +		set wireless.${iface}.ifname='${iface}'
> > +		set wireless.${iface}.mode='mesh'
> > +		set wireless.${iface}.mesh_id='${mesh_id}'
> > +		set wireless.${iface}.encryption='none'
> > +		set wireless.${iface}.mesh_fwding=0
> > +		commit wireless
> +
> > +		set network.${iface}='interface'
> > +		set network.${iface}.mtu='1528'
> > +		set network.${iface}.proto='batadv'
> > +		set network.${iface}.mesh='bat0'
> > +		commit network
> > +	__EOF__
> +
> > +	echo "${iface}"
> > +	return 0
> +}
>  # vim: set noexpandtab:tabstop=4
> -- 
> 2.7.4
> 
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigröße  : 488 bytes
Beschreibung: This is a digitally signed message part
URL         : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20171015/9863378d/attachment.sig>


Mehr Informationen über die Mailingliste franken-dev