}
+static bool
+hostapd_is_freq_in_current_hw_info(struct hostapd_iface *iface, int freq)
+{
+ struct hostapd_channel_data *chan;
+
+ if (!iface->current_mode)
+ return false;
+
+ chan = hw_mode_get_channel(iface->current_mode, freq, NULL);
+
+ /* If channel data is not found for the given frequency, consider it is
+ * out of the current hardware info. */
+ if (!chan)
+ return false;
+
+ return chan_in_current_hw_info(iface->current_hw_info, chan);
+}
+
+
static bool
hostapd_dfs_is_background_event(struct hostapd_iface *iface, int freq)
{
int ht_enabled, int chan_offset, int chan_width,
int cf1, int cf2)
{
+ if (!hostapd_is_freq_in_current_hw_info(iface, freq)) {
+ wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO,
+ DFS_EVENT_CAC_COMPLETED
+ "Ignoring since freq=%d info is out of own range",
+ freq);
+ return 0;
+ }
+
wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_CAC_COMPLETED
"success=%d freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d radar_detected=%d",
success, freq, ht_enabled, chan_offset, chan_width, cf1, cf2,
int ht_enabled, int chan_offset, int chan_width,
int cf1, int cf2)
{
+ if (!hostapd_is_freq_in_current_hw_info(iface, freq)) {
+ wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO,
+ DFS_EVENT_PRE_CAC_EXPIRED
+ "Ignoring since freq=%d info is out of own range",
+ freq);
+ return 0;
+ }
+
wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_PRE_CAC_EXPIRED
"freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d",
freq, ht_enabled, chan_offset, chan_width, cf1, cf2);
int ht_enabled, int chan_offset, int chan_width,
int cf1, int cf2)
{
+ if (!hostapd_is_freq_in_current_hw_info(iface, freq)) {
+ wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO,
+ DFS_EVENT_RADAR_DETECTED
+ "Ignoring since freq=%d info is out of own range",
+ freq);
+ return 0;
+ }
+
wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_RADAR_DETECTED
"freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d",
freq, ht_enabled, chan_offset, chan_width, cf1, cf2);
int ht_enabled, int chan_offset, int chan_width,
int cf1, int cf2)
{
+ if (!hostapd_is_freq_in_current_hw_info(iface, freq)) {
+ wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO,
+ DFS_EVENT_NOP_FINISHED
+ "Ignoring since freq=%d info is out of own range",
+ freq);
+ return 0;
+ }
+
wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_NOP_FINISHED
"freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d",
freq, ht_enabled, chan_offset, chan_width, cf1, cf2);
int ht_enabled, int chan_offset, int chan_width,
int cf1, int cf2)
{
+ if (!hostapd_is_freq_in_current_hw_info(iface, freq)) {
+ wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_CAC_START
+ "Ignoring since freq=%d info is out of own range",
+ freq);
+ return 0;
+ }
+
if (hostapd_dfs_is_background_event(iface, freq)) {
iface->radar_background.cac_started = 1;
} else {