commit: 589d7374dc5c023304f6226cb458d5346bdd3a0b Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> AuthorDate: Tue Jun 2 21:51:00 2020 +0000 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> CommitDate: Tue Jun 2 21:53:50 2020 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=589d7374
net/iw: implement 802.11s mesh Closes: https://bugs.gentoo.org/469296 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> doc/net.example.Linux.in | 7 ++++++- net/iw.sh | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in index 4fc603b..d88302b 100644 --- a/doc/net.example.Linux.in +++ b/doc/net.example.Linux.in @@ -231,7 +231,7 @@ # do require the SSID to be set - do this here #essid_eth0="any" -# Set the mode of the interface (managed, ad-hoc, master or auto) +# Set the mode of the interface (managed, ad-hoc, master, mesh or auto) # The default is auto # If it's ad-hoc or master you also may need to specify the channel below #mode_eth0="auto" @@ -409,6 +409,11 @@ # NOTE: preferred_aps list ignores blacklisted_aps - so if you have # the same SSID in both, well, you're a bit silly :p +# 802.11s mesh support +# Requires CONFIG_MAC80211_MESH in kernel and hardware support +#mode_wlan0="mesh" +#mesh_wlan0="MyMeshNetworkID" + ############################################################ # wpa_supplicant diff --git a/net/iw.sh b/net/iw.sh index dcdbb79..029b9d6 100644 --- a/net/iw.sh +++ b/net/iw.sh @@ -5,6 +5,7 @@ _config_vars="$_config_vars ssid mode associate_timeout sleep_scan" _config_vars="$_config_vars preferred_aps blacklist_aps" +_config_vars="$_config_vars mesh" iw_depend() { @@ -170,6 +171,26 @@ iw_setup_adhoc() return 0 } +iw_setup_mesh() +{ + if [ -z "${MESH}" ]; then + eerror "${IFACE} requires a MESH to be set to operate in mesh mode" + eerror "adjust the mesh_${IFVAR} setting in /etc/conf.d/net" + return 1 + fi + + iw_set_mode 'mesh' + + veinfo "Joining mesh '$MESH' with $IFACE" + iw ${IFACE} mesh join "${MESH}" || return 1 + + # Finally apply the user Config + iw_user_config + + iw_report + return 0 +} + iw_wait_for_association() { local timeout= i=0 @@ -600,6 +621,10 @@ iw_configure() managed) # Fall through ;; + mesh) + iw_setup_mesh + return $? + ;; *) eerror "Only managed and ad-hoc are supported" return 1
