Lines Matching refs:chan
248 static void acs_clean_chan_surveys(struct hostapd_channel_data *chan)
252 if (dl_list_empty(&chan->survey_list))
255 dl_list_for_each_safe(survey, tmp, &chan->survey_list,
266 struct hostapd_channel_data *chan;
269 chan = &iface->current_mode->channels[i];
271 if (chan->flag & HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED)
272 acs_clean_chan_surveys(chan);
274 dl_list_init(&chan->survey_list);
275 chan->flag |= HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED;
276 chan->min_nf = 0;
327 struct hostapd_channel_data *chan)
334 if (dl_list_empty(&chan->survey_list))
337 if (chan->flag & HOSTAPD_CHAN_DISABLED)
340 chan->interference_factor = 0;
342 dl_list_for_each(survey, &chan->survey_list, struct freq_survey, list)
354 chan->interference_factor += int_factor;
356 i, chan->min_nf, int_factor,
364 chan->interference_factor /= count;
368 static int acs_usable_ht40_chan(struct hostapd_channel_data *chan)
375 if (chan->chan == allowed[i])
382 static int acs_usable_vht80_chan(struct hostapd_channel_data *chan)
388 if (chan->chan == allowed[i])
418 static int acs_survey_list_is_sufficient(struct hostapd_channel_data *chan)
423 dl_list_for_each(survey, &chan->survey_list, struct freq_survey, list)
438 chan->chan);
448 struct hostapd_channel_data *chan;
452 chan = &iface->current_mode->channels[i];
453 if (chan->flag & HOSTAPD_CHAN_DISABLED)
456 if (!acs_survey_list_is_sufficient(chan))
467 static int acs_usable_chan(struct hostapd_channel_data *chan)
469 if (dl_list_empty(&chan->survey_list))
471 if (chan->flag & HOSTAPD_CHAN_DISABLED)
473 if (!acs_survey_list_is_sufficient(chan))
480 struct hostapd_channel_data *chan)
485 return freq_range_list_includes(&iface->conf->acs_ch_list, chan->chan);
493 struct hostapd_channel_data *chan;
496 chan = &iface->current_mode->channels[i];
498 if (!acs_usable_chan(chan))
501 if (!is_in_chanlist(iface, chan))
505 chan->chan, chan->freq);
507 acs_survey_chan_interference_factor(iface, chan);
510 chan->interference_factor);
518 struct hostapd_channel_data *chan;
522 chan = &iface->current_mode->channels[i];
524 if (chan->flag & HOSTAPD_CHAN_DISABLED)
527 if (chan->freq == freq)
528 return chan;
542 static int is_common_24ghz_chan(int chan)
544 return chan == 1 || chan == 6 || chan == 11;
566 * At this point it's assumed chan->interface_factor has been computed.
568 * option (survey, BSS, spectral, ...). chan->interference factor must be
574 struct hostapd_channel_data *chan, *adj_chan, *ideal_chan = NULL,
608 chan = &iface->current_mode->channels[i];
610 if (chan->flag & HOSTAPD_CHAN_DISABLED)
613 if (!is_in_chanlist(iface, chan))
621 !acs_usable_ht40_chan(chan)) {
623 chan->chan);
630 !acs_usable_vht80_chan(chan)) {
632 chan->chan);
637 if (acs_usable_chan(chan))
638 factor = chan->interference_factor;
642 adj_chan = acs_find_chan(iface, chan->freq + (j * 20));
654 chan->chan);
662 adj_chan = acs_find_chan(iface, chan->freq +
670 adj_chan = acs_find_chan(iface, chan->freq +
678 adj_chan = acs_find_chan(iface, chan->freq +
686 adj_chan = acs_find_chan(iface, chan->freq +
702 if (bias->channel == chan->chan)
707 is_common_24ghz_chan(chan->chan)) {
708 tmp_bias.channel = chan->chan;
717 chan->chan, factor, bias->bias);
721 chan->chan, factor);
724 if (acs_usable_chan(chan) &&
727 ideal_chan = chan;
732 rand_chan = chan;
737 ideal_chan->chan, ideal_chan->freq, ideal_factor);
822 iface->conf->channel = ideal_chan->chan;
881 struct hostapd_channel_data *chan;
892 chan = &iface->current_mode->channels[i];
893 if (chan->flag & HOSTAPD_CHAN_DISABLED)
896 if (!is_in_chanlist(iface, chan))
899 *freq++ = chan->freq;