Lines Matching refs:interfaces
80 int hostapd_for_each_interface(struct hapd_interfaces *interfaces, in hostapd_for_each_interface() argument
87 for (i = 0; i < interfaces->count; i++) { in hostapd_for_each_interface()
88 if (!interfaces->iface[i]) in hostapd_for_each_interface()
90 ret = cb(interfaces->iface[i], ctx); in hostapd_for_each_interface()
256 struct hapd_interfaces *interfaces = iface->interfaces; in hostapd_reload_config() local
269 if (iface->interfaces == NULL || in hostapd_reload_config()
270 iface->interfaces->config_read_cb == NULL) in hostapd_reload_config()
272 newconf = iface->interfaces->config_read_cb(iface->config_fname); in hostapd_reload_config()
290 hostapd_remove_iface(interfaces, hapd->conf->iface); in hostapd_reload_config()
291 iface = hostapd_init(interfaces, fname); in hostapd_reload_config()
299 iface->interfaces = interfaces; in hostapd_reload_config()
300 interfaces->iface[interfaces->count] = iface; in hostapd_reload_config()
301 interfaces->count++; in hostapd_reload_config()
488 struct hapd_interfaces *ifaces = hapd->iface->interfaces; in hostapd_free_hapd_data()
663 if (hapd->iface->interfaces && in hostapd_cleanup()
664 hapd->iface->interfaces->ctrl_iface_deinit) { in hostapd_cleanup()
666 hapd->iface->interfaces->ctrl_iface_deinit(hapd); in hostapd_cleanup()
1816 if (!hapd->iface->interfaces || in start_ctrl_iface_bss()
1817 !hapd->iface->interfaces->ctrl_iface_init) in start_ctrl_iface_bss()
1820 if (hapd->iface->interfaces->ctrl_iface_init(hapd)) { in start_ctrl_iface_bss()
1835 if (!iface->interfaces || !iface->interfaces->ctrl_iface_init) in start_ctrl_iface()
1840 if (iface->interfaces->ctrl_iface_init(hapd)) { in start_ctrl_iface()
1993 hostapd_for_each_interface(iface->interfaces, in hostapd_channel_list_updated()
2215 if (iface->interfaces && iface->interfaces->terminate_on_error) in setup_interface2()
2405 if (!hapd->iface->interfaces || in hostapd_owe_trans_get_info()
2406 !hapd->iface->interfaces->for_each_interface) in hostapd_owe_trans_get_info()
2409 return hapd->iface->interfaces->for_each_interface( in hostapd_owe_trans_get_info()
2410 hapd->iface->interfaces, hostapd_owe_iface_iter, hapd); in hostapd_owe_trans_get_info()
2451 if (!iface->interfaces || in hostapd_owe_update_trans()
2452 !iface->interfaces->for_each_interface) in hostapd_owe_update_trans()
2455 iface->interfaces->for_each_interface( in hostapd_owe_update_trans()
2456 iface->interfaces, hostapd_owe_iface_iter2, NULL); in hostapd_owe_update_trans()
2693 if (iface->interfaces && iface->interfaces->terminate_on_error > 0) in hostapd_setup_interface_complete_sync()
2694 iface->interfaces->terminate_on_error--; in hostapd_setup_interface_complete_sync()
2704 if (iface->interfaces && iface->interfaces->count > 1) in hostapd_setup_interface_complete_sync()
2727 if (iface->interfaces && iface->interfaces->terminate_on_error) { in hostapd_setup_interface_complete_sync()
2753 struct hapd_interfaces *interfaces = iface->interfaces; in hostapd_setup_interface_complete() local
2773 if (interfaces && interfaces->terminate_on_error) in hostapd_setup_interface_complete()
2783 for (i = 0; i < interfaces->count; i++) { in hostapd_setup_interface_complete()
2784 if (interfaces->iface[i]->need_to_start_in_sync && in hostapd_setup_interface_complete()
2785 !interfaces->iface[i]->ready_to_start_in_sync) in hostapd_setup_interface_complete()
2819 for (i = 0; i < interfaces->count; i++) { in hostapd_setup_interface_complete()
2820 if (interfaces->iface[i]->need_to_start_in_sync && in hostapd_setup_interface_complete()
2821 interfaces->iface[i]->ready_to_start_in_sync) { in hostapd_setup_interface_complete()
2823 interfaces->iface[i], 0); in hostapd_setup_interface_complete()
2825 interfaces->iface[i]->need_to_start_in_sync = 0; in hostapd_setup_interface_complete()
3042 struct hapd_interfaces *interfaces) in hostapd_bss_setup_multi_link() argument
3055 for (i = 0; i < interfaces->mld_count; i++) { in hostapd_bss_setup_multi_link()
3056 mld = interfaces->mld[i]; in hostapd_bss_setup_multi_link()
3083 all_mld = os_realloc_array(interfaces->mld, interfaces->mld_count + 1, in hostapd_bss_setup_multi_link()
3088 interfaces->mld = all_mld; in hostapd_bss_setup_multi_link()
3089 interfaces->mld[interfaces->mld_count] = mld; in hostapd_bss_setup_multi_link()
3090 interfaces->mld_count++; in hostapd_bss_setup_multi_link()
3104 static void hostapd_cleanup_unused_mlds(struct hapd_interfaces *interfaces) in hostapd_cleanup_unused_mlds() argument
3111 if (!interfaces->mld) in hostapd_cleanup_unused_mlds()
3114 num_mlds = interfaces->mld_count; in hostapd_cleanup_unused_mlds()
3116 for (i = 0; i < interfaces->mld_count; i++) { in hostapd_cleanup_unused_mlds()
3117 mld = interfaces->mld[i]; in hostapd_cleanup_unused_mlds()
3132 if (!remove && !interfaces->count) in hostapd_cleanup_unused_mlds()
3141 interfaces->mld[i] = NULL; in hostapd_cleanup_unused_mlds()
3146 interfaces->mld_count = 0; in hostapd_cleanup_unused_mlds()
3147 os_free(interfaces->mld); in hostapd_cleanup_unused_mlds()
3148 interfaces->mld = NULL; in hostapd_cleanup_unused_mlds()
3159 for (i = 0, j = 0; i < interfaces->mld_count; i++) { in hostapd_cleanup_unused_mlds()
3160 mld = interfaces->mld[i]; in hostapd_cleanup_unused_mlds()
3175 os_free(interfaces->mld); in hostapd_cleanup_unused_mlds()
3176 interfaces->mld = all_mld; in hostapd_cleanup_unused_mlds()
3177 interfaces->mld_count = num_mlds; in hostapd_cleanup_unused_mlds()
3191 struct hostapd_iface * hostapd_init(struct hapd_interfaces *interfaces, in hostapd_init() argument
3207 conf = interfaces->config_read_cb(hapd_iface->config_fname); in hostapd_init()
3225 hostapd_bss_setup_multi_link(hapd, interfaces); in hostapd_init()
3247 static int ifname_in_use(struct hapd_interfaces *interfaces, const char *ifname) in ifname_in_use() argument
3251 for (i = 0; i < interfaces->count; i++) { in ifname_in_use()
3252 struct hostapd_iface *iface = interfaces->iface[i]; in ifname_in_use()
3276 hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy, in hostapd_interface_init_bss() argument
3287 for (i = 0; i < interfaces->count; i++) { in hostapd_interface_init_bss()
3288 if (os_strcmp(interfaces->iface[i]->phy, phy) == 0) { in hostapd_interface_init_bss()
3289 iface = interfaces->iface[i]; in hostapd_interface_init_bss()
3304 conf = interfaces->config_read_cb(config_fname); in hostapd_interface_init_bss()
3314 if (ifname[0] != '\0' && ifname_in_use(interfaces, ifname)) { in hostapd_interface_init_bss()
3348 hostapd_bss_setup_multi_link(hapd, interfaces); in hostapd_interface_init_bss()
3357 new_iface = iface = hostapd_init(interfaces, config_fname); in hostapd_interface_init_bss()
3361 iface->interfaces = interfaces; in hostapd_interface_init_bss()
3466 if (!hapd_iface->interfaces || hapd_iface->interfaces->count <= 1) in hostapd_refresh_all_iface_beacons()
3469 for (j = 0; j < hapd_iface->interfaces->count; j++) { in hostapd_refresh_all_iface_beacons()
3470 if (hapd_iface->interfaces->iface[j] == hapd_iface) in hostapd_refresh_all_iface_beacons()
3473 ieee802_11_update_beacons(hapd_iface->interfaces->iface[j]); in hostapd_refresh_all_iface_beacons()
3504 if (hapd_iface->interfaces == NULL || in hostapd_enable_iface()
3505 hapd_iface->interfaces->driver_init == NULL || in hostapd_enable_iface()
3506 hapd_iface->interfaces->driver_init(hapd_iface)) in hostapd_enable_iface()
3612 hostapd_iface_alloc(struct hapd_interfaces *interfaces) in hostapd_iface_alloc() argument
3616 iface = os_realloc_array(interfaces->iface, interfaces->count + 1, in hostapd_iface_alloc()
3620 interfaces->iface = iface; in hostapd_iface_alloc()
3621 hapd_iface = interfaces->iface[interfaces->count] = in hostapd_iface_alloc()
3628 interfaces->count++; in hostapd_iface_alloc()
3629 hapd_iface->interfaces = interfaces; in hostapd_iface_alloc()
3636 hostapd_config_alloc(struct hapd_interfaces *interfaces, const char *ifname, in hostapd_config_alloc() argument
3715 hostapd_bss_setup_multi_link(hapd, hapd_iface->interfaces); in hostapd_data_alloc()
3725 int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf) in hostapd_add_iface() argument
3745 hapd_iface = hostapd_interface_init_bss(interfaces, phy_name, in hostapd_add_iface()
3749 for (j = 0; j < interfaces->count; j++) { in hostapd_add_iface()
3750 if (interfaces->iface[j] == hapd_iface) in hostapd_add_iface()
3753 if (j == interfaces->count) { in hostapd_add_iface()
3755 tmp = os_realloc_array(interfaces->iface, in hostapd_add_iface()
3756 interfaces->count + 1, in hostapd_add_iface()
3762 interfaces->iface = tmp; in hostapd_add_iface()
3763 interfaces->iface[interfaces->count++] = hapd_iface; in hostapd_add_iface()
3768 if (interfaces->driver_init(hapd_iface)) in hostapd_add_iface()
3817 for (i = 0; i < interfaces->count; i++) { in hostapd_add_iface()
3821 mld_ap = interfaces->iface[i]->conf->bss[0]->mld_ap; in hostapd_add_iface()
3824 if (!os_strcmp(interfaces->iface[i]->conf->bss[0]->iface, in hostapd_add_iface()
3832 hapd_iface = hostapd_iface_alloc(interfaces); in hostapd_add_iface()
3840 if (conf_file && interfaces->config_read_cb) { in hostapd_add_iface()
3841 conf = interfaces->config_read_cb(conf_file); in hostapd_add_iface()
3850 conf = hostapd_config_alloc(interfaces, buf, ptr, driver); in hostapd_add_iface()
3883 if (hapd_iface->interfaces && in hostapd_add_iface()
3884 hapd_iface->interfaces->ctrl_iface_deinit) in hostapd_add_iface()
3885 hapd_iface->interfaces-> in hostapd_add_iface()
3902 interfaces->count--; in hostapd_add_iface()
3903 interfaces->iface[interfaces->count] = NULL; in hostapd_add_iface()
3904 hostapd_cleanup_unused_mlds(interfaces); in hostapd_add_iface()
3949 int hostapd_remove_iface(struct hapd_interfaces *interfaces, char *buf) in hostapd_remove_iface() argument
3954 for (i = 0; i < interfaces->count; i++) { in hostapd_remove_iface()
3955 hapd_iface = interfaces->iface[i]; in hostapd_remove_iface()
3966 while (k < (interfaces->count - 1)) { in hostapd_remove_iface()
3967 interfaces->iface[k] = in hostapd_remove_iface()
3968 interfaces->iface[k + 1]; in hostapd_remove_iface()
3971 interfaces->count--; in hostapd_remove_iface()
3972 hostapd_cleanup_unused_mlds(interfaces); in hostapd_remove_iface()
4730 struct hostapd_data * hostapd_get_iface(struct hapd_interfaces *interfaces, in hostapd_get_iface() argument
4735 for (i = 0; i < interfaces->count; i++) { in hostapd_get_iface()
4736 struct hostapd_iface *iface = interfaces->iface[i]; in hostapd_get_iface()
4800 for (i = 0; i < hapd->iface->interfaces->count; i++) { in hostapd_mld_get_link_bss()
4801 iface = hapd->iface->interfaces->iface[i]; in hostapd_mld_get_link_bss()