Home | History | Annotate | Download | only in ap

Lines Matching defs:hapd

40 int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
70 hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
99 sta = ap_get_sta(hapd, addr);
101 ap_sta_no_session_timeout(hapd, sta);
102 accounting_sta_stop(hapd, sta);
110 sta = ap_sta_add(hapd, addr);
112 hostapd_drv_sta_disassoc(hapd, addr,
126 if (hapd->iface->drv_max_acl_mac_addrs == 0 &&
127 hostapd_check_acl(hapd, addr, NULL) != HOSTAPD_ACL_ACCEPT) {
147 (hapd->iface->conf->ht_capab &
155 ht40_intolerant_add(hapd->iface, sta);
178 if (hapd->iface->fst)
184 mbo_ap_check_sta_assoc(hapd, sta, &elems);
189 if (hapd->conf->wpa) {
192 if (hapd->conf->wps_state) {
204 if (hapd->conf->wps_state && ie[0] == 0xdd && ie[1] >= 4 &&
224 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth,
232 res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm,
268 ap_check_sa_query_timeout(hapd, sta);
279 ap_sta_start_sa_query(hapd, sta);
283 p = hostapd_eid_assoc_comeback_time(hapd, sta, p);
285 hostapd_sta_assoc(hapd, addr, reassoc, status, buf,
311 } else if (hapd->conf->wps_state) {
340 } else if (hapd->conf->osen) {
343 hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
351 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth,
358 if (wpa_validate_osen(hapd->wpa_auth, sta->wpa_sm,
365 if (hapd->conf->mbo_enabled && (hapd->conf->wpa & 2) &&
367 hapd->conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) {
382 hostapd_sta_assoc(hapd, addr, reassoc, status, buf, p - buf);
385 ap_sta_set_authorized(hapd, sta, 1);
396 hostapd_set_sta_flags(hapd, sta);
403 hostapd_new_assoc_sta(hapd, sta, !new_assoc);
409 p2p_group_notif_assoc(hapd->p2p_group, sta->addr,
418 hostapd_sta_assoc(hapd, addr, reassoc, status, buf, p - buf);
420 hostapd_drv_sta_disassoc(hapd, sta->addr, reason);
421 ap_free_sta(hapd, sta);
426 void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr)
443 hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
446 sta = ap_get_sta(hapd, addr);
454 ap_sta_set_authorized(hapd, sta, 0);
459 ap_free_sta(hapd, sta);
463 void hostapd_event_sta_low_ack(struct hostapd_data *hapd, const u8 *addr)
465 struct sta_info *sta = ap_get_sta(hapd, addr);
467 if (!sta || !hapd->conf->disassoc_low_ack)
470 hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
473 hostapd_drv_sta_disassoc(hapd, addr, WLAN_REASON_DISASSOC_LOW_ACK);
474 ap_sta_disassociate(hapd, sta, WLAN_REASON_DISASSOC_LOW_ACK);
478 void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
485 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
491 hapd->iface->freq = freq;
493 channel = hostapd_hw_get_channel(hapd, freq);
495 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
519 switch (hapd->iface->current_mode->mode) {
532 hapd->iconf->channel = channel;
533 hapd->iconf->ieee80211n = ht;
535 hapd->iconf->ieee80211ac = 0;
536 hapd->iconf->secondary_channel = offset;
537 hapd->iconf->vht_oper_chwidth = chwidth;
538 hapd->iconf->vht_oper_centr_freq_seg0_idx = seg0_idx;
539 hapd->iconf->vht_oper_centr_freq_seg1_idx = seg1_idx;
543 if (hapd->csa_in_progress &&
544 freq == hapd->cs_freq_params.freq) {
545 hostapd_cleanup_cs_params(hapd);
546 ieee802_11_set_beacon(hapd);
548 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_CSA_FINISHED
550 } else if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) {
551 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_CSA_FINISHED
558 void hostapd_event_connect_failed_reason(struct hostapd_data *hapd,
563 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_REJECTED_MAX_STA MACSTR,
567 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_REJECTED_BLOCKED_STA MACSTR,
575 void hostapd_acs_channel_selected(struct hostapd_data *hapd,
581 if (hapd->iconf->channel) {
583 hapd->iconf->channel);
587 if (!hapd->iface->current_mode) {
588 for (i = 0; i < hapd->iface->num_hw_features; i++) {
590 &hapd
593 hapd->iface->current_mode = mode;
597 if (!hapd->iface->current_mode) {
598 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
606 hapd->iface->freq = hostapd_hw_get_freq(hapd, acs_res->pri_channel);
609 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
616 hapd->iconf->channel = acs_res->pri_channel;
617 hapd->iconf->acs = 1;
620 hapd->iconf->secondary_channel = 0;
622 hapd->iconf->secondary_channel = -1;
624 hapd->iconf->secondary_channel = 1;
631 if (hapd->iface->conf->ieee80211ac) {
633 hapd->iconf->vht_oper_centr_freq_seg1_idx = 0;
634 hapd->iconf->vht_oper_centr_freq_seg0_idx = 0;
635 hapd->iconf->vht_oper_chwidth = VHT_CHANWIDTH_USE_HT;
637 hapd->iconf->vht_oper_centr_freq_seg0_idx =
639 hapd->iconf->vht_oper_chwidth = VHT_CHANWIDTH_80MHZ;
642 hapd->iconf->vht_oper_centr_freq_seg0_idx =
644 hapd->iconf->vht_oper_chwidth =
647 hapd->iconf->vht_oper_centr_freq_seg0_idx =
649 hapd->iconf->vht_oper_centr_freq_seg1_idx =
651 hapd->iconf->vht_oper_chwidth =
658 ret = hostapd_acs_completed(hapd->iface, err);
667 int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa, const u8 *da,
678 for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++) {
679 if (hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,
698 struct hostapd_data *hapd = ctx;
701 sta = ap_get_sta(hapd, dst);
705 hostapd_logger(hapd, dst, HOSTAPD_MODULE_IEEE80211,
709 hostapd_sta_auth(hapd, dst, auth_transaction, status, ies, ies_len);
714 static void hostapd_notif_auth(struct hostapd_data *hapd,
722 sta = ap_get_sta(hapd, rx_auth->peer);
724 sta = ap_sta_add(hapd, rx_auth->peer);
733 if (rx_auth->auth_type == WLAN_AUTH_FT && hapd->wpa_auth) {
736 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth,
747 hostapd_notify_auth_ft_finish, hapd);
752 hostapd_sta_auth(hapd, rx_auth->peer, rx_auth->auth_transaction + 1,
757 static void hostapd_action_rx(struct hostapd_data *hapd,
778 sta = ap_get_sta(hapd, mgmt->sa);
793 hapd, mgmt->sa,
800 ieee802_11_rx_wnm_action_ap(hapd, mgmt, drv_mgmt->frame_len);
804 if (mgmt->u.action.category == WLAN_ACTION_FST && hapd->iface->fst) {
805 fst_rx_action(hapd->iface->fst, mgmt, drv_mgmt->frame_len);
837 static void hostapd_rx_from_unknown_sta(struct hostapd_data *hapd,
841 hapd = get_hapd_bssid(hapd->iface, bssid);
842 if (hapd == NULL || hapd == HAPD_BROADCAST)
845 ieee802_11_rx_from_unknown(hapd, addr, wds);
849 static int hostapd_mgmt_rx(struct hostapd_data *hapd, struct rx_mgmt *rx_mgmt)
851 struct hostapd_iface *iface = hapd->iface;
858 if (hapd->ext_mgmt_frame_handling) {
865 wpa_msg(hapd->msg_ctx, MSG_INFO, "MGMT-RX %s", hex);
877 hapd = get_hapd_bssid(iface, bssid);
878 if (hapd == NULL) {
887 hapd = iface->bss[0];
896 if (hapd == HAPD_BROADCAST) {
912 ret = ieee802_11_mgmt(hapd, rx_mgmt->frame, rx_mgmt->frame_len,
921 static void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, const u8 *buf,
925 struct hostapd_data *orig_hapd = hapd;
928 hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len));
929 if (!hapd)
931 if (hapd == HAPD_BROADCAST) {
935 hapd = get_hapd_bssid(orig_hapd->iface, hdr->addr2);
936 if (!hapd || hapd == HAPD_BROADCAST)
943 ieee802_11_mgmt_cb(hapd, buf, len, stype, ok);
949 static int hostapd_event_new_sta(struct hostapd_data *hapd, const u8 *addr)
951 struct sta_info *sta = ap_get_sta(hapd, addr);
958 sta = ap_sta_add(hapd, addr);
960 hostapd_new_assoc_sta(hapd, sta, 0);
971 static void hostapd_event_eapol_rx(struct hostapd_data *hapd, const u8 *src,
974 struct hostapd_iface *iface = hapd->iface;
981 hapd = iface->bss[j];
986 ieee802_1x_receive(hapd, src, data, data_len);
1100 static void hostapd_event_iface_unavailable(struct hostapd_data *hapd)
1103 hapd->conf->iface);
1105 if (hapd->csa_in_progress) {
1107 hapd->conf->iface);
1108 hostapd_switch_channel_fallback(hapd->iface,
1109 &hapd->cs_freq_params);
1114 static void hostapd_event_dfs_radar_detected(struct hostapd_data *hapd,
1118 hostapd_dfs_radar_detected(hapd->iface, radar->freq, radar->ht_enabled,
1124 static void hostapd_event_dfs_cac_finished(struct hostapd_data *hapd,
1128 hostapd_dfs_complete_cac(hapd->iface, 1, radar->freq, radar->ht_enabled,
1134 static void hostapd_event_dfs_cac_aborted(struct hostapd_data *hapd,
1138 hostapd_dfs_complete_cac(hapd->iface, 0, radar->freq, radar->ht_enabled,
1144 static void hostapd_event_dfs_nop_finished(struct hostapd_data *hapd,
1148 hostapd_dfs_nop_finished(hapd->iface, radar->freq, radar->ht_enabled,
1154 static void hostapd_event_dfs_cac_started(struct hostapd_data *hapd,
1158 hostapd_dfs_start_cac(hapd->iface, radar->freq, radar->ht_enabled,
1169 struct hostapd_data *hapd = ctx;
1188 wpa_dbg(hapd->msg_ctx, level, "Event %s (%d) received",
1194 michael_mic_failure(hapd, data->michael_mic_failure.src, 1);
1197 if (hapd->iface->scan_cb)
1198 hapd->iface->scan_cb(hapd->iface);
1201 hostapd_wps_button_pushed(hapd, NULL);
1207 hostapd_mgmt_tx_cb(hapd, data->tx_status.data,
1213 hostapd_tx_status(hapd
1221 hostapd_eapol_tx_status(hapd, data->eapol_tx_status.dst,
1227 hostapd_client_poll_ok(hapd, data->client_poll.addr);
1230 hostapd_rx_from_unknown_sta(hapd, data->rx_from_unknown.bssid,
1239 if (hostapd_mgmt_rx(hapd, &data->rx_mgmt) > 0)
1242 hostapd_action_rx(hapd, &data->rx_mgmt);
1248 hostapd_probe_req_rx(hapd, data->rx_probe_req.sa,
1256 hostapd_event_new_sta(hapd, data->new_sta.addr);
1259 hostapd_event_eapol_rx(hapd, data->eapol_rx.src,
1266 hostapd_notif_assoc(hapd, data->assoc_info.addr,
1273 hostapd_notif_disassoc(hapd, data->disassoc_info.addr);
1277 hostapd_notif_disassoc(hapd, data->deauth_info.addr);
1282 hostapd_event_sta_low_ack(hapd, data->low_ack.addr);
1285 hostapd_notif_auth(hapd, &data->auth);
1290 hostapd_event_ch_switch(hapd, data->ch_switch.freq,
1301 hapd, data->connect_failed_reason.addr,
1305 hostapd_event_get_survey(hapd->iface, &data->survey_results);
1309 hostapd_event_iface_unavailable(hapd);
1314 hostapd_event_dfs_radar_detected(hapd, &data->dfs_event);
1319 hostapd_event_dfs_cac_finished(hapd, &data->dfs_event);
1324 hostapd_event_dfs_cac_aborted(hapd, &data->dfs_event);
1329 hostapd_event_dfs_nop_finished(hapd, &data->dfs_event);
1335 /* hostapd_get_hw_features(hapd->iface); */
1337 hapd->iface, data->channel_list_changed.initiator);
1342 hostapd_event_dfs_cac_started(hapd, &data->dfs_event);
1346 wpa_msg(hapd->msg_ctx, MSG_INFO, INTERFACE_ENABLED);
1347 if (hapd->disabled && hapd->started) {
1348 hapd->disabled = 0;
1353 wpa_auth_reconfig_group_keys(hapd->wpa_auth);
1354 hapd->reenable_beacon = 1;
1355 ieee802_11_set_beacon(hapd);
1359 hostapd_free_stas(hapd);
1360 wpa_msg(hapd->msg_ctx, MSG_INFO, INTERFACE_DISABLED);
1361 hapd->disabled = 1;
1365 hostapd_acs_channel_selected(hapd,
1380 struct hostapd_data *hapd;
1385 hapd = hostapd_get_iface(interfaces, data->interface_status.ifname);
1386 if (hapd && hapd->driver && hapd->driver->get_ifindex &&
1387 hapd->drv_priv) {
1390 ifindex = hapd->driver->get_ifindex(hapd->drv_priv);
1392 wpa_dbg(hapd->msg_ctx, MSG_DEBUG,
1398 if (hapd)
1399 wpa_supplicant_event(hapd, event, data);