Lines Matching defs:hapd

49 void hostapd_notify_assoc_fils_finish(struct hostapd_data *hapd,
60 eloop_cancel_timeout(fils_hlp_timeout, hapd, sta);
77 reply_res = hostapd_sta_assoc(hapd, sta->addr,
81 updated = ap_sta_set_authorized_flag(hapd, sta, 1);
85 hostapd_set_sta_flags(hapd, sta);
87 ap_sta_set_authorized_event(hapd, sta, 1);
90 hostapd_new_assoc_sta(hapd, sta, !new_assoc);
98 fils_hlp_deinit(hapd);
106 hostapd_drv_sta_remove(hapd, sta->addr);
113 static bool check_sa_query_need(struct hostapd_data *hapd, struct sta_info *sta)
121 ap_check_sa_query_timeout(hapd, sta);
130 ap_sta_start_sa_query(hapd, sta);
140 static int hostapd_update_sta_links_status(struct hostapd_data *hapd,
251 int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
268 struct hostapd_iface *iface = hapd->iface;
287 ether_addr_equal(addr, hapd->own_addr)) {
299 hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
333 sta = ap_get_sta(hapd, addr);
335 ap_sta_no_session_timeout(hapd, sta);
336 accounting_sta_stop(hapd, sta);
344 sta = ap_sta_add(hapd, addr);
346 hostapd_drv_sta_disassoc(hapd, addr,
352 if (hapd->conf->wpa && check_sa_query_need(hapd, sta)) {
354 p = hostapd_eid_assoc_comeback_time(hapd, sta, p);
355 hostapd_sta_assoc(hapd, addr, reassoc, status, buf, p - buf);
364 u8 link_id = hapd->mld_link_id;
371 os_memcpy(info->links[link_id].local_addr, hapd->own_addr,
375 hostapd_process_ml_assoc_req(hapd, &elems, sta) !=
388 hostapd_update_sta_links_status(hapd, sta, resp_ies,
407 if (hapd->iface->drv_max_acl_mac_addrs == 0 &&
408 hostapd_check_acl(hapd, addr, NULL) != HOSTAPD_ACL_ACCEPT) {
427 (hapd->iface->conf->ht_capab &
435 ht40_intolerant_add(hapd->iface, sta);
439 check_ext_capab(hapd, sta, elems.ext_capab, elems.ext_capab_len);
460 if (hapd->iface->fst)
466 mbo_ap_check_sta_assoc(hapd, sta, &elems);
471 if (hapd->conf->wpa) {
474 if (hapd->conf->wps_state) {
488 if (hapd->conf->wps_state && ie[0] == 0xdd && ie[1] >= 4 &&
508 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth,
517 if (ap_sta_is_mld(hapd, sta)) {
525 res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm,
526 hapd->iface->freq,
617 if (hapd->conf->sae_pwe == SAE_PWE_BOTH &&
630 } else if (hapd->conf->wps_state) {
659 } else if (hapd->conf->osen) {
662 hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
670 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth,
677 if (wpa_validate_osen(hapd->wpa_auth, sta->wpa_sm,
687 if (hapd->conf->mbo_enabled && (hapd->conf->wpa & 2) &&
689 hapd->conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) {
731 if (fils_process_hlp(hapd, sta, req_ies, req_ies_len) > 0) {
742 eloop_cancel_timeout(fils_hlp_timeout, hapd, sta);
769 0, hapd->conf->fils_hlp_wait_time * 1024,
770 fils_hlp_timeout, hapd, sta);
782 if ((hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE) &&
789 npos = owe_assoc_req_process(hapd, sta,
799 hostapd_sta_assoc(hapd, addr, reassoc, ret_status, buf,
813 if ((hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_DPP) &&
814 hapd->conf->dpp_netaccesskey && sta->wpa_sm &&
818 wpabuf_head(hapd->conf->dpp_netaccesskey),
819 wpabuf_len(hapd->conf->dpp_netaccesskey));
847 hostapd_sta_assoc(hapd, addr, reassoc, status, buf, p - buf);
853 updated = ap_sta_set_authorized_flag(hapd, sta, 1);
861 if (hostapd_process_assoc_ml_info(hapd, sta, req_ies, req_ies_len,
874 hostapd_set_sta_flags(hapd, sta);
876 ap_sta_set_authorized_event(hapd, sta, 1);
889 hostapd_new_assoc_sta(hapd, sta, !new_assoc);
895 p2p_group_notif_assoc(hapd->p2p_group, sta->addr,
905 hostapd_sta_assoc(hapd, addr, reassoc, status, buf, p - buf);
907 hostapd_drv_sta_disassoc(hapd, sta->addr, reason);
908 ap_free_sta(hapd, sta);
913 static void hostapd_remove_sta(struct hostapd_data *hapd, struct sta_info *sta)
915 ap_sta_set_authorized(hapd, sta, 0);
917 hostapd_set_sta_flags(hapd, sta);
921 ap_free_sta(hapd, sta);
961 void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr)
978 hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
981 sta = ap_get_sta(hapd, addr);
983 if (hostapd_is_mld_ap(hapd)) {
990 for (i = 0; i < hapd->iface->interfaces->count; ++i) {
992 hapd->iface->interfaces->iface[i];
997 hconf->mld_id != hapd->conf->mld_id)
1003 hapd = h_hapd;
1018 sta = hostapd_ml_get_assoc_sta(hapd, sta, &assoc_hapd);
1033 hostapd_remove_sta(hapd, sta);
1037 void hostapd_event_sta_low_ack(struct hostapd_data *hapd, const u8 *addr)
1039 struct sta_info *sta = ap_get_sta(hapd, addr);
1041 if (!sta || !hapd->conf->disassoc_low_ack || sta->agreed_to_steer)
1044 hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
1047 hostapd_drv_sta_disassoc(hapd, addr, WLAN_REASON_DISASSOC_LOW_ACK);
1048 ap_sta_disassociate(hapd, sta, WLAN_REASON_DISASSOC_LOW_ACK);
1052 void hostapd_event_sta_opmode_changed(struct hostapd_data *hapd, const u8 *addr,
1056 struct sta_info *sta = ap_get_sta(hapd, addr);
1080 wpa_msg(hapd->msg_ctx, MSG_INFO, STA_OPMODE_SMPS_MODE_CHANGED
1111 wpa_msg(hapd->msg_ctx, MSG_INFO, STA_OPMODE_MAX_BW_CHANGED
1116 wpa_msg(hapd->msg_ctx, MSG_INFO, STA_OPMODE_N_SS_CHANGED
1122 void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
1131 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
1135 hapd->iface->freq,
1136 freq, ht, hapd->iconf->ch_switch_vht_config,
1137 hapd->iconf->ch_switch_he_config,
1138 hapd->iconf->ch_switch_eht_config, offset,
1142 if (!hapd->iface->current_mode) {
1143 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
1150 is_dfs0 = hostapd_is_dfs_required(hapd->iface);
1151 hapd->iface->freq = freq;
1153 channel = hostapd_hw_get_channel(hapd, freq);
1155 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
1185 if (finished && hostapd_csa_update_hwmode(hapd->iface))
1188 switch (hapd->iface->current_mode->mode) {
1210 hapd->iconf->channel = channel;
1211 hapd->iconf->ieee80211n = ht;
1213 hapd->iconf->ieee80211ac = 0;
1214 if (hapd->iconf->ch_switch_vht_config) {
1216 if (hapd->iconf->ch_switch_vht_config &
1218 hapd->iconf->ieee80211ac = 1;
1219 else if (hapd->iconf->ch_switch_vht_config &
1221 hapd->iconf->ieee80211ac = 0;
1223 if (hapd->iconf->ch_switch_he_config) {
1225 if (hapd->iconf->ch_switch_he_config &
1227 hapd->iconf->ieee80211ax = 1;
1228 if (hapd->iface->freq > 4000 &&
1229 hapd->iface->freq < 5895)
1230 hapd->iconf->ieee80211ac = 1;
1232 else if (hapd->iconf->ch_switch_he_config &
1234 hapd->iconf->ieee80211ax = 0;
1237 if (hapd->iconf->ch_switch_eht_config) {
1239 if (hapd->iconf->ch_switch_eht_config &
1241 hapd->iconf->ieee80211be = 1;
1242 hapd->iconf->ieee80211ax = 1;
1243 if (!is_6ghz_freq(hapd->iface->freq) &&
1244 hapd->iface->freq > 4000)
1245 hapd->iconf->ieee80211ac = 1;
1246 } else if (hapd->iconf->ch_switch_eht_config &
1248 hapd->iconf->ieee80211be = 0;
1251 hapd->iconf->ch_switch_vht_config = 0;
1252 hapd->iconf->ch_switch_he_config = 0;
1253 hapd->iconf->ch_switch_eht_config = 0;
1258 hapd->iconf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;
1260 hapd->iconf->ht_capab &= ~HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;
1262 hapd->iconf->secondary_channel = offset;
1266 hapd->iconf->op_class = op_class;
1267 hostapd_set_oper_chwidth(hapd->iconf, chwidth);
1268 hostapd_set_oper_centr_freq_seg0_idx(hapd->iconf, seg0_idx);
1269 hostapd_set_oper_centr_freq_seg1_idx(hapd->iconf, seg1_idx);
1271 hostapd_set_and_check_bw320_offset(hapd->iconf, 0);
1273 hapd->iconf->punct_bitmap = punct_bitmap;
1275 if (hapd->iconf->ieee80211ac) {
1276 hapd->iconf->vht_capab &= ~VHT_CAP_SUPP_CHAN_WIDTH_MASK;
1278 hapd->iconf->vht_capab |=
1281 hapd->iconf->vht_capab |=
1285 is_dfs = ieee80211_is_dfs(freq, hapd->iface->hw_features,
1286 hapd->iface->num_hw_features);
1288 wpa_msg(hapd->msg_ctx, MSG_INFO,
1297 if (hapd->csa_in_progress &&
1298 freq == hapd->cs_freq_params.freq) {
1299 hostapd_cleanup_cs_params(hapd);
1300 ieee802_11_set_beacon(hapd);
1302 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_CSA_FINISHED
1304 } else if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) {
1307 hostapd_is_dfs_required(hapd->iface) <= 0 &&
1308 hapd->iface->state != HAPD_IFACE_ENABLED) {
1310 hapd->iface->cac_started = 1;
1311 hostapd_setup_interface_complete(hapd->iface, 0);
1313 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_CSA_FINISHED
1316 hostapd_is_dfs_required(hapd->iface) &&
1317 !hostapd_is_dfs_chan_available(hapd->iface) &&
1318 !hapd->iface->cac_started) {
1319 hostapd_disable_iface(hapd->iface);
1320 hostapd_enable_iface(hapd->iface);
1323 for (i = 0; i < hapd->iface->num_bss; i++)
1324 hostapd_neighbor_set_own_report(hapd->iface->bss[i]);
1327 if (hapd->conf->ocv &&
1328 !(hapd->iface->drv_flags2 &
1333 for (sta = hapd->sta_list; sta; sta = sta->next) {
1346 hapd, NULL);
1354 void hostapd_event_connect_failed_reason(struct hostapd_data *hapd,
1359 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_REJECTED_MAX_STA MACSTR,
1363 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_REJECTED_BLOCKED_STA MACSTR,
1371 void hostapd_acs_channel_selected(struct hostapd_data *hapd,
1380 hapd = hostapd_mld_get_link_bss(hapd, acs_res->link_id);
1381 if (!hapd) {
1390 if (hapd->iconf->channel) {
1392 hapd->iconf->channel);
1396 hapd->iface->freq = acs_res->pri_freq;
1398 if (!hapd->iface->current_mode) {
1399 for (i = 0; i < hapd->iface->num_hw_features; i++) {
1401 &hapd->iface->hw_features[i];
1404 if (hapd->iface->freq > 0 &&
1406 hapd->iface->freq,
1407 hapd->iface->hw_features,
1408 hapd->iface->num_hw_features))
1410 hapd->iface->current_mode = mode;
1414 if (!hapd->iface->current_mode) {
1415 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
1424 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
1430 pri_chan = hw_get_channel_freq(hapd->iface->current_mode->mode,
1432 hapd->iface->hw_features,
1433 hapd->iface->num_hw_features);
1442 hapd->iconf->channel = pri_chan->chan;
1443 hapd->iconf->acs = 1;
1446 hapd->iconf->secondary_channel = 0;
1448 hapd->iconf->secondary_channel = -1;
1450 hapd->iconf->secondary_channel = 1;
1457 hapd->iconf->edmg_channel = acs_res->edmg_channel;
1459 if (hapd->iface->conf->ieee80211ac || hapd->iface->conf->ieee80211ax) {
1461 hostapd_set_oper_centr_freq_seg1_idx(hapd->iconf, 0);
1462 hostapd_set_oper_centr_freq_seg0_idx(hapd->iconf, 0);
1463 hostapd_set_oper_chwidth(hapd->iconf, CONF_OPER_CHWIDTH_USE_HT);
1467 hapd->iconf,
1471 hapd->iconf, acs_res->vht_seg0_center_ch);
1474 hapd->iconf, CONF_OPER_CHWIDTH_80MHZ);
1477 hapd->iconf,
1480 hapd->iconf,
1484 hostapd_set_oper_chwidth(hapd->iconf,
1487 hapd->iconf, acs_res->vht_seg1_center_ch);
1492 if (hapd->iface->conf->ieee80211be && acs_res->ch_width == 320) {
1493 hostapd_set_oper_chwidth(hapd->iconf, CONF_OPER_CHWIDTH_320MHZ);
1495 hapd->iconf, acs_res->vht_seg1_center_ch);
1496 hostapd_set_oper_centr_freq_seg1_idx(hapd->iconf, 0);
1499 if (hapd->iface->conf->ieee80211be && acs_res->puncture_bitmap)
1500 hapd->iconf->punct_bitmap = acs_res->puncture_bitmap;
1504 ret = hostapd_acs_completed(hapd->iface, err);
1513 int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa, const u8 *da,
1524 for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++) {
1525 if (hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,
1543 struct hostapd_data *hapd = ctx;
1546 sta = ap_get_sta(hapd, dst);
1550 hostapd_logger(hapd, dst, HOSTAPD_MODULE_IEEE80211,
1554 hostapd_sta_auth(hapd, dst, auth_transaction, status, ies, ies_len);
1560 static void hostapd_notify_auth_fils_finish(struct hostapd_data *hapd,
1565 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
1570 mlme_authenticate_indication(hapd, sta);
1572 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
1577 hostapd_sta_auth(hapd, sta->addr, 2, resp,
1585 static void hostapd_notif_auth(struct hostapd_data *hapd,
1593 sta = ap_get_sta(hapd, rx_auth->peer);
1595 sta = ap_sta_add(hapd, rx_auth->peer);
1604 if (rx_auth->auth_type == WLAN_AUTH_FT && hapd->wpa_auth) {
1607 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth,
1618 hostapd_notify_auth_ft_finish, hapd);
1626 handle_auth_fils(hapd, sta, rx_auth->ies, rx_auth->ies_len,
1635 hostapd_sta_auth(hapd, rx_auth->peer, rx_auth->auth_transaction + 1,
1641 static void hostapd_action_rx(struct hostapd_data *hapd,
1666 sta = ap_get_sta(hapd, mgmt->sa);
1678 ieee802_11_sa_query_action(hapd, mgmt, drv_mgmt->frame_len);
1683 ieee802_11_rx_wnm_action_ap(hapd, mgmt, drv_mgmt->frame_len);
1688 if (mgmt->u.action.category == WLAN_ACTION_FST && hapd->iface->fst) {
1689 fst_rx_action(hapd->iface->fst, mgmt, drv_mgmt->frame_len);
1706 hostapd_dpp_rx_action(hapd, mgmt->sa, pos, end - pos,
1723 hostapd_nan_usd_rx_sdf(hapd, mgmt->sa, drv_mgmt->freq,
1735 switch_link_hapd(struct hostapd_data *hapd, int link_id)
1738 if (hapd->conf->mld_ap && link_id >= 0) {
1741 link_bss = hostapd_mld_get_link_bss(hapd, link_id);
1747 return hapd;
1752 switch_link_scan(struct hostapd_data *hapd, u64 scan_cookie)
1755 if (hapd->conf->mld_ap && scan_cookie != 0) {
1758 for (i = 0; i < hapd->iface->interfaces->count; i++) {
1762 h = hapd->iface->interfaces->iface[i];
1764 if (!hostapd_is_ml_partner(hapd, h_hapd))
1775 return hapd;
1793 struct hostapd_data *hapd;
1798 hapd = iface->bss[i];
1799 if (ether_addr_equal(bssid, hapd->own_addr))
1800 return hapd;
1803 if (ether_addr_equal(bssid, hapd->own_addr) ||
1804 (hapd->conf->mld_ap &&
1805 ether_addr_equal(bssid, hapd->mld->mld_addr) &&
1806 link_id == hapd->mld_link_id))
1807 return hapd;
1809 if (!hapd->conf->mld_ap)
1812 for_each_mld_link(p_hapd, hapd) {
1813 if (p_hapd == hapd)
1828 static void hostapd_rx_from_unknown_sta(struct hostapd_data *hapd,
1832 hapd = get_hapd_bssid(hapd->iface, bssid, -1);
1833 if (hapd == NULL || hapd == HAPD_BROADCAST)
1836 ieee802_11_rx_from_unknown(hapd, addr, wds);
1840 static int hostapd_mgmt_rx(struct hostapd_data *hapd, struct rx_mgmt *rx_mgmt)
1849 hapd = rx_mgmt->ctx;
1850 hapd = switch_link_hapd(hapd, rx_mgmt->link_id);
1851 iface = hapd->iface;
1854 if (hapd->ext_mgmt_frame_handling) {
1861 wpa_msg(hapd->msg_ctx, MSG_INFO, "MGMT-RX %s", hex);
1873 hapd = get_hapd_bssid(iface, bssid, rx_mgmt->link_id);
1875 if (!hapd) {
1884 hapd = iface->bss[0];
1894 if (hapd == HAPD_BROADCAST) {
1910 ret = ieee802_11_mgmt(hapd, rx_mgmt->frame, rx_mgmt->frame_len,
1919 static void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, const u8 *buf,
1925 orig_hapd = hapd;
1928 hapd = switch_link_hapd(hapd, link_id);
1929 tmp_hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len), link_id);
1931 hapd = tmp_hapd;
1933 } else if (hapd->conf->mld_ap &&
1934 ether_addr_equal(hapd->mld->mld_addr,
1936 /* AP MLD address match - use hapd pointer as-is */
1942 if (hapd == HAPD_BROADCAST) {
1946 hapd = get_hapd_bssid(orig_hapd->iface, hdr->addr2, link_id);
1947 if (!hapd || hapd == HAPD_BROADCAST)
1954 ieee802_11_mgmt_cb(hapd, buf, len, stype, ok);
1960 static int hostapd_event_new_sta(struct hostapd_data *hapd, const u8 *addr)
1962 struct sta_info *sta = ap_get_sta(hapd, addr);
1969 sta = ap_sta_add(hapd, addr);
1971 hostapd_new_assoc_sta(hapd, sta, 0);
1986 struct hostapd_data *hapd;
1994 hapd = iface->bss[j];
1995 sta = ap_get_sta(hapd, src);
2000 return hapd;
2003 if (hapd->conf->mld_ap) {
2006 for_each_mld_link(p_hapd, hapd) {
2007 if (p_hapd == hapd)
2026 static void hostapd_event_eapol_rx(struct hostapd_data *hapd, const u8 *src,
2031 struct hostapd_data *orig_hapd = hapd;
2034 hapd = switch_link_hapd(hapd, link_id);
2035 hapd = hostapd_find_by_sta(hapd->iface, src, true, NULL);
2037 hapd = hostapd_find_by_sta(hapd->iface, src, false, NULL);
2040 if (!hapd) {
2048 hapd = orig_hapd;
2051 ieee802_1x_receive(hapd, src, data, data_len, encrypted);
2183 static void hostapd_event_iface_unavailable(struct hostapd_data *hapd)
2186 hapd->conf->iface);
2188 if (hapd->csa_in_progress) {
2190 hapd->conf->iface);
2191 hostapd_switch_channel_fallback(hapd->iface,
2192 &hapd->cs_freq_params);
2197 static void hostapd_event_dfs_radar_detected(struct hostapd_data *hapd,
2201 hostapd_dfs_radar_detected(hapd->iface, radar->freq, radar->ht_enabled,
2207 static void hostapd_event_dfs_pre_cac_expired(struct hostapd_data *hapd,
2211 hostapd_dfs_pre_cac_expired(hapd->iface, radar->freq, radar->ht_enabled,
2217 static void hostapd_event_dfs_cac_finished(struct hostapd_data *hapd,
2221 hostapd_dfs_complete_cac(hapd->iface, 1, radar->freq, radar->ht_enabled,
2227 static void hostapd_event_dfs_cac_aborted(struct hostapd_data *hapd,
2231 hostapd_dfs_complete_cac(hapd->iface, 0, radar->freq, radar->ht_enabled,
2237 static void hostapd_event_dfs_nop_finished(struct hostapd_data *hapd,
2241 hostapd_dfs_nop_finished(hapd->iface, radar->freq, radar->ht_enabled,
2247 static void hostapd_event_dfs_cac_started(struct hostapd_data *hapd,
2251 hostapd_dfs_start_cac(hapd->iface, radar->freq, radar->ht_enabled,
2259 static void hostapd_event_wds_sta_interface_status(struct hostapd_data *hapd,
2264 struct sta_info *sta = ap_get_sta(hapd, addr);
2274 wpa_msg(hapd->msg_ctx, MSG_INFO, "%sifname=%s sta_addr=" MACSTR,
2282 static int hostapd_notif_update_dh_ie(struct hostapd_data *hapd,
2290 if (!hapd || !hapd->wpa_auth) {
2291 wpa_printf(MSG_DEBUG, "OWE: Invalid hapd context");
2298 if (!(hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE)) {
2309 status = owe_validate_request(hapd, peer, elems.rsn_ie,
2315 sta = ap_get_sta(hapd, peer);
2317 ap_sta_no_session_timeout(hapd, sta);
2318 accounting_sta_stop(hapd, sta);
2326 sta = ap_sta_add(hapd, peer);
2337 u8 link_id = hapd->mld_link_id;
2343 os_memcpy(info->links[link_id].local_addr, hapd->own_addr,
2349 status = owe_process_rsn_ie(hapd, sta, elems.rsn_ie,
2353 ap_free_sta(hapd, sta);
2357 hostapd_drv_update_dh_ie(hapd, link_addr ? link_addr : peer, status,
2365 static void hostapd_eapol_tx_status(struct hostapd_data *hapd, const u8 *dst,
2371 hapd = switch_link_hapd(hapd, link_id);
2372 hapd = hostapd_find_by_sta(hapd->iface, dst, false, &sta);
2381 ieee802_1x_eapol_tx_status(hapd, sta, data, len, ack);
2387 static void hostapd_event_color_change(struct hostapd_data *hapd, bool success)
2392 for (i = 0; i < hapd->iface->num_bss; i++) {
2393 bss = hapd->iface->bss[i];
2398 hapd->iface->conf->he_op.he_bss_color = bss->cca_color;
2415 struct hostapd_data *hapd = ctx;
2435 wpa_dbg(hapd->msg_ctx, level, "Event %s (%d) received",
2441 michael_mic_failure(hapd, data->michael_mic_failure.src, 1);
2446 hapd = switch_link_scan(hapd,
2449 if (hapd->iface->scan_cb)
2450 hapd->iface->scan_cb(hapd->iface);
2452 if (!hapd->iface->scan_cb && hapd->conf->mld_ap) {
2456 for (i = 0; i < hapd->iface->interfaces->count; i++) {
2458 hapd->iface->interfaces->iface[i];
2461 if (hostapd_is_ml_partner(hapd, h_hapd) &&
2469 hostapd_wps_button_pushed(hapd, NULL);
2475 hostapd_mgmt_tx_cb(hapd, data->tx_status.data,
2482 hostapd_tx_status(hapd, data->tx_status.dst,
2490 hostapd_eapol_tx_status(hapd, data->eapol_tx_status.dst,
2497 hostapd_client_poll_ok(hapd, data->client_poll.addr);
2500 hostapd_rx_from_unknown_sta(hapd, data->rx_from_unknown.bssid,
2509 hostapd_mgmt_rx(hapd, &data->rx_mgmt);
2511 hostapd_action_rx(hapd, &data->rx_mgmt);
2518 hostapd_probe_req_rx(hapd, data->rx_probe_req.sa,
2526 hostapd_event_new_sta(hapd, data->new_sta.addr);
2529 hostapd_event_eapol_rx(hapd, data->eapol_rx.src,
2540 hapd = hostapd_mld_get_link_bss(
2541 hapd, data->assoc_info.assoc_link_id);
2542 if (!hapd) {
2549 hostapd_notif_assoc(hapd, data->assoc_info.addr,
2559 sta = ap_get_sta(hapd, data->port_authorized.sta_addr);
2561 ap_sta_set_authorized(hapd, sta, 1);
2572 hapd = hostapd_mld_get_link_bss(
2573 hapd, data->update_dh.assoc_link_id);
2574 if (!hapd) {
2582 hostapd_notif_update_dh_ie(hapd, data->update_dh.peer,
2590 hostapd_notif_disassoc(hapd, data->disassoc_info.addr);
2594 hostapd_notif_disassoc(hapd, data->deauth_info.addr);
2599 hostapd_event_sta_low_ack(hapd, data->low_ack.addr);
2602 hostapd_notif_auth(hapd, &data->auth);
2610 hapd = hostapd_mld_get_link_bss(
2611 hapd, data->ch_switch.link_id);
2612 if (!hapd) {
2620 hostapd_event_ch_switch(hapd, data->ch_switch.freq,
2633 hapd, data->connect_failed_reason.addr,
2637 hostapd_event_get_survey(hapd->iface, &data->survey_results);
2641 hostapd_event_iface_unavailable(hapd);
2646 hapd = switch_link_hapd(hapd, data->dfs_event.link_id);
2647 hostapd_event_dfs_radar_detected(hapd, &data->dfs_event);
2652 hapd = switch_link_hapd(hapd, data->dfs_event.link_id);
2653 hostapd_event_dfs_pre_cac_expired(hapd, &data->dfs_event);
2658 hapd = switch_link_hapd(hapd, data->dfs_event.link_id);
2659 hostapd_event_dfs_cac_finished(hapd, &data->dfs_event);
2664 hapd = switch_link_hapd(hapd, data->dfs_event.link_id);
2665 hostapd_event_dfs_cac_aborted(hapd, &data->dfs_event);
2670 hapd = switch_link_hapd(hapd, data->dfs_event.link_id);
2671 hostapd_event_dfs_nop_finished(hapd, &data->dfs_event);
2677 /* hostapd_get_hw_features(hapd->iface); */
2679 hapd->iface, data->channel_list_changed.initiator);
2684 hapd = switch_link_hapd(hapd, data->dfs_event.link_id);
2685 hostapd_event_dfs_cac_started(hapd, &data->dfs_event);
2689 wpa_msg(hapd->msg_ctx, MSG_INFO, INTERFACE_ENABLED);
2690 if (hapd->disabled && hapd->started) {
2691 hapd->disabled = 0;
2696 if (hapd->wpa_auth)
2697 wpa_auth_reconfig_group_keys(hapd->wpa_auth);
2699 hostapd_reconfig_encryption(hapd);
2700 hapd->reenable_beacon = 1;
2701 ieee802_11_set_beacon(hapd);
2703 } else if (hapd->disabled && hapd->iface->cac_started) {
2705 hostapd_handle_dfs(hapd->iface);
2710 hostapd_free_stas(hapd);
2711 wpa_msg(hapd->msg_ctx, MSG_INFO, INTERFACE_DISABLED);
2712 hapd->disabled = 1;
2716 hostapd_acs_channel_selected(hapd,
2721 hostapd_event_sta_opmode_changed(hapd, data->sta_opmode.addr,
2728 hapd, data->wds_sta_interface.istatus,
2737 hapd = switch_link_hapd(hapd,
2740 hapd->conf->iface);
2741 hostapd_switch_color(hapd->iface->bss[0],
2745 hapd = switch_link_hapd(hapd,
2748 hapd->conf->iface);
2751 hapd = switch_link_hapd(hapd,
2754 hapd->conf->iface);
2755 hostapd_event_color_change(hapd, false);
2758 hapd = switch_link_hapd(hapd,
2761 hapd->conf->iface);
2762 hostapd_event_color_change(hapd, true);
2776 struct hostapd_data *hapd;
2781 hapd = hostapd_get_iface(interfaces, data->interface_status.ifname);
2782 if (hapd && hapd->driver && hapd->driver->get_ifindex &&
2783 hapd->drv_priv) {
2786 ifindex = hapd->driver->get_ifindex(hapd->drv_priv);
2788 wpa_dbg(hapd->msg_ctx, MSG_DEBUG,
2794 if (hapd)
2795 wpa_supplicant_event(hapd, event, data);