Lines Matching refs:hapd_iface

1597 hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,  in hostapd_alloc_bss_data()  argument
1610 hapd->iface = hapd_iface; in hostapd_alloc_bss_data()
1677 struct hostapd_iface *hapd_iface = NULL; in hostapd_init() local
1682 hapd_iface = os_zalloc(sizeof(*hapd_iface)); in hostapd_init()
1683 if (hapd_iface == NULL) in hostapd_init()
1686 hapd_iface->config_fname = os_strdup(config_file); in hostapd_init()
1687 if (hapd_iface->config_fname == NULL) in hostapd_init()
1690 conf = interfaces->config_read_cb(hapd_iface->config_fname); in hostapd_init()
1693 hapd_iface->conf = conf; in hostapd_init()
1695 hapd_iface->num_bss = conf->num_bss; in hostapd_init()
1696 hapd_iface->bss = os_calloc(conf->num_bss, in hostapd_init()
1698 if (hapd_iface->bss == NULL) in hostapd_init()
1702 hapd = hapd_iface->bss[i] = in hostapd_init()
1703 hostapd_alloc_bss_data(hapd_iface, conf, in hostapd_init()
1710 return hapd_iface; in hostapd_init()
1717 if (hapd_iface) { in hostapd_init()
1718 os_free(hapd_iface->config_fname); in hostapd_init()
1719 os_free(hapd_iface->bss); in hostapd_init()
1721 __func__, hapd_iface); in hostapd_init()
1722 os_free(hapd_iface); in hostapd_init()
1888 struct hostapd_iface *hapd_iface) in hostapd_deinit_driver() argument
1896 for (j = 0; j < hapd_iface->num_bss; j++) { in hostapd_deinit_driver()
1899 hapd_iface->bss[j]->drv_priv); in hostapd_deinit_driver()
1900 if (hapd_iface->bss[j]->drv_priv == drv_priv) in hostapd_deinit_driver()
1901 hapd_iface->bss[j]->drv_priv = NULL; in hostapd_deinit_driver()
1907 int hostapd_enable_iface(struct hostapd_iface *hapd_iface) in hostapd_enable_iface() argument
1911 if (hapd_iface->bss[0]->drv_priv != NULL) { in hostapd_enable_iface()
1913 hapd_iface->conf->bss[0]->iface); in hostapd_enable_iface()
1918 hapd_iface->conf->bss[0]->iface); in hostapd_enable_iface()
1920 for (j = 0; j < hapd_iface->num_bss; j++) in hostapd_enable_iface()
1921 hostapd_set_security_params(hapd_iface->conf->bss[j], 1); in hostapd_enable_iface()
1922 if (hostapd_config_check(hapd_iface->conf, 1) < 0) { in hostapd_enable_iface()
1927 if (hapd_iface->interfaces == NULL || in hostapd_enable_iface()
1928 hapd_iface->interfaces->driver_init == NULL || in hostapd_enable_iface()
1929 hapd_iface->interfaces->driver_init(hapd_iface)) in hostapd_enable_iface()
1932 if (hostapd_setup_interface(hapd_iface)) { in hostapd_enable_iface()
1933 hostapd_deinit_driver(hapd_iface->bss[0]->driver, in hostapd_enable_iface()
1934 hapd_iface->bss[0]->drv_priv, in hostapd_enable_iface()
1935 hapd_iface); in hostapd_enable_iface()
1943 int hostapd_reload_iface(struct hostapd_iface *hapd_iface) in hostapd_reload_iface() argument
1948 hapd_iface->conf->bss[0]->iface); in hostapd_reload_iface()
1949 for (j = 0; j < hapd_iface->num_bss; j++) in hostapd_reload_iface()
1950 hostapd_set_security_params(hapd_iface->conf->bss[j], 1); in hostapd_reload_iface()
1951 if (hostapd_config_check(hapd_iface->conf, 1) < 0) { in hostapd_reload_iface()
1955 hostapd_clear_old(hapd_iface); in hostapd_reload_iface()
1956 for (j = 0; j < hapd_iface->num_bss; j++) in hostapd_reload_iface()
1957 hostapd_reload_bss(hapd_iface->bss[j]); in hostapd_reload_iface()
1963 int hostapd_disable_iface(struct hostapd_iface *hapd_iface) in hostapd_disable_iface() argument
1969 if (hapd_iface == NULL) in hostapd_disable_iface()
1972 if (hapd_iface->bss[0]->drv_priv == NULL) { in hostapd_disable_iface()
1974 hapd_iface->conf->bss[0]->iface); in hostapd_disable_iface()
1978 wpa_msg(hapd_iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); in hostapd_disable_iface()
1979 driver = hapd_iface->bss[0]->driver; in hostapd_disable_iface()
1980 drv_priv = hapd_iface->bss[0]->drv_priv; in hostapd_disable_iface()
1982 hapd_iface->driver_ap_teardown = in hostapd_disable_iface()
1983 !!(hapd_iface->drv_flags & in hostapd_disable_iface()
1987 for (j = 0; j < hapd_iface->num_bss; j++) { in hostapd_disable_iface()
1988 struct hostapd_data *hapd = hapd_iface->bss[j]; in hostapd_disable_iface()
1993 hostapd_deinit_driver(driver, drv_priv, hapd_iface); in hostapd_disable_iface()
1998 hostapd_cleanup_iface_partial(hapd_iface); in hostapd_disable_iface()
2001 hapd_iface->bss[0]->conf->iface); in hostapd_disable_iface()
2002 hostapd_set_state(hapd_iface, HAPD_IFACE_DISABLED); in hostapd_disable_iface()
2010 struct hostapd_iface **iface, *hapd_iface; in hostapd_iface_alloc() local
2017 hapd_iface = interfaces->iface[interfaces->count] = in hostapd_iface_alloc()
2018 os_zalloc(sizeof(*hapd_iface)); in hostapd_iface_alloc()
2019 if (hapd_iface == NULL) { in hostapd_iface_alloc()
2025 hapd_iface->interfaces = interfaces; in hostapd_iface_alloc()
2027 return hapd_iface; in hostapd_iface_alloc()
2070 static int hostapd_data_alloc(struct hostapd_iface *hapd_iface, in hostapd_data_alloc() argument
2076 hapd_iface->bss = os_calloc(conf->num_bss, in hostapd_data_alloc()
2078 if (hapd_iface->bss == NULL) in hostapd_data_alloc()
2082 hapd = hapd_iface->bss[i] = in hostapd_data_alloc()
2083 hostapd_alloc_bss_data(hapd_iface, conf, conf->bss[i]); in hostapd_data_alloc()
2087 os_free(hapd_iface->bss[i]); in hostapd_data_alloc()
2088 hapd_iface->bss[i] = NULL; in hostapd_data_alloc()
2090 os_free(hapd_iface->bss); in hostapd_data_alloc()
2091 hapd_iface->bss = NULL; in hostapd_data_alloc()
2097 hapd_iface->conf = conf; in hostapd_data_alloc()
2098 hapd_iface->num_bss = conf->num_bss; in hostapd_data_alloc()
2107 struct hostapd_iface *hapd_iface = NULL, *new_iface = NULL; in hostapd_add_iface() local
2124 hapd_iface = hostapd_interface_init_bss(interfaces, phy_name, in hostapd_add_iface()
2126 if (!hapd_iface) in hostapd_add_iface()
2129 if (interfaces->iface[j] == hapd_iface) in hostapd_add_iface()
2138 hostapd_interface_deinit_free(hapd_iface); in hostapd_add_iface()
2142 interfaces->iface[interfaces->count++] = hapd_iface; in hostapd_add_iface()
2143 new_iface = hapd_iface; in hostapd_add_iface()
2147 if (interfaces->driver_init(hapd_iface)) in hostapd_add_iface()
2150 if (hostapd_setup_interface(hapd_iface)) { in hostapd_add_iface()
2152 hapd_iface->bss[0]->driver, in hostapd_add_iface()
2153 hapd_iface->bss[0]->drv_priv, in hostapd_add_iface()
2154 hapd_iface); in hostapd_add_iface()
2159 hapd = hapd_iface->bss[hapd_iface->num_bss - 1]; in hostapd_add_iface()
2160 hapd->driver = hapd_iface->bss[0]->driver; in hostapd_add_iface()
2161 hapd->drv_priv = hapd_iface->bss[0]->drv_priv; in hostapd_add_iface()
2162 os_memcpy(hapd->own_addr, hapd_iface->bss[0]->own_addr, in hostapd_add_iface()
2166 (hapd_iface->state == HAPD_IFACE_ENABLED && in hostapd_add_iface()
2169 hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; in hostapd_add_iface()
2170 hapd_iface->conf->num_bss--; in hostapd_add_iface()
2171 hapd_iface->num_bss--; in hostapd_add_iface()
2200 hapd_iface = hostapd_iface_alloc(interfaces); in hostapd_add_iface()
2201 if (hapd_iface == NULL) { in hostapd_add_iface()
2206 new_iface = hapd_iface; in hostapd_add_iface()
2221 if (hostapd_data_alloc(hapd_iface, conf) < 0) { in hostapd_add_iface()
2228 if (start_ctrl_iface(hapd_iface) < 0) in hostapd_add_iface()
2232 hapd_iface->conf->bss[0]->iface); in hostapd_add_iface()
2239 if (hapd_iface) { in hostapd_add_iface()
2240 if (hapd_iface->bss) { in hostapd_add_iface()
2241 for (i = 0; i < hapd_iface->num_bss; i++) { in hostapd_add_iface()
2242 hapd = hapd_iface->bss[i]; in hostapd_add_iface()
2245 if (hapd_iface->interfaces && in hostapd_add_iface()
2246 hapd_iface->interfaces->ctrl_iface_deinit) in hostapd_add_iface()
2247 hapd_iface->interfaces-> in hostapd_add_iface()
2250 __func__, hapd_iface->bss[i], in hostapd_add_iface()
2254 hapd_iface->bss[i] = NULL; in hostapd_add_iface()
2256 os_free(hapd_iface->bss); in hostapd_add_iface()
2257 hapd_iface->bss = NULL; in hostapd_add_iface()
2263 hostapd_cleanup_iface(hapd_iface); in hostapd_add_iface()
2305 struct hostapd_iface *hapd_iface; in hostapd_remove_iface() local
2309 hapd_iface = interfaces->iface[i]; in hostapd_remove_iface()
2310 if (hapd_iface == NULL) in hostapd_remove_iface()
2312 if (!os_strcmp(hapd_iface->conf->bss[0]->iface, buf)) { in hostapd_remove_iface()
2314 hapd_iface->driver_ap_teardown = in hostapd_remove_iface()
2315 !!(hapd_iface->drv_flags & in hostapd_remove_iface()
2318 hostapd_interface_deinit_free(hapd_iface); in hostapd_remove_iface()
2329 for (j = 0; j < hapd_iface->conf->num_bss; j++) { in hostapd_remove_iface()
2330 if (!os_strcmp(hapd_iface->conf->bss[j]->iface, buf)) { in hostapd_remove_iface()
2331 hapd_iface->driver_ap_teardown = in hostapd_remove_iface()
2332 !(hapd_iface->drv_flags & in hostapd_remove_iface()
2334 return hostapd_remove_bss(hapd_iface, j); in hostapd_remove_iface()