Lines Matching refs:hapd

49 void hostapd_notify_assoc_fils_finish(struct hostapd_data *hapd,  in hostapd_notify_assoc_fils_finish()  argument
60 eloop_cancel_timeout(fils_hlp_timeout, hapd, sta); in hostapd_notify_assoc_fils_finish()
77 reply_res = hostapd_sta_assoc(hapd, sta->addr, in hostapd_notify_assoc_fils_finish()
81 updated = ap_sta_set_authorized_flag(hapd, sta, 1); in hostapd_notify_assoc_fils_finish()
85 hostapd_set_sta_flags(hapd, sta); in hostapd_notify_assoc_fils_finish()
87 ap_sta_set_authorized_event(hapd, sta, 1); in hostapd_notify_assoc_fils_finish()
90 hostapd_new_assoc_sta(hapd, sta, !new_assoc); in hostapd_notify_assoc_fils_finish()
98 fils_hlp_deinit(hapd); in hostapd_notify_assoc_fils_finish()
106 hostapd_drv_sta_remove(hapd, sta->addr); in hostapd_notify_assoc_fils_finish()
113 static bool check_sa_query_need(struct hostapd_data *hapd, struct sta_info *sta) in check_sa_query_need() argument
121 ap_check_sa_query_timeout(hapd, sta); in check_sa_query_need()
130 ap_sta_start_sa_query(hapd, sta); in check_sa_query_need()
140 static int hostapd_update_sta_links_status(struct hostapd_data *hapd, in hostapd_update_sta_links_status() argument
251 int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr, in hostapd_notif_assoc() argument
268 struct hostapd_iface *iface = hapd->iface; in hostapd_notif_assoc()
287 ether_addr_equal(addr, hapd->own_addr)) { in hostapd_notif_assoc()
299 hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211, in hostapd_notif_assoc()
333 sta = ap_get_sta(hapd, addr); in hostapd_notif_assoc()
335 ap_sta_no_session_timeout(hapd, sta); in hostapd_notif_assoc()
336 accounting_sta_stop(hapd, sta); in hostapd_notif_assoc()
344 sta = ap_sta_add(hapd, addr); in hostapd_notif_assoc()
346 hostapd_drv_sta_disassoc(hapd, addr, in hostapd_notif_assoc()
352 if (hapd->conf->wpa && check_sa_query_need(hapd, sta)) { in hostapd_notif_assoc()
354 p = hostapd_eid_assoc_comeback_time(hapd, sta, p); in hostapd_notif_assoc()
355 hostapd_sta_assoc(hapd, addr, reassoc, status, buf, p - buf); in hostapd_notif_assoc()
364 u8 link_id = hapd->mld_link_id; in hostapd_notif_assoc()
371 os_memcpy(info->links[link_id].local_addr, hapd->own_addr, in hostapd_notif_assoc()
375 hostapd_process_ml_assoc_req(hapd, &elems, sta) != in hostapd_notif_assoc()
388 hostapd_update_sta_links_status(hapd, sta, resp_ies, in hostapd_notif_assoc()
407 if (hapd->iface->drv_max_acl_mac_addrs == 0 && in hostapd_notif_assoc()
408 hostapd_check_acl(hapd, addr, NULL) != HOSTAPD_ACL_ACCEPT) { in hostapd_notif_assoc()
427 (hapd->iface->conf->ht_capab & in hostapd_notif_assoc()
435 ht40_intolerant_add(hapd->iface, sta); in hostapd_notif_assoc()
439 check_ext_capab(hapd, sta, elems.ext_capab, elems.ext_capab_len); in hostapd_notif_assoc()
460 if (hapd->iface->fst) in hostapd_notif_assoc()
466 mbo_ap_check_sta_assoc(hapd, sta, &elems); in hostapd_notif_assoc()
471 if (hapd->conf->wpa) { in hostapd_notif_assoc()
474 if (hapd->conf->wps_state) { in hostapd_notif_assoc()
488 if (hapd->conf->wps_state && ie[0] == 0xdd && ie[1] >= 4 && in hostapd_notif_assoc()
508 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth, in hostapd_notif_assoc()
519 if (ap_sta_is_mld(hapd, sta)) { in hostapd_notif_assoc()
527 res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm, in hostapd_notif_assoc()
528 hapd->iface->freq, in hostapd_notif_assoc()
619 if (hapd->conf->sae_pwe == SAE_PWE_BOTH && in hostapd_notif_assoc()
632 } else if (hapd->conf->wps_state) { in hostapd_notif_assoc()
661 } else if (hapd->conf->osen) { in hostapd_notif_assoc()
664 hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in hostapd_notif_assoc()
672 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth, in hostapd_notif_assoc()
679 if (wpa_validate_osen(hapd->wpa_auth, sta->wpa_sm, in hostapd_notif_assoc()
689 if (hapd->conf->mbo_enabled && (hapd->conf->wpa & 2) && in hostapd_notif_assoc()
691 hapd->conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) { in hostapd_notif_assoc()
733 if (fils_process_hlp(hapd, sta, req_ies, req_ies_len) > 0) { in hostapd_notif_assoc()
744 eloop_cancel_timeout(fils_hlp_timeout, hapd, sta); in hostapd_notif_assoc()
771 0, hapd->conf->fils_hlp_wait_time * 1024, in hostapd_notif_assoc()
772 fils_hlp_timeout, hapd, sta); in hostapd_notif_assoc()
784 if ((hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE) && in hostapd_notif_assoc()
791 npos = owe_assoc_req_process(hapd, sta, in hostapd_notif_assoc()
801 hostapd_sta_assoc(hapd, addr, reassoc, ret_status, buf, in hostapd_notif_assoc()
815 if ((hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_DPP) && in hostapd_notif_assoc()
816 hapd->conf->dpp_netaccesskey && sta->wpa_sm && in hostapd_notif_assoc()
820 wpabuf_head(hapd->conf->dpp_netaccesskey), in hostapd_notif_assoc()
821 wpabuf_len(hapd->conf->dpp_netaccesskey)); in hostapd_notif_assoc()
849 hostapd_sta_assoc(hapd, addr, reassoc, status, buf, p - buf); in hostapd_notif_assoc()
855 updated = ap_sta_set_authorized_flag(hapd, sta, 1); in hostapd_notif_assoc()
863 if (hostapd_process_assoc_ml_info(hapd, sta, req_ies, req_ies_len, in hostapd_notif_assoc()
876 hostapd_set_sta_flags(hapd, sta); in hostapd_notif_assoc()
878 ap_sta_set_authorized_event(hapd, sta, 1); in hostapd_notif_assoc()
891 hostapd_new_assoc_sta(hapd, sta, !new_assoc); in hostapd_notif_assoc()
897 p2p_group_notif_assoc(hapd->p2p_group, sta->addr, in hostapd_notif_assoc()
907 hostapd_sta_assoc(hapd, addr, reassoc, status, buf, p - buf); in hostapd_notif_assoc()
909 hostapd_drv_sta_disassoc(hapd, sta->addr, reason); in hostapd_notif_assoc()
910 ap_free_sta(hapd, sta); in hostapd_notif_assoc()
915 static void hostapd_remove_sta(struct hostapd_data *hapd, struct sta_info *sta) in hostapd_remove_sta() argument
917 ap_sta_set_authorized(hapd, sta, 0); in hostapd_remove_sta()
919 hostapd_set_sta_flags(hapd, sta); in hostapd_remove_sta()
923 ap_free_sta(hapd, sta); in hostapd_remove_sta()
963 void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr) in hostapd_notif_disassoc() argument
980 hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211, in hostapd_notif_disassoc()
983 sta = ap_get_sta(hapd, addr); in hostapd_notif_disassoc()
985 if (hostapd_is_mld_ap(hapd)) { in hostapd_notif_disassoc()
992 for (i = 0; i < hapd->iface->interfaces->count; ++i) { in hostapd_notif_disassoc()
994 hapd->iface->interfaces->iface[i]; in hostapd_notif_disassoc()
999 hconf->mld_id != hapd->conf->mld_id) in hostapd_notif_disassoc()
1005 hapd = h_hapd; in hostapd_notif_disassoc()
1020 sta = hostapd_ml_get_assoc_sta(hapd, sta, &assoc_hapd); in hostapd_notif_disassoc()
1035 hostapd_remove_sta(hapd, sta); in hostapd_notif_disassoc()
1039 void hostapd_event_sta_low_ack(struct hostapd_data *hapd, const u8 *addr) in hostapd_event_sta_low_ack() argument
1041 struct sta_info *sta = ap_get_sta(hapd, addr); in hostapd_event_sta_low_ack()
1043 if (!sta || !hapd->conf->disassoc_low_ack || sta->agreed_to_steer) in hostapd_event_sta_low_ack()
1046 hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211, in hostapd_event_sta_low_ack()
1049 hostapd_drv_sta_disassoc(hapd, addr, WLAN_REASON_DISASSOC_LOW_ACK); in hostapd_event_sta_low_ack()
1050 ap_sta_disassociate(hapd, sta, WLAN_REASON_DISASSOC_LOW_ACK); in hostapd_event_sta_low_ack()
1054 void hostapd_event_sta_opmode_changed(struct hostapd_data *hapd, const u8 *addr, in hostapd_event_sta_opmode_changed() argument
1058 struct sta_info *sta = ap_get_sta(hapd, addr); in hostapd_event_sta_opmode_changed()
1082 wpa_msg(hapd->msg_ctx, MSG_INFO, STA_OPMODE_SMPS_MODE_CHANGED in hostapd_event_sta_opmode_changed()
1113 wpa_msg(hapd->msg_ctx, MSG_INFO, STA_OPMODE_MAX_BW_CHANGED in hostapd_event_sta_opmode_changed()
1118 wpa_msg(hapd->msg_ctx, MSG_INFO, STA_OPMODE_N_SS_CHANGED in hostapd_event_sta_opmode_changed()
1124 void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht, in hostapd_event_ch_switch() argument
1133 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, in hostapd_event_ch_switch()
1137 hapd->iface->freq, in hostapd_event_ch_switch()
1138 freq, ht, hapd->iconf->ch_switch_vht_config, in hostapd_event_ch_switch()
1139 hapd->iconf->ch_switch_he_config, in hostapd_event_ch_switch()
1140 hapd->iconf->ch_switch_eht_config, offset, in hostapd_event_ch_switch()
1144 if (!hapd->iface->current_mode) { in hostapd_event_ch_switch()
1145 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, in hostapd_event_ch_switch()
1152 is_dfs0 = hostapd_is_dfs_required(hapd->iface); in hostapd_event_ch_switch()
1153 hapd->iface->freq = freq; in hostapd_event_ch_switch()
1155 channel = hostapd_hw_get_channel(hapd, freq); in hostapd_event_ch_switch()
1157 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, in hostapd_event_ch_switch()
1187 if (finished && hostapd_csa_update_hwmode(hapd->iface)) in hostapd_event_ch_switch()
1190 switch (hapd->iface->current_mode->mode) { in hostapd_event_ch_switch()
1212 hapd->iconf->channel = channel; in hostapd_event_ch_switch()
1213 hapd->iconf->ieee80211n = ht; in hostapd_event_ch_switch()
1215 hapd->iconf->ieee80211ac = 0; in hostapd_event_ch_switch()
1216 if (hapd->iconf->ch_switch_vht_config) { in hostapd_event_ch_switch()
1218 if (hapd->iconf->ch_switch_vht_config & in hostapd_event_ch_switch()
1220 hapd->iconf->ieee80211ac = 1; in hostapd_event_ch_switch()
1221 else if (hapd->iconf->ch_switch_vht_config & in hostapd_event_ch_switch()
1223 hapd->iconf->ieee80211ac = 0; in hostapd_event_ch_switch()
1225 if (hapd->iconf->ch_switch_he_config) { in hostapd_event_ch_switch()
1227 if (hapd->iconf->ch_switch_he_config & in hostapd_event_ch_switch()
1229 hapd->iconf->ieee80211ax = 1; in hostapd_event_ch_switch()
1230 if (hapd->iface->freq > 4000 && in hostapd_event_ch_switch()
1231 hapd->iface->freq < 5895) in hostapd_event_ch_switch()
1232 hapd->iconf->ieee80211ac = 1; in hostapd_event_ch_switch()
1234 else if (hapd->iconf->ch_switch_he_config & in hostapd_event_ch_switch()
1236 hapd->iconf->ieee80211ax = 0; in hostapd_event_ch_switch()
1239 if (hapd->iconf->ch_switch_eht_config) { in hostapd_event_ch_switch()
1241 if (hapd->iconf->ch_switch_eht_config & in hostapd_event_ch_switch()
1243 hapd->iconf->ieee80211be = 1; in hostapd_event_ch_switch()
1244 hapd->iconf->ieee80211ax = 1; in hostapd_event_ch_switch()
1245 if (!is_6ghz_freq(hapd->iface->freq) && in hostapd_event_ch_switch()
1246 hapd->iface->freq > 4000) in hostapd_event_ch_switch()
1247 hapd->iconf->ieee80211ac = 1; in hostapd_event_ch_switch()
1248 } else if (hapd->iconf->ch_switch_eht_config & in hostapd_event_ch_switch()
1250 hapd->iconf->ieee80211be = 0; in hostapd_event_ch_switch()
1253 hapd->iconf->ch_switch_vht_config = 0; in hostapd_event_ch_switch()
1254 hapd->iconf->ch_switch_he_config = 0; in hostapd_event_ch_switch()
1255 hapd->iconf->ch_switch_eht_config = 0; in hostapd_event_ch_switch()
1260 hapd->iconf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET; in hostapd_event_ch_switch()
1262 hapd->iconf->ht_capab &= ~HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET; in hostapd_event_ch_switch()
1264 hapd->iconf->secondary_channel = offset; in hostapd_event_ch_switch()
1268 hapd->iconf->op_class = op_class; in hostapd_event_ch_switch()
1269 hostapd_set_oper_chwidth(hapd->iconf, chwidth); in hostapd_event_ch_switch()
1270 hostapd_set_oper_centr_freq_seg0_idx(hapd->iconf, seg0_idx); in hostapd_event_ch_switch()
1271 hostapd_set_oper_centr_freq_seg1_idx(hapd->iconf, seg1_idx); in hostapd_event_ch_switch()
1273 hostapd_set_and_check_bw320_offset(hapd->iconf, 0); in hostapd_event_ch_switch()
1275 hapd->iconf->punct_bitmap = punct_bitmap; in hostapd_event_ch_switch()
1277 if (hapd->iconf->ieee80211ac) { in hostapd_event_ch_switch()
1278 hapd->iconf->vht_capab &= ~VHT_CAP_SUPP_CHAN_WIDTH_MASK; in hostapd_event_ch_switch()
1280 hapd->iconf->vht_capab |= in hostapd_event_ch_switch()
1283 hapd->iconf->vht_capab |= in hostapd_event_ch_switch()
1287 is_dfs = ieee80211_is_dfs(freq, hapd->iface->hw_features, in hostapd_event_ch_switch()
1288 hapd->iface->num_hw_features); in hostapd_event_ch_switch()
1290 wpa_msg(hapd->msg_ctx, MSG_INFO, in hostapd_event_ch_switch()
1299 if (hapd->csa_in_progress && in hostapd_event_ch_switch()
1300 freq == hapd->cs_freq_params.freq) { in hostapd_event_ch_switch()
1301 hostapd_cleanup_cs_params(hapd); in hostapd_event_ch_switch()
1302 ieee802_11_set_beacon(hapd); in hostapd_event_ch_switch()
1304 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_CSA_FINISHED in hostapd_event_ch_switch()
1306 } else if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) { in hostapd_event_ch_switch()
1309 hostapd_is_dfs_required(hapd->iface) <= 0 && in hostapd_event_ch_switch()
1310 hapd->iface->state != HAPD_IFACE_ENABLED) { in hostapd_event_ch_switch()
1312 hapd->iface->cac_started = 1; in hostapd_event_ch_switch()
1313 hostapd_setup_interface_complete(hapd->iface, 0); in hostapd_event_ch_switch()
1315 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_CSA_FINISHED in hostapd_event_ch_switch()
1318 hostapd_is_dfs_required(hapd->iface) && in hostapd_event_ch_switch()
1319 !hostapd_is_dfs_chan_available(hapd->iface) && in hostapd_event_ch_switch()
1320 !hapd->iface->cac_started) { in hostapd_event_ch_switch()
1321 hostapd_disable_iface(hapd->iface); in hostapd_event_ch_switch()
1322 hostapd_enable_iface(hapd->iface); in hostapd_event_ch_switch()
1325 for (i = 0; i < hapd->iface->num_bss; i++) in hostapd_event_ch_switch()
1326 hostapd_neighbor_set_own_report(hapd->iface->bss[i]); in hostapd_event_ch_switch()
1329 if (hapd->conf->ocv && in hostapd_event_ch_switch()
1330 !(hapd->iface->drv_flags2 & in hostapd_event_ch_switch()
1335 for (sta = hapd->sta_list; sta; sta = sta->next) { in hostapd_event_ch_switch()
1348 hapd, NULL); in hostapd_event_ch_switch()
1356 void hostapd_event_connect_failed_reason(struct hostapd_data *hapd, in hostapd_event_connect_failed_reason() argument
1361 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_REJECTED_MAX_STA MACSTR, in hostapd_event_connect_failed_reason()
1365 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_REJECTED_BLOCKED_STA MACSTR, in hostapd_event_connect_failed_reason()
1373 void hostapd_acs_channel_selected(struct hostapd_data *hapd, in hostapd_acs_channel_selected() argument
1382 hapd = hostapd_mld_get_link_bss(hapd, acs_res->link_id); in hostapd_acs_channel_selected()
1383 if (!hapd) { in hostapd_acs_channel_selected()
1392 if (hapd->iconf->channel) { in hostapd_acs_channel_selected()
1394 hapd->iconf->channel); in hostapd_acs_channel_selected()
1398 hapd->iface->freq = acs_res->pri_freq; in hostapd_acs_channel_selected()
1400 if (!hapd->iface->current_mode) { in hostapd_acs_channel_selected()
1401 for (i = 0; i < hapd->iface->num_hw_features; i++) { in hostapd_acs_channel_selected()
1403 &hapd->iface->hw_features[i]; in hostapd_acs_channel_selected()
1406 if (hapd->iface->freq > 0 && in hostapd_acs_channel_selected()
1408 hapd->iface->freq, in hostapd_acs_channel_selected()
1409 hapd->iface->hw_features, in hostapd_acs_channel_selected()
1410 hapd->iface->num_hw_features)) in hostapd_acs_channel_selected()
1412 hapd->iface->current_mode = mode; in hostapd_acs_channel_selected()
1416 if (!hapd->iface->current_mode) { in hostapd_acs_channel_selected()
1417 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, in hostapd_acs_channel_selected()
1426 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, in hostapd_acs_channel_selected()
1432 pri_chan = hw_get_channel_freq(hapd->iface->current_mode->mode, in hostapd_acs_channel_selected()
1434 hapd->iface->hw_features, in hostapd_acs_channel_selected()
1435 hapd->iface->num_hw_features); in hostapd_acs_channel_selected()
1444 hapd->iconf->channel = pri_chan->chan; in hostapd_acs_channel_selected()
1445 hapd->iconf->acs = 1; in hostapd_acs_channel_selected()
1448 hapd->iconf->secondary_channel = 0; in hostapd_acs_channel_selected()
1450 hapd->iconf->secondary_channel = -1; in hostapd_acs_channel_selected()
1452 hapd->iconf->secondary_channel = 1; in hostapd_acs_channel_selected()
1459 hapd->iconf->edmg_channel = acs_res->edmg_channel; in hostapd_acs_channel_selected()
1461 if (hapd->iface->conf->ieee80211ac || hapd->iface->conf->ieee80211ax) { in hostapd_acs_channel_selected()
1463 hostapd_set_oper_centr_freq_seg1_idx(hapd->iconf, 0); in hostapd_acs_channel_selected()
1464 hostapd_set_oper_centr_freq_seg0_idx(hapd->iconf, 0); in hostapd_acs_channel_selected()
1465 hostapd_set_oper_chwidth(hapd->iconf, CONF_OPER_CHWIDTH_USE_HT); in hostapd_acs_channel_selected()
1469 hapd->iconf, in hostapd_acs_channel_selected()
1473 hapd->iconf, acs_res->vht_seg0_center_ch); in hostapd_acs_channel_selected()
1476 hapd->iconf, CONF_OPER_CHWIDTH_80MHZ); in hostapd_acs_channel_selected()
1479 hapd->iconf, in hostapd_acs_channel_selected()
1482 hapd->iconf, in hostapd_acs_channel_selected()
1486 hostapd_set_oper_chwidth(hapd->iconf, in hostapd_acs_channel_selected()
1489 hapd->iconf, acs_res->vht_seg1_center_ch); in hostapd_acs_channel_selected()
1494 if (hapd->iface->conf->ieee80211be && acs_res->ch_width == 320) { in hostapd_acs_channel_selected()
1495 hostapd_set_oper_chwidth(hapd->iconf, CONF_OPER_CHWIDTH_320MHZ); in hostapd_acs_channel_selected()
1497 hapd->iconf, acs_res->vht_seg1_center_ch); in hostapd_acs_channel_selected()
1498 hostapd_set_oper_centr_freq_seg1_idx(hapd->iconf, 0); in hostapd_acs_channel_selected()
1501 if (hapd->iface->conf->ieee80211be && acs_res->puncture_bitmap) in hostapd_acs_channel_selected()
1502 hapd->iconf->punct_bitmap = acs_res->puncture_bitmap; in hostapd_acs_channel_selected()
1506 ret = hostapd_acs_completed(hapd->iface, err); in hostapd_acs_channel_selected()
1515 int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa, const u8 *da, in hostapd_probe_req_rx() argument
1526 for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++) { in hostapd_probe_req_rx()
1527 if (hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx, in hostapd_probe_req_rx()
1545 struct hostapd_data *hapd = ctx; in hostapd_notify_auth_ft_finish() local
1548 sta = ap_get_sta(hapd, dst); in hostapd_notify_auth_ft_finish()
1552 hostapd_logger(hapd, dst, HOSTAPD_MODULE_IEEE80211, in hostapd_notify_auth_ft_finish()
1556 hostapd_sta_auth(hapd, dst, auth_transaction, status, ies, ies_len); in hostapd_notify_auth_ft_finish()
1562 static void hostapd_notify_auth_fils_finish(struct hostapd_data *hapd, in hostapd_notify_auth_fils_finish() argument
1567 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in hostapd_notify_auth_fils_finish()
1572 mlme_authenticate_indication(hapd, sta); in hostapd_notify_auth_fils_finish()
1574 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in hostapd_notify_auth_fils_finish()
1579 hostapd_sta_auth(hapd, sta->addr, 2, resp, in hostapd_notify_auth_fils_finish()
1587 static void hostapd_notif_auth(struct hostapd_data *hapd, in hostapd_notif_auth() argument
1595 sta = ap_get_sta(hapd, rx_auth->peer); in hostapd_notif_auth()
1597 sta = ap_sta_add(hapd, rx_auth->peer); in hostapd_notif_auth()
1606 if (rx_auth->auth_type == WLAN_AUTH_FT && hapd->wpa_auth) { in hostapd_notif_auth()
1609 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth, in hostapd_notif_auth()
1620 hostapd_notify_auth_ft_finish, hapd); in hostapd_notif_auth()
1628 handle_auth_fils(hapd, sta, rx_auth->ies, rx_auth->ies_len, in hostapd_notif_auth()
1637 hostapd_sta_auth(hapd, rx_auth->peer, rx_auth->auth_transaction + 1, in hostapd_notif_auth()
1643 static void hostapd_action_rx(struct hostapd_data *hapd, in hostapd_action_rx() argument
1668 sta = ap_get_sta(hapd, mgmt->sa); in hostapd_action_rx()
1680 ieee802_11_sa_query_action(hapd, mgmt, drv_mgmt->frame_len); in hostapd_action_rx()
1685 ieee802_11_rx_wnm_action_ap(hapd, mgmt, drv_mgmt->frame_len); in hostapd_action_rx()
1690 if (mgmt->u.action.category == WLAN_ACTION_FST && hapd->iface->fst) { in hostapd_action_rx()
1691 fst_rx_action(hapd->iface->fst, mgmt, drv_mgmt->frame_len); in hostapd_action_rx()
1708 hostapd_dpp_rx_action(hapd, mgmt->sa, pos, end - pos, in hostapd_action_rx()
1725 hostapd_nan_usd_rx_sdf(hapd, mgmt->sa, drv_mgmt->freq, in hostapd_action_rx()
1737 switch_link_hapd(struct hostapd_data *hapd, int link_id) in switch_link_hapd() argument
1740 if (hapd->conf->mld_ap && link_id >= 0) { in switch_link_hapd()
1743 link_bss = hostapd_mld_get_link_bss(hapd, link_id); in switch_link_hapd()
1749 return hapd; in switch_link_hapd()
1754 switch_link_scan(struct hostapd_data *hapd, u64 scan_cookie) in switch_link_scan() argument
1757 if (hapd->conf->mld_ap && scan_cookie != 0) { in switch_link_scan()
1760 for (i = 0; i < hapd->iface->interfaces->count; i++) { in switch_link_scan()
1764 h = hapd->iface->interfaces->iface[i]; in switch_link_scan()
1766 if (!hostapd_is_ml_partner(hapd, h_hapd)) in switch_link_scan()
1777 return hapd; in switch_link_scan()
1795 struct hostapd_data *hapd; in get_hapd_bssid() local
1800 hapd = iface->bss[i]; in get_hapd_bssid()
1801 if (ether_addr_equal(bssid, hapd->own_addr)) in get_hapd_bssid()
1802 return hapd; in get_hapd_bssid()
1805 if (ether_addr_equal(bssid, hapd->own_addr) || in get_hapd_bssid()
1806 (hapd->conf->mld_ap && in get_hapd_bssid()
1807 ether_addr_equal(bssid, hapd->mld->mld_addr) && in get_hapd_bssid()
1808 link_id == hapd->mld_link_id)) in get_hapd_bssid()
1809 return hapd; in get_hapd_bssid()
1811 if (!hapd->conf->mld_ap) in get_hapd_bssid()
1814 for_each_mld_link(p_hapd, hapd) { in get_hapd_bssid()
1815 if (p_hapd == hapd) in get_hapd_bssid()
1830 static void hostapd_rx_from_unknown_sta(struct hostapd_data *hapd, in hostapd_rx_from_unknown_sta() argument
1834 hapd = get_hapd_bssid(hapd->iface, bssid, -1); in hostapd_rx_from_unknown_sta()
1835 if (hapd == NULL || hapd == HAPD_BROADCAST) in hostapd_rx_from_unknown_sta()
1838 ieee802_11_rx_from_unknown(hapd, addr, wds); in hostapd_rx_from_unknown_sta()
1842 static int hostapd_mgmt_rx(struct hostapd_data *hapd, struct rx_mgmt *rx_mgmt) in hostapd_mgmt_rx() argument
1851 hapd = rx_mgmt->ctx; in hostapd_mgmt_rx()
1852 hapd = switch_link_hapd(hapd, rx_mgmt->link_id); in hostapd_mgmt_rx()
1853 iface = hapd->iface; in hostapd_mgmt_rx()
1856 if (hapd->ext_mgmt_frame_handling) { in hostapd_mgmt_rx()
1863 wpa_msg(hapd->msg_ctx, MSG_INFO, "MGMT-RX %s", hex); in hostapd_mgmt_rx()
1875 hapd = get_hapd_bssid(iface, bssid, rx_mgmt->link_id); in hostapd_mgmt_rx()
1877 if (!hapd) { in hostapd_mgmt_rx()
1886 hapd = iface->bss[0]; in hostapd_mgmt_rx()
1896 if (hapd == HAPD_BROADCAST) { in hostapd_mgmt_rx()
1912 ret = ieee802_11_mgmt(hapd, rx_mgmt->frame, rx_mgmt->frame_len, in hostapd_mgmt_rx()
1921 static void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, const u8 *buf, in hostapd_mgmt_tx_cb() argument
1927 orig_hapd = hapd; in hostapd_mgmt_tx_cb()
1930 hapd = switch_link_hapd(hapd, link_id); in hostapd_mgmt_tx_cb()
1931 tmp_hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len), link_id); in hostapd_mgmt_tx_cb()
1933 hapd = tmp_hapd; in hostapd_mgmt_tx_cb()
1935 } else if (hapd->conf->mld_ap && in hostapd_mgmt_tx_cb()
1936 ether_addr_equal(hapd->mld->mld_addr, in hostapd_mgmt_tx_cb()
1944 if (hapd == HAPD_BROADCAST) { in hostapd_mgmt_tx_cb()
1948 hapd = get_hapd_bssid(orig_hapd->iface, hdr->addr2, link_id); in hostapd_mgmt_tx_cb()
1949 if (!hapd || hapd == HAPD_BROADCAST) in hostapd_mgmt_tx_cb()
1956 ieee802_11_mgmt_cb(hapd, buf, len, stype, ok); in hostapd_mgmt_tx_cb()
1962 static int hostapd_event_new_sta(struct hostapd_data *hapd, const u8 *addr) in hostapd_event_new_sta() argument
1964 struct sta_info *sta = ap_get_sta(hapd, addr); in hostapd_event_new_sta()
1971 sta = ap_sta_add(hapd, addr); in hostapd_event_new_sta()
1973 hostapd_new_assoc_sta(hapd, sta, 0); in hostapd_event_new_sta()
1987 struct hostapd_data *hapd; in hostapd_find_by_sta() local
1995 hapd = iface->bss[j]; in hostapd_find_by_sta()
1996 sta = ap_get_sta(hapd, src); in hostapd_find_by_sta()
2001 return hapd; in hostapd_find_by_sta()
2004 if (hapd->conf->mld_ap) { in hostapd_find_by_sta()
2007 for_each_mld_link(p_hapd, hapd) { in hostapd_find_by_sta()
2008 if (p_hapd == hapd) in hostapd_find_by_sta()
2032 static void hostapd_event_eapol_rx(struct hostapd_data *hapd, const u8 *src, in hostapd_event_eapol_rx()
2039 struct hostapd_data *hapd = ctx; in hostapd_event_eapol_rx() local
2041 struct hostapd_data *orig_hapd = hapd; in hostapd_event_eapol_rx()
2044 hapd = switch_link_hapd(hapd, link_id); in hostapd_event_eapol_rx()
2045 hapd = hostapd_find_by_sta(hapd->iface, src, true, NULL); in hostapd_event_eapol_rx()
2047 hapd = hostapd_find_by_sta(hapd->iface, src, false, NULL); in hostapd_event_eapol_rx()
2050 if (!hapd) { in hostapd_event_eapol_rx()
2058 hapd = orig_hapd; in hostapd_event_eapol_rx()
2061 ieee802_1x_receive(hapd, src, data, data_len, encrypted); in hostapd_event_eapol_rx()
2193 static void hostapd_event_iface_unavailable(struct hostapd_data *hapd) in hostapd_event_iface_unavailable() argument
2196 hapd->conf->iface); in hostapd_event_iface_unavailable()
2198 if (hapd->csa_in_progress) { in hostapd_event_iface_unavailable()
2200 hapd->conf->iface); in hostapd_event_iface_unavailable()
2201 hostapd_switch_channel_fallback(hapd->iface, in hostapd_event_iface_unavailable()
2202 &hapd->cs_freq_params); in hostapd_event_iface_unavailable()
2207 static void hostapd_event_dfs_radar_detected(struct hostapd_data *hapd, in hostapd_event_dfs_radar_detected() argument
2211 hostapd_dfs_radar_detected(hapd->iface, radar->freq, radar->ht_enabled, in hostapd_event_dfs_radar_detected()
2217 static void hostapd_event_dfs_pre_cac_expired(struct hostapd_data *hapd, in hostapd_event_dfs_pre_cac_expired() argument
2221 hostapd_dfs_pre_cac_expired(hapd->iface, radar->freq, radar->ht_enabled, in hostapd_event_dfs_pre_cac_expired()
2227 static void hostapd_event_dfs_cac_finished(struct hostapd_data *hapd, in hostapd_event_dfs_cac_finished() argument
2231 hostapd_dfs_complete_cac(hapd->iface, 1, radar->freq, radar->ht_enabled, in hostapd_event_dfs_cac_finished()
2237 static void hostapd_event_dfs_cac_aborted(struct hostapd_data *hapd, in hostapd_event_dfs_cac_aborted() argument
2241 hostapd_dfs_complete_cac(hapd->iface, 0, radar->freq, radar->ht_enabled, in hostapd_event_dfs_cac_aborted()
2247 static void hostapd_event_dfs_nop_finished(struct hostapd_data *hapd, in hostapd_event_dfs_nop_finished() argument
2251 hostapd_dfs_nop_finished(hapd->iface, radar->freq, radar->ht_enabled, in hostapd_event_dfs_nop_finished()
2257 static void hostapd_event_dfs_cac_started(struct hostapd_data *hapd, in hostapd_event_dfs_cac_started() argument
2261 hostapd_dfs_start_cac(hapd->iface, radar->freq, radar->ht_enabled, in hostapd_event_dfs_cac_started()
2269 static void hostapd_event_wds_sta_interface_status(struct hostapd_data *hapd, in hostapd_event_wds_sta_interface_status() argument
2274 struct sta_info *sta = ap_get_sta(hapd, addr); in hostapd_event_wds_sta_interface_status()
2284 wpa_msg(hapd->msg_ctx, MSG_INFO, "%sifname=%s sta_addr=" MACSTR, in hostapd_event_wds_sta_interface_status()
2292 static int hostapd_notif_update_dh_ie(struct hostapd_data *hapd, in hostapd_notif_update_dh_ie() argument
2300 if (!hapd || !hapd->wpa_auth) { in hostapd_notif_update_dh_ie()
2308 if (!(hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE)) { in hostapd_notif_update_dh_ie()
2319 status = owe_validate_request(hapd, peer, elems.rsn_ie, in hostapd_notif_update_dh_ie()
2325 sta = ap_get_sta(hapd, peer); in hostapd_notif_update_dh_ie()
2327 ap_sta_no_session_timeout(hapd, sta); in hostapd_notif_update_dh_ie()
2328 accounting_sta_stop(hapd, sta); in hostapd_notif_update_dh_ie()
2336 sta = ap_sta_add(hapd, peer); in hostapd_notif_update_dh_ie()
2347 u8 link_id = hapd->mld_link_id; in hostapd_notif_update_dh_ie()
2353 os_memcpy(info->links[link_id].local_addr, hapd->own_addr, in hostapd_notif_update_dh_ie()
2359 status = owe_process_rsn_ie(hapd, sta, elems.rsn_ie, in hostapd_notif_update_dh_ie()
2363 ap_free_sta(hapd, sta); in hostapd_notif_update_dh_ie()
2367 hostapd_drv_update_dh_ie(hapd, link_addr ? link_addr : peer, status, in hostapd_notif_update_dh_ie()
2375 static void hostapd_eapol_tx_status(struct hostapd_data *hapd, const u8 *dst, in hostapd_eapol_tx_status() argument
2381 hapd = switch_link_hapd(hapd, link_id); in hostapd_eapol_tx_status()
2382 hapd = hostapd_find_by_sta(hapd->iface, dst, false, &sta); in hostapd_eapol_tx_status()
2391 ieee802_1x_eapol_tx_status(hapd, sta, data, len, ack); in hostapd_eapol_tx_status()
2397 static void hostapd_event_color_change(struct hostapd_data *hapd, bool success) in hostapd_event_color_change() argument
2402 for (i = 0; i < hapd->iface->num_bss; i++) { in hostapd_event_color_change()
2403 bss = hapd->iface->bss[i]; in hostapd_event_color_change()
2408 hapd->iface->conf->he_op.he_bss_color = bss->cca_color; in hostapd_event_color_change()
2429 struct hostapd_data *hapd = ctx; in hostapd_event() local
2449 wpa_dbg(hapd->msg_ctx, level, "Event %s (%d) received", in hostapd_event()
2455 michael_mic_failure(hapd, data->michael_mic_failure.src, 1); in hostapd_event()
2460 hapd = switch_link_scan(hapd, in hostapd_event()
2463 if (hapd->iface->scan_cb) in hostapd_event()
2464 hapd->iface->scan_cb(hapd->iface); in hostapd_event()
2466 if (!hapd->iface->scan_cb && hapd->conf->mld_ap) { in hostapd_event()
2470 for (i = 0; i < hapd->iface->interfaces->count; i++) { in hostapd_event()
2472 hapd->iface->interfaces->iface[i]; in hostapd_event()
2475 if (hostapd_is_ml_partner(hapd, h_hapd) && in hostapd_event()
2483 hostapd_wps_button_pushed(hapd, NULL); in hostapd_event()
2489 hostapd_mgmt_tx_cb(hapd, data->tx_status.data, in hostapd_event()
2496 hostapd_tx_status(hapd, data->tx_status.dst, in hostapd_event()
2504 hostapd_eapol_tx_status(hapd, data->eapol_tx_status.dst, in hostapd_event()
2511 hostapd_client_poll_ok(hapd, data->client_poll.addr); in hostapd_event()
2514 hostapd_rx_from_unknown_sta(hapd, data->rx_from_unknown.bssid, in hostapd_event()
2523 hostapd_mgmt_rx(hapd, &data->rx_mgmt); in hostapd_event()
2525 hostapd_action_rx(hapd, &data->rx_mgmt); in hostapd_event()
2532 hostapd_probe_req_rx(hapd, data->rx_probe_req.sa, in hostapd_event()
2540 hostapd_event_new_sta(hapd, data->new_sta.addr); in hostapd_event()
2543 hostapd_event_eapol_rx(hapd, data->eapol_rx.src, in hostapd_event()
2554 hapd = hostapd_mld_get_link_bss( in hostapd_event()
2555 hapd, data->assoc_info.assoc_link_id); in hostapd_event()
2556 if (!hapd) { in hostapd_event()
2563 hostapd_notif_assoc(hapd, data->assoc_info.addr, in hostapd_event()
2573 sta = ap_get_sta(hapd, data->port_authorized.sta_addr); in hostapd_event()
2575 ap_sta_set_authorized(hapd, sta, 1); in hostapd_event()
2586 hapd = hostapd_mld_get_link_bss( in hostapd_event()
2587 hapd, data->update_dh.assoc_link_id); in hostapd_event()
2588 if (!hapd) { in hostapd_event()
2596 hostapd_notif_update_dh_ie(hapd, data->update_dh.peer, in hostapd_event()
2604 hostapd_notif_disassoc(hapd, data->disassoc_info.addr); in hostapd_event()
2608 hostapd_notif_disassoc(hapd, data->deauth_info.addr); in hostapd_event()
2613 hostapd_event_sta_low_ack(hapd, data->low_ack.addr); in hostapd_event()
2616 hostapd_notif_auth(hapd, &data->auth); in hostapd_event()
2624 hapd = hostapd_mld_get_link_bss( in hostapd_event()
2625 hapd, data->ch_switch.link_id); in hostapd_event()
2626 if (!hapd) { in hostapd_event()
2634 hostapd_event_ch_switch(hapd, data->ch_switch.freq, in hostapd_event()
2647 hapd, data->connect_failed_reason.addr, in hostapd_event()
2651 hostapd_event_get_survey(hapd->iface, &data->survey_results); in hostapd_event()
2655 hostapd_event_iface_unavailable(hapd); in hostapd_event()
2660 hapd = switch_link_hapd(hapd, data->dfs_event.link_id); in hostapd_event()
2661 hostapd_event_dfs_radar_detected(hapd, &data->dfs_event); in hostapd_event()
2666 hapd = switch_link_hapd(hapd, data->dfs_event.link_id); in hostapd_event()
2667 hostapd_event_dfs_pre_cac_expired(hapd, &data->dfs_event); in hostapd_event()
2672 hapd = switch_link_hapd(hapd, data->dfs_event.link_id); in hostapd_event()
2673 hostapd_event_dfs_cac_finished(hapd, &data->dfs_event); in hostapd_event()
2678 hapd = switch_link_hapd(hapd, data->dfs_event.link_id); in hostapd_event()
2679 hostapd_event_dfs_cac_aborted(hapd, &data->dfs_event); in hostapd_event()
2684 hapd = switch_link_hapd(hapd, data->dfs_event.link_id); in hostapd_event()
2685 hostapd_event_dfs_nop_finished(hapd, &data->dfs_event); in hostapd_event()
2693 hapd->iface, data->channel_list_changed.initiator); in hostapd_event()
2698 hapd = switch_link_hapd(hapd, data->dfs_event.link_id); in hostapd_event()
2699 hostapd_event_dfs_cac_started(hapd, &data->dfs_event); in hostapd_event()
2703 wpa_msg(hapd->msg_ctx, MSG_INFO, INTERFACE_ENABLED); in hostapd_event()
2704 if (hapd->disabled && hapd->started) { in hostapd_event()
2705 hapd->disabled = 0; in hostapd_event()
2710 if (hapd->wpa_auth) in hostapd_event()
2711 wpa_auth_reconfig_group_keys(hapd->wpa_auth); in hostapd_event()
2713 hostapd_reconfig_encryption(hapd); in hostapd_event()
2714 hapd->reenable_beacon = 1; in hostapd_event()
2715 ieee802_11_set_beacon(hapd); in hostapd_event()
2717 } else if (hapd->disabled && hapd->iface->cac_started) { in hostapd_event()
2719 hostapd_handle_dfs(hapd->iface); in hostapd_event()
2724 hostapd_free_stas(hapd); in hostapd_event()
2725 wpa_msg(hapd->msg_ctx, MSG_INFO, INTERFACE_DISABLED); in hostapd_event()
2726 hapd->disabled = 1; in hostapd_event()
2730 hostapd_acs_channel_selected(hapd, in hostapd_event()
2735 hostapd_event_sta_opmode_changed(hapd, data->sta_opmode.addr, in hostapd_event()
2742 hapd, data->wds_sta_interface.istatus, in hostapd_event()
2751 hapd = switch_link_hapd(hapd, in hostapd_event()
2754 hapd->conf->iface); in hostapd_event()
2755 hostapd_switch_color(hapd->iface->bss[0], in hostapd_event()
2759 hapd = switch_link_hapd(hapd, in hostapd_event()
2762 hapd->conf->iface); in hostapd_event()
2765 hapd = switch_link_hapd(hapd, in hostapd_event()
2768 hapd->conf->iface); in hostapd_event()
2769 hostapd_event_color_change(hapd, false); in hostapd_event()
2772 hapd = switch_link_hapd(hapd, in hostapd_event()
2775 hapd->conf->iface); in hostapd_event()
2776 hostapd_event_color_change(hapd, true); in hostapd_event()
2795 struct hostapd_data *hapd; in hostapd_event_global() local
2800 hapd = hostapd_get_iface(interfaces, data->interface_status.ifname); in hostapd_event_global()
2801 if (hapd && hapd->driver && hapd->driver->get_ifindex && in hostapd_event_global()
2802 hapd->drv_priv) { in hostapd_event_global()
2805 ifindex = hapd->driver->get_ifindex(hapd->drv_priv); in hostapd_event_global()
2807 wpa_dbg(hapd->msg_ctx, MSG_DEBUG, in hostapd_event_global()
2813 if (hapd) in hostapd_event_global()
2814 wpa_supplicant_event(hapd, event, data); in hostapd_event_global()