Lines Matching refs:wpa_s

48 static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s,  in wpas_conf_ap_vht()  argument
62 center_chan = wpas_p2p_get_vht80_center(wpa_s, mode, channel); in wpas_conf_ap_vht()
65 center_chan = wpas_p2p_get_vht160_center(wpa_s, mode, channel); in wpas_conf_ap_vht()
74 center_chan = wpas_p2p_get_vht160_center(wpa_s, mode, channel); in wpas_conf_ap_vht()
77 center_chan = wpas_p2p_get_vht80_center(wpa_s, mode, in wpas_conf_ap_vht()
100 int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s, in wpa_supplicant_conf_ap_ht() argument
123 if (wpa_s->hw.modes) { in wpa_supplicant_conf_ap_ht()
126 for (i = 0; i < wpa_s->hw.num_modes; i++) { in wpa_supplicant_conf_ap_ht()
127 if (wpa_s->hw.modes[i].mode == conf->hw_mode) { in wpa_supplicant_conf_ap_ht()
128 mode = &wpa_s->hw.modes[i]; in wpa_supplicant_conf_ap_ht()
149 wpas_p2p_get_ht40_mode(wpa_s, mode, in wpa_supplicant_conf_ap_ht()
172 wpas_conf_ap_vht(wpa_s, conf, mode); in wpa_supplicant_conf_ap_ht()
180 for (iface = wpa_s->global->ifaces; iface; iface = iface->next) in wpa_supplicant_conf_ap_ht()
182 if (iface == wpa_s || in wpa_supplicant_conf_ap_ht()
205 static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s, in wpa_supplicant_conf_ap() argument
211 conf->driver = wpa_s->driver; in wpa_supplicant_conf_ap()
213 os_strlcpy(bss->iface, wpa_s->ifname, sizeof(bss->iface)); in wpa_supplicant_conf_ap()
215 if (wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf)) in wpa_supplicant_conf_ap()
233 if (ieee80211_is_dfs(ssid->frequency) && wpa_s->conf->country[0]) { in wpa_supplicant_conf_ap()
236 conf->country[0] = wpa_s->conf->country[0]; in wpa_supplicant_conf_ap()
237 conf->country[1] = wpa_s->conf->country[1]; in wpa_supplicant_conf_ap()
270 bss->isolate = !wpa_s->conf->p2p_intra_bss; in wpa_supplicant_conf_ap()
271 bss->force_per_enrollee_psk = wpa_s->global->p2p_per_sta_psk; in wpa_supplicant_conf_ap()
274 os_memcpy(bss->ip_addr_go, wpa_s->p2pdev->conf->ip_addr_go, 4); in wpa_supplicant_conf_ap()
275 os_memcpy(bss->ip_addr_mask, wpa_s->p2pdev->conf->ip_addr_mask, in wpa_supplicant_conf_ap()
278 wpa_s->p2pdev->conf->ip_addr_start, 4); in wpa_supplicant_conf_ap()
279 os_memcpy(bss->ip_addr_end, wpa_s->p2pdev->conf->ip_addr_end, in wpa_supplicant_conf_ap()
337 else if (wpa_s->conf->dtim_period) in wpa_supplicant_conf_ap()
338 bss->dtim_period = wpa_s->conf->dtim_period; in wpa_supplicant_conf_ap()
342 else if (wpa_s->conf->beacon_int) in wpa_supplicant_conf_ap()
343 conf->beacon_int = wpa_s->conf->beacon_int; in wpa_supplicant_conf_ap()
348 if (wpa_s->conf->p2p_go_ctwindow > conf->beacon_int) { in wpa_supplicant_conf_ap()
351 wpa_s->conf->p2p_go_ctwindow, in wpa_supplicant_conf_ap()
355 conf->p2p_go_ctwindow = wpa_s->conf->p2p_go_ctwindow; in wpa_supplicant_conf_ap()
433 if (wpa_s->conf->config_methods) in wpa_supplicant_conf_ap()
434 bss->config_methods = os_strdup(wpa_s->conf->config_methods); in wpa_supplicant_conf_ap()
435 os_memcpy(bss->device_type, wpa_s->conf->device_type, in wpa_supplicant_conf_ap()
437 if (wpa_s->conf->device_name) { in wpa_supplicant_conf_ap()
438 bss->device_name = os_strdup(wpa_s->conf->device_name); in wpa_supplicant_conf_ap()
439 bss->friendly_name = os_strdup(wpa_s->conf->device_name); in wpa_supplicant_conf_ap()
441 if (wpa_s->conf->manufacturer) in wpa_supplicant_conf_ap()
442 bss->manufacturer = os_strdup(wpa_s->conf->manufacturer); in wpa_supplicant_conf_ap()
443 if (wpa_s->conf->model_name) in wpa_supplicant_conf_ap()
444 bss->model_name = os_strdup(wpa_s->conf->model_name); in wpa_supplicant_conf_ap()
445 if (wpa_s->conf->model_number) in wpa_supplicant_conf_ap()
446 bss->model_number = os_strdup(wpa_s->conf->model_number); in wpa_supplicant_conf_ap()
447 if (wpa_s->conf->serial_number) in wpa_supplicant_conf_ap()
448 bss->serial_number = os_strdup(wpa_s->conf->serial_number); in wpa_supplicant_conf_ap()
449 if (is_nil_uuid(wpa_s->conf->uuid)) in wpa_supplicant_conf_ap()
450 os_memcpy(bss->uuid, wpa_s->wps->uuid, WPS_UUID_LEN); in wpa_supplicant_conf_ap()
452 os_memcpy(bss->uuid, wpa_s->conf->uuid, WPS_UUID_LEN); in wpa_supplicant_conf_ap()
453 os_memcpy(bss->os_version, wpa_s->conf->os_version, 4); in wpa_supplicant_conf_ap()
454 bss->pbc_in_m1 = wpa_s->conf->pbc_in_m1; in wpa_supplicant_conf_ap()
460 if (wpa_s->max_stations && in wpa_supplicant_conf_ap()
461 wpa_s->max_stations < wpa_s->conf->max_num_sta) in wpa_supplicant_conf_ap()
462 bss->max_num_sta = wpa_s->max_stations; in wpa_supplicant_conf_ap()
464 bss->max_num_sta = wpa_s->conf->max_num_sta; in wpa_supplicant_conf_ap()
466 bss->disassoc_low_ack = wpa_s->conf->disassoc_low_ack; in wpa_supplicant_conf_ap()
468 if (wpa_s->conf->ap_vendor_elements) { in wpa_supplicant_conf_ap()
470 wpabuf_dup(wpa_s->conf->ap_vendor_elements); in wpa_supplicant_conf_ap()
473 bss->ftm_responder = wpa_s->conf->ftm_responder; in wpa_supplicant_conf_ap()
474 bss->ftm_initiator = wpa_s->conf->ftm_initiator; in wpa_supplicant_conf_ap()
483 struct wpa_supplicant *wpa_s = ctx; in ap_public_action_rx() local
491 wpas_p2p_rx_action(wpa_s, mgmt->da, mgmt->sa, mgmt->bssid, in ap_public_action_rx()
503 struct wpa_supplicant *wpa_s = ctx; in ap_wps_event_cb() local
508 if (wpa_s->p2pdev && wpa_s->p2pdev != wpa_s && in ap_wps_event_cb()
509 wpa_s == wpa_s->global->p2p_group_formation) { in ap_wps_event_cb()
515 wpa_msg(wpa_s->p2pdev, MSG_INFO, WPS_EVENT_FAIL in ap_wps_event_cb()
519 wpas_p2p_wps_failed(wpa_s, fail); in ap_wps_event_cb()
537 struct wpa_supplicant *wpa_s = ctx; in ap_new_psk_cb() local
538 if (wpa_s->ap_iface == NULL || wpa_s->current_ssid == NULL) in ap_new_psk_cb()
540 wpas_p2p_new_psk_cb(wpa_s, mac_addr, p2p_dev_addr, psk, psk_len); in ap_new_psk_cb()
548 struct wpa_supplicant *wpa_s = ctx; in ap_vendor_action_rx() local
554 wpas_p2p_rx_action(wpa_s, mgmt->da, mgmt->sa, mgmt->bssid, in ap_vendor_action_rx()
567 struct wpa_supplicant *wpa_s = ctx; in ap_probe_req_rx() local
570 if (wpa_s->ap_iface) in ap_probe_req_rx()
571 freq = wpa_s->ap_iface->freq; in ap_probe_req_rx()
573 return wpas_p2p_probe_req_rx(wpa_s, sa, da, bssid, ie, ie_len, in ap_probe_req_rx()
581 struct wpa_supplicant *wpa_s = ctx; in ap_wps_reg_success_cb() local
582 wpas_p2p_wps_success(wpa_s, mac_addr, 1); in ap_wps_reg_success_cb()
588 struct wpa_supplicant *wpa_s = ctx; in wpas_ap_configured_cb() local
591 if (wpa_s->current_ssid && wpa_s->current_ssid->acs) in wpas_ap_configured_cb()
592 wpa_s->assoc_freq = wpa_s->ap_iface->freq; in wpas_ap_configured_cb()
595 wpa_supplicant_set_state(wpa_s, WPA_COMPLETED); in wpas_ap_configured_cb()
597 if (wpa_s->ap_configured_cb) in wpas_ap_configured_cb()
598 wpa_s->ap_configured_cb(wpa_s->ap_configured_cb_ctx, in wpas_ap_configured_cb()
599 wpa_s->ap_configured_cb_data); in wpas_ap_configured_cb()
603 int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s, in wpa_supplicant_create_ap() argument
616 wpa_supplicant_ap_deinit(wpa_s); in wpa_supplicant_create_ap()
639 wpa_s->key_mgmt = WPA_KEY_MGMT_PSK; in wpa_supplicant_create_ap()
641 wpa_s->key_mgmt = WPA_KEY_MGMT_NONE; in wpa_supplicant_create_ap()
642 params.key_mgmt_suite = wpa_s->key_mgmt; in wpa_supplicant_create_ap()
644 wpa_s->pairwise_cipher = wpa_pick_pairwise_cipher(ssid->pairwise_cipher, in wpa_supplicant_create_ap()
646 if (wpa_s->pairwise_cipher < 0) { in wpa_supplicant_create_ap()
651 params.pairwise_suite = wpa_s->pairwise_cipher; in wpa_supplicant_create_ap()
660 if (wpa_s->p2pdev->set_ap_uapsd) in wpa_supplicant_create_ap()
661 params.uapsd = wpa_s->p2pdev->ap_uapsd; in wpa_supplicant_create_ap()
662 else if (params.p2p && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_AP_UAPSD)) in wpa_supplicant_create_ap()
671 wpa_drv_get_ext_capa(wpa_s, WPA_IF_P2P_GO); in wpa_supplicant_create_ap()
673 wpa_drv_get_ext_capa(wpa_s, WPA_IF_AP_BSS); in wpa_supplicant_create_ap()
675 if (wpa_drv_associate(wpa_s, &params) < 0) { in wpa_supplicant_create_ap()
676 wpa_msg(wpa_s, MSG_INFO, "Failed to start AP functionality"); in wpa_supplicant_create_ap()
680 wpa_s->ap_iface = hapd_iface = hostapd_alloc_iface(); in wpa_supplicant_create_ap()
683 hapd_iface->owner = wpa_s; in wpa_supplicant_create_ap()
684 hapd_iface->drv_flags = wpa_s->drv_flags; in wpa_supplicant_create_ap()
685 hapd_iface->smps_modes = wpa_s->drv_smps_modes; in wpa_supplicant_create_ap()
686 hapd_iface->probe_resp_offloads = wpa_s->probe_resp_offloads; in wpa_supplicant_create_ap()
687 hapd_iface->extended_capa = wpa_s->extended_capa; in wpa_supplicant_create_ap()
688 hapd_iface->extended_capa_mask = wpa_s->extended_capa_mask; in wpa_supplicant_create_ap()
689 hapd_iface->extended_capa_len = wpa_s->extended_capa_len; in wpa_supplicant_create_ap()
691 wpa_s->ap_iface->conf = conf = hostapd_config_defaults(); in wpa_supplicant_create_ap()
693 wpa_supplicant_ap_deinit(wpa_s); in wpa_supplicant_create_ap()
704 os_memcpy(wpa_s->ap_iface->conf->wmm_ac_params, in wpa_supplicant_create_ap()
705 wpa_s->conf->wmm_ac_params, in wpa_supplicant_create_ap()
706 sizeof(wpa_s->conf->wmm_ac_params)); in wpa_supplicant_create_ap()
713 if (wpa_supplicant_conf_ap(wpa_s, ssid, conf)) { in wpa_supplicant_create_ap()
715 wpa_supplicant_ap_deinit(wpa_s); in wpa_supplicant_create_ap()
731 wpa_supplicant_ap_deinit(wpa_s); in wpa_supplicant_create_ap()
740 wpa_supplicant_ap_deinit(wpa_s); in wpa_supplicant_create_ap()
744 hapd_iface->bss[i]->msg_ctx = wpa_s; in wpa_supplicant_create_ap()
745 hapd_iface->bss[i]->msg_ctx_parent = wpa_s->p2pdev; in wpa_supplicant_create_ap()
747 hapd_iface->bss[i]->public_action_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
749 hapd_iface->bss[i]->vendor_action_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
751 ap_probe_req_rx, wpa_s); in wpa_supplicant_create_ap()
753 hapd_iface->bss[i]->wps_reg_success_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
755 hapd_iface->bss[i]->wps_event_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
757 hapd_iface->bss[i]->sta_authorized_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
760 hapd_iface->bss[i]->new_psk_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
761 hapd_iface->bss[i]->p2p = wpa_s->global->p2p; in wpa_supplicant_create_ap()
762 hapd_iface->bss[i]->p2p_group = wpas_p2p_group_init(wpa_s, in wpa_supplicant_create_ap()
766 hapd_iface->bss[i]->setup_complete_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
769 wpa_s->ext_eapol_frame_io; in wpa_supplicant_create_ap()
773 os_memcpy(hapd_iface->bss[0]->own_addr, wpa_s->own_addr, ETH_ALEN); in wpa_supplicant_create_ap()
774 hapd_iface->bss[0]->driver = wpa_s->driver; in wpa_supplicant_create_ap()
775 hapd_iface->bss[0]->drv_priv = wpa_s->drv_priv; in wpa_supplicant_create_ap()
777 wpa_s->current_ssid = ssid; in wpa_supplicant_create_ap()
778 eapol_sm_notify_config(wpa_s->eapol, NULL, NULL); in wpa_supplicant_create_ap()
779 os_memcpy(wpa_s->bssid, wpa_s->own_addr, ETH_ALEN); in wpa_supplicant_create_ap()
780 wpa_s->assoc_freq = ssid->frequency; in wpa_supplicant_create_ap()
782 if (hostapd_setup_interface(wpa_s->ap_iface)) { in wpa_supplicant_create_ap()
784 wpa_supplicant_ap_deinit(wpa_s); in wpa_supplicant_create_ap()
792 void wpa_supplicant_ap_deinit(struct wpa_supplicant *wpa_s) in wpa_supplicant_ap_deinit() argument
795 eloop_cancel_timeout(wpas_wps_ap_pin_timeout, wpa_s, NULL); in wpa_supplicant_ap_deinit()
798 if (wpa_s->ap_iface == NULL) in wpa_supplicant_ap_deinit()
801 wpa_s->current_ssid = NULL; in wpa_supplicant_ap_deinit()
802 eapol_sm_notify_config(wpa_s->eapol, NULL, NULL); in wpa_supplicant_ap_deinit()
803 wpa_s->assoc_freq = 0; in wpa_supplicant_ap_deinit()
804 wpas_p2p_ap_deinit(wpa_s); in wpa_supplicant_ap_deinit()
805 wpa_s->ap_iface->driver_ap_teardown = in wpa_supplicant_ap_deinit()
806 !!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT); in wpa_supplicant_ap_deinit()
808 hostapd_interface_deinit(wpa_s->ap_iface); in wpa_supplicant_ap_deinit()
809 hostapd_interface_free(wpa_s->ap_iface); in wpa_supplicant_ap_deinit()
810 wpa_s->ap_iface = NULL; in wpa_supplicant_ap_deinit()
811 wpa_drv_deinit_ap(wpa_s); in wpa_supplicant_ap_deinit()
812 wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_DISCONNECTED "bssid=" MACSTR in wpa_supplicant_ap_deinit()
814 MAC2STR(wpa_s->own_addr), WLAN_REASON_DEAUTH_LEAVING); in wpa_supplicant_ap_deinit()
822 struct wpa_supplicant *wpa_s = ctx; in ap_tx_status() local
823 hostapd_tx_status(wpa_s->ap_iface->bss[0], addr, buf, len, ack); in ap_tx_status()
832 struct wpa_supplicant *wpa_s = ctx; in ap_eapol_tx_status() local
833 if (!wpa_s->ap_iface) in ap_eapol_tx_status()
835 hostapd_tx_status(wpa_s->ap_iface->bss[0], dst, data, len, ack); in ap_eapol_tx_status()
843 struct wpa_supplicant *wpa_s = ctx; in ap_client_poll_ok() local
844 if (wpa_s->ap_iface) in ap_client_poll_ok()
845 hostapd_client_poll_ok(wpa_s->ap_iface->bss[0], addr); in ap_client_poll_ok()
853 struct wpa_supplicant *wpa_s = ctx; in ap_rx_from_unknown_sta() local
854 ieee802_11_rx_from_unknown(wpa_s->ap_iface->bss[0], addr, wds); in ap_rx_from_unknown_sta()
862 struct wpa_supplicant *wpa_s = ctx; in ap_mgmt_rx() local
867 ieee802_11_mgmt(wpa_s->ap_iface->bss[0], rx_mgmt->frame, in ap_mgmt_rx()
876 struct wpa_supplicant *wpa_s = ctx; in ap_mgmt_tx_cb() local
877 ieee802_11_mgmt_cb(wpa_s->ap_iface->bss[0], buf, len, stype, ok); in ap_mgmt_tx_cb()
882 void wpa_supplicant_ap_rx_eapol(struct wpa_supplicant *wpa_s, in wpa_supplicant_ap_rx_eapol() argument
885 ieee802_1x_receive(wpa_s->ap_iface->bss[0], src_addr, buf, len); in wpa_supplicant_ap_rx_eapol()
891 int wpa_supplicant_ap_wps_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid, in wpa_supplicant_ap_wps_pbc() argument
894 if (!wpa_s->ap_iface) in wpa_supplicant_ap_wps_pbc()
896 return hostapd_wps_button_pushed(wpa_s->ap_iface->bss[0], in wpa_supplicant_ap_wps_pbc()
901 int wpa_supplicant_ap_wps_cancel(struct wpa_supplicant *wpa_s) in wpa_supplicant_ap_wps_cancel() argument
906 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]->wps) in wpa_supplicant_ap_wps_cancel()
909 reg = wpa_s->ap_iface->bss[0]->wps->registrar; in wpa_supplicant_ap_wps_cancel()
911 wps_sta = ap_for_each_sta(wpa_s->ap_iface->bss[0], in wpa_supplicant_ap_wps_cancel()
931 int wpa_supplicant_ap_wps_pin(struct wpa_supplicant *wpa_s, const u8 *bssid, in wpa_supplicant_ap_wps_pin() argument
937 if (!wpa_s->ap_iface) in wpa_supplicant_ap_wps_pin()
955 ret = hostapd_wps_add_pin(wpa_s->ap_iface->bss[0], bssid, "any", pin, in wpa_supplicant_ap_wps_pin()
965 struct wpa_supplicant *wpa_s = eloop_data; in wpas_wps_ap_pin_timeout() local
967 wpas_wps_ap_pin_disable(wpa_s); in wpas_wps_ap_pin_timeout()
971 static void wpas_wps_ap_pin_enable(struct wpa_supplicant *wpa_s, int timeout) in wpas_wps_ap_pin_enable() argument
975 if (wpa_s->ap_iface == NULL) in wpas_wps_ap_pin_enable()
977 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_enable()
980 eloop_cancel_timeout(wpas_wps_ap_pin_timeout, wpa_s, NULL); in wpas_wps_ap_pin_enable()
983 wpas_wps_ap_pin_timeout, wpa_s, NULL); in wpas_wps_ap_pin_enable()
987 void wpas_wps_ap_pin_disable(struct wpa_supplicant *wpa_s) in wpas_wps_ap_pin_disable() argument
991 if (wpa_s->ap_iface == NULL) in wpas_wps_ap_pin_disable()
994 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_disable()
997 eloop_cancel_timeout(wpas_wps_ap_pin_timeout, wpa_s, NULL); in wpas_wps_ap_pin_disable()
1001 const char * wpas_wps_ap_pin_random(struct wpa_supplicant *wpa_s, int timeout) in wpas_wps_ap_pin_random() argument
1007 if (wpa_s->ap_iface == NULL) in wpas_wps_ap_pin_random()
1009 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_random()
1017 wpas_wps_ap_pin_enable(wpa_s, timeout); in wpas_wps_ap_pin_random()
1023 const char * wpas_wps_ap_pin_get(struct wpa_supplicant *wpa_s) in wpas_wps_ap_pin_get() argument
1026 if (wpa_s->ap_iface == NULL) in wpas_wps_ap_pin_get()
1028 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_get()
1033 int wpas_wps_ap_pin_set(struct wpa_supplicant *wpa_s, const char *pin, in wpas_wps_ap_pin_set() argument
1040 if (wpa_s->ap_iface == NULL) in wpas_wps_ap_pin_set()
1042 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_set()
1050 wpas_wps_ap_pin_enable(wpa_s, timeout); in wpas_wps_ap_pin_set()
1056 void wpa_supplicant_ap_pwd_auth_fail(struct wpa_supplicant *wpa_s) in wpa_supplicant_ap_pwd_auth_fail() argument
1060 if (wpa_s->ap_iface == NULL) in wpa_supplicant_ap_pwd_auth_fail()
1062 hapd = wpa_s->ap_iface->bss[0]; in wpa_supplicant_ap_pwd_auth_fail()
1083 struct wpabuf * wpas_ap_wps_nfc_config_token(struct wpa_supplicant *wpa_s, in wpas_ap_wps_nfc_config_token() argument
1088 if (wpa_s->ap_iface == NULL) in wpas_ap_wps_nfc_config_token()
1090 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_wps_nfc_config_token()
1095 struct wpabuf * wpas_ap_wps_nfc_handover_sel(struct wpa_supplicant *wpa_s, in wpas_ap_wps_nfc_handover_sel() argument
1100 if (wpa_s->ap_iface == NULL) in wpas_ap_wps_nfc_handover_sel()
1102 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_wps_nfc_handover_sel()
1107 int wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s, in wpas_ap_wps_nfc_report_handover() argument
1113 if (wpa_s->ap_iface == NULL) in wpas_ap_wps_nfc_report_handover()
1115 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_wps_nfc_report_handover()
1126 int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s, in ap_ctrl_iface_sta_first() argument
1131 if (wpa_s->ap_iface) in ap_ctrl_iface_sta_first()
1132 hapd = wpa_s->ap_iface->bss[0]; in ap_ctrl_iface_sta_first()
1133 else if (wpa_s->ifmsh) in ap_ctrl_iface_sta_first()
1134 hapd = wpa_s->ifmsh->bss[0]; in ap_ctrl_iface_sta_first()
1141 int ap_ctrl_iface_sta(struct wpa_supplicant *wpa_s, const char *txtaddr, in ap_ctrl_iface_sta() argument
1146 if (wpa_s->ap_iface) in ap_ctrl_iface_sta()
1147 hapd = wpa_s->ap_iface->bss[0]; in ap_ctrl_iface_sta()
1148 else if (wpa_s->ifmsh) in ap_ctrl_iface_sta()
1149 hapd = wpa_s->ifmsh->bss[0]; in ap_ctrl_iface_sta()
1156 int ap_ctrl_iface_sta_next(struct wpa_supplicant *wpa_s, const char *txtaddr, in ap_ctrl_iface_sta_next() argument
1161 if (wpa_s->ap_iface) in ap_ctrl_iface_sta_next()
1162 hapd = wpa_s->ap_iface->bss[0]; in ap_ctrl_iface_sta_next()
1163 else if (wpa_s->ifmsh) in ap_ctrl_iface_sta_next()
1164 hapd = wpa_s->ifmsh->bss[0]; in ap_ctrl_iface_sta_next()
1171 int ap_ctrl_iface_sta_disassociate(struct wpa_supplicant *wpa_s, in ap_ctrl_iface_sta_disassociate() argument
1174 if (wpa_s->ap_iface == NULL) in ap_ctrl_iface_sta_disassociate()
1176 return hostapd_ctrl_iface_disassociate(wpa_s->ap_iface->bss[0], in ap_ctrl_iface_sta_disassociate()
1181 int ap_ctrl_iface_sta_deauthenticate(struct wpa_supplicant *wpa_s, in ap_ctrl_iface_sta_deauthenticate() argument
1184 if (wpa_s->ap_iface == NULL) in ap_ctrl_iface_sta_deauthenticate()
1186 return hostapd_ctrl_iface_deauthenticate(wpa_s->ap_iface->bss[0], in ap_ctrl_iface_sta_deauthenticate()
1191 int ap_ctrl_iface_wpa_get_status(struct wpa_supplicant *wpa_s, char *buf, in ap_ctrl_iface_wpa_get_status() argument
1198 if (wpa_s->ap_iface == NULL) in ap_ctrl_iface_wpa_get_status()
1201 conf = wpa_s->ap_iface->bss[0]->conf; in ap_ctrl_iface_wpa_get_status()
1222 int wpa_supplicant_ap_update_beacon(struct wpa_supplicant *wpa_s) in wpa_supplicant_ap_update_beacon() argument
1224 struct hostapd_iface *iface = wpa_s->ap_iface; in wpa_supplicant_ap_update_beacon()
1225 struct wpa_ssid *ssid = wpa_s->current_ssid; in wpa_supplicant_ap_update_beacon()
1228 if (ssid == NULL || wpa_s->ap_iface == NULL || in wpa_supplicant_ap_update_beacon()
1251 int ap_switch_channel(struct wpa_supplicant *wpa_s, in ap_switch_channel() argument
1255 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) in ap_switch_channel()
1258 return hostapd_switch_channel(wpa_s->ap_iface->bss[0], settings); in ap_switch_channel()
1266 int ap_ctrl_iface_chanswitch(struct wpa_supplicant *wpa_s, const char *pos) in ap_ctrl_iface_chanswitch() argument
1274 return ap_switch_channel(wpa_s, &settings); in ap_ctrl_iface_chanswitch()
1279 void wpas_ap_ch_switch(struct wpa_supplicant *wpa_s, int freq, int ht, in wpas_ap_ch_switch() argument
1282 if (!wpa_s->ap_iface) in wpas_ap_ch_switch()
1285 wpa_s->assoc_freq = freq; in wpas_ap_ch_switch()
1286 if (wpa_s->current_ssid) in wpas_ap_ch_switch()
1287 wpa_s->current_ssid->frequency = freq; in wpas_ap_ch_switch()
1288 hostapd_event_ch_switch(wpa_s->ap_iface->bss[0], freq, ht, in wpas_ap_ch_switch()
1293 int wpa_supplicant_ap_mac_addr_filter(struct wpa_supplicant *wpa_s, in wpa_supplicant_ap_mac_addr_filter() argument
1299 if (!wpa_s->ap_iface) in wpa_supplicant_ap_mac_addr_filter()
1308 hapd = wpa_s->ap_iface->bss[0]; in wpa_supplicant_ap_mac_addr_filter()
1335 int wpas_ap_wps_add_nfc_pw(struct wpa_supplicant *wpa_s, u16 pw_id, in wpas_ap_wps_add_nfc_pw() argument
1341 if (!wpa_s->ap_iface) in wpas_ap_wps_add_nfc_pw()
1343 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_wps_add_nfc_pw()
1346 if (wpa_s->p2pdev->conf->wps_nfc_dh_pubkey == NULL || in wpas_ap_wps_add_nfc_pw()
1347 wpa_s->p2pdev->conf->wps_nfc_dh_privkey == NULL) { in wpas_ap_wps_add_nfc_pw()
1356 wpa_s->p2pdev->conf->wps_nfc_dh_privkey); in wpas_ap_wps_add_nfc_pw()
1358 wpa_s->p2pdev->conf->wps_nfc_dh_pubkey); in wpas_ap_wps_add_nfc_pw()
1380 int wpas_ap_stop_ap(struct wpa_supplicant *wpa_s) in wpas_ap_stop_ap() argument
1384 if (!wpa_s->ap_iface) in wpas_ap_stop_ap()
1386 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_stop_ap()
1391 int wpas_ap_pmksa_cache_list(struct wpa_supplicant *wpa_s, char *buf, in wpas_ap_pmksa_cache_list() argument
1399 if (wpa_s->ap_iface) { in wpas_ap_pmksa_cache_list()
1406 for (i = 0; i < wpa_s->ap_iface->num_bss; i++) { in wpas_ap_pmksa_cache_list()
1408 wpa_s->ap_iface->bss[i], in wpas_ap_pmksa_cache_list()
1413 if (wpa_s->ifmsh) { in wpas_ap_pmksa_cache_list()
1421 wpa_s->ifmsh->bss[0], &buf[reply_len], in wpas_ap_pmksa_cache_list()
1429 void wpas_ap_pmksa_cache_flush(struct wpa_supplicant *wpa_s) in wpas_ap_pmksa_cache_flush() argument
1433 if (wpa_s->ap_iface) { in wpas_ap_pmksa_cache_flush()
1434 for (i = 0; i < wpa_s->ap_iface->num_bss; i++) in wpas_ap_pmksa_cache_flush()
1435 hostapd_ctrl_iface_pmksa_flush(wpa_s->ap_iface->bss[i]); in wpas_ap_pmksa_cache_flush()
1438 if (wpa_s->ifmsh) in wpas_ap_pmksa_cache_flush()
1439 hostapd_ctrl_iface_pmksa_flush(wpa_s->ifmsh->bss[0]); in wpas_ap_pmksa_cache_flush()
1446 int wpas_ap_pmksa_cache_list_mesh(struct wpa_supplicant *wpa_s, const u8 *addr, in wpas_ap_pmksa_cache_list_mesh() argument
1449 return hostapd_ctrl_iface_pmksa_list_mesh(wpa_s->ifmsh->bss[0], addr, in wpas_ap_pmksa_cache_list_mesh()
1454 int wpas_ap_pmksa_cache_add_external(struct wpa_supplicant *wpa_s, char *cmd) in wpas_ap_pmksa_cache_add_external() argument
1459 pmksa_cache = hostapd_ctrl_iface_pmksa_create_entry(wpa_s->own_addr, in wpas_ap_pmksa_cache_add_external()
1470 dl_list_add(&wpa_s->mesh_external_pmksa_cache, &entry->list); in wpas_ap_pmksa_cache_add_external()
1482 void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, in wpas_event_dfs_radar_detected() argument
1485 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) in wpas_event_dfs_radar_detected()
1488 hostapd_dfs_radar_detected(wpa_s->ap_iface, radar->freq, in wpas_event_dfs_radar_detected()
1495 void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s, in wpas_event_dfs_cac_started() argument
1498 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) in wpas_event_dfs_cac_started()
1501 hostapd_dfs_start_cac(wpa_s->ap_iface, radar->freq, in wpas_event_dfs_cac_started()
1507 void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, in wpas_event_dfs_cac_finished() argument
1510 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) in wpas_event_dfs_cac_finished()
1513 hostapd_dfs_complete_cac(wpa_s->ap_iface, 1, radar->freq, in wpas_event_dfs_cac_finished()
1519 void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, in wpas_event_dfs_cac_aborted() argument
1522 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) in wpas_event_dfs_cac_aborted()
1525 hostapd_dfs_complete_cac(wpa_s->ap_iface, 0, radar->freq, in wpas_event_dfs_cac_aborted()
1531 void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, in wpas_event_dfs_cac_nop_finished() argument
1534 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) in wpas_event_dfs_cac_nop_finished()
1537 hostapd_dfs_nop_finished(wpa_s->ap_iface, radar->freq, in wpas_event_dfs_cac_nop_finished()
1544 void ap_periodic(struct wpa_supplicant *wpa_s) in ap_periodic() argument
1546 if (wpa_s->ap_iface) in ap_periodic()
1547 hostapd_periodic_iface(wpa_s->ap_iface); in ap_periodic()