Home | History | Annotate | Download | only in ap

Lines Matching defs:hapd_iface

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