• Home
  • Raw
  • Download

Lines Matching refs:iface

56 static int hostapd_setup_encryption(char *iface, struct hostapd_data *hapd);
58 static int setup_interface2(struct hostapd_iface *iface);
65 int (*cb)(struct hostapd_iface *iface, in hostapd_for_each_interface() argument
72 ret = cb(interfaces->iface[i], ctx); in hostapd_for_each_interface()
87 hostapd_setup_encryption(hapd->conf->iface, hapd); in hostapd_reconfig_encryption()
120 hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 1); in hostapd_reload_bss()
122 hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 0); in hostapd_reload_bss()
140 hostapd_setup_encryption(hapd->conf->iface, hapd); in hostapd_reload_bss()
153 wpa_printf(MSG_DEBUG, "Reconfigured interface %s", hapd->conf->iface); in hostapd_reload_bss()
157 static void hostapd_clear_old(struct hostapd_iface *iface) in hostapd_clear_old() argument
165 for (j = 0; j < iface->num_bss; j++) { in hostapd_clear_old()
166 hostapd_flush_old_stations(iface->bss[j], in hostapd_clear_old()
168 hostapd_broadcast_wep_clear(iface->bss[j]); in hostapd_clear_old()
173 radius_client_flush(iface->bss[j]->radius, 0); in hostapd_clear_old()
188 if (os_strcmp(newconf->bss[i]->iface, in hostapd_iface_conf_changed()
189 oldconf->bss[i]->iface) != 0) in hostapd_iface_conf_changed()
197 int hostapd_reload_config(struct hostapd_iface *iface) in hostapd_reload_config() argument
199 struct hapd_interfaces *interfaces = iface->interfaces; in hostapd_reload_config()
200 struct hostapd_data *hapd = iface->bss[0]; in hostapd_reload_config()
204 if (iface->config_fname == NULL) { in hostapd_reload_config()
206 hostapd_clear_old(iface); in hostapd_reload_config()
207 for (j = 0; j < iface->num_bss; j++) in hostapd_reload_config()
208 hostapd_reload_bss(iface->bss[j]); in hostapd_reload_config()
212 if (iface->interfaces == NULL || in hostapd_reload_config()
213 iface->interfaces->config_read_cb == NULL) in hostapd_reload_config()
215 newconf = iface->interfaces->config_read_cb(iface->config_fname); in hostapd_reload_config()
219 hostapd_clear_old(iface); in hostapd_reload_config()
228 fname = os_strdup(iface->config_fname); in hostapd_reload_config()
233 hostapd_remove_iface(interfaces, hapd->conf->iface); in hostapd_reload_config()
234 iface = hostapd_init(interfaces, fname); in hostapd_reload_config()
237 if (!iface) { in hostapd_reload_config()
242 iface->interfaces = interfaces; in hostapd_reload_config()
243 interfaces->iface[interfaces->count] = iface; in hostapd_reload_config()
245 res = hostapd_enable_iface(iface); in hostapd_reload_config()
251 iface->conf = newconf; in hostapd_reload_config()
253 for (j = 0; j < iface->num_bss; j++) { in hostapd_reload_config()
254 hapd = iface->bss[j]; in hostapd_reload_config()
312 hostapd_broadcast_key_clear_iface(hapd, hapd->conf->iface); in hostapd_broadcast_wep_clear()
324 hostapd_drv_set_key(hapd->conf->iface, in hostapd_broadcast_wep_set()
351 __func__, hapd->conf ? hapd->conf->iface : "N/A"); in hostapd_free_hapd_data()
357 wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); in hostapd_free_hapd_data()
381 if (hostapd_if_remove(hapd, WPA_IF_AP_BSS, hapd->conf->iface)) { in hostapd_free_hapd_data()
384 hapd->conf->iface); in hostapd_free_hapd_data()
449 hapd->conf ? hapd->conf->iface : "N/A"); in hostapd_cleanup()
450 if (hapd->iface->interfaces && in hostapd_cleanup()
451 hapd->iface->interfaces->ctrl_iface_deinit) { in hostapd_cleanup()
453 hapd->iface->interfaces->ctrl_iface_deinit(hapd); in hostapd_cleanup()
459 static void sta_track_deinit(struct hostapd_iface *iface) in sta_track_deinit() argument
463 if (!iface->num_sta_seen) in sta_track_deinit()
466 while ((info = dl_list_first(&iface->sta_seen, struct hostapd_sta_info, in sta_track_deinit()
469 iface->num_sta_seen--; in sta_track_deinit()
475 static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface) in hostapd_cleanup_iface_partial() argument
477 wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); in hostapd_cleanup_iface_partial()
480 hostapd_stop_setup_timers(iface); in hostapd_cleanup_iface_partial()
483 if (iface->current_mode) in hostapd_cleanup_iface_partial()
484 acs_cleanup(iface); in hostapd_cleanup_iface_partial()
485 hostapd_free_hw_features(iface->hw_features, iface->num_hw_features); in hostapd_cleanup_iface_partial()
486 iface->hw_features = NULL; in hostapd_cleanup_iface_partial()
487 iface->current_mode = NULL; in hostapd_cleanup_iface_partial()
488 os_free(iface->current_rates); in hostapd_cleanup_iface_partial()
489 iface->current_rates = NULL; in hostapd_cleanup_iface_partial()
490 os_free(iface->basic_rates); in hostapd_cleanup_iface_partial()
491 iface->basic_rates = NULL; in hostapd_cleanup_iface_partial()
492 ap_list_deinit(iface); in hostapd_cleanup_iface_partial()
493 sta_track_deinit(iface); in hostapd_cleanup_iface_partial()
504 static void hostapd_cleanup_iface(struct hostapd_iface *iface) in hostapd_cleanup_iface() argument
506 wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); in hostapd_cleanup_iface()
507 eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); in hostapd_cleanup_iface()
508 eloop_cancel_timeout(hostapd_interface_setup_failure_handler, iface, in hostapd_cleanup_iface()
511 hostapd_cleanup_iface_partial(iface); in hostapd_cleanup_iface()
512 hostapd_config_free(iface->conf); in hostapd_cleanup_iface()
513 iface->conf = NULL; in hostapd_cleanup_iface()
515 os_free(iface->config_fname); in hostapd_cleanup_iface()
516 os_free(iface->bss); in hostapd_cleanup_iface()
517 wpa_printf(MSG_DEBUG, "%s: free iface=%p", __func__, iface); in hostapd_cleanup_iface()
518 os_free(iface); in hostapd_cleanup_iface()
524 if (hapd->drv_priv && !hapd->iface->driver_ap_teardown && hapd->conf) { in hostapd_clear_wep()
531 static int hostapd_setup_encryption(char *iface, struct hostapd_data *hapd) in hostapd_setup_encryption() argument
550 hostapd_drv_set_key(iface, hapd, WPA_ALG_WEP, NULL, i, in hostapd_setup_encryption()
575 if (!hapd->iface->driver_ap_teardown) { in hostapd_flush_old_stations()
612 static int hostapd_validate_bssid_configuration(struct hostapd_iface *iface) in hostapd_validate_bssid_configuration() argument
615 struct hostapd_data *hapd = iface->bss[0]; in hostapd_validate_bssid_configuration()
616 unsigned int i = iface->conf->num_bss, bits = 0, j; in hostapd_validate_bssid_configuration()
622 if (iface->conf->use_driver_iface_addr) in hostapd_validate_bssid_configuration()
633 for (j = 0; j < iface->conf->num_bss; j++) { in hostapd_validate_bssid_configuration()
634 if (is_zero_ether_addr(iface->conf->bss[j]->bssid)) { in hostapd_validate_bssid_configuration()
642 iface->conf->bss[j]->bssid[i] ^ in hostapd_validate_bssid_configuration()
683 (unsigned long) iface->conf->num_bss, MAC2STR(mask), bits); in hostapd_validate_bssid_configuration()
1045 __func__, hapd, conf->iface, first); in hostapd_setup_bss()
1056 __func__, conf->iface); in hostapd_setup_bss()
1069 hapd->iface->bss[0]->own_addr) == in hostapd_setup_bss()
1073 "the radio", conf->iface); in hostapd_setup_bss()
1086 if (hostapd_if_add(hapd->iface->bss[0], WPA_IF_AP_BSS, in hostapd_setup_bss()
1087 conf->iface, addr, hapd, in hostapd_setup_bss()
1110 if ((hapd->conf->mesh & MESH_ENABLED) && hapd->iface->mconf == NULL) in hostapd_setup_bss()
1120 if (hostapd_setup_encryption(conf->iface, hapd)) in hostapd_setup_bss()
1154 conf->iface, MAC2STR(hapd->own_addr), in hostapd_setup_bss()
1300 static void hostapd_tx_queue_params(struct hostapd_iface *iface) in hostapd_tx_queue_params() argument
1302 struct hostapd_data *hapd = iface->bss[0]; in hostapd_tx_queue_params()
1307 if ((hapd->conf->mesh & MESH_ENABLED) && iface->mconf == NULL) in hostapd_tx_queue_params()
1312 p = &iface->conf->tx_queue[i]; in hostapd_tx_queue_params()
1357 if (hapd->iface->drv_max_acl_mac_addrs == 0) in hostapd_set_acl()
1384 if (!hapd->iface->interfaces || in start_ctrl_iface_bss()
1385 !hapd->iface->interfaces->ctrl_iface_init) in start_ctrl_iface_bss()
1388 if (hapd->iface->interfaces->ctrl_iface_init(hapd)) { in start_ctrl_iface_bss()
1391 hapd->conf->iface); in start_ctrl_iface_bss()
1399 static int start_ctrl_iface(struct hostapd_iface *iface) in start_ctrl_iface() argument
1403 if (!iface->interfaces || !iface->interfaces->ctrl_iface_init) in start_ctrl_iface()
1406 for (i = 0; i < iface->num_bss; i++) { in start_ctrl_iface()
1407 struct hostapd_data *hapd = iface->bss[i]; in start_ctrl_iface()
1408 if (iface->interfaces->ctrl_iface_init(hapd)) { in start_ctrl_iface()
1411 hapd->conf->iface); in start_ctrl_iface()
1422 struct hostapd_iface *iface = eloop_ctx; in channel_list_update_timeout() local
1424 if (!iface->wait_channel_update) { in channel_list_update_timeout()
1434 setup_interface2(iface); in channel_list_update_timeout()
1438 void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator) in hostapd_channel_list_updated() argument
1440 if (!iface->wait_channel_update || initiator != REGDOM_SET_BY_USER) in hostapd_channel_list_updated()
1444 eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); in hostapd_channel_list_updated()
1445 setup_interface2(iface); in hostapd_channel_list_updated()
1449 static int setup_interface(struct hostapd_iface *iface) in setup_interface() argument
1451 struct hostapd_data *hapd = iface->bss[0]; in setup_interface()
1461 iface->driver_ap_teardown = 0; in setup_interface()
1463 if (!iface->phy[0]) { in setup_interface()
1467 os_strlcpy(iface->phy, phy, sizeof(iface->phy)); in setup_interface()
1475 for (i = 1; i < iface->num_bss; i++) { in setup_interface()
1476 iface->bss[i]->driver = hapd->driver; in setup_interface()
1477 iface->bss[i]->drv_priv = hapd->drv_priv; in setup_interface()
1480 if (hostapd_validate_bssid_configuration(iface)) in setup_interface()
1488 if (start_ctrl_iface(iface)) in setup_interface()
1494 hostapd_set_state(iface, HAPD_IFACE_COUNTRY_UPDATE); in setup_interface()
1510 iface->wait_channel_update = 1; in setup_interface()
1513 iface, NULL); in setup_interface()
1518 return setup_interface2(iface); in setup_interface()
1522 static int setup_interface2(struct hostapd_iface *iface) in setup_interface2() argument
1524 iface->wait_channel_update = 0; in setup_interface2()
1526 if (hostapd_get_hw_features(iface)) { in setup_interface2()
1530 int ret = hostapd_select_hw_mode(iface); in setup_interface2()
1540 ret = hostapd_check_ht_capab(iface); in setup_interface2()
1549 if (iface->conf->ieee80211h) in setup_interface2()
1552 return hostapd_setup_interface_complete(iface, 0); in setup_interface2()
1555 hostapd_set_state(iface, HAPD_IFACE_DISABLED); in setup_interface2()
1556 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); in setup_interface2()
1557 if (iface->interfaces && iface->interfaces->terminate_on_error) in setup_interface2()
1579 *hw_mode = ieee80211_freq_to_chan(hapd->iface->freq, channel); in fst_hostapd_get_channel_info_cb()
1587 if (hapd->iface->fst_ies != fst_ies) { in fst_hostapd_set_ies_cb()
1588 hapd->iface->fst_ies = fst_ies; in fst_hostapd_set_ies_cb()
1600 return hostapd_drv_send_action(hapd, hapd->iface->freq, 0, da, in fst_hostapd_send_action_cb()
1690 static int hostapd_owe_iface_iter(struct hostapd_iface *iface, void *ctx) in hostapd_owe_iface_iter() argument
1695 for (i = 0; i < iface->num_bss; i++) { in hostapd_owe_iface_iter()
1696 struct hostapd_data *bss = iface->bss[i]; in hostapd_owe_iface_iter()
1699 bss->conf->iface) != 0) in hostapd_owe_iface_iter()
1705 hapd->conf->iface, bss->conf->iface, in hostapd_owe_iface_iter()
1735 if (!hapd->iface->interfaces || in hostapd_owe_trans_get_info()
1736 !hapd->iface->interfaces->for_each_interface) in hostapd_owe_trans_get_info()
1737 return hostapd_owe_iface_iter(hapd->iface, hapd); in hostapd_owe_trans_get_info()
1739 return hapd->iface->interfaces->for_each_interface( in hostapd_owe_trans_get_info()
1740 hapd->iface->interfaces, hostapd_owe_iface_iter, hapd); in hostapd_owe_trans_get_info()
1744 static int hostapd_owe_iface_iter2(struct hostapd_iface *iface, void *ctx) in hostapd_owe_iface_iter2() argument
1748 for (i = 0; i < iface->num_bss; i++) { in hostapd_owe_iface_iter2()
1749 struct hostapd_data *bss = iface->bss[i]; in hostapd_owe_iface_iter2()
1759 bss->conf->iface); in hostapd_owe_iface_iter2()
1769 static void hostapd_owe_update_trans(struct hostapd_iface *iface) in hostapd_owe_update_trans() argument
1774 if (!iface->interfaces || in hostapd_owe_update_trans()
1775 !iface->interfaces->for_each_interface) in hostapd_owe_update_trans()
1776 hostapd_owe_iface_iter2(iface, NULL); in hostapd_owe_update_trans()
1778 iface->interfaces->for_each_interface( in hostapd_owe_update_trans()
1779 iface->interfaces, hostapd_owe_iface_iter2, NULL); in hostapd_owe_update_trans()
1787 struct hostapd_iface *iface = eloop_ctx; in hostapd_interface_setup_failure_handler() local
1790 if (iface->num_bss < 1 || !iface->bss || !iface->bss[0]) in hostapd_interface_setup_failure_handler()
1792 hapd = iface->bss[0]; in hostapd_interface_setup_failure_handler()
1798 static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface, in hostapd_setup_interface_complete_sync() argument
1801 struct hostapd_data *hapd = iface->bss[0]; in hostapd_setup_interface_complete_sync()
1811 if (iface->conf->channel) { in hostapd_setup_interface_complete_sync()
1816 iface->freq = hostapd_hw_get_freq(hapd, iface->conf->channel); in hostapd_setup_interface_complete_sync()
1819 hostapd_hw_mode_txt(iface->conf->hw_mode), in hostapd_setup_interface_complete_sync()
1820 iface->conf->channel, iface->freq); in hostapd_setup_interface_complete_sync()
1824 if (!(iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD)) { in hostapd_setup_interface_complete_sync()
1826 res = hostapd_handle_dfs(iface); in hostapd_setup_interface_complete_sync()
1834 res_dfs_offload = hostapd_handle_dfs_offload(iface); in hostapd_setup_interface_complete_sync()
1853 if (iface->mconf != NULL) { in hostapd_setup_interface_complete_sync()
1856 iface->bss[0]->conf->iface); in hostapd_setup_interface_complete_sync()
1862 hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq, in hostapd_setup_interface_complete_sync()
1876 if (iface->current_mode) { in hostapd_setup_interface_complete_sync()
1877 if (hostapd_prepare_rates(iface, iface->current_mode)) { in hostapd_setup_interface_complete_sync()
1905 for (j = 0; j < iface->num_bss; j++) { in hostapd_setup_interface_complete_sync()
1906 hapd = iface->bss[j]; in hostapd_setup_interface_complete_sync()
1911 hapd = iface->bss[j]; in hostapd_setup_interface_complete_sync()
1923 hapd = iface->bss[0]; in hostapd_setup_interface_complete_sync()
1925 hostapd_tx_queue_params(iface); in hostapd_setup_interface_complete_sync()
1927 ap_list_init(iface); in hostapd_setup_interface_complete_sync()
1943 for (j = 0; j < iface->num_bss; j++) { in hostapd_setup_interface_complete_sync()
1944 if (hostapd_init_wps_complete(iface->bss[j])) in hostapd_setup_interface_complete_sync()
1948 if ((iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) && in hostapd_setup_interface_complete_sync()
1967 iface->fst = fst_attach(hapd->conf->iface, hapd->own_addr, in hostapd_setup_interface_complete_sync()
1969 if (!iface->fst) { in hostapd_setup_interface_complete_sync()
1977 hostapd_set_state(iface, HAPD_IFACE_ENABLED); in hostapd_setup_interface_complete_sync()
1978 hostapd_owe_update_trans(iface); in hostapd_setup_interface_complete_sync()
1979 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_ENABLED); in hostapd_setup_interface_complete_sync()
1984 iface->bss[0]->conf->iface); in hostapd_setup_interface_complete_sync()
1985 if (iface->interfaces && iface->interfaces->terminate_on_error > 0) in hostapd_setup_interface_complete_sync()
1986 iface->interfaces->terminate_on_error--; in hostapd_setup_interface_complete_sync()
1988 for (j = 0; j < iface->num_bss; j++) in hostapd_setup_interface_complete_sync()
1989 hostapd_neighbor_set_own_report(iface->bss[j]); in hostapd_setup_interface_complete_sync()
1995 hostapd_set_state(iface, HAPD_IFACE_DISABLED); in hostapd_setup_interface_complete_sync()
1998 if (iface->fst) { in hostapd_setup_interface_complete_sync()
1999 fst_detach(iface->fst); in hostapd_setup_interface_complete_sync()
2000 iface->fst = NULL; in hostapd_setup_interface_complete_sync()
2004 if (iface->interfaces && iface->interfaces->terminate_on_error) { in hostapd_setup_interface_complete_sync()
2013 iface, NULL); in hostapd_setup_interface_complete_sync()
2028 int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err) in hostapd_setup_interface_complete() argument
2030 struct hapd_interfaces *interfaces = iface->interfaces; in hostapd_setup_interface_complete()
2031 struct hostapd_data *hapd = iface->bss[0]; in hostapd_setup_interface_complete()
2035 if (!iface->need_to_start_in_sync) in hostapd_setup_interface_complete()
2036 return hostapd_setup_interface_complete_sync(iface, err); in hostapd_setup_interface_complete()
2040 hostapd_set_state(iface, HAPD_IFACE_DISABLED); in hostapd_setup_interface_complete()
2041 iface->need_to_start_in_sync = 0; in hostapd_setup_interface_complete()
2048 if (iface->ready_to_start_in_sync) { in hostapd_setup_interface_complete()
2054 if (interfaces->iface[i]->need_to_start_in_sync && in hostapd_setup_interface_complete()
2055 !interfaces->iface[i]->ready_to_start_in_sync) in hostapd_setup_interface_complete()
2063 if (not_ready_in_sync_ifaces > 1 && iface->state == HAPD_IFACE_DFS) { in hostapd_setup_interface_complete()
2068 iface->need_to_start_in_sync = 0; in hostapd_setup_interface_complete()
2071 iface->bss[0]->conf->iface); in hostapd_setup_interface_complete()
2072 return hostapd_setup_interface_complete_sync(iface, err); in hostapd_setup_interface_complete()
2077 iface->ready_to_start_in_sync = 1; in hostapd_setup_interface_complete()
2080 iface->bss[0]->conf->iface); in hostapd_setup_interface_complete()
2086 iface->bss[0]->conf->iface); in hostapd_setup_interface_complete()
2087 iface->need_to_start_in_sync = 0; in hostapd_setup_interface_complete()
2088 hostapd_setup_interface_complete_sync(iface, err); in hostapd_setup_interface_complete()
2090 if (interfaces->iface[i]->need_to_start_in_sync && in hostapd_setup_interface_complete()
2091 interfaces->iface[i]->ready_to_start_in_sync) { in hostapd_setup_interface_complete()
2093 interfaces->iface[i], 0); in hostapd_setup_interface_complete()
2095 interfaces->iface[i]->need_to_start_in_sync = 0; in hostapd_setup_interface_complete()
2119 int hostapd_setup_interface(struct hostapd_iface *iface) in hostapd_setup_interface() argument
2123 ret = setup_interface(iface); in hostapd_setup_interface()
2126 iface->bss[0]->conf->iface); in hostapd_setup_interface()
2159 hapd->iface = hapd_iface; in hostapd_alloc_bss_data()
2183 hapd->conf ? hapd->conf->iface : "N/A"); in hostapd_bss_deinit()
2190 void hostapd_interface_deinit(struct hostapd_iface *iface) in hostapd_interface_deinit() argument
2194 wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); in hostapd_interface_deinit()
2195 if (iface == NULL) in hostapd_interface_deinit()
2198 hostapd_set_state(iface, HAPD_IFACE_DISABLED); in hostapd_interface_deinit()
2200 eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); in hostapd_interface_deinit()
2201 iface->wait_channel_update = 0; in hostapd_interface_deinit()
2204 if (iface->fst) { in hostapd_interface_deinit()
2205 fst_detach(iface->fst); in hostapd_interface_deinit()
2206 iface->fst = NULL; in hostapd_interface_deinit()
2210 for (j = (int) iface->num_bss - 1; j >= 0; j--) { in hostapd_interface_deinit()
2211 if (!iface->bss) in hostapd_interface_deinit()
2213 hostapd_bss_deinit(iface->bss[j]); in hostapd_interface_deinit()
2218 hostapd_stop_setup_timers(iface); in hostapd_interface_deinit()
2219 eloop_cancel_timeout(ap_ht2040_timeout, iface, NULL); in hostapd_interface_deinit()
2225 void hostapd_interface_free(struct hostapd_iface *iface) in hostapd_interface_free() argument
2228 wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); in hostapd_interface_free()
2229 for (j = 0; j < iface->num_bss; j++) { in hostapd_interface_free()
2230 if (!iface->bss) in hostapd_interface_free()
2233 __func__, iface->bss[j]); in hostapd_interface_free()
2234 os_free(iface->bss[j]); in hostapd_interface_free()
2236 hostapd_cleanup_iface(iface); in hostapd_interface_free()
2322 struct hostapd_iface *iface = interfaces->iface[i]; in ifname_in_use() local
2323 for (j = 0; j < iface->num_bss; j++) { in ifname_in_use()
2324 struct hostapd_data *hapd = iface->bss[j]; in ifname_in_use()
2325 if (os_strcmp(ifname, hapd->conf->iface) == 0) in ifname_in_use()
2349 struct hostapd_iface *new_iface = NULL, *iface = NULL; in hostapd_interface_init_bss() local
2358 if (os_strcmp(interfaces->iface[i]->phy, phy) == 0) { in hostapd_interface_init_bss()
2359 iface = interfaces->iface[i]; in hostapd_interface_init_bss()
2365 config_fname, phy, iface ? "" : " --> new PHY"); in hostapd_interface_init_bss()
2366 if (iface) { in hostapd_interface_init_bss()
2383 ifname = conf->bss[0]->iface; in hostapd_interface_init_bss()
2392 iface->conf->bss, iface->conf->num_bss + 1, in hostapd_interface_init_bss()
2394 tmp_bss = os_realloc_array(iface->bss, iface->num_bss + 1, in hostapd_interface_init_bss()
2397 iface->bss = tmp_bss; in hostapd_interface_init_bss()
2399 iface->conf->bss = tmp_conf; in hostapd_interface_init_bss()
2400 iface->conf->last_bss = tmp_conf[0]; in hostapd_interface_init_bss()
2406 bss = iface->conf->bss[iface->conf->num_bss] = conf->bss[0]; in hostapd_interface_init_bss()
2407 iface->conf->num_bss++; in hostapd_interface_init_bss()
2409 hapd = hostapd_alloc_bss_data(iface, iface->conf, bss); in hostapd_interface_init_bss()
2411 iface->conf->num_bss--; in hostapd_interface_init_bss()
2415 iface->conf->last_bss = bss; in hostapd_interface_init_bss()
2416 iface->bss[iface->num_bss] = hapd; in hostapd_interface_init_bss()
2419 bss_idx = iface->num_bss++; in hostapd_interface_init_bss()
2425 new_iface = iface = hostapd_init(interfaces, config_fname); in hostapd_interface_init_bss()
2426 if (!iface) in hostapd_interface_init_bss()
2428 os_strlcpy(iface->phy, phy, sizeof(iface->phy)); in hostapd_interface_init_bss()
2429 iface->interfaces = interfaces; in hostapd_interface_init_bss()
2434 if (iface->bss[bss_idx]->conf->logger_stdout_level > 0) in hostapd_interface_init_bss()
2435 iface->bss[bss_idx]->conf->logger_stdout_level--; in hostapd_interface_init_bss()
2438 if (iface->conf->bss[bss_idx]->iface[0] == '\0' && in hostapd_interface_init_bss()
2439 !hostapd_drv_none(iface->bss[bss_idx])) { in hostapd_interface_init_bss()
2447 return iface; in hostapd_interface_init_bss()
2451 void hostapd_interface_deinit_free(struct hostapd_iface *iface) in hostapd_interface_deinit_free() argument
2456 wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); in hostapd_interface_deinit_free()
2457 if (iface == NULL) in hostapd_interface_deinit_free()
2460 __func__, (unsigned int) iface->num_bss, in hostapd_interface_deinit_free()
2461 (unsigned int) iface->conf->num_bss); in hostapd_interface_deinit_free()
2462 driver = iface->bss[0]->driver; in hostapd_interface_deinit_free()
2463 drv_priv = iface->bss[0]->drv_priv; in hostapd_interface_deinit_free()
2464 hostapd_interface_deinit(iface); in hostapd_interface_deinit_free()
2469 iface->bss[0]->drv_priv = NULL; in hostapd_interface_deinit_free()
2471 hostapd_interface_free(iface); in hostapd_interface_deinit_free()
2506 hapd_iface->conf->bss[0]->iface); in hostapd_enable_iface()
2511 hapd_iface->conf->bss[0]->iface); in hostapd_enable_iface()
2541 hapd_iface->conf->bss[0]->iface); in hostapd_reload_iface()
2567 hapd_iface->conf->bss[0]->iface); in hostapd_disable_iface()
2599 hapd_iface->bss[0]->conf->iface); in hostapd_disable_iface()
2608 struct hostapd_iface **iface, *hapd_iface; in hostapd_iface_alloc() local
2610 iface = os_realloc_array(interfaces->iface, interfaces->count + 1, in hostapd_iface_alloc()
2612 if (iface == NULL) in hostapd_iface_alloc()
2614 interfaces->iface = iface; in hostapd_iface_alloc()
2615 hapd_iface = interfaces->iface[interfaces->count] = in hostapd_iface_alloc()
2669 os_strlcpy(bss->iface, ifname, sizeof(bss->iface)); in hostapd_config_alloc()
2743 if (interfaces->iface[j] == hapd_iface) in hostapd_add_iface()
2748 tmp = os_realloc_array(interfaces->iface, in hostapd_add_iface()
2755 interfaces->iface = tmp; in hostapd_add_iface()
2756 interfaces->iface[interfaces->count++] = hapd_iface; in hostapd_add_iface()
2787 __func__, hapd, hapd->conf->iface); in hostapd_add_iface()
2807 if (!os_strcmp(interfaces->iface[i]->conf->bss[0]->iface, in hostapd_add_iface()
2826 os_strlcpy(conf->bss[0]->iface, buf, in hostapd_add_iface()
2827 sizeof(conf->bss[0]->iface)); in hostapd_add_iface()
2853 hapd_iface->conf->bss[0]->iface); in hostapd_add_iface()
2872 hapd->conf->iface); in hostapd_add_iface()
2882 interfaces->iface[interfaces->count] = NULL; in hostapd_add_iface()
2890 static int hostapd_remove_bss(struct hostapd_iface *iface, unsigned int idx) in hostapd_remove_bss() argument
2894 wpa_printf(MSG_INFO, "Remove BSS '%s'", iface->conf->bss[idx]->iface); in hostapd_remove_bss()
2897 if (idx < iface->num_bss) { in hostapd_remove_bss()
2898 struct hostapd_data *hapd = iface->bss[idx]; in hostapd_remove_bss()
2902 __func__, hapd, hapd->conf->iface); in hostapd_remove_bss()
2907 iface->num_bss--; in hostapd_remove_bss()
2909 for (i = idx; i < iface->num_bss; i++) in hostapd_remove_bss()
2910 iface->bss[i] = iface->bss[i + 1]; in hostapd_remove_bss()
2912 hostapd_config_free_bss(iface->conf->bss[idx]); in hostapd_remove_bss()
2913 iface->conf->bss[idx] = NULL; in hostapd_remove_bss()
2916 iface->conf->num_bss--; in hostapd_remove_bss()
2917 for (i = idx; i < iface->conf->num_bss; i++) in hostapd_remove_bss()
2918 iface->conf->bss[i] = iface->conf->bss[i + 1]; in hostapd_remove_bss()
2930 hapd_iface = interfaces->iface[i]; in hostapd_remove_iface()
2933 if (!os_strcmp(hapd_iface->conf->bss[0]->iface, buf)) { in hostapd_remove_iface()
2942 interfaces->iface[k] = in hostapd_remove_iface()
2943 interfaces->iface[k + 1]; in hostapd_remove_iface()
2951 if (!os_strcmp(hapd_iface->conf->bss[j]->iface, buf)) { in hostapd_remove_iface()
3020 if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_WIRED) { in hostapd_new_assoc_sta()
3025 hapd->conf->iface, __func__, in hostapd_new_assoc_sta()
3028 } else if (!(hapd->iface->drv_flags & in hostapd_new_assoc_sta()
3033 hapd->conf->iface, __func__, MAC2STR(sta->addr), in hostapd_new_assoc_sta()
3065 void hostapd_set_state(struct hostapd_iface *iface, enum hostapd_iface_state s) in hostapd_set_state() argument
3068 iface->conf ? iface->conf->bss[0]->iface : "N/A", in hostapd_set_state()
3069 hostapd_state_text(iface->state), hostapd_state_text(s)); in hostapd_set_state()
3070 iface->state = s; in hostapd_set_state()
3074 int hostapd_csa_in_progress(struct hostapd_iface *iface) in hostapd_csa_in_progress() argument
3078 for (i = 0; i < iface->num_bss; i++) in hostapd_csa_in_progress()
3079 if (iface->bss[i]->csa_in_progress) in hostapd_csa_in_progress()
3257 struct hostapd_iface *iface = hapd->iface; in hostapd_fill_csa_settings() local
3263 if (!iface || !iface->freq || hapd->csa_in_progress) in hostapd_fill_csa_settings()
3285 &hapd->iface->cs_oper_class, in hostapd_fill_csa_settings()
3297 ret = hostapd_change_config_freq(iface->bss[0], iface->conf, in hostapd_fill_csa_settings()
3306 hostapd_change_config_freq(iface->bss[0], iface->conf, in hostapd_fill_csa_settings()
3363 if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA)) { in hostapd_switch_channel()
3388 hostapd_switch_channel_fallback(struct hostapd_iface *iface, in hostapd_switch_channel_fallback() argument
3421 iface->freq = freq_params->freq; in hostapd_switch_channel_fallback()
3422 iface->conf->channel = freq_params->channel; in hostapd_switch_channel_fallback()
3423 iface->conf->secondary_channel = freq_params->sec_channel_offset; in hostapd_switch_channel_fallback()
3424 iface->conf->vht_oper_centr_freq_seg0_idx = vht_seg0_idx; in hostapd_switch_channel_fallback()
3425 iface->conf->vht_oper_centr_freq_seg1_idx = vht_seg1_idx; in hostapd_switch_channel_fallback()
3426 iface->conf->vht_oper_chwidth = vht_bw; in hostapd_switch_channel_fallback()
3427 iface->conf->ieee80211n = freq_params->ht_enabled; in hostapd_switch_channel_fallback()
3428 iface->conf->ieee80211ac = freq_params->vht_enabled; in hostapd_switch_channel_fallback()
3435 hostapd_disable_iface(iface); in hostapd_switch_channel_fallback()
3436 hostapd_enable_iface(iface); in hostapd_switch_channel_fallback()
3448 struct hostapd_iface *iface = interfaces->iface[i]; in hostapd_get_iface() local
3450 for (j = 0; j < iface->num_bss; j++) { in hostapd_get_iface()
3451 struct hostapd_data *hapd = iface->bss[j]; in hostapd_get_iface()
3453 if (os_strcmp(ifname, hapd->conf->iface) == 0) in hostapd_get_iface()
3462 void hostapd_periodic_iface(struct hostapd_iface *iface) in hostapd_periodic_iface() argument
3466 ap_list_timer(iface); in hostapd_periodic_iface()
3468 for (i = 0; i < iface->num_bss; i++) { in hostapd_periodic_iface()
3469 struct hostapd_data *hapd = iface->bss[i]; in hostapd_periodic_iface()