Home | History | Annotate | Download | only in ap

Lines Matching refs:hapd

67 int hostapd_build_ap_extra_ies(struct hostapd_data *hapd,
78 pos = hostapd_eid_time_adv(hapd, pos);
81 pos = hostapd_eid_time_zone(hapd, pos);
86 pos = hostapd_eid_ext_capab(hapd, pos);
89 pos = hostapd_eid_interworking(hapd, pos);
90 pos = hostapd_eid_adv_proto(hapd, pos);
91 pos = hostapd_eid_roaming_consortium(hapd, pos);
97 if (add_buf(&beacon, hapd->iface->fst_ies) < 0 ||
98 add_buf(&proberesp, hapd->iface->fst_ies) < 0 ||
99 add_buf(&assocresp, hapd->iface->fst_ies) < 0)
104 pos = hostapd_eid_fils_indic(hapd, buf, 0);
110 if (add_buf(&beacon, hapd->wps_beacon_ie) < 0 ||
111 add_buf(&proberesp, hapd->wps_probe_resp_ie) < 0)
115 if (add_buf(&beacon, hapd->p2p_beacon_ie) < 0 ||
116 add_buf(&proberesp, hapd->p2p_probe_resp_ie) < 0)
121 if (hapd->conf->p2p & P2P_MANAGE) {
125 p = hostapd_eid_p2p_manage(hapd, start);
132 p = hostapd_eid_p2p_manage(hapd, start);
139 if (hapd->conf->wps_state) {
147 if (hapd->conf->p2p & P2P_MANAGE) {
151 p = hostapd_eid_p2p_manage(hapd, start);
158 if (hapd->p2p_group) {
160 a = p2p_group_assoc_resp_ie(hapd->p2p_group, P2P_SC_SUCCESS);
167 pos = hostapd_eid_hs20_indication(hapd, buf);
172 pos = hostapd_eid_osen(hapd, buf);
179 if (hapd->conf->mbo_enabled || hapd->enable_oce) {
180 pos = hostapd_eid_mbo(hapd, buf, sizeof(buf));
188 add_buf(&beacon, hapd->conf->vendor_elements);
189 add_buf(&proberesp, hapd->conf->vendor_elements);
190 add_buf(&assocresp, hapd->conf->assocresp_elements);
206 void hostapd_free_ap_extra_ies(struct hostapd_data *hapd,
217 int hostapd_reset_ap_wps_ie(struct hostapd_data *hapd)
219 if (hapd->driver == NULL || hapd->driver->set_ap_wps_ie == NULL)
222 return hapd->driver->set_ap_wps_ie(hapd->drv_priv, NULL, NULL, NULL);
226 int hostapd_set_ap_wps_ie(struct hostapd_data *hapd)
231 if (hapd->driver == NULL || hapd->driver->set_ap_wps_ie == NULL)
234 if (hostapd_build_ap_extra_ies(hapd, &beacon, &proberesp, &assocresp) <
238 ret = hapd->driver->set_ap_wps_ie(hapd->drv_priv, beacon, proberesp,
241 hostapd_free_ap_extra_ies(hapd, beacon, proberesp, assocresp);
247 int hostapd_set_authorized(struct hostapd_data *hapd,
251 return hostapd_sta_set_flags(hapd, sta->addr,
257 return hostapd_sta_set_flags(hapd, sta->addr,
263 int hostapd_set_sta_flags(struct hostapd_data *hapd, struct sta_info *sta)
268 if (((!hapd->conf->ieee802_1x && !hapd->conf->wpa) ||
274 return hostapd_sta_set_flags(hapd, sta->addr, total_flags,
279 int hostapd_set_drv_ieee8021x(struct hostapd_data *hapd, const char *ifname,
287 params.wpa = hapd->conf->wpa;
288 params.ieee802_1x = hapd->conf->ieee802_1x;
289 params.wpa_group = hapd->conf->wpa_group;
290 if ((hapd->conf->wpa & (WPA_PROTO_WPA | WPA_PROTO_RSN)) ==
292 params.wpa_pairwise = hapd->conf->wpa_pairwise |
293 hapd->conf->rsn_pairwise;
294 else if (hapd->conf->wpa & WPA_PROTO_RSN)
295 params.wpa_pairwise = hapd->conf->rsn_pairwise;
296 else if (hapd->conf->wpa & WPA_PROTO_WPA)
297 params.wpa_pairwise = hapd->conf->wpa_pairwise;
298 params.wpa_key_mgmt = hapd->conf->wpa_key_mgmt;
299 params.rsn_preauth = hapd->conf->rsn_preauth;
301 params.ieee80211w = hapd->conf->ieee80211w;
304 return hostapd_set_ieee8021x(hapd, &params);
308 int hostapd_vlan_if_add(struct hostapd_data *hapd, const char *ifname)
312 return hostapd_if_add(hapd, WPA_IF_AP_VLAN, ifname, hapd->own_addr,
317 int hostapd_vlan_if_remove(struct hostapd_data *hapd, const char *ifname)
319 return hostapd_if_remove(hapd, WPA_IF_AP_VLAN, ifname);
323 int hostapd_set_wds_sta(struct hostapd_data *hapd, char *ifname_wds,
328 if (hapd->driver == NULL || hapd->driver->set_wds_sta == NULL)
330 if (hapd->conf->wds_bridge[0])
331 bridge = hapd->conf->wds_bridge;
332 else if (hapd->conf->bridge[0])
333 bridge = hapd->conf->bridge;
334 return hapd->driver->set_wds_sta(hapd->drv_priv, addr, aid, val,
339 int hostapd_add_sta_node(struct hostapd_data *hapd, const u8 *addr,
342 if (hapd->driver == NULL || hapd->driver->add_sta_node == NULL)
344 return hapd->driver->add_sta_node(hapd->drv_priv, addr, auth_alg);
348 int hostapd_sta_auth(struct hostapd_data *hapd, const u8 *addr,
356 if (hapd->driver == NULL || hapd->driver->sta_auth == NULL)
362 sta = ap_get_sta(hapd, addr);
381 params.own_addr = hapd->own_addr;
388 return hapd->driver->sta_auth(hapd->drv_priv, &params);
392 int hostapd_sta_assoc(struct hostapd_data *hapd, const u8 *addr,
395 if (hapd->driver == NULL || hapd->driver->sta_assoc == NULL)
397 return hapd->driver->sta_assoc(hapd->drv_priv, hapd->own_addr, addr,
402 int hostapd_sta_add(struct hostapd_data *hapd,
413 if (hapd->driver == NULL)
415 if (hapd->driver->sta_add == NULL)
433 return hapd->driver->sta_add(hapd->drv_priv, &params);
437 int hostapd_add_tspec(struct hostapd_data *hapd, const u8 *addr,
440 if (hapd->driver == NULL || hapd->driver->add_tspec == NULL)
442 return hapd->driver->add_tspec(hapd->drv_priv, addr, tspec_ie,
447 int hostapd_set_privacy(struct hostapd_data *hapd, int enabled)
449 if (hapd->driver == NULL || hapd->driver->set_privacy == NULL)
451 return hapd->driver->set_privacy(hapd->drv_priv, enabled);
455 int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
458 if (hapd->driver == NULL || hapd->driver->set_generic_elem == NULL)
460 return hapd->driver->set_generic_elem(hapd->drv_priv, elem, elem_len);
464 int hostapd_get_ssid(struct hostapd_data *hapd, u8 *buf, size_t len)
466 if (hapd->driver == NULL || hapd->driver->hapd_get_ssid == NULL)
468 return hapd->driver->hapd_get_ssid(hapd->drv_priv, buf, len);
472 int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len)
474 if (hapd->driver == NULL || hapd->driver->hapd_set_ssid == NULL)
476 return hapd->driver->hapd_set_ssid(hapd->drv_priv, buf, len);
480 int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type,
485 if (hapd->driver == NULL || hapd->driver->if_add == NULL)
487 return hapd->driver->if_add(hapd->drv_priv, type, ifname, addr,
493 int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type,
496 if (hapd->driver == NULL || hapd->drv_priv == NULL ||
497 hapd->driver->if_remove == NULL)
499 return hapd->driver->if_remove(hapd->drv_priv, type, ifname);
503 int hostapd_set_ieee8021x(struct hostapd_data *hapd,
506 if (hapd->driver == NULL || hapd->driver->set_ieee8021x == NULL)
508 return hapd->driver->set_ieee8021x(hapd->drv_priv, params);
512 int hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
515 if (hapd->driver == NULL || hapd->driver->get_seqnum == NULL)
517 return hapd->driver->get_seqnum(ifname, hapd->drv_priv, addr, idx,
522 int hostapd_flush(struct hostapd_data *hapd)
524 if (hapd->driver == NULL || hapd->driver->flush == NULL)
526 return hapd->driver->flush(hapd->drv_priv);
530 int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode,
541 hapd->iface->current_mode ?
542 hapd->iface->current_mode->vht_capab : 0))
545 if (hapd->driver == NULL)
547 if (hapd->driver->set_freq == NULL)
549 return hapd->driver->set_freq(hapd->drv_priv, &data);
552 int hostapd_set_rts(struct hostapd_data *hapd, int rts)
554 if (hapd->driver == NULL || hapd->driver->set_rts == NULL)
556 return hapd->driver->set_rts(hapd->drv_priv, rts);
560 int hostapd_set_frag(struct hostapd_data *hapd, int frag)
562 if (hapd->driver == NULL || hapd->driver->set_frag == NULL)
564 return hapd->driver->set_frag(hapd->drv_priv, frag);
568 int hostapd_sta_set_flags(struct hostapd_data *hapd, u8 *addr,
571 if (hapd->driver == NULL || hapd->driver->sta_set_flags == NULL)
573 return hapd->driver->sta_set_flags(hapd->drv_priv, addr, total_flags,
578 int hostapd_set_country(struct hostapd_data *hapd, const char *country)
580 if (hapd->driver == NULL ||
581 hapd->driver->set_country == NULL)
583 return hapd->driver->set_country(hapd->drv_priv, country);
587 int hostapd_set_tx_queue_params(struct hostapd_data *hapd, int queue, int aifs,
590 if (hapd->driver == NULL || hapd->driver->set_tx_queue_params == NULL)
592 return hapd->driver->set_tx_queue_params(hapd->drv_priv, queue, aifs,
598 hostapd_get_hw_feature_data(struct hostapd_data *hapd, u16 *num_modes,
601 if (hapd->driver == NULL ||
602 hapd->driver->get_hw_feature_data == NULL)
604 return hapd->driver->get_hw_feature_data(hapd->drv_priv, num_modes,
609 int hostapd_driver_commit(struct hostapd_data *hapd)
611 if (hapd->driver == NULL || hapd->driver->commit == NULL)
613 return hapd->driver->commit(hapd->drv_priv);
617 int hostapd_drv_none(struct hostapd_data *hapd)
619 return hapd->driver && os_strcmp(hapd->driver->name, "none") == 0;
623 int hostapd_driver_scan(struct hostapd_data *hapd,
626 if (hapd->driver && hapd->driver->scan2)
627 return hapd->driver->scan2(hapd->drv_priv, params);
633 struct hostapd_data *hapd)
635 if (hapd->driver && hapd->driver->get_scan_results2)
636 return hapd->driver->get_scan_results2(hapd->drv_priv);
641 int hostapd_driver_set_noa(struct hostapd_data *hapd, u8 count, int start,
644 if (hapd->driver && hapd->driver->set_noa)
645 return hapd->driver->set_noa(hapd->drv_priv, count, start,
651 int hostapd_drv_set_key(const char *ifname, struct hostapd_data *hapd,
657 if (hapd->driver == NULL || hapd->driver->set_key == NULL)
659 return hapd->driver->set_key(ifname, hapd->drv_priv, alg, addr,
665 int hostapd_drv_send_mlme(struct hostapd_data *hapd,
668 if (!hapd->driver || !hapd->driver->send_mlme || !hapd->drv_priv)
670 return hapd->driver->send_mlme(hapd->drv_priv, msg, len, noack, 0,
675 int hostapd_drv_send_mlme_csa(struct hostapd_data *hapd,
679 if (hapd->driver == NULL || hapd->driver->send_mlme == NULL)
681 return hapd->driver->send_mlme(hapd->drv_priv, msg, len, noack, 0,
686 int hostapd_drv_sta_deauth(struct hostapd_data *hapd,
689 if (!hapd->driver || !hapd->driver->sta_deauth || !hapd->drv_priv)
691 return hapd->driver->sta_deauth(hapd->drv_priv, hapd->own_addr, addr,
696 int hostapd_drv_sta_disassoc(struct hostapd_data *hapd,
699 if (!hapd->driver || !hapd->driver->sta_disassoc || !hapd->drv_priv)
701 return hapd->driver->sta_disassoc(hapd->drv_priv, hapd->own_addr, addr,
706 int hostapd_drv_wnm_oper(struct hostapd_data *hapd, enum wnm_oper oper,
709 if (hapd->driver == NULL || hapd->driver->wnm_oper == NULL)
711 return hapd->driver->wnm_oper(hapd->drv_priv, oper, peer, buf,
716 int hostapd_drv_send_action(struct hostapd_data *hapd, unsigned int freq,
725 if (!hapd->driver || !hapd->driver->send_action || !hapd->drv_priv)
727 bssid = hapd->own_addr;
736 sta = ap_get_sta(hapd, dst);
740 return hapd->driver->send_action(hapd->drv_priv, freq, wait, dst,
741 hapd->own_addr, bssid, data, len, 0);
745 int hostapd_drv_send_action_addr3_ap(struct hostapd_data *hapd,
750 if (hapd->driver == NULL || hapd->driver->send_action == NULL)
752 return hapd->driver->send_action(hapd->drv_priv, freq, wait, dst,
753 hapd->own_addr, hapd->own_addr, data,
764 struct hostapd_data *hapd = iface->bss[0];
768 if (!hapd->driver || !hapd->driver->start_dfs_cac)
786 res = hapd->driver->start_dfs_cac(hapd->drv_priv, &data);
796 int hostapd_drv_set_qos_map(struct hostapd_data *hapd,
799 if (!hapd->driver || !hapd->driver->set_qos_map || !hapd->drv_priv)
801 return hapd->driver->set_qos_map(hapd->drv_priv, qos_map_set,
806 static void hostapd_get_hw_mode_any_channels(struct hostapd_data *hapd,
817 freq_range_list_includes(&hapd->iface->conf->acs_ch_list,
820 !(hapd->iface->conf->acs_exclude_dfs &&
829 struct hostapd_data *hapd = iface->bss[0];
831 if (!hapd->driver || !hapd->driver->get_ext_capab)
834 hapd->driver->get_ext_capab(hapd->drv_priv, WPA_IF_AP_BSS,
841 int hostapd_drv_do_acs(struct hostapd_data *hapd)
850 if (hapd->driver == NULL || hapd->driver->do_acs == NULL)
854 params.hw_mode = hapd->iface->conf->hw_mode;
860 if (!hapd->iface->conf->acs_ch_list.num)
863 mode = hapd->iface->current_mode;
873 &hapd->iface->conf->acs_ch_list,
876 if (hapd->iface->conf->acs_exclude_dfs &&
885 for (i = 0; i < hapd->iface->num_hw_features; i++) {
886 mode = &hapd->iface->hw_features[i];
887 hostapd_get_hw_mode_any_channels(hapd, mode,
897 params.ht_enabled = !!(hapd->iface->conf->ieee80211n);
898 params.ht40_enabled = !!(hapd->iface->conf->ht_capab &
900 params.vht_enabled = !!(hapd->iface->conf->ieee80211ac);
902 if (hapd->iface->conf->ieee80211n && params.ht40_enabled)
907 if (hapd->iface->conf->ieee80211ac && params.ht40_enabled) {
908 if (hapd->iface->conf->vht_oper_chwidth == VHT_CHANWIDTH_80MHZ)
910 else if (hapd->iface->conf->vht_oper_chwidth ==
912 hapd->iface->conf->vht_oper_chwidth ==
917 ret = hapd->driver->do_acs(hapd->drv_priv, &params);