Home | History | Annotate | Download | only in ap

Lines Matching refs:hapd_iface

1983  * @hapd_iface: Pointer to interface data
1993 hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
2006 hapd->iface = hapd_iface;
2081 struct hostapd_iface *hapd_iface;
2083 hapd_iface = os_zalloc(sizeof(*hapd_iface));
2084 if (!hapd_iface)
2087 dl_list_init(&hapd_iface->sta_seen);
2089 return hapd_iface;
2105 struct hostapd_iface *hapd_iface = NULL;
2110 hapd_iface = hostapd_alloc_iface();
2111 if (hapd_iface == NULL)
2114 hapd_iface->config_fname = os_strdup(config_file);
2115 if (hapd_iface->config_fname == NULL)
2118 conf = interfaces->config_read_cb(hapd_iface->config_fname);
2121 hapd_iface->conf = conf;
2123 hapd_iface->num_bss = conf->num_bss;
2124 hapd_iface->bss = os_calloc(conf->num_bss,
2126 if (hapd_iface->bss == NULL)
2130 hapd = hapd_iface->bss[i] =
2131 hostapd_alloc_bss_data(hapd_iface, conf,
2138 return hapd_iface;
2145 if (hapd_iface) {
2146 os_free(hapd_iface->config_fname);
2147 os_free(hapd_iface->bss);
2149 __func__, hapd_iface);
2150 os_free(hapd_iface);
2316 struct hostapd_iface *hapd_iface)
2324 for (j = 0; j < hapd_iface->num_bss; j++) {
2327 hapd_iface->bss[j]->drv_priv);
2328 if (hapd_iface->bss[j]->drv_priv == drv_priv)
2329 hapd_iface->bss[j]->drv_priv = NULL;
2335 int hostapd_enable_iface(struct hostapd_iface *hapd_iface)
2339 if (hapd_iface->bss[0]->drv_priv != NULL) {
2341 hapd_iface->conf->bss[0]->iface);
2346 hapd_iface->conf->bss[0]->iface);
2348 for (j = 0; j < hapd_iface->num_bss; j++)
2349 hostapd_set_security_params(hapd_iface->conf->bss[j], 1);
2350 if (hostapd_config_check(hapd_iface->conf, 1) < 0) {
2355 if (hapd_iface->interfaces == NULL ||
2356 hapd_iface->interfaces->driver_init == NULL ||
2357 hapd_iface->interfaces->driver_init(hapd_iface))
2360 if (hostapd_setup_interface(hapd_iface)) {
2361 hostapd_deinit_driver(hapd_iface->bss[0]->driver,
2362 hapd_iface->bss[0]->drv_priv,
2363 hapd_iface);
2371 int hostapd_reload_iface(struct hostapd_iface *hapd_iface)
2376 hapd_iface->conf->bss[0]->iface);
2377 for (j = 0; j < hapd_iface->num_bss; j++)
2378 hostapd_set_security_params(hapd_iface->conf->bss[j], 1);
2379 if (hostapd_config_check(hapd_iface->conf, 1) < 0) {
2383 hostapd_clear_old(hapd_iface);
2384 for (j = 0; j < hapd_iface->num_bss; j++)
2385 hostapd_reload_bss(hapd_iface->bss[j]);
2391 int hostapd_disable_iface(struct hostapd_iface *hapd_iface)
2397 if (hapd_iface == NULL)
2400 if (hapd_iface->bss[0]->drv_priv == NULL) {
2402 hapd_iface->conf->bss[0]->iface);
2406 wpa_msg(hapd_iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_DISABLED);
2407 driver = hapd_iface->bss[0]->driver;
2408 drv_priv = hapd_iface->bss[0]->drv_priv;
2410 hapd_iface->driver_ap_teardown =
2411 !!(hapd_iface->drv_flags &
2415 for (j = 0; j < hapd_iface->num_bss; j++) {
2416 struct hostapd_data *hapd = hapd_iface->bss[j];
2421 hostapd_deinit_driver(driver, drv_priv, hapd_iface);
2426 hostapd_cleanup_iface_partial(hapd_iface);
2429 hapd_iface->bss[0]->conf->iface);
2430 hostapd_set_state(hapd_iface, HAPD_IFACE_DISABLED);
2438 struct hostapd_iface **iface, *hapd_iface;
2445 hapd_iface = interfaces->iface[interfaces->count] =
2447 if (hapd_iface == NULL) {
2453 hapd_iface->interfaces = interfaces;
2455 return hapd_iface;
2514 static int hostapd_data_alloc(struct hostapd_iface *hapd_iface,
2520 hapd_iface->bss = os_calloc(conf->num_bss,
2522 if (hapd_iface->bss == NULL)
2526 hapd = hapd_iface->bss[i] =
2527 hostapd_alloc_bss_data(hapd_iface, conf, conf->bss[i]);
2531 os_free(hapd_iface->bss[i]);
2532 hapd_iface->bss[i] = NULL;
2534 hapd_iface->bss);
2535 hapd_iface->bss = NULL;
2541 hapd_iface->conf = conf;
2542 hapd_iface->num_bss = conf->num_bss;
2551 struct hostapd_iface *hapd_iface = NULL, *new_iface = NULL;
2568 hapd_iface = hostapd_interface_init_bss(interfaces, phy_name,
2570 if (!hapd_iface)
2573 if (interfaces->iface[j] == hapd_iface)
2582 hostapd_interface_deinit_free(hapd_iface);
2586 interfaces->iface[interfaces->count++] = hapd_iface;
2587 new_iface = hapd_iface;
2591 if (interfaces->driver_init(hapd_iface))
2594 if (hostapd_setup_interface(hapd_iface)) {
2596 hapd_iface->bss[0]->driver,
2597 hapd_iface->bss[0]->drv_priv,
2598 hapd_iface);
2603 hapd = hapd_iface->bss[hapd_iface->num_bss - 1];
2604 hapd->driver = hapd_iface->bss[0]->driver;
2605 hapd->drv_priv = hapd_iface->bss[0]->drv_priv;
2606 os_memcpy(hapd->own_addr, hapd_iface->bss[0]->own_addr,
2610 (hapd_iface->state == HAPD_IFACE_ENABLED &&
2613 hapd_iface->bss[hapd_iface->num_bss - 1] = NULL;
2614 hapd_iface->conf->num_bss--;
2615 hapd_iface->num_bss--;
2644 hapd_iface = hostapd_iface_alloc(interfaces);
2645 if (hapd_iface == NULL) {
2650 new_iface = hapd_iface;
2671 if (hostapd_data_alloc(hapd_iface, conf) < 0) {
2678 if (start_ctrl_iface(hapd_iface) < 0)
2682 hapd_iface->conf->bss[0]->iface);
2689 if (hapd_iface) {
2690 if (hapd_iface->bss) {
2691 for (i = 0; i < hapd_iface->num_bss; i++) {
2692 hapd = hapd_iface->bss[i];
2695 if (hapd_iface->interfaces &&
2696 hapd_iface->interfaces->ctrl_iface_deinit)
2697 hapd_iface->interfaces->
2700 __func__, hapd_iface->bss[i],
2704 hapd_iface->bss[i] = NULL;
2706 os_free(hapd_iface->bss);
2707 hapd_iface->bss = NULL;
2713 hostapd_cleanup_iface(hapd_iface);
2755 struct hostapd_iface *hapd_iface;
2759 hapd_iface = interfaces->iface[i];
2760 if (hapd_iface == NULL)
2762 if (!os_strcmp(hapd_iface->conf->bss[0]->iface, buf)) {
2764 hapd_iface->driver_ap_teardown =
2765 !!(hapd_iface->drv_flags &
2768 hostapd_interface_deinit_free(hapd_iface);
2779 for (j = 0; j < hapd_iface->conf->num_bss; j++) {
2780 if (!os_strcmp(hapd_iface->conf->bss[j]->iface, buf)) {
2781 hapd_iface->driver_ap_teardown =
2782 !(hapd_iface->drv_flags &
2784 return hostapd_remove_bss(hapd_iface, j);