1 |
commit: 589d7374dc5c023304f6226cb458d5346bdd3a0b |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jun 2 21:51:00 2020 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 2 21:53:50 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=589d7374 |
7 |
|
8 |
net/iw: implement 802.11s mesh |
9 |
|
10 |
Closes: https://bugs.gentoo.org/469296 |
11 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
12 |
|
13 |
doc/net.example.Linux.in | 7 ++++++- |
14 |
net/iw.sh | 25 +++++++++++++++++++++++++ |
15 |
2 files changed, 31 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in |
18 |
index 4fc603b..d88302b 100644 |
19 |
--- a/doc/net.example.Linux.in |
20 |
+++ b/doc/net.example.Linux.in |
21 |
@@ -231,7 +231,7 @@ |
22 |
# do require the SSID to be set - do this here |
23 |
#essid_eth0="any" |
24 |
|
25 |
-# Set the mode of the interface (managed, ad-hoc, master or auto) |
26 |
+# Set the mode of the interface (managed, ad-hoc, master, mesh or auto) |
27 |
# The default is auto |
28 |
# If it's ad-hoc or master you also may need to specify the channel below |
29 |
#mode_eth0="auto" |
30 |
@@ -409,6 +409,11 @@ |
31 |
# NOTE: preferred_aps list ignores blacklisted_aps - so if you have |
32 |
# the same SSID in both, well, you're a bit silly :p |
33 |
|
34 |
+# 802.11s mesh support |
35 |
+# Requires CONFIG_MAC80211_MESH in kernel and hardware support |
36 |
+#mode_wlan0="mesh" |
37 |
+#mesh_wlan0="MyMeshNetworkID" |
38 |
+ |
39 |
|
40 |
############################################################ |
41 |
# wpa_supplicant |
42 |
|
43 |
diff --git a/net/iw.sh b/net/iw.sh |
44 |
index dcdbb79..029b9d6 100644 |
45 |
--- a/net/iw.sh |
46 |
+++ b/net/iw.sh |
47 |
@@ -5,6 +5,7 @@ |
48 |
|
49 |
_config_vars="$_config_vars ssid mode associate_timeout sleep_scan" |
50 |
_config_vars="$_config_vars preferred_aps blacklist_aps" |
51 |
+_config_vars="$_config_vars mesh" |
52 |
|
53 |
iw_depend() |
54 |
{ |
55 |
@@ -170,6 +171,26 @@ iw_setup_adhoc() |
56 |
return 0 |
57 |
} |
58 |
|
59 |
+iw_setup_mesh() |
60 |
+{ |
61 |
+ if [ -z "${MESH}" ]; then |
62 |
+ eerror "${IFACE} requires a MESH to be set to operate in mesh mode" |
63 |
+ eerror "adjust the mesh_${IFVAR} setting in /etc/conf.d/net" |
64 |
+ return 1 |
65 |
+ fi |
66 |
+ |
67 |
+ iw_set_mode 'mesh' |
68 |
+ |
69 |
+ veinfo "Joining mesh '$MESH' with $IFACE" |
70 |
+ iw ${IFACE} mesh join "${MESH}" || return 1 |
71 |
+ |
72 |
+ # Finally apply the user Config |
73 |
+ iw_user_config |
74 |
+ |
75 |
+ iw_report |
76 |
+ return 0 |
77 |
+} |
78 |
+ |
79 |
iw_wait_for_association() |
80 |
{ |
81 |
local timeout= i=0 |
82 |
@@ -600,6 +621,10 @@ iw_configure() |
83 |
managed) |
84 |
# Fall through |
85 |
;; |
86 |
+ mesh) |
87 |
+ iw_setup_mesh |
88 |
+ return $? |
89 |
+ ;; |
90 |
*) |
91 |
eerror "Only managed and ad-hoc are supported" |
92 |
return 1 |