• Home
  • Raw
  • Download

Lines Matching refs:iface

244 static int acs_request_scan(struct hostapd_iface *iface);
263 static void acs_cleanup(struct hostapd_iface *iface) in acs_cleanup() argument
268 for (i = 0; i < iface->current_mode->num_channels; i++) { in acs_cleanup()
269 chan = &iface->current_mode->channels[i]; in acs_cleanup()
279 iface->chans_surveyed = 0; in acs_cleanup()
280 iface->acs_num_completed_scans = 0; in acs_cleanup()
284 static void acs_fail(struct hostapd_iface *iface) in acs_fail() argument
287 acs_cleanup(iface); in acs_fail()
288 hostapd_disable_iface(iface); in acs_fail()
326 acs_survey_chan_interference_factor(struct hostapd_iface *iface, in acs_survey_chan_interference_factor() argument
353 iface->lowest_nf); in acs_survey_chan_interference_factor()
445 static int acs_surveys_are_sufficient(struct hostapd_iface *iface) in acs_surveys_are_sufficient() argument
451 for (i = 0; i < iface->current_mode->num_channels; i++) { in acs_surveys_are_sufficient()
452 chan = &iface->current_mode->channels[i]; in acs_surveys_are_sufficient()
479 static int is_in_chanlist(struct hostapd_iface *iface, in is_in_chanlist() argument
482 if (!iface->conf->acs_ch_list.num) in is_in_chanlist()
485 return freq_range_list_includes(&iface->conf->acs_ch_list, chan->chan); in is_in_chanlist()
490 struct hostapd_iface *iface) in acs_survey_all_chans_intereference_factor() argument
495 for (i = 0; i < iface->current_mode->num_channels; i++) { in acs_survey_all_chans_intereference_factor()
496 chan = &iface->current_mode->channels[i]; in acs_survey_all_chans_intereference_factor()
501 if (!is_in_chanlist(iface, chan)) in acs_survey_all_chans_intereference_factor()
507 acs_survey_chan_interference_factor(iface, chan); in acs_survey_all_chans_intereference_factor()
515 static struct hostapd_channel_data *acs_find_chan(struct hostapd_iface *iface, in acs_find_chan() argument
521 for (i = 0; i < iface->current_mode->num_channels; i++) { in acs_find_chan()
522 chan = &iface->current_mode->channels[i]; in acs_find_chan()
572 acs_find_ideal_chan(struct hostapd_iface *iface) in acs_find_ideal_chan() argument
583 if (iface->conf->ieee80211n && in acs_find_ideal_chan()
584 iface->conf->secondary_channel == -1) { in acs_find_ideal_chan()
589 if (iface->conf->ieee80211n && in acs_find_ideal_chan()
590 iface->conf->secondary_channel) in acs_find_ideal_chan()
593 if (iface->conf->ieee80211ac && in acs_find_ideal_chan()
594 iface->conf->vht_oper_chwidth == 1) in acs_find_ideal_chan()
604 for (i = 0; i < iface->current_mode->num_channels; i++) { in acs_find_ideal_chan()
608 chan = &iface->current_mode->channels[i]; in acs_find_ideal_chan()
613 if (!is_in_chanlist(iface, chan)) in acs_find_ideal_chan()
618 if (iface->current_mode->mode == HOSTAPD_MODE_IEEE80211A && in acs_find_ideal_chan()
619 iface->conf->ieee80211n && in acs_find_ideal_chan()
620 iface->conf->secondary_channel && in acs_find_ideal_chan()
627 if (iface->current_mode->mode == HOSTAPD_MODE_IEEE80211A && in acs_find_ideal_chan()
628 iface->conf->ieee80211ac && in acs_find_ideal_chan()
629 iface->conf->vht_oper_chwidth == 1 && in acs_find_ideal_chan()
642 adj_chan = acs_find_chan(iface, chan->freq + (j * 20)); in acs_find_ideal_chan()
660 if (is_24ghz_mode(iface->current_mode->mode)) { in acs_find_ideal_chan()
662 adj_chan = acs_find_chan(iface, chan->freq + in acs_find_ideal_chan()
670 adj_chan = acs_find_chan(iface, chan->freq + in acs_find_ideal_chan()
678 adj_chan = acs_find_chan(iface, chan->freq + in acs_find_ideal_chan()
686 adj_chan = acs_find_chan(iface, chan->freq + in acs_find_ideal_chan()
699 if (iface->conf->acs_chan_bias) { in acs_find_ideal_chan()
700 for (k = 0; k < iface->conf->num_acs_chan_bias; k++) { in acs_find_ideal_chan()
701 bias = &iface->conf->acs_chan_bias[k]; in acs_find_ideal_chan()
706 } else if (is_24ghz_mode(iface->current_mode->mode) && in acs_find_ideal_chan()
745 static void acs_adjust_vht_center_freq(struct hostapd_iface *iface) in acs_adjust_vht_center_freq() argument
751 switch (iface->conf->vht_oper_chwidth) { in acs_adjust_vht_center_freq()
753 offset = 2 * iface->conf->secondary_channel; in acs_adjust_vht_center_freq()
765 iface->conf->vht_oper_centr_freq_seg0_idx = in acs_adjust_vht_center_freq()
766 iface->conf->channel + offset; in acs_adjust_vht_center_freq()
770 static int acs_study_survey_based(struct hostapd_iface *iface) in acs_study_survey_based() argument
774 if (!iface->chans_surveyed) { in acs_study_survey_based()
779 if (!acs_surveys_are_sufficient(iface)) { in acs_study_survey_based()
784 acs_survey_all_chans_intereference_factor(iface); in acs_study_survey_based()
789 static int acs_study_options(struct hostapd_iface *iface) in acs_study_options() argument
793 err = acs_study_survey_based(iface); in acs_study_options()
804 static void acs_study(struct hostapd_iface *iface) in acs_study() argument
809 err = acs_study_options(iface); in acs_study()
815 ideal_chan = acs_find_ideal_chan(iface); in acs_study()
822 iface->conf->channel = ideal_chan->chan; in acs_study()
824 if (iface->conf->ieee80211ac) in acs_study()
825 acs_adjust_vht_center_freq(iface); in acs_study()
833 if (hostapd_acs_completed(iface, err) == HOSTAPD_CHAN_VALID) { in acs_study()
834 acs_cleanup(iface); in acs_study()
841 acs_fail(iface); in acs_study()
845 static void acs_scan_complete(struct hostapd_iface *iface) in acs_scan_complete() argument
849 iface->scan_cb = NULL; in acs_scan_complete()
852 iface->conf->acs_num_scans); in acs_scan_complete()
854 err = hostapd_drv_get_survey(iface->bss[0], 0); in acs_scan_complete()
860 if (++iface->acs_num_completed_scans < iface->conf->acs_num_scans) { in acs_scan_complete()
861 err = acs_request_scan(iface); in acs_scan_complete()
870 acs_study(iface); in acs_scan_complete()
873 hostapd_acs_completed(iface, 1); in acs_scan_complete()
874 acs_fail(iface); in acs_scan_complete()
878 static int acs_request_scan(struct hostapd_iface *iface) in acs_request_scan() argument
885 params.freqs = os_calloc(iface->current_mode->num_channels + 1, in acs_request_scan()
891 for (i = 0; i < iface->current_mode->num_channels; i++) { in acs_request_scan()
892 chan = &iface->current_mode->channels[i]; in acs_request_scan()
896 if (!is_in_chanlist(iface, chan)) in acs_request_scan()
903 iface->scan_cb = acs_scan_complete; in acs_request_scan()
906 iface->acs_num_completed_scans + 1, in acs_request_scan()
907 iface->conf->acs_num_scans); in acs_request_scan()
909 if (hostapd_driver_scan(iface->bss[0], &params) < 0) { in acs_request_scan()
911 acs_cleanup(iface); in acs_request_scan()
921 enum hostapd_chan_status acs_init(struct hostapd_iface *iface) in acs_init() argument
927 if (iface->drv_flags & WPA_DRIVER_FLAGS_ACS_OFFLOAD) { in acs_init()
929 err = hostapd_drv_do_acs(iface->bss[0]); in acs_init()
935 if (!iface->current_mode) in acs_init()
938 acs_cleanup(iface); in acs_init()
940 err = acs_request_scan(iface); in acs_init()
944 hostapd_set_state(iface, HAPD_IFACE_ACS); in acs_init()
945 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, ACS_EVENT_STARTED); in acs_init()