diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2020-06-02 14:51:00 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2020-06-02 14:53:50 -0700 |
commit | 589d7374dc5c023304f6226cb458d5346bdd3a0b (patch) | |
tree | 8ff2a6c64e9f31d965015b4ed05d59338d318953 | |
parent | net/iw: refactor iw mode setup (diff) | |
download | netifrc-589d7374.tar.gz netifrc-589d7374.tar.bz2 netifrc-589d7374.zip |
net/iw: implement 802.11s mesh
Closes: https://bugs.gentoo.org/469296
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r-- | doc/net.example.Linux.in | 7 | ||||
-rw-r--r-- | net/iw.sh | 25 |
2 files changed, 31 insertions, 1 deletions
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 @@ -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 |