Lines Matching refs:sta

27 		    int (*cb)(struct hostapd_data *hapd, struct sta_info *sta,  in ap_for_each_sta()  argument
31 struct sta_info *sta; in ap_for_each_sta() local
33 for (sta = hapd->sta_list; sta; sta = sta->next) { in ap_for_each_sta()
34 if (cb(hapd, sta, ctx)) in ap_for_each_sta()
42 struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta) in ap_get_sta() argument
46 s = hapd->sta_hash[STA_HASH(sta)]; in ap_get_sta()
47 while (s != NULL && os_memcmp(s->addr, sta, 6) != 0) in ap_get_sta()
53 static void ap_sta_list_del(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_list_del() argument
57 if (hapd->sta_list == sta) { in ap_sta_list_del()
58 hapd->sta_list = sta->next; in ap_sta_list_del()
63 while (tmp != NULL && tmp->next != sta) in ap_sta_list_del()
67 "list.", MAC2STR(sta->addr)); in ap_sta_list_del()
69 tmp->next = sta->next; in ap_sta_list_del()
73 void ap_sta_hash_add(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_hash_add() argument
75 sta->hnext = hapd->sta_hash[STA_HASH(sta->addr)]; in ap_sta_hash_add()
76 hapd->sta_hash[STA_HASH(sta->addr)] = sta; in ap_sta_hash_add()
80 static void ap_sta_hash_del(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_hash_del() argument
84 s = hapd->sta_hash[STA_HASH(sta->addr)]; in ap_sta_hash_del()
86 if (os_memcmp(s->addr, sta->addr, 6) == 0) { in ap_sta_hash_del()
87 hapd->sta_hash[STA_HASH(sta->addr)] = s->hnext; in ap_sta_hash_del()
92 os_memcmp(s->hnext->addr, sta->addr, ETH_ALEN) != 0) in ap_sta_hash_del()
98 " from hash table", MAC2STR(sta->addr)); in ap_sta_hash_del()
101 void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta) in ap_free_sta() argument
103 ap_sta_hash_del(hapd, sta); in ap_free_sta()
104 ap_sta_list_del(hapd, sta); in ap_free_sta()
109 sae_clear_data(sta->sae); in ap_free_sta()
110 os_free(sta->sae); in ap_free_sta()
111 if (sta->lock) { in ap_free_sta()
112 os_semphr_give(sta->lock); in ap_free_sta()
113 os_mutex_delete(sta->lock); in ap_free_sta()
114 sta->lock = NULL; in ap_free_sta()
117 wpa_auth_sta_deinit(sta->wpa_sm); in ap_free_sta()
119 if (ap_sta_pending_delayed_1x_auth_fail_disconnect(hapd, sta)) in ap_free_sta()
120 eloop_cancel_timeout(ap_sta_delayed_1x_auth_fail_cb, hapd, sta); in ap_free_sta()
122 ieee802_1x_free_station(hapd, sta); in ap_free_sta()
124 wpabuf_free(sta->wps_ie); in ap_free_sta()
127 os_free(sta); in ap_free_sta()
133 struct sta_info *sta, *prev; in hostapd_free_stas() local
135 sta = hapd->sta_list; in hostapd_free_stas()
137 while (sta) { in hostapd_free_stas()
138 prev = sta; in hostapd_free_stas()
139 sta = sta->next; in hostapd_free_stas()
149 struct sta_info *sta; in ap_sta_add() local
151 sta = ap_get_sta(hapd, addr); in ap_sta_add()
152 if (sta) in ap_sta_add()
153 return sta; in ap_sta_add()
163 sta = os_zalloc(sizeof(struct sta_info)); in ap_sta_add()
164 if (sta == NULL) { in ap_sta_add()
170 os_memcpy(sta->addr, addr, ETH_ALEN); in ap_sta_add()
171 sta->next = hapd->sta_list; in ap_sta_add()
172 hapd->sta_list = sta; in ap_sta_add()
174 ap_sta_hash_add(hapd, sta); in ap_sta_add()
176 sta->sae_commit_processing = false; in ap_sta_add()
177 sta->remove_pending = false; in ap_sta_add()
178 sta->lock = os_semphr_create(1, 1); in ap_sta_add()
181 return sta; in ap_sta_add()
186 struct sta_info *sta = timeout_ctx; in ap_sta_delayed_1x_auth_fail_cb() local
191 " after EAP-Failure", MAC2STR(sta->addr)); in ap_sta_delayed_1x_auth_fail_cb()
194 esp_wifi_ap_deauth_internal(sta->addr, reason); in ap_sta_delayed_1x_auth_fail_cb()
199 struct sta_info *sta) in ap_sta_delayed_1x_auth_fail_disconnect() argument
203 " after EAP-Failure in 10 ms", MAC2STR(sta->addr)); in ap_sta_delayed_1x_auth_fail_disconnect()
210 eloop_cancel_timeout(ap_sta_delayed_1x_auth_fail_cb, hapd, sta); in ap_sta_delayed_1x_auth_fail_disconnect()
212 hapd, sta); in ap_sta_delayed_1x_auth_fail_disconnect()
219 struct sta_info *sta) in ap_sta_pending_delayed_1x_auth_fail_disconnect() argument
222 hapd, sta); in ap_sta_pending_delayed_1x_auth_fail_disconnect()