Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
print "ieee80211d=1"
# Enable Radar Detection
- if enabled dfs; then
+ if enabled dfs && wireless_supports_dfs "${device}"; then
print "ieee80211h=1"
else
print "ieee80211h=0"
list_match "${capability}" $(__phy_list_ht_capabilities "${phy}")
}
+
+# Returns TRUE if the PHY supports DFS
+phy_supports_dfs() {
+ local phy="${1}"
+ assert isset phy
+
+ local driver="$(phy_get_driver "${phy}")"
+ if ! isset driver; then
+ return ${EXIT_ERROR}
+ fi
+
+ # This is basically a whilelist of drivers which support this
+ # There is no better detection
+ case "${driver}" in
+ ath10k_*|ath9k|ath5k)
+ return ${EXIT_TRUE}
+ ;;
+ *)
+ return ${EXIT_FALSE}
+ ;;
+ esac
+}
network-phy-list-vht-caps "${phy}"
}
+
+wireless_supports_dfs() {
+ local device="${1}"
+ assert isset device
+
+ local phy="$(device_get_phy "${device}")"
+ if ! isset phy; then
+ log ERROR "Could not determine PHY for ${device}"
+ return ${EXIT_ERROR}
+ fi
+
+ phy_supports_dfs "${phy}"
+}
cli_space
fi
+ cli_headline 2 "Features"
+
+ cli_print_fmt1 2 "DFS" \
+ "$(phy_supports_dfs "${phy}" && print "Supported" || print "Not Supported")"
+
+ cli_space
+
return ${EXIT_OK}
}