Lines Matching full:channel

75 /* dfs_channel_available: select new channel according to type parameter */
80 /* Select only radar channel where CAC has not been in dfs_channel_available()
93 * channel for CSA, unless they are available for immediate use. in dfs_channel_available()
113 * The tables contain first valid channel number based on channel width. in dfs_is_chan_allowed()
114 * We will also choose this first channel as the control one. in dfs_is_chan_allowed()
188 /* hostapd DFS implementation assumes the first channel as primary. in dfs_chan_range_available()
189 * If it's not allowed to use the first channel as primary, decline the in dfs_chan_range_available()
190 * whole channel range. */ in dfs_chan_range_available()
192 wpa_printf(MSG_DEBUG, "DFS: primary channel not allowed"); in dfs_chan_range_available()
200 wpa_printf(MSG_DEBUG, "DFS: no channel data for %d", in dfs_chan_range_available()
205 /* HT 40 MHz secondary channel availability checked only for in dfs_chan_range_available()
206 * primary channel */ in dfs_chan_range_available()
214 wpa_printf(MSG_DEBUG, "DFS: channel not available %d", in dfs_chan_range_available()
262 "DFS: channel %d (%d) is incompatible", in dfs_find_channel()
277 "DFS: channel %d (%d) not in chanlist", in dfs_find_channel()
290 wpa_printf(MSG_DEBUG, "Selected channel %d (%d)", in dfs_find_channel()
295 wpa_printf(MSG_DEBUG, "Adding channel %d (%d)", in dfs_find_channel()
340 "DFS: Unsupported channel width configuration"); in dfs_adjust_center_freq()
351 /* Return start channel idx we will use for mode->channels[idx] */
356 int channel_no = iface->conf->channel; in dfs_get_start_chan_idx()
428 mode->num_channels, channel_no, iface->conf->channel, in dfs_get_start_chan_idx()
434 wpa_printf(MSG_DEBUG, "Available channel: %d", in dfs_get_start_chan_idx()
443 /* At least one channel have radar flag */
447 struct hostapd_channel_data *channel; in dfs_check_chans_radar() local
456 channel = &mode->channels[start_chan_idx + i]; in dfs_check_chans_radar()
457 if (channel->flag & HOSTAPD_CHAN_RADAR) in dfs_check_chans_radar()
469 struct hostapd_channel_data *channel; in dfs_check_chans_available() local
476 channel = &mode->channels[start_chan_idx + i]; in dfs_check_chans_available()
478 if (channel->flag & HOSTAPD_CHAN_DISABLED) in dfs_check_chans_available()
481 if (!(channel->flag & HOSTAPD_CHAN_RADAR)) in dfs_check_chans_available()
484 if ((channel->flag & HOSTAPD_CHAN_DFS_MASK) != in dfs_check_chans_available()
493 /* At least one channel unavailable */
498 struct hostapd_channel_data *channel; in dfs_check_chans_unavailable() local
505 channel = &mode->channels[start_chan_idx + i]; in dfs_check_chans_unavailable()
506 if (channel->flag & HOSTAPD_CHAN_DISABLED) in dfs_check_chans_unavailable()
508 if ((channel->flag & HOSTAPD_CHAN_DFS_MASK) == in dfs_check_chans_unavailable()
533 wpa_printf(MSG_DEBUG, "DFS: Selecting random channel"); in dfs_get_valid_channel()
559 wpa_printf(MSG_DEBUG, "DFS: no random channel found"); in dfs_get_valid_channel()
562 wpa_printf(MSG_DEBUG, "DFS: got random channel %d (%d)", in dfs_get_valid_channel()
571 /* Get secondary channel for HT80P80 */ in dfs_get_valid_channel()
598 /* Check if we got a valid secondary channel which is not in dfs_get_valid_channel()
599 * adjacent to the first channel. in dfs_get_valid_channel()
620 struct hostapd_channel_data *channel; in dfs_set_valid_channel() local
624 channel = dfs_get_valid_channel(iface, &sec, &cf1, &cf2, in dfs_set_valid_channel()
627 if (!channel) { in dfs_set_valid_channel()
628 wpa_printf(MSG_ERROR, "could not get valid channel"); in dfs_set_valid_channel()
632 iface->freq = channel->freq; in dfs_set_valid_channel()
633 iface->conf->channel = channel->chan; in dfs_set_valid_channel()
659 return 1; /* Channel found */ in set_dfs_state_freq()
749 /* Check we are on DFS channel(s) */ in dfs_are_channels_overlapped()
802 struct hostapd_channel_data *channel; in dfs_get_cac_time() local
812 channel = &mode->channels[start_chan_idx + i]; in dfs_get_cac_time()
813 if (!(channel->flag & HOSTAPD_CHAN_RADAR)) in dfs_get_cac_time()
815 if (channel->dfs_cac_ms > cac_time_ms) in dfs_get_cac_time()
816 cac_time_ms = channel->dfs_cac_ms; in dfs_get_cac_time()
825 * 1 - continue channel/ap setup
826 * 0 - channel/ap setup will be continued after CAC
850 /* Get start (first) channel for current configuration */ in hostapd_handle_dfs()
882 wpa_printf(MSG_DEBUG, "DFS %d chans unavailable - choose other channel: %s", in hostapd_handle_dfs()
899 iface->conf->channel, iface->conf->secondary_channel, in hostapd_handle_dfs()
906 iface, iface->conf->hw_mode, iface->freq, iface->conf->channel, in hostapd_handle_dfs()
922 iface->radar_background.channel = iface->conf->channel; in hostapd_handle_dfs()
932 * Let's select a random channel according to the in hostapd_handle_dfs()
951 /* Get the start (first) channel for current configuration */ in hostapd_is_dfs_chan_available()
965 int channel, int freq, in hostapd_dfs_request_channel_switch() argument
978 wpa_printf(MSG_DEBUG, "DFS will switch to a new channel %d", channel); in hostapd_dfs_request_channel_switch()
980 "freq=%d chan=%d sec_chan=%d", freq, channel, in hostapd_dfs_request_channel_switch()
1001 freq, channel, in hostapd_dfs_request_channel_switch()
1035 iface->conf->channel = channel; in hostapd_dfs_request_channel_switch()
1049 /* Channel configuration will be updated once CSA completes and in hostapd_dfs_request_channel_switch()
1051 wpa_printf(MSG_DEBUG, "DFS waiting channel switch event"); in hostapd_dfs_request_channel_switch()
1061 struct hostapd_channel_data *channel; in hostapd_dfs_update_background_chain() local
1066 * Allow selection of DFS channel in ETSI to comply with in hostapd_dfs_update_background_chain()
1072 channel = dfs_get_valid_channel(iface, &sec, &oper_centr_freq_seg0_idx, in hostapd_dfs_update_background_chain()
1075 if (!channel || in hostapd_dfs_update_background_chain()
1076 channel->chan == iface->conf->channel || in hostapd_dfs_update_background_chain()
1077 channel->chan == iface->radar_background.channel) in hostapd_dfs_update_background_chain()
1078 channel = dfs_downgrade_bandwidth(iface, &sec, in hostapd_dfs_update_background_chain()
1082 if (!channel || in hostapd_dfs_update_background_chain()
1084 channel->freq, channel->chan, in hostapd_dfs_update_background_chain()
1093 iface->radar_background.channel = -1; in hostapd_dfs_update_background_chain()
1097 iface->radar_background.channel = channel->chan; in hostapd_dfs_update_background_chain()
1098 iface->radar_background.freq = channel->freq; in hostapd_dfs_update_background_chain()
1105 __func__, channel->chan, channel->freq); in hostapd_dfs_update_background_chain()
1113 iface->radar_background.channel != -1 && in hostapd_dfs_is_background_event()
1123 iface->conf->channel = iface->radar_background.channel; in hostapd_dfs_start_channel_switch_background()
1135 iface, iface->conf->channel, iface->freq, in hostapd_dfs_start_channel_switch_background()
1155 * a radar was detected in this channel, interface setup in hostapd_dfs_complete_cac()
1158 * non-DFS channel in hostapd_dfs_complete_cac()
1160 * DFS channel. in hostapd_dfs_complete_cac()
1174 * channel. Perform CSA, move the main chain to the in hostapd_dfs_complete_cac()
1175 * selected channel and configure the background chain in hostapd_dfs_complete_cac()
1176 * to a new DFS channel. in hostapd_dfs_complete_cac()
1188 * Just mark the channel available when CAC completion in hostapd_dfs_complete_cac()
1193 * sure the configured channel is available because this in hostapd_dfs_complete_cac()
1238 struct hostapd_channel_data *channel; in dfs_downgrade_bandwidth() local
1241 channel = dfs_get_valid_channel(iface, secondary_channel, in dfs_downgrade_bandwidth()
1245 if (channel) { in dfs_downgrade_bandwidth()
1246 wpa_printf(MSG_DEBUG, "DFS: Selected channel: %d", in dfs_downgrade_bandwidth()
1247 channel->chan); in dfs_downgrade_bandwidth()
1248 return channel; in dfs_downgrade_bandwidth()
1273 struct hostapd_channel_data *channel; in hostapd_dfs_start_channel_switch_cac() local
1282 channel = dfs_get_valid_channel(iface, &secondary_channel, in hostapd_dfs_start_channel_switch_cac()
1287 if (!channel) { in hostapd_dfs_start_channel_switch_cac()
1288 channel = dfs_downgrade_bandwidth(iface, &secondary_channel, in hostapd_dfs_start_channel_switch_cac()
1292 if (!channel) { in hostapd_dfs_start_channel_switch_cac()
1293 wpa_printf(MSG_ERROR, "No valid channel available"); in hostapd_dfs_start_channel_switch_cac()
1298 wpa_printf(MSG_DEBUG, "DFS will switch to a new channel %d", in hostapd_dfs_start_channel_switch_cac()
1299 channel->chan); in hostapd_dfs_start_channel_switch_cac()
1301 "freq=%d chan=%d sec_chan=%d", channel->freq, in hostapd_dfs_start_channel_switch_cac()
1302 channel->chan, secondary_channel); in hostapd_dfs_start_channel_switch_cac()
1304 iface->freq = channel->freq; in hostapd_dfs_start_channel_switch_cac()
1305 iface->conf->channel = channel->chan; in hostapd_dfs_start_channel_switch_cac()
1337 * Just select a new random channel according to the in hostapd_dfs_background_start_channel_switch()
1345 * If background radar detection is supported and the radar channel in hostapd_dfs_background_start_channel_switch()
1349 if (iface->radar_background.channel == -1) in hostapd_dfs_background_start_channel_switch()
1354 * Background channel not available yet. Perform CAC on the in hostapd_dfs_background_start_channel_switch()
1367 struct hostapd_channel_data *channel; in hostapd_dfs_start_channel_switch() local
1387 * Allow selection of DFS channel in ETSI to comply with in hostapd_dfs_start_channel_switch()
1393 /* Perform channel switch/CSA */ in hostapd_dfs_start_channel_switch()
1394 channel = dfs_get_valid_channel(iface, &secondary_channel, in hostapd_dfs_start_channel_switch()
1399 if (!channel) { in hostapd_dfs_start_channel_switch()
1401 * If there is no channel to switch immediately to, check if in hostapd_dfs_start_channel_switch()
1402 * there is another channel where we can switch even if it in hostapd_dfs_start_channel_switch()
1406 channel = dfs_downgrade_bandwidth(iface, &secondary_channel, in hostapd_dfs_start_channel_switch()
1410 if (!channel) { in hostapd_dfs_start_channel_switch()
1421 iface->freq = channel->freq; in hostapd_dfs_start_channel_switch()
1422 iface->conf->channel = channel->chan; in hostapd_dfs_start_channel_switch()
1435 return hostapd_dfs_request_channel_switch(iface, channel->chan, in hostapd_dfs_start_channel_switch()
1436 channel->freq, in hostapd_dfs_start_channel_switch()
1474 /* Radar detected while operating, switch the channel. */ in hostapd_dfs_radar_detected()
1502 iface->radar_background.channel == -1) { in hostapd_dfs_nop_finished()
1521 /* Get start (first) channel for current configuration */ in hostapd_is_dfs_required()
1548 * DFS channel. Clear it for this new CAC process. */ in hostapd_dfs_start_cac()
1576 * 2 - continue channel/AP setup for non-DFS channel
1577 * 1 - continue channel/AP setup for DFS channel
1578 * 0 - channel/AP setup will be continued after CAC
1590 * callback to continue AP/channel setup. Reset the CAC start flag and in hostapd_handle_dfs_offload()
1609 "%s: freq %d MHz does not require DFS. Continue channel/AP setup", in hostapd_handle_dfs_offload()