Lines Matching refs:hapd_iface

2885 hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,  in hostapd_alloc_bss_data()  argument
2898 hapd->iface = hapd_iface; in hostapd_alloc_bss_data()
3026 struct hostapd_iface *hapd_iface; in hostapd_alloc_iface() local
3028 hapd_iface = os_zalloc(sizeof(*hapd_iface)); in hostapd_alloc_iface()
3029 if (!hapd_iface) in hostapd_alloc_iface()
3032 dl_list_init(&hapd_iface->sta_seen); in hostapd_alloc_iface()
3034 return hapd_iface; in hostapd_alloc_iface()
3201 struct hostapd_iface *hapd_iface = NULL; in hostapd_init() local
3206 hapd_iface = hostapd_alloc_iface(); in hostapd_init()
3207 if (hapd_iface == NULL) in hostapd_init()
3210 hapd_iface->config_fname = os_strdup(config_file); in hostapd_init()
3211 if (hapd_iface->config_fname == NULL) in hostapd_init()
3214 conf = interfaces->config_read_cb(hapd_iface->config_fname); in hostapd_init()
3217 hapd_iface->conf = conf; in hostapd_init()
3219 hapd_iface->num_bss = conf->num_bss; in hostapd_init()
3220 hapd_iface->bss = os_calloc(conf->num_bss, in hostapd_init()
3222 if (hapd_iface->bss == NULL) in hostapd_init()
3226 hapd = hapd_iface->bss[i] = in hostapd_init()
3227 hostapd_alloc_bss_data(hapd_iface, conf, in hostapd_init()
3235 hapd_iface->is_ch_switch_dfs = false; in hostapd_init()
3236 return hapd_iface; in hostapd_init()
3243 if (hapd_iface) { in hostapd_init()
3244 os_free(hapd_iface->config_fname); in hostapd_init()
3245 os_free(hapd_iface->bss); in hostapd_init()
3247 __func__, hapd_iface); in hostapd_init()
3248 os_free(hapd_iface); in hostapd_init()
3444 struct hostapd_iface *hapd_iface) in hostapd_deinit_driver() argument
3451 hostapd_cleanup_driver(driver, drv_priv, hapd_iface); in hostapd_deinit_driver()
3454 for (j = 0; j < hapd_iface->num_bss; j++) { in hostapd_deinit_driver()
3457 hapd_iface->bss[j]->drv_priv); in hostapd_deinit_driver()
3458 if (hapd_iface->bss[j]->drv_priv == drv_priv) { in hostapd_deinit_driver()
3459 hapd_iface->bss[j]->drv_priv = NULL; in hostapd_deinit_driver()
3460 hapd_iface->extended_capa = NULL; in hostapd_deinit_driver()
3461 hapd_iface->extended_capa_mask = NULL; in hostapd_deinit_driver()
3462 hapd_iface->extended_capa_len = 0; in hostapd_deinit_driver()
3469 static void hostapd_refresh_all_iface_beacons(struct hostapd_iface *hapd_iface) in hostapd_refresh_all_iface_beacons() argument
3473 if (!hapd_iface->interfaces || hapd_iface->interfaces->count <= 1) in hostapd_refresh_all_iface_beacons()
3476 for (j = 0; j < hapd_iface->interfaces->count; j++) { in hostapd_refresh_all_iface_beacons()
3477 if (hapd_iface->interfaces->iface[j] == hapd_iface) in hostapd_refresh_all_iface_beacons()
3480 ieee802_11_update_beacons(hapd_iface->interfaces->iface[j]); in hostapd_refresh_all_iface_beacons()
3485 int hostapd_enable_iface(struct hostapd_iface *hapd_iface) in hostapd_enable_iface() argument
3489 if (!hapd_iface) in hostapd_enable_iface()
3492 if (hapd_iface->enable_iface_cb) in hostapd_enable_iface()
3493 return hapd_iface->enable_iface_cb(hapd_iface); in hostapd_enable_iface()
3495 if (hapd_iface->bss[0]->drv_priv != NULL) { in hostapd_enable_iface()
3497 hapd_iface->conf->bss[0]->iface); in hostapd_enable_iface()
3502 hapd_iface->conf->bss[0]->iface); in hostapd_enable_iface()
3504 for (j = 0; j < hapd_iface->num_bss; j++) in hostapd_enable_iface()
3505 hostapd_set_security_params(hapd_iface->conf->bss[j], 1); in hostapd_enable_iface()
3506 if (hostapd_config_check(hapd_iface->conf, 1) < 0) { in hostapd_enable_iface()
3511 if (hapd_iface->interfaces == NULL || in hostapd_enable_iface()
3512 hapd_iface->interfaces->driver_init == NULL || in hostapd_enable_iface()
3513 hapd_iface->interfaces->driver_init(hapd_iface)) in hostapd_enable_iface()
3516 if (hostapd_setup_interface(hapd_iface)) { in hostapd_enable_iface()
3517 hostapd_deinit_driver(hapd_iface->bss[0]->driver, in hostapd_enable_iface()
3518 hapd_iface->bss[0]->drv_priv, in hostapd_enable_iface()
3519 hapd_iface); in hostapd_enable_iface()
3523 hostapd_refresh_all_iface_beacons(hapd_iface); in hostapd_enable_iface()
3529 int hostapd_reload_iface(struct hostapd_iface *hapd_iface) in hostapd_reload_iface() argument
3534 hapd_iface->conf->bss[0]->iface); in hostapd_reload_iface()
3535 for (j = 0; j < hapd_iface->num_bss; j++) in hostapd_reload_iface()
3536 hostapd_set_security_params(hapd_iface->conf->bss[j], 1); in hostapd_reload_iface()
3537 if (hostapd_config_check(hapd_iface->conf, 1) < 0) { in hostapd_reload_iface()
3541 hostapd_clear_old(hapd_iface); in hostapd_reload_iface()
3542 for (j = 0; j < hapd_iface->num_bss; j++) in hostapd_reload_iface()
3543 hostapd_reload_bss(hapd_iface->bss[j]); in hostapd_reload_iface()
3564 int hostapd_disable_iface(struct hostapd_iface *hapd_iface) in hostapd_disable_iface() argument
3570 if (hapd_iface == NULL) in hostapd_disable_iface()
3573 if (hapd_iface->disable_iface_cb) in hostapd_disable_iface()
3574 return hapd_iface->disable_iface_cb(hapd_iface); in hostapd_disable_iface()
3576 if (hapd_iface->bss[0]->drv_priv == NULL) { in hostapd_disable_iface()
3578 hapd_iface->conf->bss[0]->iface); in hostapd_disable_iface()
3582 wpa_msg(hapd_iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); in hostapd_disable_iface()
3583 driver = hapd_iface->bss[0]->driver; in hostapd_disable_iface()
3584 drv_priv = hapd_iface->bss[0]->drv_priv; in hostapd_disable_iface()
3586 hapd_iface->driver_ap_teardown = in hostapd_disable_iface()
3587 !!(hapd_iface->drv_flags & in hostapd_disable_iface()
3591 for (j = 0; j < hapd_iface->num_bss; j++) in hostapd_disable_iface()
3592 hostapd_cleanup_cs_params(hapd_iface->bss[j]); in hostapd_disable_iface()
3596 for (j = 0; j < hapd_iface->num_bss; j++) { in hostapd_disable_iface()
3597 struct hostapd_data *hapd = hapd_iface->bss[j]; in hostapd_disable_iface()
3603 hostapd_deinit_driver(driver, drv_priv, hapd_iface); in hostapd_disable_iface()
3608 hostapd_cleanup_iface_partial(hapd_iface); in hostapd_disable_iface()
3611 hapd_iface->bss[0]->conf->iface); in hostapd_disable_iface()
3612 hostapd_set_state(hapd_iface, HAPD_IFACE_DISABLED); in hostapd_disable_iface()
3613 hostapd_refresh_all_iface_beacons(hapd_iface); in hostapd_disable_iface()
3621 struct hostapd_iface **iface, *hapd_iface; in hostapd_iface_alloc() local
3628 hapd_iface = interfaces->iface[interfaces->count] = in hostapd_iface_alloc()
3630 if (hapd_iface == NULL) { in hostapd_iface_alloc()
3636 hapd_iface->interfaces = interfaces; in hostapd_iface_alloc()
3638 return hapd_iface; in hostapd_iface_alloc()
3697 static int hostapd_data_alloc(struct hostapd_iface *hapd_iface, in hostapd_data_alloc() argument
3703 hapd_iface->bss = os_calloc(conf->num_bss, in hostapd_data_alloc()
3705 if (hapd_iface->bss == NULL) in hostapd_data_alloc()
3709 hapd = hapd_iface->bss[i] = in hostapd_data_alloc()
3710 hostapd_alloc_bss_data(hapd_iface, conf, conf->bss[i]); in hostapd_data_alloc()
3714 os_free(hapd_iface->bss[i]); in hostapd_data_alloc()
3715 hapd_iface->bss[i] = NULL; in hostapd_data_alloc()
3717 os_free(hapd_iface->bss); in hostapd_data_alloc()
3718 hapd_iface->bss = NULL; in hostapd_data_alloc()
3722 hostapd_bss_setup_multi_link(hapd, hapd_iface->interfaces); in hostapd_data_alloc()
3725 hapd_iface->conf = conf; in hostapd_data_alloc()
3726 hapd_iface->num_bss = conf->num_bss; in hostapd_data_alloc()
3735 struct hostapd_iface *hapd_iface = NULL, *new_iface = NULL; in hostapd_add_iface() local
3752 hapd_iface = hostapd_interface_init_bss(interfaces, phy_name, in hostapd_add_iface()
3754 if (!hapd_iface) in hostapd_add_iface()
3757 if (interfaces->iface[j] == hapd_iface) in hostapd_add_iface()
3766 hostapd_interface_deinit_free(hapd_iface); in hostapd_add_iface()
3770 interfaces->iface[interfaces->count++] = hapd_iface; in hostapd_add_iface()
3771 new_iface = hapd_iface; in hostapd_add_iface()
3775 if (interfaces->driver_init(hapd_iface)) in hostapd_add_iface()
3778 if (hostapd_setup_interface(hapd_iface)) { in hostapd_add_iface()
3780 hapd_iface->bss[0]->driver, in hostapd_add_iface()
3781 hapd_iface->bss[0]->drv_priv, in hostapd_add_iface()
3782 hapd_iface); in hostapd_add_iface()
3787 hapd = hapd_iface->bss[hapd_iface->num_bss - 1]; in hostapd_add_iface()
3788 hapd->driver = hapd_iface->bss[0]->driver; in hostapd_add_iface()
3789 hapd->drv_priv = hapd_iface->bss[0]->drv_priv; in hostapd_add_iface()
3790 os_memcpy(hapd->own_addr, hapd_iface->bss[0]->own_addr, in hostapd_add_iface()
3794 (hapd_iface->state == HAPD_IFACE_ENABLED && in hostapd_add_iface()
3798 hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; in hostapd_add_iface()
3799 hapd_iface->conf->num_bss--; in hostapd_add_iface()
3800 hapd_iface->num_bss--; in hostapd_add_iface()
3812 hostapd_owe_update_trans(hapd_iface); in hostapd_add_iface()
3839 hapd_iface = hostapd_iface_alloc(interfaces); in hostapd_add_iface()
3840 if (hapd_iface == NULL) { in hostapd_add_iface()
3845 new_iface = hapd_iface; in hostapd_add_iface()
3866 if (hostapd_data_alloc(hapd_iface, conf) < 0) { in hostapd_add_iface()
3873 if (start_ctrl_iface(hapd_iface) < 0) in hostapd_add_iface()
3877 hapd_iface->conf->bss[0]->iface); in hostapd_add_iface()
3884 if (hapd_iface) { in hostapd_add_iface()
3885 if (hapd_iface->bss) { in hostapd_add_iface()
3886 for (i = 0; i < hapd_iface->num_bss; i++) { in hostapd_add_iface()
3887 hapd = hapd_iface->bss[i]; in hostapd_add_iface()
3890 if (hapd_iface->interfaces && in hostapd_add_iface()
3891 hapd_iface->interfaces->ctrl_iface_deinit) in hostapd_add_iface()
3892 hapd_iface->interfaces-> in hostapd_add_iface()
3895 __func__, hapd_iface->bss[i], in hostapd_add_iface()
3903 hapd_iface->bss[i] = NULL; in hostapd_add_iface()
3905 os_free(hapd_iface->bss); in hostapd_add_iface()
3906 hapd_iface->bss = NULL; in hostapd_add_iface()
3913 hostapd_cleanup_iface(hapd_iface); in hostapd_add_iface()
3958 struct hostapd_iface *hapd_iface; in hostapd_remove_iface() local
3962 hapd_iface = interfaces->iface[i]; in hostapd_remove_iface()
3963 if (hapd_iface == NULL) in hostapd_remove_iface()
3965 if (!os_strcmp(hapd_iface->conf->bss[0]->iface, buf)) { in hostapd_remove_iface()
3967 hapd_iface->driver_ap_teardown = in hostapd_remove_iface()
3968 !!(hapd_iface->drv_flags & in hostapd_remove_iface()
3971 hostapd_interface_deinit_free(hapd_iface); in hostapd_remove_iface()
3984 for (j = 0; j < hapd_iface->conf->num_bss; j++) { in hostapd_remove_iface()
3985 if (!os_strcmp(hapd_iface->conf->bss[j]->iface, buf)) { in hostapd_remove_iface()
3986 hapd_iface->driver_ap_teardown = in hostapd_remove_iface()
3987 !(hapd_iface->drv_flags & in hostapd_remove_iface()
3989 return hostapd_remove_bss(hapd_iface, j); in hostapd_remove_iface()