Lines Matching refs:sta

123 			   struct sta_info *sta,  in copy_supp_rates()  argument
128 MAC2STR(sta->addr)); in copy_supp_rates()
133 sizeof(sta->supported_rates)) { in copy_supp_rates()
136 " %d+%d", MAC2STR(sta->addr), elems->supp_rates_len, in copy_supp_rates()
141 sta->supported_rates_len = merge_byte_arrays( in copy_supp_rates()
142 sta->supported_rates, sizeof(sta->supported_rates), in copy_supp_rates()
173 struct sta_info *sta; in llid_in_use() local
176 for (sta = hapd->sta_list; sta; sta = sta->next) { in llid_in_use()
177 if (sta->my_lid == llid) in llid_in_use()
187 struct sta_info *sta) in mesh_mpm_init_link() argument
196 sta->my_lid = llid; in mesh_mpm_init_link()
197 sta->peer_lid = 0; in mesh_mpm_init_link()
198 sta->peer_aid = 0; in mesh_mpm_init_link()
204 sta->plink_state = PLINK_IDLE; in mesh_mpm_init_link()
209 struct sta_info *sta, in mesh_mpm_send_plink_action() argument
224 if (!sta) in mesh_mpm_send_plink_action()
291 wpabuf_put_le16(buf, sta->aid); in mesh_mpm_send_plink_action()
353 wpabuf_put_le16(buf, sta->my_lid); in mesh_mpm_send_plink_action()
355 wpabuf_put_le16(buf, sta->peer_lid); in mesh_mpm_send_plink_action()
359 if (sta->sae == NULL) { in mesh_mpm_send_plink_action()
363 mesh_rsn_get_pmkid(wpa_s->mesh_rsn, sta, in mesh_mpm_send_plink_action()
432 if (ampe && mesh_rsn_protect_frame(wpa_s->mesh_rsn, sta, cat, buf)) { in mesh_mpm_send_plink_action()
440 type, MAC2STR(sta->addr), sta->my_lid, sta->peer_lid); in mesh_mpm_send_plink_action()
442 sta->addr, wpa_s->own_addr, wpa_s->own_addr, in mesh_mpm_send_plink_action()
455 struct sta_info *sta, in wpa_mesh_set_plink_state() argument
462 MAC2STR(sta->addr), mplstate[sta->plink_state], in wpa_mesh_set_plink_state()
464 sta->plink_state = state; in wpa_mesh_set_plink_state()
467 params.addr = sta->addr; in wpa_mesh_set_plink_state()
469 params.peer_aid = sta->peer_aid; in wpa_mesh_set_plink_state()
476 ": %d", MAC2STR(sta->addr), ret); in wpa_mesh_set_plink_state()
482 struct sta_info *sta) in mesh_mpm_fsm_restart() argument
486 eloop_cancel_timeout(plink_timer, wpa_s, sta); in mesh_mpm_fsm_restart()
488 ap_free_sta(hapd, sta); in mesh_mpm_fsm_restart()
495 struct sta_info *sta = user_data; in plink_timer() local
500 switch (sta->plink_state) { in plink_timer()
504 if (sta->mpm_retries < conf->dot11MeshMaxRetries) { in plink_timer()
508 plink_timer, wpa_s, sta); in plink_timer()
509 mesh_mpm_send_plink_action(wpa_s, sta, PLINK_OPEN, 0); in plink_timer()
510 sta->mpm_retries++; in plink_timer()
520 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING); in plink_timer()
523 plink_timer, wpa_s, sta); in plink_timer()
524 mesh_mpm_send_plink_action(wpa_s, sta, PLINK_CLOSE, reason); in plink_timer()
529 if (sta->mesh_sae_pmksa_caching) { in plink_timer()
532 MAC2STR(sta->addr)); in plink_timer()
533 wpa_auth_pmksa_remove(hapd->wpa_auth, sta->addr); in plink_timer()
535 mesh_mpm_fsm_restart(wpa_s, sta); in plink_timer()
545 mesh_mpm_plink_open(struct wpa_supplicant *wpa_s, struct sta_info *sta, in mesh_mpm_plink_open() argument
550 eloop_cancel_timeout(plink_timer, wpa_s, sta); in mesh_mpm_plink_open()
553 plink_timer, wpa_s, sta); in mesh_mpm_plink_open()
554 mesh_mpm_send_plink_action(wpa_s, sta, PLINK_OPEN, 0); in mesh_mpm_plink_open()
555 wpa_mesh_set_plink_state(wpa_s, sta, next_state); in mesh_mpm_plink_open()
559 static int mesh_mpm_plink_close(struct hostapd_data *hapd, struct sta_info *sta, in mesh_mpm_plink_close() argument
565 if (sta) { in mesh_mpm_plink_close()
566 if (sta->plink_state == PLINK_ESTAB) { in mesh_mpm_plink_close()
569 wpa_s, sta->addr, WLAN_REASON_UNSPECIFIED); in mesh_mpm_plink_close()
571 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING); in mesh_mpm_plink_close()
572 mesh_mpm_send_plink_action(wpa_s, sta, PLINK_CLOSE, reason); in mesh_mpm_plink_close()
574 MAC2STR(sta->addr)); in mesh_mpm_plink_close()
575 eloop_cancel_timeout(plink_timer, wpa_s, sta); in mesh_mpm_plink_close()
576 eloop_cancel_timeout(mesh_auth_timer, wpa_s, sta); in mesh_mpm_plink_close()
587 struct sta_info *sta; in mesh_mpm_close_peer() local
595 sta = ap_get_sta(hapd, addr); in mesh_mpm_close_peer()
596 if (!sta) { in mesh_mpm_close_peer()
601 return mesh_mpm_plink_close(hapd, sta, wpa_s) == 0 ? 0 : -1; in mesh_mpm_close_peer()
619 struct sta_info *sta; in mesh_mpm_connect_peer() local
636 sta = ap_get_sta(hapd, addr); in mesh_mpm_connect_peer()
637 if (!sta) { in mesh_mpm_connect_peer()
642 if ((PLINK_OPN_SNT <= sta->plink_state && in mesh_mpm_connect_peer()
643 sta->plink_state <= PLINK_ESTAB) || in mesh_mpm_connect_peer()
644 (sta->sae && sta->sae->state > SAE_NOTHING)) { in mesh_mpm_connect_peer()
651 mesh_mpm_plink_open(wpa_s, sta, PLINK_OPN_SNT); in mesh_mpm_connect_peer()
653 mesh_rsn_auth_sae_sta(wpa_s, sta); in mesh_mpm_connect_peer()
682 struct sta_info *sta; in mesh_mpm_auth_peer() local
685 sta = ap_get_sta(data, addr); in mesh_mpm_auth_peer()
686 if (!sta) { in mesh_mpm_auth_peer()
693 sta->flags |= WLAN_STA_AUTH; in mesh_mpm_auth_peer()
695 mesh_rsn_init_ampe_sta(wpa_s, sta); in mesh_mpm_auth_peer()
698 params.addr = sta->addr; in mesh_mpm_auth_peer()
704 MAC2STR(sta->addr)); in mesh_mpm_auth_peer()
709 MAC2STR(sta->addr), ret); in mesh_mpm_auth_peer()
712 if (!sta->my_lid) in mesh_mpm_auth_peer()
713 mesh_mpm_init_link(wpa_s, sta); in mesh_mpm_auth_peer()
715 mesh_mpm_plink_open(wpa_s, sta, PLINK_OPN_SNT); in mesh_mpm_auth_peer()
731 struct sta_info *sta; in mesh_mpm_add_peer() local
743 sta = ap_get_sta(data, addr); in mesh_mpm_add_peer()
744 if (sta) in mesh_mpm_add_peer()
747 sta = ap_sta_add(data, addr); in mesh_mpm_add_peer()
748 if (!sta) in mesh_mpm_add_peer()
752 sta->flags |= WLAN_STA_WMM; in mesh_mpm_add_peer()
755 if (copy_supp_rates(wpa_s, sta, elems)) { in mesh_mpm_add_peer()
756 ap_free_sta(data, sta); in mesh_mpm_add_peer()
760 if (!sta->my_lid) in mesh_mpm_add_peer()
761 mesh_mpm_init_link(wpa_s, sta); in mesh_mpm_add_peer()
763 copy_sta_ht_capab(data, sta, elems->ht_capabilities); in mesh_mpm_add_peer()
768 sta->ht_capabilities) { in mesh_mpm_add_peer()
771 MAC2STR(sta->addr)); in mesh_mpm_add_peer()
772 set_disable_ht40(sta->ht_capabilities, 1); in mesh_mpm_add_peer()
775 if (update_ht_state(data, sta) > 0) in mesh_mpm_add_peer()
779 copy_sta_vht_capab(data, sta, elems->vht_capabilities); in mesh_mpm_add_peer()
780 copy_sta_vht_oper(data, sta, elems->vht_operation); in mesh_mpm_add_peer()
781 set_sta_vht_opmode(data, sta, elems->opmode_notif); in mesh_mpm_add_peer()
785 copy_sta_he_capab(data, sta, IEEE80211_MODE_MESH, in mesh_mpm_add_peer()
787 copy_sta_he_6ghz_capab(data, sta, elems->he_6ghz_band_cap); in mesh_mpm_add_peer()
790 copy_sta_eht_capab(data, sta, IEEE80211_MODE_MESH, in mesh_mpm_add_peer()
797 if (hostapd_get_aid(data, sta) < 0) { in mesh_mpm_add_peer()
799 ap_free_sta(data, sta); in mesh_mpm_add_peer()
805 params.supp_rates = sta->supported_rates; in mesh_mpm_add_peer()
806 params.supp_rates_len = sta->supported_rates_len; in mesh_mpm_add_peer()
808 params.plink_state = sta->plink_state; in mesh_mpm_add_peer()
809 params.aid = sta->aid; in mesh_mpm_add_peer()
810 params.peer_aid = sta->peer_aid; in mesh_mpm_add_peer()
812 params.ht_capabilities = sta->ht_capabilities; in mesh_mpm_add_peer()
813 params.vht_capabilities = sta->vht_capabilities; in mesh_mpm_add_peer()
814 params.he_capab = sta->he_capab; in mesh_mpm_add_peer()
815 params.he_capab_len = sta->he_capab_len; in mesh_mpm_add_peer()
816 params.he_6ghz_capab = sta->he_6ghz_capab; in mesh_mpm_add_peer()
817 params.eht_capab = sta->eht_capab; in mesh_mpm_add_peer()
818 params.eht_capab_len = sta->eht_capab_len; in mesh_mpm_add_peer()
826 sta->flags |= WLAN_STA_MFP; in mesh_mpm_add_peer()
835 ap_free_sta(data, sta); in mesh_mpm_add_peer()
839 return sta; in mesh_mpm_add_peer()
848 struct sta_info *sta; in wpa_mesh_new_mesh_peer() local
851 sta = mesh_mpm_add_peer(wpa_s, addr, elems); in wpa_mesh_new_mesh_peer()
852 if (!sta) in wpa_mesh_new_mesh_peer()
887 if (sta->plink_state < PLINK_OPN_SNT || in wpa_mesh_new_mesh_peer()
888 sta->plink_state > PLINK_ESTAB) in wpa_mesh_new_mesh_peer()
889 mesh_mpm_plink_open(wpa_s, sta, PLINK_OPN_SNT); in wpa_mesh_new_mesh_peer()
891 mesh_rsn_auth_sae_sta(wpa_s, sta); in wpa_mesh_new_mesh_peer()
909 struct sta_info *sta) in mesh_mpm_plink_estab() argument
916 MAC2STR(sta->addr)); in mesh_mpm_plink_estab()
919 wpa_hexdump_key(MSG_DEBUG, "mesh: MTK", sta->mtk, sta->mtk_len); in mesh_mpm_plink_estab()
922 sta->addr, 0, 0, seq, sizeof(seq), in mesh_mpm_plink_estab()
923 sta->mtk, sta->mtk_len, in mesh_mpm_plink_estab()
927 sta->mgtk_rsc, sizeof(sta->mgtk_rsc)); in mesh_mpm_plink_estab()
929 sta->mgtk, sta->mgtk_len); in mesh_mpm_plink_estab()
932 sta->addr, sta->mgtk_key_id, 0, in mesh_mpm_plink_estab()
933 sta->mgtk_rsc, sizeof(sta->mgtk_rsc), in mesh_mpm_plink_estab()
934 sta->mgtk, sta->mgtk_len, in mesh_mpm_plink_estab()
937 if (sta->igtk_len) { in mesh_mpm_plink_estab()
939 sta->igtk_rsc, sizeof(sta->igtk_rsc)); in mesh_mpm_plink_estab()
941 sta->igtk, sta->igtk_len); in mesh_mpm_plink_estab()
945 sta->addr, sta->igtk_key_id, 0, in mesh_mpm_plink_estab()
946 sta->igtk_rsc, sizeof(sta->igtk_rsc), in mesh_mpm_plink_estab()
947 sta->igtk, sta->igtk_len, in mesh_mpm_plink_estab()
952 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_ESTAB); in mesh_mpm_plink_estab()
955 sta->flags |= WLAN_STA_ASSOC; in mesh_mpm_plink_estab()
956 sta->mesh_sae_pmksa_caching = 0; in mesh_mpm_plink_estab()
960 eloop_cancel_timeout(plink_timer, wpa_s, sta); in mesh_mpm_plink_estab()
962 wpas_notify_mesh_peer_connected(wpa_s, sta->addr); in mesh_mpm_plink_estab()
966 static void mesh_mpm_fsm(struct wpa_supplicant *wpa_s, struct sta_info *sta, in mesh_mpm_fsm() argument
973 MAC2STR(sta->addr), mplstate[sta->plink_state], in mesh_mpm_fsm()
976 switch (sta->plink_state) { in mesh_mpm_fsm()
980 mesh_mpm_fsm_restart(wpa_s, sta); in mesh_mpm_fsm()
983 mesh_mpm_plink_open(wpa_s, sta, PLINK_OPN_RCVD); in mesh_mpm_fsm()
984 mesh_mpm_send_plink_action(wpa_s, sta, PLINK_CONFIRM, in mesh_mpm_fsm()
988 mesh_mpm_send_plink_action(wpa_s, sta, in mesh_mpm_fsm()
1003 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING); in mesh_mpm_fsm()
1009 plink_timer, wpa_s, sta); in mesh_mpm_fsm()
1010 mesh_mpm_send_plink_action(wpa_s, sta, in mesh_mpm_fsm()
1015 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_OPN_RCVD); in mesh_mpm_fsm()
1016 mesh_mpm_send_plink_action(wpa_s, sta, in mesh_mpm_fsm()
1020 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_CNF_RCVD); in mesh_mpm_fsm()
1021 eloop_cancel_timeout(plink_timer, wpa_s, sta); in mesh_mpm_fsm()
1025 plink_timer, wpa_s, sta); in mesh_mpm_fsm()
1039 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING); in mesh_mpm_fsm()
1045 plink_timer, wpa_s, sta); in mesh_mpm_fsm()
1046 sta->mpm_close_reason = reason; in mesh_mpm_fsm()
1047 mesh_mpm_send_plink_action(wpa_s, sta, in mesh_mpm_fsm()
1051 mesh_mpm_send_plink_action(wpa_s, sta, in mesh_mpm_fsm()
1056 mesh_rsn_derive_mtk(wpa_s, sta); in mesh_mpm_fsm()
1057 mesh_mpm_plink_estab(wpa_s, sta); in mesh_mpm_fsm()
1071 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING); in mesh_mpm_fsm()
1077 plink_timer, wpa_s, sta); in mesh_mpm_fsm()
1078 sta->mpm_close_reason = reason; in mesh_mpm_fsm()
1079 mesh_mpm_send_plink_action(wpa_s, sta, in mesh_mpm_fsm()
1084 mesh_rsn_derive_mtk(wpa_s, sta); in mesh_mpm_fsm()
1085 mesh_mpm_plink_estab(wpa_s, sta); in mesh_mpm_fsm()
1086 mesh_mpm_send_plink_action(wpa_s, sta, in mesh_mpm_fsm()
1098 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING); in mesh_mpm_fsm()
1105 plink_timer, wpa_s, sta); in mesh_mpm_fsm()
1106 sta->mpm_close_reason = reason; in mesh_mpm_fsm()
1110 MAC2STR(sta->addr), reason); in mesh_mpm_fsm()
1112 wpas_notify_mesh_peer_disconnected(wpa_s, sta->addr, in mesh_mpm_fsm()
1117 mesh_mpm_send_plink_action(wpa_s, sta, in mesh_mpm_fsm()
1121 mesh_mpm_send_plink_action(wpa_s, sta, in mesh_mpm_fsm()
1131 mesh_mpm_fsm_restart(wpa_s, sta); in mesh_mpm_fsm()
1137 reason = sta->mpm_close_reason; in mesh_mpm_fsm()
1138 mesh_mpm_send_plink_action(wpa_s, sta, in mesh_mpm_fsm()
1148 mplevent[event], mplstate[sta->plink_state]); in mesh_mpm_fsm()
1160 struct sta_info *sta; in mesh_mpm_action_rx() local
1248 sta = ap_get_sta(hapd, mgmt->sa); in mesh_mpm_action_rx()
1254 if (!sta && action_field == PLINK_OPEN && in mesh_mpm_action_rx()
1257 sta = mesh_mpm_add_peer(wpa_s, mgmt->sa, &elems); in mesh_mpm_action_rx()
1259 if (!sta) { in mesh_mpm_action_rx()
1266 if (sta->sae && sta->sae->state != SAE_ACCEPTED) { in mesh_mpm_action_rx()
1272 if (!sta->my_lid) in mesh_mpm_action_rx()
1273 mesh_mpm_init_link(wpa_s, sta); in mesh_mpm_action_rx()
1278 res = mesh_rsn_process_ampe(wpa_s, sta, &elems, in mesh_mpm_action_rx()
1288 mesh_mpm_fsm(wpa_s, sta, OPN_RJCT, in mesh_mpm_action_rx()
1296 struct wpa_state_machine *sm = sta->wpa_sm; in mesh_mpm_action_rx()
1317 wpa_auth_uses_ocv(sta->wpa_sm)) { in mesh_mpm_action_rx()
1329 sta, channel_width_to_int(ci.chanwidth), in mesh_mpm_action_rx()
1345 if (sta->plink_state == PLINK_BLOCKED) { in mesh_mpm_action_rx()
1359 } else if (sta->peer_lid && sta->peer_lid != plid) { in mesh_mpm_action_rx()
1362 sta->peer_lid, plid); in mesh_mpm_action_rx()
1365 sta->peer_lid = plid; in mesh_mpm_action_rx()
1376 } else if (sta->my_lid != llid || in mesh_mpm_action_rx()
1377 (sta->peer_lid && sta->peer_lid != plid)) { in mesh_mpm_action_rx()
1380 sta->my_lid, llid, sta->peer_lid, plid); in mesh_mpm_action_rx()
1383 if (!sta->peer_lid) in mesh_mpm_action_rx()
1384 sta->peer_lid = plid; in mesh_mpm_action_rx()
1385 sta->peer_aid = aid; in mesh_mpm_action_rx()
1390 if (sta->plink_state == PLINK_ESTAB) in mesh_mpm_action_rx()
1401 else if (sta->peer_lid != plid) { in mesh_mpm_action_rx()
1404 sta->peer_lid, plid); in mesh_mpm_action_rx()
1406 } else if (peer_mgmt_ie.plid && sta->my_lid != llid) { in mesh_mpm_action_rx()
1409 sta->my_lid, llid); in mesh_mpm_action_rx()
1423 mesh_mpm_fsm(wpa_s, sta, event, reason); in mesh_mpm_action_rx()
1428 void mesh_mpm_free_sta(struct hostapd_data *hapd, struct sta_info *sta) in mesh_mpm_free_sta() argument
1432 if (sta->plink_state == PLINK_ESTAB) { in mesh_mpm_free_sta()
1435 wpa_s, sta->addr, WLAN_REASON_UNSPECIFIED); in mesh_mpm_free_sta()
1437 eloop_cancel_timeout(plink_timer, ELOOP_ALL_CTX, sta); in mesh_mpm_free_sta()
1438 eloop_cancel_timeout(mesh_auth_timer, ELOOP_ALL_CTX, sta); in mesh_mpm_free_sta()