Lines Matching +full:addr +full:- +full:mode
2 * hostapd - Driver operations
3 * Copyright (c) 2009-2010, Jouni Malinen <j@w1.fi>
51 return -1;
62 return -1;
81 if (add_buf_data(&assocresp, buf, pos - buf) < 0 ||
82 add_buf_data(&proberesp, buf, pos - buf) < 0)
88 if (add_buf_data(&beacon, buf, pos - buf) < 0)
91 if (add_buf_data(&proberesp, buf, pos - buf) < 0)
96 if (add_buf_data(&assocresp, buf, pos - buf) < 0)
101 if (add_buf_data(&beacon, buf, pos - buf) < 0 ||
102 add_buf_data(&proberesp, buf, pos - buf) < 0)
106 if (add_buf(&beacon, hapd->iface->fst_ies) < 0 ||
107 add_buf(&proberesp, hapd->iface->fst_ies) < 0 ||
108 add_buf(&assocresp, hapd->iface->fst_ies) < 0)
114 if (add_buf_data(&beacon, buf, pos - buf) < 0 ||
115 add_buf_data(&proberesp, buf, pos - buf) < 0)
120 if (add_buf_data(&assocresp, buf, pos - buf) < 0)
123 if (add_buf(&beacon, hapd->wps_beacon_ie) < 0 ||
124 add_buf(&proberesp, hapd->wps_probe_resp_ie) < 0)
128 if (add_buf(&beacon, hapd->p2p_beacon_ie) < 0 ||
129 add_buf(&proberesp, hapd->p2p_probe_resp_ie) < 0)
134 if (hapd->conf->p2p & P2P_MANAGE) {
139 wpabuf_put(beacon, p - start);
146 wpabuf_put(proberesp, p - start);
152 if (hapd->conf->wps_state) {
160 if (hapd->conf->p2p & P2P_MANAGE) {
165 wpabuf_put(assocresp, p - start);
171 if (hapd->p2p_group) {
173 a = p2p_group_assoc_resp_ie(hapd->p2p_group, P2P_SC_SUCCESS);
181 if (add_buf_data(&beacon, buf, pos - buf) < 0 ||
182 add_buf_data(&proberesp, buf, pos - buf) < 0)
186 if (add_buf_data(&beacon, buf, pos - buf) < 0 ||
187 add_buf_data(&proberesp, buf, pos - buf) < 0)
192 if (hapd->conf->mbo_enabled ||
195 if (add_buf_data(&beacon, buf, pos - buf) < 0 ||
196 add_buf_data(&proberesp, buf, pos - buf) < 0 ||
197 add_buf_data(&assocresp, buf, pos - buf) < 0)
204 if (add_buf_data(&beacon, buf, pos - buf) < 0 ||
205 add_buf_data(&proberesp, buf, pos - buf) < 0)
209 add_buf(&beacon, hapd->conf->vendor_elements);
210 add_buf(&proberesp, hapd->conf->vendor_elements);
212 add_buf(&proberesp, hapd->conf->presp_elements);
214 add_buf(&assocresp, hapd->conf->assocresp_elements);
226 return -1;
243 if (hapd->driver == NULL || hapd->driver->set_ap_wps_ie == NULL)
246 return hapd->driver->set_ap_wps_ie(hapd->drv_priv, NULL, NULL, NULL);
255 if (hapd->driver == NULL || hapd->driver->set_ap_wps_ie == NULL)
260 return -1;
262 ret = hapd->driver->set_ap_wps_ie(hapd->drv_priv, beacon, proberesp,
276 sta->mld_assoc_link_id != hapd->mld_link_id)
296 __func__, MAC2STR(sta->addr));
301 return hostapd_sta_set_flags(hapd, sta->addr,
303 sta->flags),
307 return hostapd_sta_set_flags(hapd, sta->addr,
308 hostapd_sta_flags_to_drv(sta->flags),
316 total_flags = hostapd_sta_flags_to_drv(sta->flags);
331 __func__, MAC2STR(sta->addr));
337 return hostapd_sta_set_flags(hapd, sta->addr, total_flags,
350 params.wpa = hapd->conf->wpa;
351 params.ieee802_1x = hapd->conf->ieee802_1x;
352 params.wpa_group = hapd->conf->wpa_group;
353 if ((hapd->conf->wpa & (WPA_PROTO_WPA | WPA_PROTO_RSN)) ==
355 params.wpa_pairwise = hapd->conf->wpa_pairwise |
356 hapd->conf->rsn_pairwise;
357 else if (hapd->conf->wpa & WPA_PROTO_RSN)
358 params.wpa_pairwise = hapd->conf->rsn_pairwise;
359 else if (hapd->conf->wpa & WPA_PROTO_WPA)
360 params.wpa_pairwise = hapd->conf->wpa_pairwise;
361 params.wpa_key_mgmt = hapd->conf->wpa_key_mgmt;
362 params.rsn_preauth = hapd->conf->rsn_preauth;
363 params.ieee80211w = hapd->conf->ieee80211w;
373 return hostapd_if_add(hapd, WPA_IF_AP_VLAN, ifname, hapd->own_addr,
385 const u8 *addr, int aid, int val)
389 if (hapd->driver == NULL || hapd->driver->set_wds_sta == NULL)
390 return -1;
391 if (hapd->conf->wds_bridge[0])
392 bridge = hapd->conf->wds_bridge;
393 else if (hapd->conf->bridge[0])
394 bridge = hapd->conf->bridge;
395 return hapd->driver->set_wds_sta(hapd->drv_priv, addr, aid, val,
400 int hostapd_add_sta_node(struct hostapd_data *hapd, const u8 *addr,
403 if (hapd->driver == NULL || hapd->driver->add_sta_node == NULL)
404 return -EOPNOTSUPP;
405 return hapd->driver->add_sta_node(hapd->drv_priv, addr, auth_alg);
409 int hostapd_sta_auth(struct hostapd_data *hapd, const u8 *addr,
417 if (hapd->driver == NULL || hapd->driver->sta_auth == NULL)
423 sta = ap_get_sta(hapd, addr);
427 MAC2STR(addr));
431 if (sta->auth_alg == WLAN_AUTH_FILS_SK ||
432 sta->auth_alg == WLAN_AUTH_FILS_SK_PFS ||
433 sta->auth_alg == WLAN_AUTH_FILS_PK) {
435 wpa_auth_get_fils_aead_params(sta->wpa_sm, params.fils_anonce,
442 params.own_addr = hapd->own_addr;
443 params.addr = addr;
449 return hapd->driver->sta_auth(hapd->drv_priv, ¶ms);
453 int hostapd_sta_assoc(struct hostapd_data *hapd, const u8 *addr,
456 if (hapd->driver == NULL || hapd->driver->sta_assoc == NULL)
458 return hapd->driver->sta_assoc(hapd->drv_priv, hapd->own_addr, addr,
464 const u8 *addr, u16 aid, u16 capability,
479 if (hapd->driver == NULL)
481 if (hapd->driver->sta_add == NULL)
485 params.addr = addr;
504 params.mld_link_id = -1;
511 if (hapd->conf->mld_ap) {
512 params.mld_link_id = hapd->mld_link_id;
518 return hapd->driver->sta_add(hapd->drv_priv, ¶ms);
522 int hostapd_add_tspec(struct hostapd_data *hapd, const u8 *addr,
525 if (hapd->driver == NULL || hapd->driver->add_tspec == NULL)
527 return hapd->driver->add_tspec(hapd->drv_priv, addr, tspec_ie,
534 if (hapd->driver == NULL || hapd->driver->set_privacy == NULL)
536 return hapd->driver->set_privacy(hapd->drv_priv, enabled);
543 if (hapd->driver == NULL || hapd->driver->set_generic_elem == NULL)
545 return hapd->driver->set_generic_elem(hapd->drv_priv, elem, elem_len);
551 if (hapd->driver == NULL || hapd->driver->hapd_get_ssid == NULL)
553 return hapd->driver->hapd_get_ssid(hapd->drv_priv, buf, len);
559 if (hapd->driver == NULL || hapd->driver->hapd_set_ssid == NULL)
561 return hapd->driver->hapd_set_ssid(hapd->drv_priv, buf, len);
566 const char *ifname, const u8 *addr, void *bss_ctx,
570 if (hapd->driver == NULL || hapd->driver->if_add == NULL)
571 return -1;
572 return hapd->driver->if_add(hapd->drv_priv, type, ifname, addr,
583 if (!hapd->driver || !hapd->drv_priv || !hapd->driver->link_remove)
584 return -1;
586 return hapd->driver->link_remove(hapd->drv_priv, type, ifname,
587 hapd->mld_link_id);
595 if (hapd->driver == NULL || hapd->drv_priv == NULL ||
596 hapd->driver->if_remove == NULL)
597 return -1;
600 if (hapd->conf->mld_ap)
602 hapd->mld_link_id);
605 return hapd->driver->if_remove(hapd->drv_priv, type, ifname);
612 if (hapd->driver == NULL || hapd->driver->set_ieee8021x == NULL)
614 return hapd->driver->set_ieee8021x(hapd->drv_priv, params);
619 const u8 *addr, int idx, int link_id, u8 *seq)
621 if (hapd->driver == NULL || hapd->driver->get_seqnum == NULL)
623 return hapd->driver->get_seqnum(ifname, hapd->drv_priv, addr, idx,
630 int link_id = -1;
632 if (hapd->driver == NULL || hapd->driver->flush == NULL)
636 if (hapd->conf && hapd->conf->mld_ap)
637 link_id = hapd->mld_link_id;
640 return hapd->driver->flush(hapd->drv_priv, link_id);
644 int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode,
652 struct hostapd_hw_modes *cmode = hapd->iface->current_mode;
654 if (hostapd_set_freq_params(&data, mode, freq, channel, edmg,
659 cmode ? cmode->vht_capab : 0,
661 &cmode->he_capab[IEEE80211_MODE_AP] : NULL,
663 &cmode->eht_capab[IEEE80211_MODE_AP] :
665 return -1;
667 if (hapd->driver == NULL)
669 if (hapd->driver->set_freq == NULL)
672 data.link_id = -1;
675 if (hapd->conf->mld_ap) {
676 data.link_id = hapd->mld_link_id;
682 return hapd->driver->set_freq(hapd->drv_priv, &data);
687 if (hapd->driver == NULL || hapd->driver->set_rts == NULL)
689 return hapd->driver->set_rts(hapd->drv_priv, rts);
695 if (hapd->driver == NULL || hapd->driver->set_frag == NULL)
697 return hapd->driver->set_frag(hapd->drv_priv, frag);
701 int hostapd_sta_set_flags(struct hostapd_data *hapd, u8 *addr,
704 if (!hapd->driver || !hapd->drv_priv || !hapd->driver->sta_set_flags)
706 return hapd->driver->sta_set_flags(hapd->drv_priv, addr, total_flags,
711 int hostapd_sta_set_airtime_weight(struct hostapd_data *hapd, const u8 *addr,
714 if (!hapd->driver || !hapd->driver->sta_set_airtime_weight)
716 return hapd->driver->sta_set_airtime_weight(hapd->drv_priv, addr,
723 if (hapd->driver == NULL ||
724 hapd->driver->set_country == NULL)
726 return hapd->driver->set_country(hapd->drv_priv, country);
733 int link_id = -1;
735 if (hapd->driver == NULL || hapd->driver->set_tx_queue_params == NULL)
739 if (hapd->conf->mld_ap)
740 link_id = hapd->mld_link_id;
743 return hapd->driver->set_tx_queue_params(hapd->drv_priv, queue, aifs,
753 if (!hapd->driver || !hapd->driver->get_hw_feature_data ||
754 !hapd->drv_priv)
756 return hapd->driver->get_hw_feature_data(hapd->drv_priv, num_modes,
763 if (hapd->driver == NULL || hapd->driver->commit == NULL)
765 return hapd->driver->commit(hapd->drv_priv);
771 return hapd->driver && os_strcmp(hapd->driver->name, "none") == 0;
777 return hapd->driver && os_strcmp(hapd->driver->name, "nl80211") == 0;
784 if (hapd->driver && hapd->driver->scan2)
785 return hapd->driver->scan2(hapd->drv_priv, params);
786 return -1;
793 if (hapd->driver && hapd->driver->get_scan_results)
794 return hapd->driver->get_scan_results(hapd->drv_priv, NULL);
795 if (hapd->driver && hapd->driver->get_scan_results2)
796 return hapd->driver->get_scan_results2(hapd->drv_priv);
804 if (hapd->driver && hapd->driver->set_noa)
805 return hapd->driver->set_noa(hapd->drv_priv, count, start,
807 return -1;
812 enum wpa_alg alg, const u8 *addr,
819 if (hapd->driver == NULL || hapd->driver->set_key == NULL)
825 params.addr = addr;
834 params.link_id = -1;
837 if (hapd->conf->mld_ap && !(key_flag & KEY_FLAG_PAIRWISE))
838 params.link_id = hapd->mld_link_id;
841 return hapd->driver->set_key(hapd->drv_priv, ¶ms);
850 int link_id = -1;
853 if (hapd->conf->mld_ap)
854 link_id = hapd->mld_link_id;
857 if (!hapd->driver || !hapd->driver->send_mlme || !hapd->drv_priv)
859 return hapd->driver->send_mlme(hapd->drv_priv, msg, len, noack, 0,
866 const u8 *addr, int reason)
868 int link_id = -1;
869 const u8 *own_addr = hapd->own_addr;
872 if (hapd->conf->mld_ap) {
873 struct sta_info *sta = ap_get_sta(hapd, addr);
875 link_id = hapd->mld_link_id;
877 own_addr = hapd->mld->mld_addr;
881 if (!hapd->driver || !hapd->driver->sta_deauth || !hapd->drv_priv)
883 return hapd->driver->sta_deauth(hapd->drv_priv, own_addr, addr,
889 const u8 *addr, int reason)
891 const u8 *own_addr = hapd->own_addr;
894 if (hapd->conf->mld_ap) {
895 struct sta_info *sta = ap_get_sta(hapd, addr);
898 own_addr = hapd->mld->mld_addr;
902 if (!hapd->driver || !hapd->driver->sta_disassoc || !hapd->drv_priv)
904 return hapd->driver->sta_disassoc(hapd->drv_priv, own_addr, addr,
912 if (hapd->driver == NULL || hapd->driver->wnm_oper == NULL)
913 return -1;
914 return hapd->driver->wnm_oper(hapd->drv_priv, oper, peer, buf,
923 const u8 *own_addr = hapd->own_addr;
930 if (!hapd->driver || !hapd->driver->send_action || !hapd->drv_priv)
932 bssid = hapd->own_addr;
940 if (!sta || !(sta->flags & WLAN_STA_ASSOC))
952 } else if (hapd->conf->mld_ap) {
956 own_addr = hapd->mld->mld_addr;
962 return hapd->driver->send_action(hapd->drv_priv, freq, wait, dst,
985 enum hostapd_hw_mode mode, int freq,
992 struct hostapd_data *hapd = iface->bss[0];
995 struct hostapd_hw_modes *cmode = iface->current_mode;
997 if (!hapd->driver || !hapd->driver->start_dfs_cac || !cmode)
1000 if (!iface->conf->ieee80211h) {
1003 return -1;
1006 if (hostapd_set_freq_params(&data, mode, freq, channel, 0, 0,
1012 cmode->vht_capab,
1013 &cmode->he_capab[IEEE80211_MODE_AP],
1014 &cmode->eht_capab[IEEE80211_MODE_AP],
1017 return -1;
1021 res = hapd->driver->start_dfs_cac(hapd->drv_priv, &data);
1024 iface->radar_background.cac_started = 1;
1026 iface->cac_started = 1;
1027 os_get_reltime(&iface->dfs_cac_start);
1037 if (!hapd->driver || !hapd->driver->set_qos_map || !hapd->drv_priv ||
1038 !(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_QOS_MAPPING))
1040 return hapd->driver->set_qos_map(hapd->drv_priv, qos_map_set,
1046 struct hostapd_hw_modes *mode,
1053 for (i = 0; i < mode->num_channels; i++) {
1054 struct hostapd_channel_data *chan = &mode->channels[i];
1057 (hapd->iface->conf->acs_freq_list.num &&
1059 &hapd->iface->conf->acs_freq_list,
1060 chan->freq)))
1063 (!hapd->iface->conf->acs_freq_list_present &&
1064 hapd->iface->conf->acs_ch_list.num &&
1066 &hapd->iface->conf->acs_ch_list,
1067 chan->chan)))
1069 if (is_6ghz_freq(chan->freq) &&
1070 ((hapd->iface->conf->acs_exclude_6ghz_non_psc &&
1071 !is_6ghz_psc_frequency(chan->freq)) ||
1072 (!hapd->iface->conf->ieee80211ax &&
1073 !hapd->iface->conf->ieee80211be)))
1075 if ((!(chan->flag & HOSTAPD_CHAN_DISABLED) || allow_disabled) &&
1076 !(hapd->iface->conf->acs_exclude_dfs &&
1077 (chan->flag & HOSTAPD_CHAN_RADAR)) &&
1078 !(chan->max_tx_power < hapd->iface->conf->min_tx_power))
1079 int_array_add_unique(freq_list, chan->freq);
1080 else if ((chan->flag & HOSTAPD_CHAN_NO_IR) &&
1081 is_6ghz_freq(chan->freq))
1085 hapd->iface->is_no_ir = is_no_ir;
1091 struct hostapd_data *hapd = iface->bss[0];
1093 if (!hapd->driver || !hapd->driver->get_ext_capab)
1096 hapd->driver->get_ext_capab(hapd->drv_priv, WPA_IF_AP_BSS,
1097 &iface->extended_capa,
1098 &iface->extended_capa_mask,
1099 &iface->extended_capa_len);
1105 struct hostapd_data *hapd = iface->bss[0];
1107 if (!hapd->driver || !hapd->driver->get_mld_capab)
1110 hapd->driver->get_mld_capab(hapd->drv_priv, WPA_IF_AP_BSS,
1111 &iface->mld_eml_capa,
1112 &iface->mld_mld_capa);
1117 * hostapd_drv_do_acs - Start automatic channel selection
1119 * Returns: 0 on success, -1 on failure, 1 on failure due to NO_IR (AFC)
1125 struct hostapd_hw_modes *mode;
1129 if (hapd->driver == NULL || hapd->driver->do_acs == NULL)
1133 params.hw_mode = hapd->iface->conf->hw_mode;
1134 params.link_id = -1;
1136 if (hapd->conf->mld_ap && hapd->iconf->ieee80211be &&
1137 !hapd->conf->disable_11be)
1138 params.link_id = hapd->mld_link_id;
1145 if (hapd->iface->conf->acs_freq_list_present)
1146 acs_ch_list_all = !hapd->iface->conf->acs_freq_list.num;
1148 acs_ch_list_all = !hapd->iface->conf->acs_ch_list.num;
1150 if (hapd->iface->current_mode)
1151 selected_mode = hapd->iface->current_mode->mode;
1155 for (i = 0; i < hapd->iface->num_hw_features; i++) {
1156 mode = &hapd->iface->hw_features[i];
1158 selected_mode != mode->mode)
1160 hostapd_get_hw_mode_any_channels(hapd, mode, acs_ch_list_all,
1164 if (!freq_list && hapd->iface->is_no_ir) {
1171 params.edmg_enabled = hapd->iface->conf->enable_edmg;
1173 params.ht_enabled = !!(hapd->iface->conf->ieee80211n);
1174 params.ht40_enabled = !!(hapd->iface->conf->ht_capab &
1176 params.vht_enabled = !!(hapd->iface->conf->ieee80211ac);
1177 params.eht_enabled = !!(hapd->iface->conf->ieee80211be);
1179 if (hapd->iface->conf->ieee80211n && params.ht40_enabled)
1184 if ((hapd->iface->conf->ieee80211be ||
1185 hapd->iface->conf->ieee80211ax ||
1186 hapd->iface->conf->ieee80211ac) &&
1190 oper_chwidth = hostapd_get_oper_chwidth(hapd->iface->conf);
1200 if (hapd->iface->conf->op_class)
1202 hapd->iface->conf->op_class);
1203 ret = hapd->driver->do_acs(hapd->drv_priv, ¶ms);
1213 if (!hapd->driver || !hapd->driver->update_dh_ie || !hapd->drv_priv)
1215 return hapd->driver->update_dh_ie(hapd->drv_priv, peer, reason_code,
1222 if (!hapd->driver || !hapd->driver->dpp_listen || !hapd->drv_priv)
1224 return hapd->driver->dpp_listen(hapd->drv_priv, enable);
1237 if (!hapd->driver || !hapd->driver->set_secure_ranging_ctx)
1250 return hapd->driver->set_secure_ranging_ctx(hapd->drv_priv, ¶ms);