+ # Automatically enable ACS if no channel is set and ACS is available
+ if ! isset CHANNEL && phy_supports_acs "${PHY}"; then
+ CHANNEL="0"
+
+ log INFO "Automatic Channel Selection (ACS) enabled"
+ fi
+
+ # Channel bandwidth must match the mode
+ if isset CHANNEL_BANDWIDTH && ! wireless_channel_bandwidth_is_valid "${MODE}" "${CHANNEL_BANDWIDTH}"; then
+ error "Channel Bandwidth '${CHANNEL_BANDWIDTH}' is not supported for ${MODE}"
+ return ${EXIT_ERROR}
+ fi
+
+ # Check if SECRET is set when WPA* is enabled
+ if ! isset SECRET && (enabled WPA3_PERSONAL || enabled WPA2_PERSONAL); then
+ error "Secret is not set when PSK authentication is enabled"
+ return ${EXIT_ERROR}
+ fi
+