• Home
  • Raw
  • Download

Lines Matching refs:iface

74 int hostapd_get_hw_features(struct hostapd_iface *iface)  in hostapd_get_hw_features()  argument
76 struct hostapd_data *hapd = iface->bss[0]; in hostapd_get_hw_features()
92 iface->hw_flags = flags; in hostapd_get_hw_features()
94 hostapd_free_hw_features(iface->hw_features, iface->num_hw_features); in hostapd_get_hw_features()
95 iface->hw_features = modes; in hostapd_get_hw_features()
96 iface->num_hw_features = num_modes; in hostapd_get_hw_features()
101 (iface->drv_flags & WPA_DRIVER_FLAGS_RADAR); in hostapd_get_hw_features()
118 !(iface->drv_flags & in hostapd_get_hw_features()
144 int hostapd_prepare_rates(struct hostapd_iface *iface, in hostapd_prepare_rates() argument
153 if (iface->conf->basic_rates) in hostapd_prepare_rates()
154 basic_rates = iface->conf->basic_rates; in hostapd_prepare_rates()
176 os_free(iface->basic_rates); in hostapd_prepare_rates()
177 iface->basic_rates = os_malloc(i * sizeof(int)); in hostapd_prepare_rates()
178 if (iface->basic_rates) in hostapd_prepare_rates()
179 os_memcpy(iface->basic_rates, basic_rates, i * sizeof(int)); in hostapd_prepare_rates()
181 os_free(iface->current_rates); in hostapd_prepare_rates()
182 iface->num_rates = 0; in hostapd_prepare_rates()
184 iface->current_rates = in hostapd_prepare_rates()
186 if (!iface->current_rates) { in hostapd_prepare_rates()
195 if (iface->conf->supported_rates && in hostapd_prepare_rates()
196 !hostapd_rate_found(iface->conf->supported_rates, in hostapd_prepare_rates()
200 rate = &iface->current_rates[iface->num_rates]; in hostapd_prepare_rates()
207 iface->num_rates, rate->rate, rate->flags); in hostapd_prepare_rates()
208 iface->num_rates++; in hostapd_prepare_rates()
211 if ((iface->num_rates == 0 || num_basic_rates == 0) && in hostapd_prepare_rates()
212 (!iface->conf->ieee80211n || !iface->conf->require_ht)) { in hostapd_prepare_rates()
215 iface->num_rates, num_basic_rates); in hostapd_prepare_rates()
224 static int ieee80211n_allowed_ht40_channel_pair(struct hostapd_iface *iface) in ieee80211n_allowed_ht40_channel_pair() argument
231 if (!iface->conf->secondary_channel) in ieee80211n_allowed_ht40_channel_pair()
234 sec_chan = iface->conf->channel + iface->conf->secondary_channel * 4; in ieee80211n_allowed_ht40_channel_pair()
237 iface->conf->channel, sec_chan); in ieee80211n_allowed_ht40_channel_pair()
242 for (j = 0; j < iface->current_mode->num_channels; j++) { in ieee80211n_allowed_ht40_channel_pair()
244 &iface->current_mode->channels[j]; in ieee80211n_allowed_ht40_channel_pair()
263 if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211A) in ieee80211n_allowed_ht40_channel_pair()
266 if (iface->conf->secondary_channel > 0) in ieee80211n_allowed_ht40_channel_pair()
267 first = iface->conf->channel; in ieee80211n_allowed_ht40_channel_pair()
280 iface->conf->channel, in ieee80211n_allowed_ht40_channel_pair()
281 iface->conf->secondary_channel); in ieee80211n_allowed_ht40_channel_pair()
289 static void ieee80211n_switch_pri_sec(struct hostapd_iface *iface) in ieee80211n_switch_pri_sec() argument
291 if (iface->conf->secondary_channel > 0) { in ieee80211n_switch_pri_sec()
292 iface->conf->channel += 4; in ieee80211n_switch_pri_sec()
293 iface->conf->secondary_channel = -1; in ieee80211n_switch_pri_sec()
295 iface->conf->channel -= 4; in ieee80211n_switch_pri_sec()
296 iface->conf->secondary_channel = 1; in ieee80211n_switch_pri_sec()
326 static int ieee80211n_check_40mhz_5g(struct hostapd_iface *iface, in ieee80211n_check_40mhz_5g() argument
334 pri_chan = iface->conf->channel; in ieee80211n_check_40mhz_5g()
335 sec_chan = pri_chan + iface->conf->secondary_channel * 4; in ieee80211n_check_40mhz_5g()
336 pri_freq = hostapd_hw_get_freq(iface->bss[0], pri_chan); in ieee80211n_check_40mhz_5g()
337 if (iface->conf->secondary_channel > 0) in ieee80211n_check_40mhz_5g()
358 ieee80211n_switch_pri_sec(iface); in ieee80211n_check_40mhz_5g()
388 ieee80211n_switch_pri_sec(iface); in ieee80211n_check_40mhz_5g()
428 static int ieee80211n_check_40mhz_2g4(struct hostapd_iface *iface, in ieee80211n_check_40mhz_2g4() argument
435 pri_freq = hostapd_hw_get_freq(iface->bss[0], iface->conf->channel); in ieee80211n_check_40mhz_2g4()
436 if (iface->conf->secondary_channel > 0) in ieee80211n_check_40mhz_2g4()
512 static void ieee80211n_check_scan(struct hostapd_iface *iface) in ieee80211n_check_scan() argument
521 iface->scan_cb = NULL; in ieee80211n_check_scan()
523 scan_res = hostapd_driver_get_scan_results(iface->bss[0]); in ieee80211n_check_scan()
525 hostapd_setup_interface_complete(iface, 1); in ieee80211n_check_scan()
529 if (iface->current_mode->mode == HOSTAPD_MODE_IEEE80211A) in ieee80211n_check_scan()
530 oper40 = ieee80211n_check_40mhz_5g(iface, scan_res); in ieee80211n_check_scan()
532 oper40 = ieee80211n_check_40mhz_2g4(iface, scan_res); in ieee80211n_check_scan()
535 iface->secondary_ch = iface->conf->secondary_channel; in ieee80211n_check_scan()
539 iface->conf->channel, in ieee80211n_check_scan()
540 iface->conf->channel + in ieee80211n_check_scan()
541 iface->conf->secondary_channel * 4); in ieee80211n_check_scan()
542 iface->conf->secondary_channel = 0; in ieee80211n_check_scan()
543 if (iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX) { in ieee80211n_check_scan()
552 res = ieee80211n_allowed_ht40_channel_pair(iface); in ieee80211n_check_scan()
554 iface->conf->secondary_channel = 0; in ieee80211n_check_scan()
558 hostapd_setup_interface_complete(iface, !res); in ieee80211n_check_scan()
562 static void ieee80211n_scan_channels_2g4(struct hostapd_iface *iface, in ieee80211n_scan_channels_2g4() argument
571 if (iface->current_mode == NULL) in ieee80211n_scan_channels_2g4()
574 pri_freq = hostapd_hw_get_freq(iface->bss[0], iface->conf->channel); in ieee80211n_scan_channels_2g4()
575 if (iface->conf->secondary_channel > 0) in ieee80211n_scan_channels_2g4()
584 mode = iface->current_mode; in ieee80211n_scan_channels_2g4()
602 static void ieee80211n_scan_channels_5g(struct hostapd_iface *iface, in ieee80211n_scan_channels_5g() argument
611 if (iface->current_mode == NULL) in ieee80211n_scan_channels_5g()
614 pri_freq = hostapd_hw_get_freq(iface->bss[0], iface->conf->channel); in ieee80211n_scan_channels_5g()
615 if (iface->conf->secondary_channel > 0) { in ieee80211n_scan_channels_5g()
625 mode = iface->current_mode; in ieee80211n_scan_channels_5g()
646 struct hostapd_iface *iface = eloop_data; in ap_ht40_scan_retry() local
651 if (iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G) in ap_ht40_scan_retry()
652 ieee80211n_scan_channels_2g4(iface, &params); in ap_ht40_scan_retry()
654 ieee80211n_scan_channels_5g(iface, &params); in ap_ht40_scan_retry()
656 ret = hostapd_driver_scan(iface->bss[0], &params); in ap_ht40_scan_retry()
657 iface->num_ht40_scan_tries++; in ap_ht40_scan_retry()
661 iface->num_ht40_scan_tries < HT2040_COEX_SCAN_RETRY) { in ap_ht40_scan_retry()
664 ret, strerror(-ret), iface->num_ht40_scan_tries); in ap_ht40_scan_retry()
665 eloop_register_timeout(1, 0, ap_ht40_scan_retry, iface, NULL); in ap_ht40_scan_retry()
670 iface->scan_cb = ieee80211n_check_scan; in ap_ht40_scan_retry()
676 iface->conf->secondary_channel = 0; in ap_ht40_scan_retry()
677 iface->conf->ht_capab &= ~HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET; in ap_ht40_scan_retry()
678 hostapd_setup_interface_complete(iface, 0); in ap_ht40_scan_retry()
682 void hostapd_stop_setup_timers(struct hostapd_iface *iface) in hostapd_stop_setup_timers() argument
684 eloop_cancel_timeout(ap_ht40_scan_retry, iface, NULL); in hostapd_stop_setup_timers()
688 static int ieee80211n_check_40mhz(struct hostapd_iface *iface) in ieee80211n_check_40mhz() argument
693 if (!iface->conf->secondary_channel) in ieee80211n_check_40mhz()
696 hostapd_set_state(iface, HAPD_IFACE_HT_SCAN); in ieee80211n_check_40mhz()
700 if (iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G) in ieee80211n_check_40mhz()
701 ieee80211n_scan_channels_2g4(iface, &params); in ieee80211n_check_40mhz()
703 ieee80211n_scan_channels_5g(iface, &params); in ieee80211n_check_40mhz()
705 ret = hostapd_driver_scan(iface->bss[0], &params); in ieee80211n_check_40mhz()
712 iface->num_ht40_scan_tries = 1; in ieee80211n_check_40mhz()
713 eloop_cancel_timeout(ap_ht40_scan_retry, iface, NULL); in ieee80211n_check_40mhz()
714 eloop_register_timeout(1, 0, ap_ht40_scan_retry, iface, NULL); in ieee80211n_check_40mhz()
725 iface->scan_cb = ieee80211n_check_scan; in ieee80211n_check_40mhz()
730 static int ieee80211n_supported_ht_capab(struct hostapd_iface *iface) in ieee80211n_supported_ht_capab() argument
732 u16 hw = iface->current_mode->ht_capab; in ieee80211n_supported_ht_capab()
733 u16 conf = iface->conf->ht_capab; in ieee80211n_supported_ht_capab()
858 static int ieee80211ac_supported_vht_capab(struct hostapd_iface *iface) in ieee80211ac_supported_vht_capab() argument
860 u32 hw = iface->current_mode->vht_capab; in ieee80211ac_supported_vht_capab()
861 u32 conf = iface->conf->vht_capab; in ieee80211ac_supported_vht_capab()
910 int hostapd_check_ht_capab(struct hostapd_iface *iface) in hostapd_check_ht_capab() argument
914 if (!iface->conf->ieee80211n) in hostapd_check_ht_capab()
916 if (!ieee80211n_supported_ht_capab(iface)) in hostapd_check_ht_capab()
919 if (!ieee80211ac_supported_vht_capab(iface)) in hostapd_check_ht_capab()
922 ret = ieee80211n_check_40mhz(iface); in hostapd_check_ht_capab()
925 if (!ieee80211n_allowed_ht40_channel_pair(iface)) in hostapd_check_ht_capab()
933 static int hostapd_is_usable_chan(struct hostapd_iface *iface, in hostapd_is_usable_chan() argument
939 for (i = 0; i < iface->current_mode->num_channels; i++) { in hostapd_is_usable_chan()
940 chan = &iface->current_mode->channels[i]; in hostapd_is_usable_chan()
961 static int hostapd_is_usable_chans(struct hostapd_iface *iface) in hostapd_is_usable_chans() argument
963 if (!hostapd_is_usable_chan(iface, iface->conf->channel, 1)) in hostapd_is_usable_chans()
966 if (!iface->conf->secondary_channel) in hostapd_is_usable_chans()
969 return hostapd_is_usable_chan(iface, iface->conf->channel + in hostapd_is_usable_chans()
970 iface->conf->secondary_channel * 4, 0); in hostapd_is_usable_chans()
975 hostapd_check_chans(struct hostapd_iface *iface) in hostapd_check_chans() argument
977 if (iface->conf->channel) { in hostapd_check_chans()
978 if (hostapd_is_usable_chans(iface)) in hostapd_check_chans()
989 switch (acs_init(iface)) { in hostapd_check_chans()
1000 static void hostapd_notify_bad_chans(struct hostapd_iface *iface) in hostapd_notify_bad_chans() argument
1002 hostapd_logger(iface->bss[0], NULL, in hostapd_notify_bad_chans()
1007 iface->conf->channel, in hostapd_notify_bad_chans()
1008 iface->current_mode->mode, in hostapd_notify_bad_chans()
1009 hostapd_hw_mode_txt(iface->current_mode->mode)); in hostapd_notify_bad_chans()
1010 hostapd_logger(iface->bss[0], NULL, HOSTAPD_MODULE_IEEE80211, in hostapd_notify_bad_chans()
1016 int hostapd_acs_completed(struct hostapd_iface *iface, int err) in hostapd_acs_completed() argument
1023 switch (hostapd_check_chans(iface)) { in hostapd_acs_completed()
1025 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, in hostapd_acs_completed()
1027 hostapd_hw_get_freq(iface->bss[0], in hostapd_acs_completed()
1028 iface->conf->channel), in hostapd_acs_completed()
1029 iface->conf->channel); in hostapd_acs_completed()
1033 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, ACS_EVENT_FAILED); in hostapd_acs_completed()
1034 hostapd_notify_bad_chans(iface); in hostapd_acs_completed()
1039 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, ACS_EVENT_FAILED); in hostapd_acs_completed()
1040 hostapd_notify_bad_chans(iface); in hostapd_acs_completed()
1044 ret = hostapd_check_ht_capab(iface); in hostapd_acs_completed()
1054 return hostapd_setup_interface_complete(iface, ret); in hostapd_acs_completed()
1066 int hostapd_select_hw_mode(struct hostapd_iface *iface) in hostapd_select_hw_mode() argument
1070 if (iface->num_hw_features < 1) in hostapd_select_hw_mode()
1073 if ((iface->conf->hw_mode == HOSTAPD_MODE_IEEE80211G || in hostapd_select_hw_mode()
1074 iface->conf->ieee80211n || iface->conf->ieee80211ac) && in hostapd_select_hw_mode()
1075 iface->conf->channel == 14) { in hostapd_select_hw_mode()
1077 iface->conf->hw_mode = HOSTAPD_MODE_IEEE80211B; in hostapd_select_hw_mode()
1078 iface->conf->ieee80211n = 0; in hostapd_select_hw_mode()
1079 iface->conf->ieee80211ac = 0; in hostapd_select_hw_mode()
1082 iface->current_mode = NULL; in hostapd_select_hw_mode()
1083 for (i = 0; i < iface->num_hw_features; i++) { in hostapd_select_hw_mode()
1084 struct hostapd_hw_modes *mode = &iface->hw_features[i]; in hostapd_select_hw_mode()
1085 if (mode->mode == iface->conf->hw_mode) { in hostapd_select_hw_mode()
1086 iface->current_mode = mode; in hostapd_select_hw_mode()
1091 if (iface->current_mode == NULL) { in hostapd_select_hw_mode()
1094 hostapd_logger(iface->bss[0], NULL, HOSTAPD_MODULE_IEEE80211, in hostapd_select_hw_mode()
1098 (int) iface->conf->hw_mode); in hostapd_select_hw_mode()
1102 switch (hostapd_check_chans(iface)) { in hostapd_select_hw_mode()
1109 hostapd_notify_bad_chans(iface); in hostapd_select_hw_mode()
1136 if (!hapd->iface->current_mode) in hostapd_hw_get_freq()
1139 for (i = 0; i < hapd->iface->current_mode->num_channels; i++) { in hostapd_hw_get_freq()
1141 &hapd->iface->current_mode->channels[i]; in hostapd_hw_get_freq()
1154 if (!hapd->iface->current_mode) in hostapd_hw_get_channel()
1157 for (i = 0; i < hapd->iface->current_mode->num_channels; i++) { in hostapd_hw_get_channel()
1159 &hapd->iface->current_mode->channels[i]; in hostapd_hw_get_channel()