Lines Matching refs:wpa_s
48 static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s, in wpas_conf_ap_vht() argument
83 center_chan = wpas_p2p_get_vht80_center(wpa_s, mode, channel); in wpas_conf_ap_vht()
89 center_chan = wpas_p2p_get_vht160_center(wpa_s, mode, channel); in wpas_conf_ap_vht()
101 center_chan = wpas_p2p_get_vht160_center(wpa_s, mode, channel); in wpas_conf_ap_vht()
108 center_chan = wpas_p2p_get_vht80_center(wpa_s, mode, in wpas_conf_ap_vht()
136 int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s, in wpa_supplicant_conf_ap_ht() argument
159 if (wpa_s->hw.modes) { in wpa_supplicant_conf_ap_ht()
167 for (i = 0; i < wpa_s->hw.num_modes; i++) { in wpa_supplicant_conf_ap_ht()
168 if (wpa_s->hw.modes[i].mode == conf->hw_mode) { in wpa_supplicant_conf_ap_ht()
169 mode = &wpa_s->hw.modes[i]; in wpa_supplicant_conf_ap_ht()
203 wpas_p2p_get_ht40_mode(wpa_s, mode, in wpa_supplicant_conf_ap_ht()
240 wpas_conf_ap_vht(wpa_s, ssid, conf, mode); in wpa_supplicant_conf_ap_ht()
248 for (iface = wpa_s->global->ifaces; iface; iface = iface->next) in wpa_supplicant_conf_ap_ht()
250 if (iface == wpa_s || in wpa_supplicant_conf_ap_ht()
273 static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s, in wpa_supplicant_conf_ap() argument
279 conf->driver = wpa_s->driver; in wpa_supplicant_conf_ap()
281 os_strlcpy(bss->iface, wpa_s->ifname, sizeof(bss->iface)); in wpa_supplicant_conf_ap()
283 if (wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf)) in wpa_supplicant_conf_ap()
301 if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes, in wpa_supplicant_conf_ap()
302 wpa_s->hw.num_modes) && wpa_s->conf->country[0]) { in wpa_supplicant_conf_ap()
305 conf->country[0] = wpa_s->conf->country[0]; in wpa_supplicant_conf_ap()
306 conf->country[1] = wpa_s->conf->country[1]; in wpa_supplicant_conf_ap()
345 bss->isolate = !wpa_s->conf->p2p_intra_bss; in wpa_supplicant_conf_ap()
346 bss->force_per_enrollee_psk = wpa_s->global->p2p_per_sta_psk; in wpa_supplicant_conf_ap()
349 os_memcpy(bss->ip_addr_go, wpa_s->p2pdev->conf->ip_addr_go, 4); in wpa_supplicant_conf_ap()
350 os_memcpy(bss->ip_addr_mask, wpa_s->p2pdev->conf->ip_addr_mask, in wpa_supplicant_conf_ap()
353 wpa_s->p2pdev->conf->ip_addr_start, 4); in wpa_supplicant_conf_ap()
354 os_memcpy(bss->ip_addr_end, wpa_s->p2pdev->conf->ip_addr_end, in wpa_supplicant_conf_ap()
406 if (wpa_s->conf->go_interworking) { in wpa_supplicant_conf_ap()
409 wpa_s->conf->go_access_network_type); in wpa_supplicant_conf_ap()
410 bss->interworking = wpa_s->conf->go_interworking; in wpa_supplicant_conf_ap()
411 bss->access_network_type = wpa_s->conf->go_access_network_type; in wpa_supplicant_conf_ap()
412 bss->internet = wpa_s->conf->go_internet; in wpa_supplicant_conf_ap()
413 if (wpa_s->conf->go_venue_group) { in wpa_supplicant_conf_ap()
416 wpa_s->conf->go_venue_group, in wpa_supplicant_conf_ap()
417 wpa_s->conf->go_venue_type); in wpa_supplicant_conf_ap()
418 bss->venue_group = wpa_s->conf->go_venue_group; in wpa_supplicant_conf_ap()
419 bss->venue_type = wpa_s->conf->go_venue_type; in wpa_supplicant_conf_ap()
429 else if (wpa_s->conf->dtim_period) in wpa_supplicant_conf_ap()
430 bss->dtim_period = wpa_s->conf->dtim_period; in wpa_supplicant_conf_ap()
434 else if (wpa_s->conf->beacon_int) in wpa_supplicant_conf_ap()
435 conf->beacon_int = wpa_s->conf->beacon_int; in wpa_supplicant_conf_ap()
440 if (wpa_s->conf->p2p_go_ctwindow > conf->beacon_int) { in wpa_supplicant_conf_ap()
443 wpa_s->conf->p2p_go_ctwindow, in wpa_supplicant_conf_ap()
447 conf->p2p_go_ctwindow = wpa_s->conf->p2p_go_ctwindow; in wpa_supplicant_conf_ap()
529 if (wpa_s->conf->config_methods) in wpa_supplicant_conf_ap()
530 bss->config_methods = os_strdup(wpa_s->conf->config_methods); in wpa_supplicant_conf_ap()
531 os_memcpy(bss->device_type, wpa_s->conf->device_type, in wpa_supplicant_conf_ap()
533 if (wpa_s->conf->device_name) { in wpa_supplicant_conf_ap()
534 bss->device_name = os_strdup(wpa_s->conf->device_name); in wpa_supplicant_conf_ap()
535 bss->friendly_name = os_strdup(wpa_s->conf->device_name); in wpa_supplicant_conf_ap()
537 if (wpa_s->conf->manufacturer) in wpa_supplicant_conf_ap()
538 bss->manufacturer = os_strdup(wpa_s->conf->manufacturer); in wpa_supplicant_conf_ap()
539 if (wpa_s->conf->model_name) in wpa_supplicant_conf_ap()
540 bss->model_name = os_strdup(wpa_s->conf->model_name); in wpa_supplicant_conf_ap()
541 if (wpa_s->conf->model_number) in wpa_supplicant_conf_ap()
542 bss->model_number = os_strdup(wpa_s->conf->model_number); in wpa_supplicant_conf_ap()
543 if (wpa_s->conf->serial_number) in wpa_supplicant_conf_ap()
544 bss->serial_number = os_strdup(wpa_s->conf->serial_number); in wpa_supplicant_conf_ap()
545 if (is_nil_uuid(wpa_s->conf->uuid)) in wpa_supplicant_conf_ap()
546 os_memcpy(bss->uuid, wpa_s->wps->uuid, WPS_UUID_LEN); in wpa_supplicant_conf_ap()
548 os_memcpy(bss->uuid, wpa_s->conf->uuid, WPS_UUID_LEN); in wpa_supplicant_conf_ap()
549 os_memcpy(bss->os_version, wpa_s->conf->os_version, 4); in wpa_supplicant_conf_ap()
550 bss->pbc_in_m1 = wpa_s->conf->pbc_in_m1; in wpa_supplicant_conf_ap()
556 if (wpa_s->max_stations && in wpa_supplicant_conf_ap()
557 wpa_s->max_stations < wpa_s->conf->max_num_sta) in wpa_supplicant_conf_ap()
558 bss->max_num_sta = wpa_s->max_stations; in wpa_supplicant_conf_ap()
560 bss->max_num_sta = wpa_s->conf->max_num_sta; in wpa_supplicant_conf_ap()
563 bss->isolate = wpa_s->conf->ap_isolate; in wpa_supplicant_conf_ap()
565 bss->disassoc_low_ack = wpa_s->conf->disassoc_low_ack; in wpa_supplicant_conf_ap()
567 if (wpa_s->conf->ap_vendor_elements) { in wpa_supplicant_conf_ap()
569 wpabuf_dup(wpa_s->conf->ap_vendor_elements); in wpa_supplicant_conf_ap()
572 bss->ftm_responder = wpa_s->conf->ftm_responder; in wpa_supplicant_conf_ap()
573 bss->ftm_initiator = wpa_s->conf->ftm_initiator; in wpa_supplicant_conf_ap()
582 struct wpa_supplicant *wpa_s = ctx; in ap_public_action_rx() local
590 wpas_p2p_rx_action(wpa_s, mgmt->da, mgmt->sa, mgmt->bssid, in ap_public_action_rx()
602 struct wpa_supplicant *wpa_s = ctx; in ap_wps_event_cb() local
607 if (wpa_s->p2pdev && wpa_s->p2pdev != wpa_s && in ap_wps_event_cb()
608 wpa_s == wpa_s->global->p2p_group_formation) { in ap_wps_event_cb()
614 wpa_msg(wpa_s->p2pdev, MSG_INFO, WPS_EVENT_FAIL in ap_wps_event_cb()
618 wpas_p2p_wps_failed(wpa_s, fail); in ap_wps_event_cb()
636 struct wpa_supplicant *wpa_s = ctx; in ap_new_psk_cb() local
637 if (wpa_s->ap_iface == NULL || wpa_s->current_ssid == NULL) in ap_new_psk_cb()
639 wpas_p2p_new_psk_cb(wpa_s, mac_addr, p2p_dev_addr, psk, psk_len); in ap_new_psk_cb()
647 struct wpa_supplicant *wpa_s = ctx; in ap_vendor_action_rx() local
653 wpas_p2p_rx_action(wpa_s, mgmt->da, mgmt->sa, mgmt->bssid, in ap_vendor_action_rx()
666 struct wpa_supplicant *wpa_s = ctx; in ap_probe_req_rx() local
669 if (wpa_s->ap_iface) in ap_probe_req_rx()
670 freq = wpa_s->ap_iface->freq; in ap_probe_req_rx()
672 return wpas_p2p_probe_req_rx(wpa_s, sa, da, bssid, ie, ie_len, in ap_probe_req_rx()
680 struct wpa_supplicant *wpa_s = ctx; in ap_wps_reg_success_cb() local
681 wpas_p2p_wps_success(wpa_s, mac_addr, 1); in ap_wps_reg_success_cb()
687 struct wpa_supplicant *wpa_s = ctx; in wpas_ap_configured_cb() local
690 hostapd_state_text(wpa_s->ap_iface->state)); in wpas_ap_configured_cb()
691 if (wpa_s->ap_iface->state == HAPD_IFACE_DISABLED) { in wpas_ap_configured_cb()
692 wpa_supplicant_ap_deinit(wpa_s); in wpas_ap_configured_cb()
697 if (wpa_s->current_ssid && wpa_s->current_ssid->acs) { in wpas_ap_configured_cb()
698 wpa_s->assoc_freq = wpa_s->ap_iface->freq; in wpas_ap_configured_cb()
699 wpa_s->current_ssid->frequency = wpa_s->ap_iface->freq; in wpas_ap_configured_cb()
703 wpa_supplicant_set_state(wpa_s, WPA_COMPLETED); in wpas_ap_configured_cb()
705 if (wpa_s->ap_configured_cb) in wpas_ap_configured_cb()
706 wpa_s->ap_configured_cb(wpa_s->ap_configured_cb_ctx, in wpas_ap_configured_cb()
707 wpa_s->ap_configured_cb_data); in wpas_ap_configured_cb()
711 int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s, in wpa_supplicant_create_ap() argument
724 wpa_supplicant_ap_deinit(wpa_s); in wpa_supplicant_create_ap()
747 wpa_s->key_mgmt = WPA_KEY_MGMT_PSK; in wpa_supplicant_create_ap()
749 wpa_s->key_mgmt = WPA_KEY_MGMT_NONE; in wpa_supplicant_create_ap()
750 params.key_mgmt_suite = wpa_s->key_mgmt; in wpa_supplicant_create_ap()
752 wpa_s->pairwise_cipher = wpa_pick_pairwise_cipher(ssid->pairwise_cipher, in wpa_supplicant_create_ap()
754 if (wpa_s->pairwise_cipher < 0) { in wpa_supplicant_create_ap()
759 params.pairwise_suite = wpa_s->pairwise_cipher; in wpa_supplicant_create_ap()
768 if (wpa_s->p2pdev->set_ap_uapsd) in wpa_supplicant_create_ap()
769 params.uapsd = wpa_s->p2pdev->ap_uapsd; in wpa_supplicant_create_ap()
770 else if (params.p2p && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_AP_UAPSD)) in wpa_supplicant_create_ap()
775 if (ieee80211_is_dfs(params.freq.freq, wpa_s->hw.modes, in wpa_supplicant_create_ap()
776 wpa_s->hw.num_modes)) in wpa_supplicant_create_ap()
780 wpa_drv_get_ext_capa(wpa_s, WPA_IF_P2P_GO); in wpa_supplicant_create_ap()
782 wpa_drv_get_ext_capa(wpa_s, WPA_IF_AP_BSS); in wpa_supplicant_create_ap()
784 if (wpa_drv_associate(wpa_s, ¶ms) < 0) { in wpa_supplicant_create_ap()
785 wpa_msg(wpa_s, MSG_INFO, "Failed to start AP functionality"); in wpa_supplicant_create_ap()
789 wpa_s->ap_iface = hapd_iface = hostapd_alloc_iface(); in wpa_supplicant_create_ap()
792 hapd_iface->owner = wpa_s; in wpa_supplicant_create_ap()
793 hapd_iface->drv_flags = wpa_s->drv_flags; in wpa_supplicant_create_ap()
794 hapd_iface->smps_modes = wpa_s->drv_smps_modes; in wpa_supplicant_create_ap()
795 hapd_iface->probe_resp_offloads = wpa_s->probe_resp_offloads; in wpa_supplicant_create_ap()
796 hapd_iface->extended_capa = wpa_s->extended_capa; in wpa_supplicant_create_ap()
797 hapd_iface->extended_capa_mask = wpa_s->extended_capa_mask; in wpa_supplicant_create_ap()
798 hapd_iface->extended_capa_len = wpa_s->extended_capa_len; in wpa_supplicant_create_ap()
800 wpa_s->ap_iface->conf = conf = hostapd_config_defaults(); in wpa_supplicant_create_ap()
802 wpa_supplicant_ap_deinit(wpa_s); in wpa_supplicant_create_ap()
806 os_memcpy(wpa_s->ap_iface->conf->wmm_ac_params, in wpa_supplicant_create_ap()
807 wpa_s->conf->wmm_ac_params, in wpa_supplicant_create_ap()
808 sizeof(wpa_s->conf->wmm_ac_params)); in wpa_supplicant_create_ap()
815 if (wpa_supplicant_conf_ap(wpa_s, ssid, conf)) { in wpa_supplicant_create_ap()
817 wpa_supplicant_ap_deinit(wpa_s); in wpa_supplicant_create_ap()
833 wpa_supplicant_ap_deinit(wpa_s); in wpa_supplicant_create_ap()
842 wpa_supplicant_ap_deinit(wpa_s); in wpa_supplicant_create_ap()
846 hapd_iface->bss[i]->msg_ctx = wpa_s; in wpa_supplicant_create_ap()
847 hapd_iface->bss[i]->msg_ctx_parent = wpa_s->p2pdev; in wpa_supplicant_create_ap()
849 hapd_iface->bss[i]->public_action_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
851 hapd_iface->bss[i]->vendor_action_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
853 ap_probe_req_rx, wpa_s); in wpa_supplicant_create_ap()
855 hapd_iface->bss[i]->wps_reg_success_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
857 hapd_iface->bss[i]->wps_event_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
859 hapd_iface->bss[i]->sta_authorized_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
862 hapd_iface->bss[i]->new_psk_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
863 hapd_iface->bss[i]->p2p = wpa_s->global->p2p; in wpa_supplicant_create_ap()
864 hapd_iface->bss[i]->p2p_group = wpas_p2p_group_init(wpa_s, in wpa_supplicant_create_ap()
868 hapd_iface->bss[i]->setup_complete_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
871 wpa_s->ext_eapol_frame_io; in wpa_supplicant_create_ap()
875 os_memcpy(hapd_iface->bss[0]->own_addr, wpa_s->own_addr, ETH_ALEN); in wpa_supplicant_create_ap()
876 hapd_iface->bss[0]->driver = wpa_s->driver; in wpa_supplicant_create_ap()
877 hapd_iface->bss[0]->drv_priv = wpa_s->drv_priv; in wpa_supplicant_create_ap()
879 wpa_s->current_ssid = ssid; in wpa_supplicant_create_ap()
880 eapol_sm_notify_config(wpa_s->eapol, NULL, NULL); in wpa_supplicant_create_ap()
881 os_memcpy(wpa_s->bssid, wpa_s->own_addr, ETH_ALEN); in wpa_supplicant_create_ap()
882 wpa_s->assoc_freq = ssid->frequency; in wpa_supplicant_create_ap()
885 if (wpa_s->p2p_go_do_acs) { in wpa_supplicant_create_ap()
886 wpa_s->ap_iface->conf->channel = 0; in wpa_supplicant_create_ap()
887 wpa_s->ap_iface->conf->hw_mode = wpa_s->p2p_go_acs_band; in wpa_supplicant_create_ap()
892 if (hostapd_setup_interface(wpa_s->ap_iface)) { in wpa_supplicant_create_ap()
894 wpa_supplicant_ap_deinit(wpa_s); in wpa_supplicant_create_ap()
902 void wpa_supplicant_ap_deinit(struct wpa_supplicant *wpa_s) in wpa_supplicant_ap_deinit() argument
905 eloop_cancel_timeout(wpas_wps_ap_pin_timeout, wpa_s, NULL); in wpa_supplicant_ap_deinit()
908 if (wpa_s->ap_iface == NULL) in wpa_supplicant_ap_deinit()
911 wpa_s->current_ssid = NULL; in wpa_supplicant_ap_deinit()
912 eapol_sm_notify_config(wpa_s->eapol, NULL, NULL); in wpa_supplicant_ap_deinit()
913 wpa_s->assoc_freq = 0; in wpa_supplicant_ap_deinit()
914 wpas_p2p_ap_deinit(wpa_s); in wpa_supplicant_ap_deinit()
915 wpa_s->ap_iface->driver_ap_teardown = in wpa_supplicant_ap_deinit()
916 !!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT); in wpa_supplicant_ap_deinit()
918 hostapd_interface_deinit(wpa_s->ap_iface); in wpa_supplicant_ap_deinit()
919 hostapd_interface_free(wpa_s->ap_iface); in wpa_supplicant_ap_deinit()
920 wpa_s->ap_iface = NULL; in wpa_supplicant_ap_deinit()
921 wpa_drv_deinit_ap(wpa_s); in wpa_supplicant_ap_deinit()
922 wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_DISCONNECTED "bssid=" MACSTR in wpa_supplicant_ap_deinit()
924 MAC2STR(wpa_s->own_addr), WLAN_REASON_DEAUTH_LEAVING); in wpa_supplicant_ap_deinit()
932 struct wpa_supplicant *wpa_s = ctx; in ap_tx_status() local
933 hostapd_tx_status(wpa_s->ap_iface->bss[0], addr, buf, len, ack); in ap_tx_status()
942 struct wpa_supplicant *wpa_s = ctx; in ap_eapol_tx_status() local
943 if (!wpa_s->ap_iface) in ap_eapol_tx_status()
945 hostapd_tx_status(wpa_s->ap_iface->bss[0], dst, data, len, ack); in ap_eapol_tx_status()
953 struct wpa_supplicant *wpa_s = ctx; in ap_client_poll_ok() local
954 if (wpa_s->ap_iface) in ap_client_poll_ok()
955 hostapd_client_poll_ok(wpa_s->ap_iface->bss[0], addr); in ap_client_poll_ok()
963 struct wpa_supplicant *wpa_s = ctx; in ap_rx_from_unknown_sta() local
964 ieee802_11_rx_from_unknown(wpa_s->ap_iface->bss[0], addr, wds); in ap_rx_from_unknown_sta()
972 struct wpa_supplicant *wpa_s = ctx; in ap_mgmt_rx() local
977 ieee802_11_mgmt(wpa_s->ap_iface->bss[0], rx_mgmt->frame, in ap_mgmt_rx()
986 struct wpa_supplicant *wpa_s = ctx; in ap_mgmt_tx_cb() local
987 ieee802_11_mgmt_cb(wpa_s->ap_iface->bss[0], buf, len, stype, ok); in ap_mgmt_tx_cb()
992 void wpa_supplicant_ap_rx_eapol(struct wpa_supplicant *wpa_s, in wpa_supplicant_ap_rx_eapol() argument
995 ieee802_1x_receive(wpa_s->ap_iface->bss[0], src_addr, buf, len); in wpa_supplicant_ap_rx_eapol()
1001 int wpa_supplicant_ap_wps_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid, in wpa_supplicant_ap_wps_pbc() argument
1004 if (!wpa_s->ap_iface) in wpa_supplicant_ap_wps_pbc()
1006 return hostapd_wps_button_pushed(wpa_s->ap_iface->bss[0], in wpa_supplicant_ap_wps_pbc()
1011 int wpa_supplicant_ap_wps_cancel(struct wpa_supplicant *wpa_s) in wpa_supplicant_ap_wps_cancel() argument
1016 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]->wps) in wpa_supplicant_ap_wps_cancel()
1019 reg = wpa_s->ap_iface->bss[0]->wps->registrar; in wpa_supplicant_ap_wps_cancel()
1021 wps_sta = ap_for_each_sta(wpa_s->ap_iface->bss[0], in wpa_supplicant_ap_wps_cancel()
1041 int wpa_supplicant_ap_wps_pin(struct wpa_supplicant *wpa_s, const u8 *bssid, in wpa_supplicant_ap_wps_pin() argument
1047 if (!wpa_s->ap_iface) in wpa_supplicant_ap_wps_pin()
1065 ret = hostapd_wps_add_pin(wpa_s->ap_iface->bss[0], bssid, "any", pin, in wpa_supplicant_ap_wps_pin()
1075 struct wpa_supplicant *wpa_s = eloop_data; in wpas_wps_ap_pin_timeout() local
1077 wpas_wps_ap_pin_disable(wpa_s); in wpas_wps_ap_pin_timeout()
1081 static void wpas_wps_ap_pin_enable(struct wpa_supplicant *wpa_s, int timeout) in wpas_wps_ap_pin_enable() argument
1085 if (wpa_s->ap_iface == NULL) in wpas_wps_ap_pin_enable()
1087 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_enable()
1090 eloop_cancel_timeout(wpas_wps_ap_pin_timeout, wpa_s, NULL); in wpas_wps_ap_pin_enable()
1093 wpas_wps_ap_pin_timeout, wpa_s, NULL); in wpas_wps_ap_pin_enable()
1097 void wpas_wps_ap_pin_disable(struct wpa_supplicant *wpa_s) in wpas_wps_ap_pin_disable() argument
1101 if (wpa_s->ap_iface == NULL) in wpas_wps_ap_pin_disable()
1104 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_disable()
1107 eloop_cancel_timeout(wpas_wps_ap_pin_timeout, wpa_s, NULL); in wpas_wps_ap_pin_disable()
1111 const char * wpas_wps_ap_pin_random(struct wpa_supplicant *wpa_s, int timeout) in wpas_wps_ap_pin_random() argument
1117 if (wpa_s->ap_iface == NULL) in wpas_wps_ap_pin_random()
1119 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_random()
1127 wpas_wps_ap_pin_enable(wpa_s, timeout); in wpas_wps_ap_pin_random()
1133 const char * wpas_wps_ap_pin_get(struct wpa_supplicant *wpa_s) in wpas_wps_ap_pin_get() argument
1136 if (wpa_s->ap_iface == NULL) in wpas_wps_ap_pin_get()
1138 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_get()
1143 int wpas_wps_ap_pin_set(struct wpa_supplicant *wpa_s, const char *pin, in wpas_wps_ap_pin_set() argument
1150 if (wpa_s->ap_iface == NULL) in wpas_wps_ap_pin_set()
1152 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_set()
1160 wpas_wps_ap_pin_enable(wpa_s, timeout); in wpas_wps_ap_pin_set()
1166 void wpa_supplicant_ap_pwd_auth_fail(struct wpa_supplicant *wpa_s) in wpa_supplicant_ap_pwd_auth_fail() argument
1170 if (wpa_s->ap_iface == NULL) in wpa_supplicant_ap_pwd_auth_fail()
1172 hapd = wpa_s->ap_iface->bss[0]; in wpa_supplicant_ap_pwd_auth_fail()
1193 struct wpabuf * wpas_ap_wps_nfc_config_token(struct wpa_supplicant *wpa_s, in wpas_ap_wps_nfc_config_token() argument
1198 if (wpa_s->ap_iface == NULL) in wpas_ap_wps_nfc_config_token()
1200 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_wps_nfc_config_token()
1205 struct wpabuf * wpas_ap_wps_nfc_handover_sel(struct wpa_supplicant *wpa_s, in wpas_ap_wps_nfc_handover_sel() argument
1210 if (wpa_s->ap_iface == NULL) in wpas_ap_wps_nfc_handover_sel()
1212 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_wps_nfc_handover_sel()
1217 int wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s, in wpas_ap_wps_nfc_report_handover() argument
1223 if (wpa_s->ap_iface == NULL) in wpas_ap_wps_nfc_report_handover()
1225 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_wps_nfc_report_handover()
1236 int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s, in ap_ctrl_iface_sta_first() argument
1241 if (wpa_s->ap_iface) in ap_ctrl_iface_sta_first()
1242 hapd = wpa_s->ap_iface->bss[0]; in ap_ctrl_iface_sta_first()
1243 else if (wpa_s->ifmsh) in ap_ctrl_iface_sta_first()
1244 hapd = wpa_s->ifmsh->bss[0]; in ap_ctrl_iface_sta_first()
1251 int ap_ctrl_iface_sta(struct wpa_supplicant *wpa_s, const char *txtaddr, in ap_ctrl_iface_sta() argument
1256 if (wpa_s->ap_iface) in ap_ctrl_iface_sta()
1257 hapd = wpa_s->ap_iface->bss[0]; in ap_ctrl_iface_sta()
1258 else if (wpa_s->ifmsh) in ap_ctrl_iface_sta()
1259 hapd = wpa_s->ifmsh->bss[0]; in ap_ctrl_iface_sta()
1266 int ap_ctrl_iface_sta_next(struct wpa_supplicant *wpa_s, const char *txtaddr, in ap_ctrl_iface_sta_next() argument
1271 if (wpa_s->ap_iface) in ap_ctrl_iface_sta_next()
1272 hapd = wpa_s->ap_iface->bss[0]; in ap_ctrl_iface_sta_next()
1273 else if (wpa_s->ifmsh) in ap_ctrl_iface_sta_next()
1274 hapd = wpa_s->ifmsh->bss[0]; in ap_ctrl_iface_sta_next()
1281 int ap_ctrl_iface_sta_disassociate(struct wpa_supplicant *wpa_s, in ap_ctrl_iface_sta_disassociate() argument
1284 if (wpa_s->ap_iface == NULL) in ap_ctrl_iface_sta_disassociate()
1286 return hostapd_ctrl_iface_disassociate(wpa_s->ap_iface->bss[0], in ap_ctrl_iface_sta_disassociate()
1291 int ap_ctrl_iface_sta_deauthenticate(struct wpa_supplicant *wpa_s, in ap_ctrl_iface_sta_deauthenticate() argument
1294 if (wpa_s->ap_iface == NULL) in ap_ctrl_iface_sta_deauthenticate()
1296 return hostapd_ctrl_iface_deauthenticate(wpa_s->ap_iface->bss[0], in ap_ctrl_iface_sta_deauthenticate()
1301 int ap_ctrl_iface_wpa_get_status(struct wpa_supplicant *wpa_s, char *buf, in ap_ctrl_iface_wpa_get_status() argument
1308 if (wpa_s->ap_iface == NULL) in ap_ctrl_iface_wpa_get_status()
1311 conf = wpa_s->ap_iface->bss[0]->conf; in ap_ctrl_iface_wpa_get_status()
1332 int wpa_supplicant_ap_update_beacon(struct wpa_supplicant *wpa_s) in wpa_supplicant_ap_update_beacon() argument
1334 struct hostapd_iface *iface = wpa_s->ap_iface; in wpa_supplicant_ap_update_beacon()
1335 struct wpa_ssid *ssid = wpa_s->current_ssid; in wpa_supplicant_ap_update_beacon()
1338 if (ssid == NULL || wpa_s->ap_iface == NULL || in wpa_supplicant_ap_update_beacon()
1361 int ap_switch_channel(struct wpa_supplicant *wpa_s, in ap_switch_channel() argument
1365 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) in ap_switch_channel()
1368 return hostapd_switch_channel(wpa_s->ap_iface->bss[0], settings); in ap_switch_channel()
1376 int ap_ctrl_iface_chanswitch(struct wpa_supplicant *wpa_s, const char *pos) in ap_ctrl_iface_chanswitch() argument
1384 return ap_switch_channel(wpa_s, &settings); in ap_ctrl_iface_chanswitch()
1389 void wpas_ap_ch_switch(struct wpa_supplicant *wpa_s, int freq, int ht, in wpas_ap_ch_switch() argument
1392 struct hostapd_iface *iface = wpa_s->ap_iface; in wpas_ap_ch_switch()
1395 iface = wpa_s->ifmsh; in wpas_ap_ch_switch()
1398 wpa_s->assoc_freq = freq; in wpas_ap_ch_switch()
1399 if (wpa_s->current_ssid) in wpas_ap_ch_switch()
1400 wpa_s->current_ssid->frequency = freq; in wpas_ap_ch_switch()
1406 int wpa_supplicant_ap_mac_addr_filter(struct wpa_supplicant *wpa_s, in wpa_supplicant_ap_mac_addr_filter() argument
1412 if (!wpa_s->ap_iface) in wpa_supplicant_ap_mac_addr_filter()
1421 hapd = wpa_s->ap_iface->bss[0]; in wpa_supplicant_ap_mac_addr_filter()
1448 int wpas_ap_wps_add_nfc_pw(struct wpa_supplicant *wpa_s, u16 pw_id, in wpas_ap_wps_add_nfc_pw() argument
1454 if (!wpa_s->ap_iface) in wpas_ap_wps_add_nfc_pw()
1456 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_wps_add_nfc_pw()
1459 if (wpa_s->p2pdev->conf->wps_nfc_dh_pubkey == NULL || in wpas_ap_wps_add_nfc_pw()
1460 wpa_s->p2pdev->conf->wps_nfc_dh_privkey == NULL) { in wpas_ap_wps_add_nfc_pw()
1469 wpa_s->p2pdev->conf->wps_nfc_dh_privkey); in wpas_ap_wps_add_nfc_pw()
1471 wpa_s->p2pdev->conf->wps_nfc_dh_pubkey); in wpas_ap_wps_add_nfc_pw()
1493 int wpas_ap_stop_ap(struct wpa_supplicant *wpa_s) in wpas_ap_stop_ap() argument
1497 if (!wpa_s->ap_iface) in wpas_ap_stop_ap()
1499 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_stop_ap()
1504 int wpas_ap_pmksa_cache_list(struct wpa_supplicant *wpa_s, char *buf, in wpas_ap_pmksa_cache_list() argument
1512 if (wpa_s->ap_iface) { in wpas_ap_pmksa_cache_list()
1519 for (i = 0; i < wpa_s->ap_iface->num_bss; i++) { in wpas_ap_pmksa_cache_list()
1521 wpa_s->ap_iface->bss[i], in wpas_ap_pmksa_cache_list()
1526 if (wpa_s->ifmsh) { in wpas_ap_pmksa_cache_list()
1534 wpa_s->ifmsh->bss[0], &buf[reply_len], in wpas_ap_pmksa_cache_list()
1542 void wpas_ap_pmksa_cache_flush(struct wpa_supplicant *wpa_s) in wpas_ap_pmksa_cache_flush() argument
1546 if (wpa_s->ap_iface) { in wpas_ap_pmksa_cache_flush()
1547 for (i = 0; i < wpa_s->ap_iface->num_bss; i++) in wpas_ap_pmksa_cache_flush()
1548 hostapd_ctrl_iface_pmksa_flush(wpa_s->ap_iface->bss[i]); in wpas_ap_pmksa_cache_flush()
1551 if (wpa_s->ifmsh) in wpas_ap_pmksa_cache_flush()
1552 hostapd_ctrl_iface_pmksa_flush(wpa_s->ifmsh->bss[0]); in wpas_ap_pmksa_cache_flush()
1559 int wpas_ap_pmksa_cache_list_mesh(struct wpa_supplicant *wpa_s, const u8 *addr, in wpas_ap_pmksa_cache_list_mesh() argument
1562 return hostapd_ctrl_iface_pmksa_list_mesh(wpa_s->ifmsh->bss[0], addr, in wpas_ap_pmksa_cache_list_mesh()
1567 int wpas_ap_pmksa_cache_add_external(struct wpa_supplicant *wpa_s, char *cmd) in wpas_ap_pmksa_cache_add_external() argument
1572 pmksa_cache = hostapd_ctrl_iface_pmksa_create_entry(wpa_s->own_addr, in wpas_ap_pmksa_cache_add_external()
1583 dl_list_add(&wpa_s->mesh_external_pmksa_cache, &entry->list); in wpas_ap_pmksa_cache_add_external()
1595 void wpas_ap_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, in wpas_ap_event_dfs_radar_detected() argument
1598 struct hostapd_iface *iface = wpa_s->ap_iface; in wpas_ap_event_dfs_radar_detected()
1601 iface = wpa_s->ifmsh; in wpas_ap_event_dfs_radar_detected()
1612 void wpas_ap_event_dfs_cac_started(struct wpa_supplicant *wpa_s, in wpas_ap_event_dfs_cac_started() argument
1615 struct hostapd_iface *iface = wpa_s->ap_iface; in wpas_ap_event_dfs_cac_started()
1618 iface = wpa_s->ifmsh; in wpas_ap_event_dfs_cac_started()
1628 void wpas_ap_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, in wpas_ap_event_dfs_cac_finished() argument
1631 struct hostapd_iface *iface = wpa_s->ap_iface; in wpas_ap_event_dfs_cac_finished()
1634 iface = wpa_s->ifmsh; in wpas_ap_event_dfs_cac_finished()
1644 void wpas_ap_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, in wpas_ap_event_dfs_cac_aborted() argument
1647 struct hostapd_iface *iface = wpa_s->ap_iface; in wpas_ap_event_dfs_cac_aborted()
1650 iface = wpa_s->ifmsh; in wpas_ap_event_dfs_cac_aborted()
1660 void wpas_ap_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, in wpas_ap_event_dfs_cac_nop_finished() argument
1663 struct hostapd_iface *iface = wpa_s->ap_iface; in wpas_ap_event_dfs_cac_nop_finished()
1666 iface = wpa_s->ifmsh; in wpas_ap_event_dfs_cac_nop_finished()
1677 void ap_periodic(struct wpa_supplicant *wpa_s) in ap_periodic() argument
1679 if (wpa_s->ap_iface) in ap_periodic()
1680 hostapd_periodic_iface(wpa_s->ap_iface); in ap_periodic()