]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/functions/functions.phy
wireless: Try to automatically enable HT40+/- on devices that support it
[people/ms/network.git] / src / functions / functions.phy
index 76974fa860c46c2fc0766ad49f8436d5ea9842f9..96287a524de6141305728093184527af46502e29 100644 (file)
@@ -169,3 +169,22 @@ phy_supports_channel() {
 
        return ${EXIT_FALSE}
 }
+
+__phy_list_ht_capabilities() {
+       local phy="${1}"
+       assert isset phy
+
+       local capabilities="$(network-phy-list-ht-caps "${phy}")"
+
+       print "${capabilities//[\[\]]/ }"
+}
+
+phy_supports_ht_capability() {
+       local phy="${1}"
+       assert isset phy
+
+       local capability="${2}"
+       assert isset capability
+
+       list_match "${capability}" $(__phy_list_ht_capabilities "${phy}")
+}