Lines Matching refs:hapd
36 static u8 * hostapd_eid_rm_enabled_capab(struct hostapd_data *hapd, u8 *eid, in hostapd_eid_rm_enabled_capab() argument
39 if (!hapd->conf->radio_measurements || len < 2 + 4) in hostapd_eid_rm_enabled_capab()
44 *eid++ = (hapd->conf->radio_measurements & BIT(0)) ? in hostapd_eid_rm_enabled_capab()
54 static u8 * hostapd_eid_bss_load(struct hostapd_data *hapd, u8 *eid, size_t len) in hostapd_eid_bss_load() argument
60 if (hapd->conf->bss_load_test_set) { in hostapd_eid_bss_load()
63 os_memcpy(eid, hapd->conf->bss_load_test, 5); in hostapd_eid_bss_load()
68 if (hapd->conf->bss_load_update_period) { in hostapd_eid_bss_load()
71 WPA_PUT_LE16(eid, hapd->num_sta); in hostapd_eid_bss_load()
73 *eid++ = hapd->iface->channel_utilization; in hostapd_eid_bss_load()
81 static u8 ieee802_11_erp_info(struct hostapd_data *hapd) in ieee802_11_erp_info() argument
85 if (hapd->iface->current_mode == NULL || in ieee802_11_erp_info()
86 hapd->iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G) in ieee802_11_erp_info()
89 if (hapd->iface->olbc) in ieee802_11_erp_info()
91 if (hapd->iface->num_sta_non_erp > 0) { in ieee802_11_erp_info()
95 if (hapd->iface->num_sta_no_short_preamble > 0 || in ieee802_11_erp_info()
96 hapd->iconf->preamble == LONG_PREAMBLE) in ieee802_11_erp_info()
103 static u8 * hostapd_eid_ds_params(struct hostapd_data *hapd, u8 *eid) in hostapd_eid_ds_params() argument
107 *eid++ = hapd->iconf->channel; in hostapd_eid_ds_params()
112 static u8 * hostapd_eid_erp_info(struct hostapd_data *hapd, u8 *eid) in hostapd_eid_erp_info() argument
114 if (hapd->iface->current_mode == NULL || in hostapd_eid_erp_info()
115 hapd->iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G) in hostapd_eid_erp_info()
130 *eid++ = ieee802_11_erp_info(hapd); in hostapd_eid_erp_info()
136 static u8 * hostapd_eid_pwr_constraint(struct hostapd_data *hapd, u8 *eid) in hostapd_eid_pwr_constraint() argument
142 if (hapd->iface->current_mode == NULL || in hostapd_eid_pwr_constraint()
143 hapd->iface->current_mode->mode != HOSTAPD_MODE_IEEE80211A) in hostapd_eid_pwr_constraint()
147 if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) in hostapd_eid_pwr_constraint()
154 if (!hapd->iconf->ieee80211h && in hostapd_eid_pwr_constraint()
155 hapd->iconf->local_pwr_constraint == -1) in hostapd_eid_pwr_constraint()
159 dfs = hostapd_is_dfs_required(hapd->iface); in hostapd_eid_pwr_constraint()
166 if (dfs == 0 && hapd->iconf->local_pwr_constraint == -1) in hostapd_eid_pwr_constraint()
177 if (hapd->iconf->local_pwr_constraint == -1) in hostapd_eid_pwr_constraint()
198 *pos++ = hapd->iconf->local_pwr_constraint; in hostapd_eid_pwr_constraint()
222 static u8 * hostapd_eid_country(struct hostapd_data *hapd, u8 *eid, in hostapd_eid_country() argument
232 if (!hapd->iconf->ieee80211d || max_len < 6 || in hostapd_eid_country()
233 hapd->iface->current_mode == NULL) in hostapd_eid_country()
238 os_memcpy(pos, hapd->iconf->country, 3); /* e.g., 'US ' */ in hostapd_eid_country()
241 mode = hapd->iface->current_mode; in hostapd_eid_country()
284 static u8 * hostapd_eid_wpa(struct hostapd_data *hapd, u8 *eid, size_t len) in hostapd_eid_wpa() argument
289 ie = wpa_auth_get_wpa_ie(hapd->wpa_auth, &ielen); in hostapd_eid_wpa()
298 static u8 * hostapd_eid_csa(struct hostapd_data *hapd, u8 *eid) in hostapd_eid_csa() argument
301 if (hapd->iface->cs_oper_class && hapd->iconf->ecsa_ie_only) in hostapd_eid_csa()
305 if (!hapd->cs_freq_params.channel) in hostapd_eid_csa()
310 *eid++ = hapd->cs_block_tx; in hostapd_eid_csa()
311 *eid++ = hapd->cs_freq_params.channel; in hostapd_eid_csa()
312 *eid++ = hapd->cs_count; in hostapd_eid_csa()
318 static u8 * hostapd_eid_ecsa(struct hostapd_data *hapd, u8 *eid) in hostapd_eid_ecsa() argument
320 if (!hapd->cs_freq_params.channel || !hapd->iface->cs_oper_class) in hostapd_eid_ecsa()
325 *eid++ = hapd->cs_block_tx; in hostapd_eid_ecsa()
326 *eid++ = hapd->iface->cs_oper_class; in hostapd_eid_ecsa()
327 *eid++ = hapd->cs_freq_params.channel; in hostapd_eid_ecsa()
328 *eid++ = hapd->cs_count; in hostapd_eid_ecsa()
334 static u8 * hostapd_eid_supported_op_classes(struct hostapd_data *hapd, u8 *eid) in hostapd_eid_supported_op_classes() argument
338 if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA) || in hostapd_eid_supported_op_classes()
339 !hapd->iface->freq) in hostapd_eid_supported_op_classes()
342 if (ieee80211_freq_to_channel_ext(hapd->iface->freq, in hostapd_eid_supported_op_classes()
343 hapd->iconf->secondary_channel, in hostapd_eid_supported_op_classes()
344 hapd->iconf->vht_oper_chwidth, in hostapd_eid_supported_op_classes()
362 static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, in hostapd_gen_probe_resp() argument
373 if (hapd->wps_probe_resp_ie) in hostapd_gen_probe_resp()
374 buflen += wpabuf_len(hapd->wps_probe_resp_ie); in hostapd_gen_probe_resp()
377 if (hapd->p2p_probe_resp_ie) in hostapd_gen_probe_resp()
378 buflen += wpabuf_len(hapd->p2p_probe_resp_ie); in hostapd_gen_probe_resp()
381 if (hapd->iface->fst_ies) in hostapd_gen_probe_resp()
382 buflen += wpabuf_len(hapd->iface->fst_ies); in hostapd_gen_probe_resp()
384 if (hapd->conf->vendor_elements) in hostapd_gen_probe_resp()
385 buflen += wpabuf_len(hapd->conf->vendor_elements); in hostapd_gen_probe_resp()
386 if (hapd->conf->vendor_vht) { in hostapd_gen_probe_resp()
391 buflen += hostapd_mbo_ie_len(hapd); in hostapd_gen_probe_resp()
403 os_memcpy(resp->sa, hapd->own_addr, ETH_ALEN); in hostapd_gen_probe_resp()
405 os_memcpy(resp->bssid, hapd->own_addr, ETH_ALEN); in hostapd_gen_probe_resp()
407 host_to_le16(hapd->iconf->beacon_int); in hostapd_gen_probe_resp()
411 host_to_le16(hostapd_own_capab_info(hapd)); in hostapd_gen_probe_resp()
415 *pos++ = hapd->conf->ssid.ssid_len; in hostapd_gen_probe_resp()
416 os_memcpy(pos, hapd->conf->ssid.ssid, hapd->conf->ssid.ssid_len); in hostapd_gen_probe_resp()
417 pos += hapd->conf->ssid.ssid_len; in hostapd_gen_probe_resp()
420 pos = hostapd_eid_supp_rates(hapd, pos); in hostapd_gen_probe_resp()
423 pos = hostapd_eid_ds_params(hapd, pos); in hostapd_gen_probe_resp()
425 pos = hostapd_eid_country(hapd, pos, epos - pos); in hostapd_gen_probe_resp()
428 pos = hostapd_eid_pwr_constraint(hapd, pos); in hostapd_gen_probe_resp()
431 csa_pos = hostapd_eid_csa(hapd, pos); in hostapd_gen_probe_resp()
433 hapd->cs_c_off_proberesp = csa_pos - (u8 *) resp - 1; in hostapd_gen_probe_resp()
437 pos = hostapd_eid_erp_info(hapd, pos); in hostapd_gen_probe_resp()
440 pos = hostapd_eid_ext_supp_rates(hapd, pos); in hostapd_gen_probe_resp()
443 pos = hostapd_eid_wpa(hapd, pos, epos - pos); in hostapd_gen_probe_resp()
445 pos = hostapd_eid_bss_load(hapd, pos, epos - pos); in hostapd_gen_probe_resp()
447 pos = hostapd_eid_rm_enabled_capab(hapd, pos, epos - pos); in hostapd_gen_probe_resp()
450 csa_pos = hostapd_eid_ecsa(hapd, pos); in hostapd_gen_probe_resp()
452 hapd->cs_c_off_ecsa_proberesp = csa_pos - (u8 *) resp - 1; in hostapd_gen_probe_resp()
455 pos = hostapd_eid_supported_op_classes(hapd, pos); in hostapd_gen_probe_resp()
460 pos = hostapd_eid_secondary_channel(hapd, pos); in hostapd_gen_probe_resp()
462 pos = hostapd_eid_ht_capabilities(hapd, pos); in hostapd_gen_probe_resp()
463 pos = hostapd_eid_ht_operation(hapd, pos); in hostapd_gen_probe_resp()
466 pos = hostapd_eid_ext_capab(hapd, pos); in hostapd_gen_probe_resp()
468 pos = hostapd_eid_time_adv(hapd, pos); in hostapd_gen_probe_resp()
469 pos = hostapd_eid_time_zone(hapd, pos); in hostapd_gen_probe_resp()
471 pos = hostapd_eid_interworking(hapd, pos); in hostapd_gen_probe_resp()
472 pos = hostapd_eid_adv_proto(hapd, pos); in hostapd_gen_probe_resp()
473 pos = hostapd_eid_roaming_consortium(hapd, pos); in hostapd_gen_probe_resp()
476 if (hapd->iface->fst_ies) { in hostapd_gen_probe_resp()
477 os_memcpy(pos, wpabuf_head(hapd->iface->fst_ies), in hostapd_gen_probe_resp()
478 wpabuf_len(hapd->iface->fst_ies)); in hostapd_gen_probe_resp()
479 pos += wpabuf_len(hapd->iface->fst_ies); in hostapd_gen_probe_resp()
484 if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) { in hostapd_gen_probe_resp()
485 pos = hostapd_eid_vht_capabilities(hapd, pos); in hostapd_gen_probe_resp()
486 pos = hostapd_eid_vht_operation(hapd, pos); in hostapd_gen_probe_resp()
487 pos = hostapd_eid_txpower_envelope(hapd, pos); in hostapd_gen_probe_resp()
488 pos = hostapd_eid_wb_chsw_wrapper(hapd, pos); in hostapd_gen_probe_resp()
490 if (hapd->conf->vendor_vht) in hostapd_gen_probe_resp()
491 pos = hostapd_eid_vendor_vht(hapd, pos); in hostapd_gen_probe_resp()
495 pos = hostapd_eid_wmm(hapd, pos); in hostapd_gen_probe_resp()
498 if (hapd->conf->wps_state && hapd->wps_probe_resp_ie) { in hostapd_gen_probe_resp()
499 os_memcpy(pos, wpabuf_head(hapd->wps_probe_resp_ie), in hostapd_gen_probe_resp()
500 wpabuf_len(hapd->wps_probe_resp_ie)); in hostapd_gen_probe_resp()
501 pos += wpabuf_len(hapd->wps_probe_resp_ie); in hostapd_gen_probe_resp()
506 if ((hapd->conf->p2p & P2P_ENABLED) && is_p2p && in hostapd_gen_probe_resp()
507 hapd->p2p_probe_resp_ie) { in hostapd_gen_probe_resp()
508 os_memcpy(pos, wpabuf_head(hapd->p2p_probe_resp_ie), in hostapd_gen_probe_resp()
509 wpabuf_len(hapd->p2p_probe_resp_ie)); in hostapd_gen_probe_resp()
510 pos += wpabuf_len(hapd->p2p_probe_resp_ie); in hostapd_gen_probe_resp()
514 if ((hapd->conf->p2p & (P2P_MANAGE | P2P_ENABLED | P2P_GROUP_OWNER)) == in hostapd_gen_probe_resp()
516 pos = hostapd_eid_p2p_manage(hapd, pos); in hostapd_gen_probe_resp()
520 pos = hostapd_eid_hs20_indication(hapd, pos); in hostapd_gen_probe_resp()
521 pos = hostapd_eid_osen(hapd, pos); in hostapd_gen_probe_resp()
524 pos = hostapd_eid_mbo(hapd, pos, (u8 *) resp + buflen - pos); in hostapd_gen_probe_resp()
526 if (hapd->conf->vendor_elements) { in hostapd_gen_probe_resp()
527 os_memcpy(pos, wpabuf_head(hapd->conf->vendor_elements), in hostapd_gen_probe_resp()
528 wpabuf_len(hapd->conf->vendor_elements)); in hostapd_gen_probe_resp()
529 pos += wpabuf_len(hapd->conf->vendor_elements); in hostapd_gen_probe_resp()
543 static enum ssid_match_result ssid_match(struct hostapd_data *hapd, in ssid_match() argument
553 if (ssid_len == hapd->conf->ssid.ssid_len && in ssid_match()
554 os_memcmp(ssid, hapd->conf->ssid.ssid, ssid_len) == 0) in ssid_match()
567 if (pos[1] == hapd->conf->ssid.ssid_len && in ssid_match()
568 os_memcmp(pos + 2, hapd->conf->ssid.ssid, pos[1]) == 0) in ssid_match()
655 struct hostapd_data *hapd = NULL; in sta_track_seen_on() local
659 hapd = iface->bss[j]; in sta_track_seen_on()
660 if (os_strcmp(ifname, hapd->conf->iface) == 0) in sta_track_seen_on()
662 hapd = NULL; in sta_track_seen_on()
665 if (hapd && sta_track_get(iface, addr)) in sta_track_seen_on()
666 return hapd; in sta_track_seen_on()
673 void handle_probe_req(struct hostapd_data *hapd, in handle_probe_req() argument
691 if (hapd->iconf->track_sta_max_num) in handle_probe_req()
692 sta_track_add(hapd->iface, mgmt->sa); in handle_probe_req()
695 for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++) in handle_probe_req()
696 if (hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx, in handle_probe_req()
701 if (!hapd->iconf->send_probe_response) in handle_probe_req()
728 hapd->iface->current_mode && in handle_probe_req()
729 (hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G || in handle_probe_req()
730 hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211B) && in handle_probe_req()
731 hapd->iconf->channel != elems.ds_params[0]) { in handle_probe_req()
734 hapd->iconf->channel, elems.ds_params[0]); in handle_probe_req()
739 if (hapd->p2p && hapd->p2p_group && elems.wps_ie) { in handle_probe_req()
742 if (wps && !p2p_group_match_dev_type(hapd->p2p_group, wps)) { in handle_probe_req()
752 if (hapd->p2p && hapd->p2p_group && elems.p2p) { in handle_probe_req()
755 if (p2p && !p2p_group_match_dev_id(hapd->p2p_group, p2p)) { in handle_probe_req()
765 if (hapd->conf->ignore_broadcast_ssid && elems.ssid_len == 0 && in handle_probe_req()
773 if ((hapd->conf->p2p & P2P_GROUP_OWNER) && in handle_probe_req()
782 res = ssid_match(hapd, elems.ssid, elems.ssid_len, in handle_probe_req()
797 if (hapd->conf->interworking && in handle_probe_req()
801 ant != hapd->conf->access_network_type) { in handle_probe_req()
809 if (hapd->conf->interworking && elems.interworking && in handle_probe_req()
817 os_memcmp(hessid, hapd->conf->hessid, ETH_ALEN) != 0) { in handle_probe_req()
828 if ((hapd->conf->p2p & P2P_GROUP_OWNER) && in handle_probe_req()
841 if (hapd->conf->no_probe_resp_if_seen_on && in handle_probe_req()
844 sta_track_seen_on(hapd->iface, mgmt->sa, in handle_probe_req()
845 hapd->conf->no_probe_resp_if_seen_on)) { in handle_probe_req()
848 hapd->conf->iface, MAC2STR(mgmt->sa), in handle_probe_req()
849 hapd->conf->no_probe_resp_if_seen_on); in handle_probe_req()
853 if (hapd->conf->no_probe_resp_if_max_sta && in handle_probe_req()
856 hapd->num_sta >= hapd->conf->max_num_sta && in handle_probe_req()
857 !ap_get_sta(hapd, mgmt->sa)) { in handle_probe_req()
860 hapd->conf->iface, MAC2STR(mgmt->sa)); in handle_probe_req()
865 if (hapd->iconf->ignore_probe_probability > 0.0 && in handle_probe_req()
866 drand48() < hapd->iconf->ignore_probe_probability) { in handle_probe_req()
874 resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL, in handle_probe_req()
887 if (hapd->csa_in_progress) { in handle_probe_req()
888 if (hapd->cs_c_off_proberesp) in handle_probe_req()
890 hapd->cs_c_off_proberesp; in handle_probe_req()
892 if (hapd->cs_c_off_ecsa_proberesp) in handle_probe_req()
894 hapd->cs_c_off_ecsa_proberesp; in handle_probe_req()
897 ret = hostapd_drv_send_mlme_csa(hapd, resp, resp_len, noack, in handle_probe_req()
912 static u8 * hostapd_probe_resp_offloads(struct hostapd_data *hapd, in hostapd_probe_resp_offloads() argument
916 if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD)) in hostapd_probe_resp_offloads()
920 if (hapd->conf->wps_state && hapd->wps_probe_resp_ie && in hostapd_probe_resp_offloads()
921 (!(hapd->iface->probe_resp_offloads & in hostapd_probe_resp_offloads()
929 if ((hapd->conf->p2p & P2P_ENABLED) && hapd->p2p_probe_resp_ie && in hostapd_probe_resp_offloads()
930 !(hapd->iface->probe_resp_offloads & in hostapd_probe_resp_offloads()
936 if (hapd->conf->interworking && in hostapd_probe_resp_offloads()
937 !(hapd->iface->probe_resp_offloads & in hostapd_probe_resp_offloads()
944 return hostapd_gen_probe_resp(hapd, NULL, 0, resp_len); in hostapd_probe_resp_offloads()
950 int ieee802_11_build_ap_params(struct hostapd_data *hapd, in ieee802_11_build_ap_params() argument
967 if (hapd->conf->wps_state && hapd->wps_beacon_ie) in ieee802_11_build_ap_params()
968 tail_len += wpabuf_len(hapd->wps_beacon_ie); in ieee802_11_build_ap_params()
971 if (hapd->p2p_beacon_ie) in ieee802_11_build_ap_params()
972 tail_len += wpabuf_len(hapd->p2p_beacon_ie); in ieee802_11_build_ap_params()
975 if (hapd->iface->fst_ies) in ieee802_11_build_ap_params()
976 tail_len += wpabuf_len(hapd->iface->fst_ies); in ieee802_11_build_ap_params()
978 if (hapd->conf->vendor_elements) in ieee802_11_build_ap_params()
979 tail_len += wpabuf_len(hapd->conf->vendor_elements); in ieee802_11_build_ap_params()
982 if (hapd->conf->vendor_vht) { in ieee802_11_build_ap_params()
988 tail_len += hostapd_mbo_ie_len(hapd); in ieee802_11_build_ap_params()
1003 os_memcpy(head->sa, hapd->own_addr, ETH_ALEN); in ieee802_11_build_ap_params()
1004 os_memcpy(head->bssid, hapd->own_addr, ETH_ALEN); in ieee802_11_build_ap_params()
1006 host_to_le16(hapd->iconf->beacon_int); in ieee802_11_build_ap_params()
1009 capab_info = hostapd_own_capab_info(hapd); in ieee802_11_build_ap_params()
1015 if (hapd->conf->ignore_broadcast_ssid == 2) { in ieee802_11_build_ap_params()
1017 *pos++ = hapd->conf->ssid.ssid_len; in ieee802_11_build_ap_params()
1018 os_memset(pos, 0, hapd->conf->ssid.ssid_len); in ieee802_11_build_ap_params()
1019 pos += hapd->conf->ssid.ssid_len; in ieee802_11_build_ap_params()
1020 } else if (hapd->conf->ignore_broadcast_ssid) { in ieee802_11_build_ap_params()
1023 *pos++ = hapd->conf->ssid.ssid_len; in ieee802_11_build_ap_params()
1024 os_memcpy(pos, hapd->conf->ssid.ssid, in ieee802_11_build_ap_params()
1025 hapd->conf->ssid.ssid_len); in ieee802_11_build_ap_params()
1026 pos += hapd->conf->ssid.ssid_len; in ieee802_11_build_ap_params()
1030 pos = hostapd_eid_supp_rates(hapd, pos); in ieee802_11_build_ap_params()
1033 pos = hostapd_eid_ds_params(hapd, pos); in ieee802_11_build_ap_params()
1037 tailpos = hostapd_eid_country(hapd, tailpos, in ieee802_11_build_ap_params()
1041 tailpos = hostapd_eid_pwr_constraint(hapd, tailpos); in ieee802_11_build_ap_params()
1044 csa_pos = hostapd_eid_csa(hapd, tailpos); in ieee802_11_build_ap_params()
1046 hapd->cs_c_off_beacon = csa_pos - tail - 1; in ieee802_11_build_ap_params()
1050 tailpos = hostapd_eid_erp_info(hapd, tailpos); in ieee802_11_build_ap_params()
1053 tailpos = hostapd_eid_ext_supp_rates(hapd, tailpos); in ieee802_11_build_ap_params()
1056 tailpos = hostapd_eid_wpa(hapd, tailpos, tail + BEACON_TAIL_BUF_SIZE - in ieee802_11_build_ap_params()
1059 tailpos = hostapd_eid_rm_enabled_capab(hapd, tailpos, in ieee802_11_build_ap_params()
1063 tailpos = hostapd_eid_bss_load(hapd, tailpos, in ieee802_11_build_ap_params()
1067 csa_pos = hostapd_eid_ecsa(hapd, tailpos); in ieee802_11_build_ap_params()
1069 hapd->cs_c_off_ecsa_beacon = csa_pos - tail - 1; in ieee802_11_build_ap_params()
1072 tailpos = hostapd_eid_supported_op_classes(hapd, tailpos); in ieee802_11_build_ap_params()
1077 tailpos = hostapd_eid_secondary_channel(hapd, tailpos); in ieee802_11_build_ap_params()
1079 tailpos = hostapd_eid_ht_capabilities(hapd, tailpos); in ieee802_11_build_ap_params()
1080 tailpos = hostapd_eid_ht_operation(hapd, tailpos); in ieee802_11_build_ap_params()
1083 tailpos = hostapd_eid_ext_capab(hapd, tailpos); in ieee802_11_build_ap_params()
1089 tailpos = hostapd_eid_time_adv(hapd, tailpos); in ieee802_11_build_ap_params()
1091 tailpos = hostapd_eid_interworking(hapd, tailpos); in ieee802_11_build_ap_params()
1092 tailpos = hostapd_eid_adv_proto(hapd, tailpos); in ieee802_11_build_ap_params()
1093 tailpos = hostapd_eid_roaming_consortium(hapd, tailpos); in ieee802_11_build_ap_params()
1096 if (hapd->iface->fst_ies) { in ieee802_11_build_ap_params()
1097 os_memcpy(tailpos, wpabuf_head(hapd->iface->fst_ies), in ieee802_11_build_ap_params()
1098 wpabuf_len(hapd->iface->fst_ies)); in ieee802_11_build_ap_params()
1099 tailpos += wpabuf_len(hapd->iface->fst_ies); in ieee802_11_build_ap_params()
1104 if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) { in ieee802_11_build_ap_params()
1105 tailpos = hostapd_eid_vht_capabilities(hapd, tailpos); in ieee802_11_build_ap_params()
1106 tailpos = hostapd_eid_vht_operation(hapd, tailpos); in ieee802_11_build_ap_params()
1107 tailpos = hostapd_eid_txpower_envelope(hapd, tailpos); in ieee802_11_build_ap_params()
1108 tailpos = hostapd_eid_wb_chsw_wrapper(hapd, tailpos); in ieee802_11_build_ap_params()
1110 if (hapd->conf->vendor_vht) in ieee802_11_build_ap_params()
1111 tailpos = hostapd_eid_vendor_vht(hapd, tailpos); in ieee802_11_build_ap_params()
1115 tailpos = hostapd_eid_wmm(hapd, tailpos); in ieee802_11_build_ap_params()
1118 if (hapd->conf->wps_state && hapd->wps_beacon_ie) { in ieee802_11_build_ap_params()
1119 os_memcpy(tailpos, wpabuf_head(hapd->wps_beacon_ie), in ieee802_11_build_ap_params()
1120 wpabuf_len(hapd->wps_beacon_ie)); in ieee802_11_build_ap_params()
1121 tailpos += wpabuf_len(hapd->wps_beacon_ie); in ieee802_11_build_ap_params()
1126 if ((hapd->conf->p2p & P2P_ENABLED) && hapd->p2p_beacon_ie) { in ieee802_11_build_ap_params()
1127 os_memcpy(tailpos, wpabuf_head(hapd->p2p_beacon_ie), in ieee802_11_build_ap_params()
1128 wpabuf_len(hapd->p2p_beacon_ie)); in ieee802_11_build_ap_params()
1129 tailpos += wpabuf_len(hapd->p2p_beacon_ie); in ieee802_11_build_ap_params()
1133 if ((hapd->conf->p2p & (P2P_MANAGE | P2P_ENABLED | P2P_GROUP_OWNER)) == in ieee802_11_build_ap_params()
1135 tailpos = hostapd_eid_p2p_manage(hapd, tailpos); in ieee802_11_build_ap_params()
1139 tailpos = hostapd_eid_hs20_indication(hapd, tailpos); in ieee802_11_build_ap_params()
1140 tailpos = hostapd_eid_osen(hapd, tailpos); in ieee802_11_build_ap_params()
1143 tailpos = hostapd_eid_mbo(hapd, tailpos, tail + tail_len - tailpos); in ieee802_11_build_ap_params()
1145 if (hapd->conf->vendor_elements) { in ieee802_11_build_ap_params()
1146 os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), in ieee802_11_build_ap_params()
1147 wpabuf_len(hapd->conf->vendor_elements)); in ieee802_11_build_ap_params()
1148 tailpos += wpabuf_len(hapd->conf->vendor_elements); in ieee802_11_build_ap_params()
1153 resp = hostapd_probe_resp_offloads(hapd, &resp_len); in ieee802_11_build_ap_params()
1163 params->dtim_period = hapd->conf->dtim_period; in ieee802_11_build_ap_params()
1164 params->beacon_int = hapd->iconf->beacon_int; in ieee802_11_build_ap_params()
1165 params->basic_rates = hapd->iface->basic_rates; in ieee802_11_build_ap_params()
1166 params->ssid = hapd->conf->ssid.ssid; in ieee802_11_build_ap_params()
1167 params->ssid_len = hapd->conf->ssid.ssid_len; in ieee802_11_build_ap_params()
1168 if ((hapd->conf->wpa & (WPA_PROTO_WPA | WPA_PROTO_RSN)) == in ieee802_11_build_ap_params()
1170 params->pairwise_ciphers = hapd->conf->wpa_pairwise | in ieee802_11_build_ap_params()
1171 hapd->conf->rsn_pairwise; in ieee802_11_build_ap_params()
1172 else if (hapd->conf->wpa & WPA_PROTO_RSN) in ieee802_11_build_ap_params()
1173 params->pairwise_ciphers = hapd->conf->rsn_pairwise; in ieee802_11_build_ap_params()
1174 else if (hapd->conf->wpa & WPA_PROTO_WPA) in ieee802_11_build_ap_params()
1175 params->pairwise_ciphers = hapd->conf->wpa_pairwise; in ieee802_11_build_ap_params()
1176 params->group_cipher = hapd->conf->wpa_group; in ieee802_11_build_ap_params()
1177 params->key_mgmt_suites = hapd->conf->wpa_key_mgmt; in ieee802_11_build_ap_params()
1178 params->auth_algs = hapd->conf->auth_algs; in ieee802_11_build_ap_params()
1179 params->wpa_version = hapd->conf->wpa; in ieee802_11_build_ap_params()
1180 params->privacy = hapd->conf->ssid.wep.keys_set || hapd->conf->wpa || in ieee802_11_build_ap_params()
1181 (hapd->conf->ieee802_1x && in ieee802_11_build_ap_params()
1182 (hapd->conf->default_wep_key_len || in ieee802_11_build_ap_params()
1183 hapd->conf->individual_wep_key_len)); in ieee802_11_build_ap_params()
1184 switch (hapd->conf->ignore_broadcast_ssid) { in ieee802_11_build_ap_params()
1195 params->isolate = hapd->conf->isolate; in ieee802_11_build_ap_params()
1196 params->smps_mode = hapd->iconf->ht_capab & HT_CAP_INFO_SMPS_MASK; in ieee802_11_build_ap_params()
1198 params->cts_protect = !!(ieee802_11_erp_info(hapd) & in ieee802_11_build_ap_params()
1200 params->preamble = hapd->iface->num_sta_no_short_preamble == 0 && in ieee802_11_build_ap_params()
1201 hapd->iconf->preamble == SHORT_PREAMBLE; in ieee802_11_build_ap_params()
1202 if (hapd->iface->current_mode && in ieee802_11_build_ap_params()
1203 hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G) in ieee802_11_build_ap_params()
1205 hapd->iface->num_sta_no_short_slot_time > 0 ? 0 : 1; in ieee802_11_build_ap_params()
1208 if (!hapd->iconf->ieee80211n || hapd->conf->disable_11n) in ieee802_11_build_ap_params()
1211 params->ht_opmode = hapd->iface->ht_op_mode; in ieee802_11_build_ap_params()
1213 params->interworking = hapd->conf->interworking; in ieee802_11_build_ap_params()
1214 if (hapd->conf->interworking && in ieee802_11_build_ap_params()
1215 !is_zero_ether_addr(hapd->conf->hessid)) in ieee802_11_build_ap_params()
1216 params->hessid = hapd->conf->hessid; in ieee802_11_build_ap_params()
1217 params->access_network_type = hapd->conf->access_network_type; in ieee802_11_build_ap_params()
1218 params->ap_max_inactivity = hapd->conf->ap_max_inactivity; in ieee802_11_build_ap_params()
1220 params->p2p_go_ctwindow = hapd->iconf->p2p_go_ctwindow; in ieee802_11_build_ap_params()
1223 params->disable_dgaf = hapd->conf->disable_dgaf; in ieee802_11_build_ap_params()
1224 if (hapd->conf->osen) { in ieee802_11_build_ap_params()
1229 params->pbss = hapd->conf->pbss; in ieee802_11_build_ap_params()
1245 int ieee802_11_set_beacon(struct hostapd_data *hapd) in ieee802_11_set_beacon() argument
1249 struct hostapd_iface *iface = hapd->iface; in ieee802_11_set_beacon()
1254 if (hapd->csa_in_progress) { in ieee802_11_set_beacon()
1259 hapd->beacon_set_done = 1; in ieee802_11_set_beacon()
1261 if (ieee802_11_build_ap_params(hapd, ¶ms) < 0) in ieee802_11_set_beacon()
1264 if (hostapd_build_ap_extra_ies(hapd, &beacon, &proberesp, &assocresp) < in ieee802_11_set_beacon()
1271 params.reenable = hapd->reenable_beacon; in ieee802_11_set_beacon()
1272 hapd->reenable_beacon = 0; in ieee802_11_set_beacon()
1285 res = hostapd_drv_set_ap(hapd, ¶ms); in ieee802_11_set_beacon()
1286 hostapd_free_ap_extra_ies(hapd, beacon, proberesp, assocresp); in ieee802_11_set_beacon()