Lines Matching refs:hapd_iface

2878 hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,  in hostapd_alloc_bss_data()  argument
2891 hapd->iface = hapd_iface; in hostapd_alloc_bss_data()
3019 struct hostapd_iface *hapd_iface; in hostapd_alloc_iface() local
3021 hapd_iface = os_zalloc(sizeof(*hapd_iface)); in hostapd_alloc_iface()
3022 if (!hapd_iface) in hostapd_alloc_iface()
3025 dl_list_init(&hapd_iface->sta_seen); in hostapd_alloc_iface()
3027 return hapd_iface; in hostapd_alloc_iface()
3194 struct hostapd_iface *hapd_iface = NULL; in hostapd_init() local
3199 hapd_iface = hostapd_alloc_iface(); in hostapd_init()
3200 if (hapd_iface == NULL) in hostapd_init()
3203 hapd_iface->config_fname = os_strdup(config_file); in hostapd_init()
3204 if (hapd_iface->config_fname == NULL) in hostapd_init()
3207 conf = interfaces->config_read_cb(hapd_iface->config_fname); in hostapd_init()
3210 hapd_iface->conf = conf; in hostapd_init()
3212 hapd_iface->num_bss = conf->num_bss; in hostapd_init()
3213 hapd_iface->bss = os_calloc(conf->num_bss, in hostapd_init()
3215 if (hapd_iface->bss == NULL) in hostapd_init()
3219 hapd = hapd_iface->bss[i] = in hostapd_init()
3220 hostapd_alloc_bss_data(hapd_iface, conf, in hostapd_init()
3228 hapd_iface->is_ch_switch_dfs = false; in hostapd_init()
3229 return hapd_iface; in hostapd_init()
3236 if (hapd_iface) { in hostapd_init()
3237 os_free(hapd_iface->config_fname); in hostapd_init()
3238 os_free(hapd_iface->bss); in hostapd_init()
3240 __func__, hapd_iface); in hostapd_init()
3241 os_free(hapd_iface); in hostapd_init()
3437 struct hostapd_iface *hapd_iface) in hostapd_deinit_driver() argument
3444 hostapd_cleanup_driver(driver, drv_priv, hapd_iface); in hostapd_deinit_driver()
3447 for (j = 0; j < hapd_iface->num_bss; j++) { in hostapd_deinit_driver()
3450 hapd_iface->bss[j]->drv_priv); in hostapd_deinit_driver()
3451 if (hapd_iface->bss[j]->drv_priv == drv_priv) { in hostapd_deinit_driver()
3452 hapd_iface->bss[j]->drv_priv = NULL; in hostapd_deinit_driver()
3453 hapd_iface->extended_capa = NULL; in hostapd_deinit_driver()
3454 hapd_iface->extended_capa_mask = NULL; in hostapd_deinit_driver()
3455 hapd_iface->extended_capa_len = 0; in hostapd_deinit_driver()
3462 static void hostapd_refresh_all_iface_beacons(struct hostapd_iface *hapd_iface) in hostapd_refresh_all_iface_beacons() argument
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()
3478 int hostapd_enable_iface(struct hostapd_iface *hapd_iface) in hostapd_enable_iface() argument
3482 if (!hapd_iface) in hostapd_enable_iface()
3485 if (hapd_iface->enable_iface_cb) in hostapd_enable_iface()
3486 return hapd_iface->enable_iface_cb(hapd_iface); in hostapd_enable_iface()
3488 if (hapd_iface->bss[0]->drv_priv != NULL) { in hostapd_enable_iface()
3490 hapd_iface->conf->bss[0]->iface); in hostapd_enable_iface()
3495 hapd_iface->conf->bss[0]->iface); in hostapd_enable_iface()
3497 for (j = 0; j < hapd_iface->num_bss; j++) in hostapd_enable_iface()
3498 hostapd_set_security_params(hapd_iface->conf->bss[j], 1); in hostapd_enable_iface()
3499 if (hostapd_config_check(hapd_iface->conf, 1) < 0) { in hostapd_enable_iface()
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()
3509 if (hostapd_setup_interface(hapd_iface)) { in hostapd_enable_iface()
3510 hostapd_deinit_driver(hapd_iface->bss[0]->driver, in hostapd_enable_iface()
3511 hapd_iface->bss[0]->drv_priv, in hostapd_enable_iface()
3512 hapd_iface); in hostapd_enable_iface()
3516 hostapd_refresh_all_iface_beacons(hapd_iface); in hostapd_enable_iface()
3522 int hostapd_reload_iface(struct hostapd_iface *hapd_iface) in hostapd_reload_iface() argument
3527 hapd_iface->conf->bss[0]->iface); in hostapd_reload_iface()
3528 for (j = 0; j < hapd_iface->num_bss; j++) in hostapd_reload_iface()
3529 hostapd_set_security_params(hapd_iface->conf->bss[j], 1); in hostapd_reload_iface()
3530 if (hostapd_config_check(hapd_iface->conf, 1) < 0) { in hostapd_reload_iface()
3534 hostapd_clear_old(hapd_iface); in hostapd_reload_iface()
3535 for (j = 0; j < hapd_iface->num_bss; j++) in hostapd_reload_iface()
3536 hostapd_reload_bss(hapd_iface->bss[j]); in hostapd_reload_iface()
3557 int hostapd_disable_iface(struct hostapd_iface *hapd_iface) in hostapd_disable_iface() argument
3563 if (hapd_iface == NULL) in hostapd_disable_iface()
3566 if (hapd_iface->disable_iface_cb) in hostapd_disable_iface()
3567 return hapd_iface->disable_iface_cb(hapd_iface); in hostapd_disable_iface()
3569 if (hapd_iface->bss[0]->drv_priv == NULL) { in hostapd_disable_iface()
3571 hapd_iface->conf->bss[0]->iface); in hostapd_disable_iface()
3575 wpa_msg(hapd_iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); in hostapd_disable_iface()
3576 driver = hapd_iface->bss[0]->driver; in hostapd_disable_iface()
3577 drv_priv = hapd_iface->bss[0]->drv_priv; in hostapd_disable_iface()
3579 hapd_iface->driver_ap_teardown = in hostapd_disable_iface()
3580 !!(hapd_iface->drv_flags & in hostapd_disable_iface()
3584 for (j = 0; j < hapd_iface->num_bss; j++) in hostapd_disable_iface()
3585 hostapd_cleanup_cs_params(hapd_iface->bss[j]); in hostapd_disable_iface()
3589 for (j = 0; j < hapd_iface->num_bss; j++) { in hostapd_disable_iface()
3590 struct hostapd_data *hapd = hapd_iface->bss[j]; in hostapd_disable_iface()
3596 hostapd_deinit_driver(driver, drv_priv, hapd_iface); in hostapd_disable_iface()
3601 hostapd_cleanup_iface_partial(hapd_iface); in hostapd_disable_iface()
3604 hapd_iface->bss[0]->conf->iface); in hostapd_disable_iface()
3605 hostapd_set_state(hapd_iface, HAPD_IFACE_DISABLED); in hostapd_disable_iface()
3606 hostapd_refresh_all_iface_beacons(hapd_iface); in hostapd_disable_iface()
3614 struct hostapd_iface **iface, *hapd_iface; in hostapd_iface_alloc() local
3621 hapd_iface = interfaces->iface[interfaces->count] = in hostapd_iface_alloc()
3623 if (hapd_iface == NULL) { in hostapd_iface_alloc()
3629 hapd_iface->interfaces = interfaces; in hostapd_iface_alloc()
3631 return hapd_iface; in hostapd_iface_alloc()
3690 static int hostapd_data_alloc(struct hostapd_iface *hapd_iface, in hostapd_data_alloc() argument
3696 hapd_iface->bss = os_calloc(conf->num_bss, in hostapd_data_alloc()
3698 if (hapd_iface->bss == NULL) in hostapd_data_alloc()
3702 hapd = hapd_iface->bss[i] = in hostapd_data_alloc()
3703 hostapd_alloc_bss_data(hapd_iface, conf, conf->bss[i]); in hostapd_data_alloc()
3707 os_free(hapd_iface->bss[i]); in hostapd_data_alloc()
3708 hapd_iface->bss[i] = NULL; in hostapd_data_alloc()
3710 os_free(hapd_iface->bss); in hostapd_data_alloc()
3711 hapd_iface->bss = NULL; in hostapd_data_alloc()
3715 hostapd_bss_setup_multi_link(hapd, hapd_iface->interfaces); in hostapd_data_alloc()
3718 hapd_iface->conf = conf; in hostapd_data_alloc()
3719 hapd_iface->num_bss = conf->num_bss; in hostapd_data_alloc()
3728 struct hostapd_iface *hapd_iface = NULL, *new_iface = NULL; in hostapd_add_iface() local
3745 hapd_iface = hostapd_interface_init_bss(interfaces, phy_name, in hostapd_add_iface()
3747 if (!hapd_iface) in hostapd_add_iface()
3750 if (interfaces->iface[j] == hapd_iface) in hostapd_add_iface()
3759 hostapd_interface_deinit_free(hapd_iface); in hostapd_add_iface()
3763 interfaces->iface[interfaces->count++] = hapd_iface; in hostapd_add_iface()
3764 new_iface = hapd_iface; in hostapd_add_iface()
3768 if (interfaces->driver_init(hapd_iface)) in hostapd_add_iface()
3771 if (hostapd_setup_interface(hapd_iface)) { in hostapd_add_iface()
3773 hapd_iface->bss[0]->driver, in hostapd_add_iface()
3774 hapd_iface->bss[0]->drv_priv, in hostapd_add_iface()
3775 hapd_iface); in hostapd_add_iface()
3780 hapd = hapd_iface->bss[hapd_iface->num_bss - 1]; in hostapd_add_iface()
3781 hapd->driver = hapd_iface->bss[0]->driver; in hostapd_add_iface()
3782 hapd->drv_priv = hapd_iface->bss[0]->drv_priv; in hostapd_add_iface()
3783 os_memcpy(hapd->own_addr, hapd_iface->bss[0]->own_addr, in hostapd_add_iface()
3787 (hapd_iface->state == HAPD_IFACE_ENABLED && in hostapd_add_iface()
3791 hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; in hostapd_add_iface()
3792 hapd_iface->conf->num_bss--; in hostapd_add_iface()
3793 hapd_iface->num_bss--; in hostapd_add_iface()
3805 hostapd_owe_update_trans(hapd_iface); in hostapd_add_iface()
3832 hapd_iface = hostapd_iface_alloc(interfaces); in hostapd_add_iface()
3833 if (hapd_iface == NULL) { in hostapd_add_iface()
3838 new_iface = hapd_iface; in hostapd_add_iface()
3859 if (hostapd_data_alloc(hapd_iface, conf) < 0) { in hostapd_add_iface()
3866 if (start_ctrl_iface(hapd_iface) < 0) in hostapd_add_iface()
3870 hapd_iface->conf->bss[0]->iface); in hostapd_add_iface()
3877 if (hapd_iface) { in hostapd_add_iface()
3878 if (hapd_iface->bss) { in hostapd_add_iface()
3879 for (i = 0; i < hapd_iface->num_bss; i++) { in hostapd_add_iface()
3880 hapd = hapd_iface->bss[i]; 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()
3888 __func__, hapd_iface->bss[i], in hostapd_add_iface()
3896 hapd_iface->bss[i] = NULL; in hostapd_add_iface()
3898 os_free(hapd_iface->bss); in hostapd_add_iface()
3899 hapd_iface->bss = NULL; in hostapd_add_iface()
3906 hostapd_cleanup_iface(hapd_iface); in hostapd_add_iface()
3951 struct hostapd_iface *hapd_iface; in hostapd_remove_iface() local
3955 hapd_iface = interfaces->iface[i]; in hostapd_remove_iface()
3956 if (hapd_iface == NULL) in hostapd_remove_iface()
3958 if (!os_strcmp(hapd_iface->conf->bss[0]->iface, buf)) { in hostapd_remove_iface()
3960 hapd_iface->driver_ap_teardown = in hostapd_remove_iface()
3961 !!(hapd_iface->drv_flags & in hostapd_remove_iface()
3964 hostapd_interface_deinit_free(hapd_iface); in hostapd_remove_iface()
3977 for (j = 0; j < hapd_iface->conf->num_bss; j++) { in hostapd_remove_iface()
3978 if (!os_strcmp(hapd_iface->conf->bss[j]->iface, buf)) { in hostapd_remove_iface()
3979 hapd_iface->driver_ap_teardown = in hostapd_remove_iface()
3980 !(hapd_iface->drv_flags & in hostapd_remove_iface()
3982 return hostapd_remove_bss(hapd_iface, j); in hostapd_remove_iface()