Lines Matching full:interfaces
77 int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
84 for (i = 0; i < interfaces->count; i++) {
85 if (!interfaces->iface[i])
87 ret = cb(interfaces->iface[i], ctx);
253 struct hapd_interfaces *interfaces = iface->interfaces;
266 if (iface->interfaces == NULL ||
267 iface->interfaces->config_read_cb == NULL)
269 newconf = iface->interfaces->config_read_cb(iface->config_fname);
287 hostapd_remove_iface(interfaces, hapd->conf->iface);
288 iface = hostapd_init(interfaces, fname);
296 iface->interfaces = interfaces;
297 interfaces->iface[interfaces->count] = iface;
298 interfaces->count++;
485 struct hapd_interfaces *ifaces = hapd->iface->interfaces;
660 if (hapd->iface->interfaces &&
661 hapd->iface->interfaces->ctrl_iface_deinit) {
663 hapd->iface->interfaces->ctrl_iface_deinit(hapd);
1813 if (!hapd->iface->interfaces ||
1814 !hapd->iface->interfaces->ctrl_iface_init)
1817 if (hapd->iface->interfaces->ctrl_iface_init(hapd)) {
1832 if (!iface->interfaces || !iface->interfaces->ctrl_iface_init)
1837 if (iface->interfaces->ctrl_iface_init(hapd)) {
1850 * deinitializing the driver and the control interfaces. A subsequent
1990 hostapd_for_each_interface(iface->interfaces,
2040 * Initialize control interfaces early to allow external monitoring of
2227 if (iface->interfaces && iface->interfaces->terminate_on_error)
2417 if (!hapd->iface->interfaces ||
2418 !hapd->iface->interfaces->for_each_interface)
2421 return hapd->iface->interfaces->for_each_interface(
2422 hapd->iface->interfaces, hostapd_owe_iface_iter, hapd);
2463 if (!iface->interfaces ||
2464 !iface->interfaces->for_each_interface)
2467 iface->interfaces->for_each_interface(
2468 iface->interfaces, hostapd_owe_iface_iter2, NULL);
2705 if (iface->interfaces && iface->interfaces->terminate_on_error > 0)
2706 iface->interfaces->terminate_on_error--;
2711 if (iface->interfaces && iface->interfaces->count > 1)
2734 if (iface->interfaces && iface->interfaces->terminate_on_error) {
2760 struct hapd_interfaces *interfaces = iface->interfaces;
2780 if (interfaces && interfaces->terminate_on_error)
2790 for (i = 0; i < interfaces->count; i++) {
2791 if (interfaces->iface[i]->need_to_start_in_sync &&
2792 !interfaces->iface[i]->ready_to_start_in_sync)
2798 * waiting interfaces. If not, add this interface to the waiting list.
2813 /* need to wait as there are other interfaces still coming up */
2816 "%s: Interface waiting to sync with other interfaces",
2822 "%s: Last interface to sync - starting all interfaces",
2826 for (i = 0; i < interfaces->count; i++) {
2827 if (interfaces->iface[i]->need_to_start_in_sync &&
2828 interfaces->iface[i]->ready_to_start_in_sync) {
2830 interfaces->iface[i], 0);
2831 /* Only once the interfaces are sync started */
2832 interfaces->iface[i]->need_to_start_in_sync = 0;
3049 struct hapd_interfaces *interfaces)
3062 for (i = 0; i < interfaces->mld_count; i++) {
3063 mld = interfaces->mld[i];
3090 all_mld = os_realloc_array(interfaces->mld, interfaces->mld_count + 1,
3095 interfaces->mld = all_mld;
3096 interfaces->mld[interfaces->mld_count] = mld;
3097 interfaces->mld_count++;
3111 static void hostapd_cleanup_unused_mlds(struct hapd_interfaces *interfaces)
3118 if (!interfaces->mld)
3121 num_mlds = interfaces->mld_count;
3123 for (i = 0; i < interfaces->mld_count; i++) {
3124 mld = interfaces->mld[i];
3134 /* If MLD is still being referenced but the number of interfaces
3139 if (!remove && !interfaces->count)
3148 interfaces->mld[i] = NULL;
3153 interfaces->mld_count = 0;
3154 os_free(interfaces->mld);
3155 interfaces->mld = NULL;
3166 for (i = 0, j = 0; i < interfaces->mld_count; i++) {
3167 mld = interfaces->mld[i];
3182 os_free(interfaces->mld);
3183 interfaces->mld = all_mld;
3184 interfaces->mld_count = num_mlds;
3198 struct hostapd_iface * hostapd_init(struct hapd_interfaces *interfaces,
3214 conf = interfaces->config_read_cb(hapd_iface->config_fname);
3232 hostapd_bss_setup_multi_link(hapd, interfaces);
3254 static int ifname_in_use(struct hapd_interfaces *interfaces, const char *ifname)
3258 for (i = 0; i < interfaces->count; i++) {
3259 struct hostapd_iface *iface = interfaces->iface[i];
3283 hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy,
3294 for (i = 0; i < interfaces->count; i++) {
3295 if (os_strcmp(interfaces->iface[i]->phy, phy) == 0) {
3296 iface = interfaces->iface[i];
3311 conf = interfaces->config_read_cb(config_fname);
3321 if (ifname[0] != '\0' && ifname_in_use(interfaces, ifname)) {
3355 hostapd_bss_setup_multi_link(hapd, interfaces);
3364 new_iface = iface = hostapd_init(interfaces, config_fname);
3368 iface->interfaces = interfaces;
3473 if (!hapd_iface->interfaces || hapd_iface->interfaces->count <= 1)
3476 for (j = 0; j < hapd_iface->interfaces->count; j++) {
3477 if (hapd_iface->interfaces->iface[j] == hapd_iface)
3480 ieee802_11_update_beacons(hapd_iface->interfaces->iface[j]);
3511 if (hapd_iface->interfaces == NULL ||
3512 hapd_iface->interfaces->driver_init == NULL ||
3513 hapd_iface->interfaces->driver_init(hapd_iface))
3619 hostapd_iface_alloc(struct hapd_interfaces *interfaces)
3623 iface = os_realloc_array(interfaces->iface, interfaces->count + 1,
3627 interfaces->iface = iface;
3628 hapd_iface = interfaces->iface[interfaces->count] =
3635 interfaces->count++;
3636 hapd_iface->interfaces = interfaces;
3643 hostapd_config_alloc(struct hapd_interfaces *interfaces, const char *ifname,
3722 hostapd_bss_setup_multi_link(hapd, hapd_iface->interfaces);
3732 int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf)
3752 hapd_iface = hostapd_interface_init_bss(interfaces, phy_name,
3756 for (j = 0; j < interfaces->count; j++) {
3757 if (interfaces->iface[j] == hapd_iface)
3760 if (j == interfaces->count) {
3762 tmp = os_realloc_array(interfaces->iface,
3763 interfaces->count + 1,
3769 interfaces->iface = tmp;
3770 interfaces->iface[interfaces->count++] = hapd_iface;
3775 if (interfaces->driver_init(hapd_iface))
3824 for (i = 0; i < interfaces->count; i++) {
3828 mld_ap = interfaces->iface[i]->conf->bss[0]->mld_ap;
3831 if (!os_strcmp(interfaces->iface[i]->conf->bss[0]->iface,
3839 hapd_iface = hostapd_iface_alloc(interfaces);
3847 if (conf_file && interfaces->config_read_cb) {
3848 conf = interfaces->config_read_cb(conf_file);
3857 conf = hostapd_config_alloc(interfaces, buf, ptr, driver);
3890 if (hapd_iface->interfaces &&
3891 hapd_iface->interfaces->ctrl_iface_deinit)
3892 hapd_iface->interfaces->
3909 interfaces->count--;
3910 interfaces->iface[interfaces->count] = NULL;
3911 hostapd_cleanup_unused_mlds(interfaces);
3956 int hostapd_remove_iface(struct hapd_interfaces *interfaces, char *buf)
3961 for (i = 0; i < interfaces->count; i++) {
3962 hapd_iface = interfaces->iface[i];
3973 while (k < (interfaces->count - 1)) {
3974 interfaces->iface[k] =
3975 interfaces->iface[k + 1];
3978 interfaces->count--;
3979 hostapd_cleanup_unused_mlds(interfaces);
4737 struct hostapd_data * hostapd_get_iface(struct hapd_interfaces *interfaces,
4742 for (i = 0; i < interfaces->count; i++) {
4743 struct hostapd_iface *iface = interfaces->iface[i];
4807 for (i = 0; i < hapd->iface->interfaces->count; i++) {
4808 iface = hapd->iface->interfaces->iface[i];