• Home
  • Raw
  • Download

Lines Matching refs:iface

52 static int hostapd_setup_encryption(char *iface, struct hostapd_data *hapd);
54 static int setup_interface2(struct hostapd_iface *iface);
59 int (*cb)(struct hostapd_iface *iface, in hostapd_for_each_interface() argument
66 ret = cb(interfaces->iface[i], ctx); in hostapd_for_each_interface()
101 hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 1); in hostapd_reload_bss()
103 hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 0); in hostapd_reload_bss()
121 hostapd_setup_encryption(hapd->conf->iface, hapd); in hostapd_reload_bss()
134 wpa_printf(MSG_DEBUG, "Reconfigured interface %s", hapd->conf->iface); in hostapd_reload_bss()
138 static void hostapd_clear_old(struct hostapd_iface *iface) in hostapd_clear_old() argument
146 for (j = 0; j < iface->num_bss; j++) { in hostapd_clear_old()
147 hostapd_flush_old_stations(iface->bss[j], in hostapd_clear_old()
149 hostapd_broadcast_wep_clear(iface->bss[j]); in hostapd_clear_old()
154 radius_client_flush(iface->bss[j]->radius, 0); in hostapd_clear_old()
160 int hostapd_reload_config(struct hostapd_iface *iface) in hostapd_reload_config() argument
162 struct hostapd_data *hapd = iface->bss[0]; in hostapd_reload_config()
166 if (iface->config_fname == NULL) { in hostapd_reload_config()
168 hostapd_clear_old(iface); in hostapd_reload_config()
169 for (j = 0; j < iface->num_bss; j++) in hostapd_reload_config()
170 hostapd_reload_bss(iface->bss[j]); in hostapd_reload_config()
174 if (iface->interfaces == NULL || in hostapd_reload_config()
175 iface->interfaces->config_read_cb == NULL) in hostapd_reload_config()
177 newconf = iface->interfaces->config_read_cb(iface->config_fname); in hostapd_reload_config()
181 hostapd_clear_old(iface); in hostapd_reload_config()
184 iface->conf = newconf; in hostapd_reload_config()
186 for (j = 0; j < iface->num_bss; j++) { in hostapd_reload_config()
187 hapd = iface->bss[j]; in hostapd_reload_config()
245 hostapd_broadcast_key_clear_iface(hapd, hapd->conf->iface); in hostapd_broadcast_wep_clear()
257 hostapd_drv_set_key(hapd->conf->iface, in hostapd_broadcast_wep_set()
284 __func__, hapd->conf->iface); in hostapd_free_hapd_data()
289 wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); in hostapd_free_hapd_data()
309 if (hostapd_if_remove(hapd, WPA_IF_AP_BSS, hapd->conf->iface)) { in hostapd_free_hapd_data()
312 hapd->conf->iface); in hostapd_free_hapd_data()
363 hapd->conf->iface); in hostapd_cleanup()
364 if (hapd->iface->interfaces && in hostapd_cleanup()
365 hapd->iface->interfaces->ctrl_iface_deinit) { in hostapd_cleanup()
367 hapd->iface->interfaces->ctrl_iface_deinit(hapd); in hostapd_cleanup()
373 static void sta_track_deinit(struct hostapd_iface *iface) in sta_track_deinit() argument
377 if (!iface->num_sta_seen) in sta_track_deinit()
380 while ((info = dl_list_first(&iface->sta_seen, struct hostapd_sta_info, in sta_track_deinit()
383 iface->num_sta_seen--; in sta_track_deinit()
389 static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface) in hostapd_cleanup_iface_partial() argument
391 wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); in hostapd_cleanup_iface_partial()
394 hostapd_stop_setup_timers(iface); in hostapd_cleanup_iface_partial()
397 hostapd_free_hw_features(iface->hw_features, iface->num_hw_features); in hostapd_cleanup_iface_partial()
398 iface->hw_features = NULL; in hostapd_cleanup_iface_partial()
399 os_free(iface->current_rates); in hostapd_cleanup_iface_partial()
400 iface->current_rates = NULL; in hostapd_cleanup_iface_partial()
401 os_free(iface->basic_rates); in hostapd_cleanup_iface_partial()
402 iface->basic_rates = NULL; in hostapd_cleanup_iface_partial()
403 ap_list_deinit(iface); in hostapd_cleanup_iface_partial()
404 sta_track_deinit(iface); in hostapd_cleanup_iface_partial()
415 static void hostapd_cleanup_iface(struct hostapd_iface *iface) in hostapd_cleanup_iface() argument
417 wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); in hostapd_cleanup_iface()
418 eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); in hostapd_cleanup_iface()
420 hostapd_cleanup_iface_partial(iface); in hostapd_cleanup_iface()
421 hostapd_config_free(iface->conf); in hostapd_cleanup_iface()
422 iface->conf = NULL; in hostapd_cleanup_iface()
424 os_free(iface->config_fname); in hostapd_cleanup_iface()
425 os_free(iface->bss); in hostapd_cleanup_iface()
426 wpa_printf(MSG_DEBUG, "%s: free iface=%p", __func__, iface); in hostapd_cleanup_iface()
427 os_free(iface); in hostapd_cleanup_iface()
433 if (hapd->drv_priv && !hapd->iface->driver_ap_teardown) { in hostapd_clear_wep()
440 static int hostapd_setup_encryption(char *iface, struct hostapd_data *hapd) in hostapd_setup_encryption() argument
459 hostapd_drv_set_key(iface, hapd, WPA_ALG_WEP, NULL, i, in hostapd_setup_encryption()
484 if (!hapd->iface->driver_ap_teardown) { in hostapd_flush_old_stations()
518 static int hostapd_validate_bssid_configuration(struct hostapd_iface *iface) in hostapd_validate_bssid_configuration() argument
521 struct hostapd_data *hapd = iface->bss[0]; in hostapd_validate_bssid_configuration()
522 unsigned int i = iface->conf->num_bss, bits = 0, j; in hostapd_validate_bssid_configuration()
528 if (iface->conf->use_driver_iface_addr) in hostapd_validate_bssid_configuration()
539 for (j = 0; j < iface->conf->num_bss; j++) { in hostapd_validate_bssid_configuration()
540 if (is_zero_ether_addr(iface->conf->bss[j]->bssid)) { in hostapd_validate_bssid_configuration()
548 iface->conf->bss[j]->bssid[i] ^ in hostapd_validate_bssid_configuration()
587 (unsigned long) iface->conf->num_bss, MAC2STR(mask), bits); in hostapd_validate_bssid_configuration()
907 __func__, hapd, conf->iface, first); in hostapd_setup_bss()
918 __func__, conf->iface); in hostapd_setup_bss()
931 hapd->iface->bss[0]->own_addr) == in hostapd_setup_bss()
935 "the radio", conf->iface); in hostapd_setup_bss()
948 if (hostapd_if_add(hapd->iface->bss[0], WPA_IF_AP_BSS, in hostapd_setup_bss()
949 conf->iface, addr, hapd, in hostapd_setup_bss()
972 if (hapd->iface->mconf == NULL) in hostapd_setup_bss()
982 if (hostapd_setup_encryption(conf->iface, hapd)) in hostapd_setup_bss()
1016 conf->iface, MAC2STR(hapd->own_addr), in hostapd_setup_bss()
1153 static void hostapd_tx_queue_params(struct hostapd_iface *iface) in hostapd_tx_queue_params() argument
1155 struct hostapd_data *hapd = iface->bss[0]; in hostapd_tx_queue_params()
1160 if (iface->mconf == NULL) in hostapd_tx_queue_params()
1165 p = &iface->conf->tx_queue[i]; in hostapd_tx_queue_params()
1210 if (hapd->iface->drv_max_acl_mac_addrs == 0) in hostapd_set_acl()
1237 if (!hapd->iface->interfaces || in start_ctrl_iface_bss()
1238 !hapd->iface->interfaces->ctrl_iface_init) in start_ctrl_iface_bss()
1241 if (hapd->iface->interfaces->ctrl_iface_init(hapd)) { in start_ctrl_iface_bss()
1244 hapd->conf->iface); in start_ctrl_iface_bss()
1252 static int start_ctrl_iface(struct hostapd_iface *iface) in start_ctrl_iface() argument
1256 if (!iface->interfaces || !iface->interfaces->ctrl_iface_init) in start_ctrl_iface()
1259 for (i = 0; i < iface->num_bss; i++) { in start_ctrl_iface()
1260 struct hostapd_data *hapd = iface->bss[i]; in start_ctrl_iface()
1261 if (iface->interfaces->ctrl_iface_init(hapd)) { in start_ctrl_iface()
1264 hapd->conf->iface); in start_ctrl_iface()
1275 struct hostapd_iface *iface = eloop_ctx; in channel_list_update_timeout() local
1277 if (!iface->wait_channel_update) { in channel_list_update_timeout()
1287 setup_interface2(iface); in channel_list_update_timeout()
1291 void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator) in hostapd_channel_list_updated() argument
1293 if (!iface->wait_channel_update || initiator != REGDOM_SET_BY_USER) in hostapd_channel_list_updated()
1297 eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); in hostapd_channel_list_updated()
1298 setup_interface2(iface); in hostapd_channel_list_updated()
1302 static int setup_interface(struct hostapd_iface *iface) in setup_interface() argument
1304 struct hostapd_data *hapd = iface->bss[0]; in setup_interface()
1314 iface->driver_ap_teardown = 0; in setup_interface()
1316 if (!iface->phy[0]) { in setup_interface()
1320 os_strlcpy(iface->phy, phy, sizeof(iface->phy)); in setup_interface()
1328 for (i = 1; i < iface->num_bss; i++) { in setup_interface()
1329 iface->bss[i]->driver = hapd->driver; in setup_interface()
1330 iface->bss[i]->drv_priv = hapd->drv_priv; in setup_interface()
1333 if (hostapd_validate_bssid_configuration(iface)) in setup_interface()
1341 if (start_ctrl_iface(iface)) in setup_interface()
1347 hostapd_set_state(iface, HAPD_IFACE_COUNTRY_UPDATE); in setup_interface()
1363 iface->wait_channel_update = 1; in setup_interface()
1366 iface, NULL); in setup_interface()
1371 return setup_interface2(iface); in setup_interface()
1375 static int setup_interface2(struct hostapd_iface *iface) in setup_interface2() argument
1377 iface->wait_channel_update = 0; in setup_interface2()
1379 if (hostapd_get_hw_features(iface)) { in setup_interface2()
1383 int ret = hostapd_select_hw_mode(iface); in setup_interface2()
1393 ret = hostapd_check_ht_capab(iface); in setup_interface2()
1402 if (iface->conf->ieee80211h) in setup_interface2()
1405 return hostapd_setup_interface_complete(iface, 0); in setup_interface2()
1408 hostapd_set_state(iface, HAPD_IFACE_DISABLED); in setup_interface2()
1409 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); in setup_interface2()
1410 if (iface->interfaces && iface->interfaces->terminate_on_error) in setup_interface2()
1432 *hw_mode = ieee80211_freq_to_chan(hapd->iface->freq, channel); in fst_hostapd_get_channel_info_cb()
1440 if (hapd->iface->fst_ies != fst_ies) { in fst_hostapd_set_ies_cb()
1441 hapd->iface->fst_ies = fst_ies; in fst_hostapd_set_ies_cb()
1453 return hostapd_drv_send_action(hapd, hapd->iface->freq, 0, da, in fst_hostapd_send_action_cb()
1593 (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_UAPSD)) in hostapd_set_own_neighbor_report()
1608 if (ieee80211_freq_to_channel_ext(hapd->iface->freq, in hostapd_set_own_neighbor_report()
1621 ieee80211_freq_to_chan(hapd->iface->freq + in hostapd_set_own_neighbor_report()
1641 wpabuf_put_u8(nr, ieee80211_get_phy_type(hapd->iface->freq, ht, vht)); in hostapd_set_own_neighbor_report()
1662 static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface, in hostapd_setup_interface_complete_sync() argument
1665 struct hostapd_data *hapd = iface->bss[0]; in hostapd_setup_interface_complete_sync()
1675 if (iface->conf->channel) { in hostapd_setup_interface_complete_sync()
1680 iface->freq = hostapd_hw_get_freq(hapd, iface->conf->channel); in hostapd_setup_interface_complete_sync()
1683 hostapd_hw_mode_txt(iface->conf->hw_mode), in hostapd_setup_interface_complete_sync()
1684 iface->conf->channel, iface->freq); in hostapd_setup_interface_complete_sync()
1688 if (!(iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD)) { in hostapd_setup_interface_complete_sync()
1690 res = hostapd_handle_dfs(iface); in hostapd_setup_interface_complete_sync()
1698 res_dfs_offload = hostapd_handle_dfs_offload(iface); in hostapd_setup_interface_complete_sync()
1717 if (iface->mconf != NULL) { in hostapd_setup_interface_complete_sync()
1720 iface->bss[0]->conf->iface); in hostapd_setup_interface_complete_sync()
1726 hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq, in hostapd_setup_interface_complete_sync()
1740 if (iface->current_mode) { in hostapd_setup_interface_complete_sync()
1741 if (hostapd_prepare_rates(iface, iface->current_mode)) { in hostapd_setup_interface_complete_sync()
1767 for (j = 0; j < iface->num_bss; j++) { in hostapd_setup_interface_complete_sync()
1768 hapd = iface->bss[j]; in hostapd_setup_interface_complete_sync()
1773 hapd = iface->bss[j]; in hostapd_setup_interface_complete_sync()
1782 hapd = iface->bss[0]; in hostapd_setup_interface_complete_sync()
1784 hostapd_tx_queue_params(iface); in hostapd_setup_interface_complete_sync()
1786 ap_list_init(iface); in hostapd_setup_interface_complete_sync()
1802 for (j = 0; j < iface->num_bss; j++) { in hostapd_setup_interface_complete_sync()
1803 if (hostapd_init_wps_complete(iface->bss[j])) in hostapd_setup_interface_complete_sync()
1807 if ((iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) && in hostapd_setup_interface_complete_sync()
1826 iface->fst = fst_attach(hapd->conf->iface, hapd->own_addr, in hostapd_setup_interface_complete_sync()
1828 if (!iface->fst) { in hostapd_setup_interface_complete_sync()
1836 hostapd_set_state(iface, HAPD_IFACE_ENABLED); in hostapd_setup_interface_complete_sync()
1837 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_ENABLED); in hostapd_setup_interface_complete_sync()
1842 iface->bss[0]->conf->iface); in hostapd_setup_interface_complete_sync()
1843 if (iface->interfaces && iface->interfaces->terminate_on_error > 0) in hostapd_setup_interface_complete_sync()
1844 iface->interfaces->terminate_on_error--; in hostapd_setup_interface_complete_sync()
1846 for (j = 0; j < iface->num_bss; j++) in hostapd_setup_interface_complete_sync()
1847 hostapd_set_own_neighbor_report(iface->bss[j]); in hostapd_setup_interface_complete_sync()
1853 hostapd_set_state(iface, HAPD_IFACE_DISABLED); in hostapd_setup_interface_complete_sync()
1856 if (iface->fst) { in hostapd_setup_interface_complete_sync()
1857 fst_detach(iface->fst); in hostapd_setup_interface_complete_sync()
1858 iface->fst = NULL; in hostapd_setup_interface_complete_sync()
1861 if (iface->interfaces && iface->interfaces->terminate_on_error) in hostapd_setup_interface_complete_sync()
1875 int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err) in hostapd_setup_interface_complete() argument
1877 struct hapd_interfaces *interfaces = iface->interfaces; in hostapd_setup_interface_complete()
1878 struct hostapd_data *hapd = iface->bss[0]; in hostapd_setup_interface_complete()
1882 if (!iface->need_to_start_in_sync) in hostapd_setup_interface_complete()
1883 return hostapd_setup_interface_complete_sync(iface, err); in hostapd_setup_interface_complete()
1887 hostapd_set_state(iface, HAPD_IFACE_DISABLED); in hostapd_setup_interface_complete()
1888 iface->need_to_start_in_sync = 0; in hostapd_setup_interface_complete()
1895 if (iface->ready_to_start_in_sync) { in hostapd_setup_interface_complete()
1901 if (interfaces->iface[i]->need_to_start_in_sync && in hostapd_setup_interface_complete()
1902 !interfaces->iface[i]->ready_to_start_in_sync) in hostapd_setup_interface_complete()
1910 if (not_ready_in_sync_ifaces > 1 && iface->state == HAPD_IFACE_DFS) { in hostapd_setup_interface_complete()
1915 iface->need_to_start_in_sync = 0; in hostapd_setup_interface_complete()
1918 iface->bss[0]->conf->iface); in hostapd_setup_interface_complete()
1919 return hostapd_setup_interface_complete_sync(iface, err); in hostapd_setup_interface_complete()
1924 iface->ready_to_start_in_sync = 1; in hostapd_setup_interface_complete()
1927 iface->bss[0]->conf->iface); in hostapd_setup_interface_complete()
1933 iface->bss[0]->conf->iface); in hostapd_setup_interface_complete()
1934 iface->need_to_start_in_sync = 0; in hostapd_setup_interface_complete()
1935 hostapd_setup_interface_complete_sync(iface, err); in hostapd_setup_interface_complete()
1937 if (interfaces->iface[i]->need_to_start_in_sync && in hostapd_setup_interface_complete()
1938 interfaces->iface[i]->ready_to_start_in_sync) { in hostapd_setup_interface_complete()
1940 interfaces->iface[i], 0); in hostapd_setup_interface_complete()
1942 interfaces->iface[i]->need_to_start_in_sync = 0; in hostapd_setup_interface_complete()
1966 int hostapd_setup_interface(struct hostapd_iface *iface) in hostapd_setup_interface() argument
1970 ret = setup_interface(iface); in hostapd_setup_interface()
1973 iface->bss[0]->conf->iface); in hostapd_setup_interface()
2006 hapd->iface = hapd_iface; in hostapd_alloc_bss_data()
2023 hapd->conf->iface); in hostapd_bss_deinit()
2030 void hostapd_interface_deinit(struct hostapd_iface *iface) in hostapd_interface_deinit() argument
2034 wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); in hostapd_interface_deinit()
2035 if (iface == NULL) in hostapd_interface_deinit()
2038 hostapd_set_state(iface, HAPD_IFACE_DISABLED); in hostapd_interface_deinit()
2042 hostapd_stop_setup_timers(iface); in hostapd_interface_deinit()
2043 eloop_cancel_timeout(ap_ht2040_timeout, iface, NULL); in hostapd_interface_deinit()
2046 eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); in hostapd_interface_deinit()
2047 iface->wait_channel_update = 0; in hostapd_interface_deinit()
2050 if (iface->fst) { in hostapd_interface_deinit()
2051 fst_detach(iface->fst); in hostapd_interface_deinit()
2052 iface->fst = NULL; in hostapd_interface_deinit()
2056 for (j = iface->num_bss - 1; j >= 0; j--) { in hostapd_interface_deinit()
2057 if (!iface->bss) in hostapd_interface_deinit()
2059 hostapd_bss_deinit(iface->bss[j]); in hostapd_interface_deinit()
2064 void hostapd_interface_free(struct hostapd_iface *iface) in hostapd_interface_free() argument
2067 wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); in hostapd_interface_free()
2068 for (j = 0; j < iface->num_bss; j++) { in hostapd_interface_free()
2069 if (!iface->bss) in hostapd_interface_free()
2072 __func__, iface->bss[j]); in hostapd_interface_free()
2073 os_free(iface->bss[j]); in hostapd_interface_free()
2075 hostapd_cleanup_iface(iface); in hostapd_interface_free()
2161 struct hostapd_iface *iface = interfaces->iface[i]; in ifname_in_use() local
2162 for (j = 0; j < iface->num_bss; j++) { in ifname_in_use()
2163 struct hostapd_data *hapd = iface->bss[j]; in ifname_in_use()
2164 if (os_strcmp(ifname, hapd->conf->iface) == 0) in ifname_in_use()
2188 struct hostapd_iface *new_iface = NULL, *iface = NULL; in hostapd_interface_init_bss() local
2197 if (os_strcmp(interfaces->iface[i]->phy, phy) == 0) { in hostapd_interface_init_bss()
2198 iface = interfaces->iface[i]; in hostapd_interface_init_bss()
2204 config_fname, phy, iface ? "" : " --> new PHY"); in hostapd_interface_init_bss()
2205 if (iface) { in hostapd_interface_init_bss()
2222 ifname = conf->bss[0]->iface; in hostapd_interface_init_bss()
2231 iface->conf->bss, iface->conf->num_bss + 1, in hostapd_interface_init_bss()
2233 tmp_bss = os_realloc_array(iface->bss, iface->num_bss + 1, in hostapd_interface_init_bss()
2236 iface->bss = tmp_bss; in hostapd_interface_init_bss()
2238 iface->conf->bss = tmp_conf; in hostapd_interface_init_bss()
2239 iface->conf->last_bss = tmp_conf[0]; in hostapd_interface_init_bss()
2245 bss = iface->conf->bss[iface->conf->num_bss] = conf->bss[0]; in hostapd_interface_init_bss()
2246 iface->conf->num_bss++; in hostapd_interface_init_bss()
2248 hapd = hostapd_alloc_bss_data(iface, iface->conf, bss); in hostapd_interface_init_bss()
2250 iface->conf->num_bss--; in hostapd_interface_init_bss()
2254 iface->conf->last_bss = bss; in hostapd_interface_init_bss()
2255 iface->bss[iface->num_bss] = hapd; in hostapd_interface_init_bss()
2258 bss_idx = iface->num_bss++; in hostapd_interface_init_bss()
2264 new_iface = iface = hostapd_init(interfaces, config_fname); in hostapd_interface_init_bss()
2265 if (!iface) in hostapd_interface_init_bss()
2267 os_strlcpy(iface->phy, phy, sizeof(iface->phy)); in hostapd_interface_init_bss()
2268 iface->interfaces = interfaces; in hostapd_interface_init_bss()
2273 if (iface->bss[bss_idx]->conf->logger_stdout_level > 0) in hostapd_interface_init_bss()
2274 iface->bss[bss_idx]->conf->logger_stdout_level--; in hostapd_interface_init_bss()
2277 if (iface->conf->bss[bss_idx]->iface[0] == '\0' && in hostapd_interface_init_bss()
2278 !hostapd_drv_none(iface->bss[bss_idx])) { in hostapd_interface_init_bss()
2286 return iface; in hostapd_interface_init_bss()
2290 void hostapd_interface_deinit_free(struct hostapd_iface *iface) in hostapd_interface_deinit_free() argument
2295 wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); in hostapd_interface_deinit_free()
2296 if (iface == NULL) in hostapd_interface_deinit_free()
2299 __func__, (unsigned int) iface->num_bss, in hostapd_interface_deinit_free()
2300 (unsigned int) iface->conf->num_bss); in hostapd_interface_deinit_free()
2301 driver = iface->bss[0]->driver; in hostapd_interface_deinit_free()
2302 drv_priv = iface->bss[0]->drv_priv; in hostapd_interface_deinit_free()
2303 hostapd_interface_deinit(iface); in hostapd_interface_deinit_free()
2308 iface->bss[0]->drv_priv = NULL; in hostapd_interface_deinit_free()
2310 hostapd_interface_free(iface); in hostapd_interface_deinit_free()
2341 hapd_iface->conf->bss[0]->iface); in hostapd_enable_iface()
2346 hapd_iface->conf->bss[0]->iface); in hostapd_enable_iface()
2376 hapd_iface->conf->bss[0]->iface); in hostapd_reload_iface()
2402 hapd_iface->conf->bss[0]->iface); in hostapd_disable_iface()
2429 hapd_iface->bss[0]->conf->iface); in hostapd_disable_iface()
2438 struct hostapd_iface **iface, *hapd_iface; in hostapd_iface_alloc() local
2440 iface = os_realloc_array(interfaces->iface, interfaces->count + 1, in hostapd_iface_alloc()
2442 if (iface == NULL) in hostapd_iface_alloc()
2444 interfaces->iface = iface; in hostapd_iface_alloc()
2445 hapd_iface = interfaces->iface[interfaces->count] = in hostapd_iface_alloc()
2499 os_strlcpy(bss->iface, ifname, sizeof(bss->iface)); in hostapd_config_alloc()
2573 if (interfaces->iface[j] == hapd_iface) in hostapd_add_iface()
2578 tmp = os_realloc_array(interfaces->iface, in hostapd_add_iface()
2585 interfaces->iface = tmp; in hostapd_add_iface()
2586 interfaces->iface[interfaces->count++] = hapd_iface; in hostapd_add_iface()
2617 __func__, hapd, hapd->conf->iface); in hostapd_add_iface()
2636 if (!os_strcmp(interfaces->iface[i]->conf->bss[0]->iface, in hostapd_add_iface()
2655 os_strlcpy(conf->bss[0]->iface, buf, in hostapd_add_iface()
2656 sizeof(conf->bss[0]->iface)); in hostapd_add_iface()
2682 hapd_iface->conf->bss[0]->iface); in hostapd_add_iface()
2701 hapd->conf->iface); in hostapd_add_iface()
2711 interfaces->iface[interfaces->count] = NULL; in hostapd_add_iface()
2719 static int hostapd_remove_bss(struct hostapd_iface *iface, unsigned int idx) in hostapd_remove_bss() argument
2723 wpa_printf(MSG_INFO, "Remove BSS '%s'", iface->conf->bss[idx]->iface); in hostapd_remove_bss()
2726 if (idx < iface->num_bss) { in hostapd_remove_bss()
2727 struct hostapd_data *hapd = iface->bss[idx]; in hostapd_remove_bss()
2731 __func__, hapd, hapd->conf->iface); in hostapd_remove_bss()
2736 iface->num_bss--; in hostapd_remove_bss()
2738 for (i = idx; i < iface->num_bss; i++) in hostapd_remove_bss()
2739 iface->bss[i] = iface->bss[i + 1]; in hostapd_remove_bss()
2741 hostapd_config_free_bss(iface->conf->bss[idx]); in hostapd_remove_bss()
2742 iface->conf->bss[idx] = NULL; in hostapd_remove_bss()
2745 iface->conf->num_bss--; in hostapd_remove_bss()
2746 for (i = idx; i < iface->conf->num_bss; i++) in hostapd_remove_bss()
2747 iface->conf->bss[i] = iface->conf->bss[i + 1]; in hostapd_remove_bss()
2759 hapd_iface = interfaces->iface[i]; in hostapd_remove_iface()
2762 if (!os_strcmp(hapd_iface->conf->bss[0]->iface, buf)) { in hostapd_remove_iface()
2771 interfaces->iface[k] = in hostapd_remove_iface()
2772 interfaces->iface[k + 1]; in hostapd_remove_iface()
2780 if (!os_strcmp(hapd_iface->conf->bss[j]->iface, buf)) { in hostapd_remove_iface()
2846 if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_WIRED) { in hostapd_new_assoc_sta()
2851 hapd->conf->iface, __func__, in hostapd_new_assoc_sta()
2854 } else if (!(hapd->iface->drv_flags & in hostapd_new_assoc_sta()
2859 hapd->conf->iface, __func__, MAC2STR(sta->addr), in hostapd_new_assoc_sta()
2891 void hostapd_set_state(struct hostapd_iface *iface, enum hostapd_iface_state s) in hostapd_set_state() argument
2894 iface->conf ? iface->conf->bss[0]->iface : "N/A", in hostapd_set_state()
2895 hostapd_state_text(iface->state), hostapd_state_text(s)); in hostapd_set_state()
2896 iface->state = s; in hostapd_set_state()
2900 int hostapd_csa_in_progress(struct hostapd_iface *iface) in hostapd_csa_in_progress() argument
2904 for (i = 0; i < iface->num_bss; i++) in hostapd_csa_in_progress()
2905 if (iface->bss[i]->csa_in_progress) in hostapd_csa_in_progress()
3091 struct hostapd_iface *iface = hapd->iface; in hostapd_fill_csa_settings() local
3097 if (!iface || !iface->freq || hapd->csa_in_progress) in hostapd_fill_csa_settings()
3119 &hapd->iface->cs_oper_class, in hostapd_fill_csa_settings()
3131 ret = hostapd_change_config_freq(iface->bss[0], iface->conf, in hostapd_fill_csa_settings()
3140 hostapd_change_config_freq(iface->bss[0], iface->conf, in hostapd_fill_csa_settings()
3184 if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA)) { in hostapd_switch_channel()
3209 hostapd_switch_channel_fallback(struct hostapd_iface *iface, in hostapd_switch_channel_fallback() argument
3243 iface->freq = freq_params->freq; in hostapd_switch_channel_fallback()
3244 iface->conf->channel = freq_params->channel; in hostapd_switch_channel_fallback()
3245 iface->conf->secondary_channel = freq_params->sec_channel_offset; in hostapd_switch_channel_fallback()
3246 iface->conf->vht_oper_centr_freq_seg0_idx = vht_seg0_idx; in hostapd_switch_channel_fallback()
3247 iface->conf->vht_oper_centr_freq_seg1_idx = vht_seg1_idx; in hostapd_switch_channel_fallback()
3248 iface->conf->vht_oper_chwidth = vht_bw; in hostapd_switch_channel_fallback()
3249 iface->conf->ieee80211n = freq_params->ht_enabled; in hostapd_switch_channel_fallback()
3250 iface->conf->ieee80211ac = freq_params->vht_enabled; in hostapd_switch_channel_fallback()
3256 for (i = 0; i < iface->num_bss; i++) in hostapd_switch_channel_fallback()
3257 hostapd_cleanup_cs_params(iface->bss[i]); in hostapd_switch_channel_fallback()
3259 hostapd_disable_iface(iface); in hostapd_switch_channel_fallback()
3260 hostapd_enable_iface(iface); in hostapd_switch_channel_fallback()
3272 struct hostapd_iface *iface = interfaces->iface[i]; in hostapd_get_iface() local
3274 for (j = 0; j < iface->num_bss; j++) { in hostapd_get_iface()
3275 struct hostapd_data *hapd = iface->bss[j]; in hostapd_get_iface()
3277 if (os_strcmp(ifname, hapd->conf->iface) == 0) in hostapd_get_iface()
3286 void hostapd_periodic_iface(struct hostapd_iface *iface) in hostapd_periodic_iface() argument
3290 ap_list_timer(iface); in hostapd_periodic_iface()
3292 for (i = 0; i < iface->num_bss; i++) { in hostapd_periodic_iface()
3293 struct hostapd_data *hapd = iface->bss[i]; in hostapd_periodic_iface()