X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Fnetwork.git;a=blobdiff_plain;f=src%2Ffunctions%2Ffunctions.wireless;h=12204c07879b6794c99f94e9d13b0442674cb4ce;hp=0437d27bfecf598dc68bfc1da616fdb74c5d2005;hb=7842c2ce43d1f185e65bb9f2beead96376e2bd34;hpb=54094fc7ae1bc17e8d8361f7758d9404f1eeff02 diff --git a/src/functions/functions.wireless b/src/functions/functions.wireless index 0437d27b..12204c07 100644 --- a/src/functions/functions.wireless +++ b/src/functions/functions.wireless @@ -37,6 +37,9 @@ declare -A WIRELESS_CHANNEL_BANDWIDTHS=( ["802.11g"]="20 40" ) +WIRELESS_ENVIRONMENTS=( "indoor+outdoor" "indoor" "outdoor" ) +WIRELESS_DEFAULT_ENVIRONMENT="${WIRELESS_ENVIRONMENTS[0]}" + cli_wireless() { local action=${1} shift 1 @@ -536,6 +539,19 @@ wireless_get_vht_caps() { network-phy-list-vht-caps "${phy}" } +wireless_supports_acs() { + 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_acs "${phy}" +} + wireless_supports_dfs() { local device="${1}" assert isset device @@ -548,3 +564,9 @@ wireless_supports_dfs() { phy_supports_dfs "${phy}" } + +wireless_environment_is_valid() { + local environment="${1}" + + list_match "${environment}" "${WIRELESS_ENVIRONMENTS[@]}" +}