Home | History | Annotate | Download | only in ap

Lines Matching defs:hapd

66 int hostapd_build_ap_extra_ies(struct hostapd_data *hapd,
77 pos = hostapd_eid_time_adv(hapd, pos);
80 pos = hostapd_eid_time_zone(hapd, pos);
85 pos = hostapd_eid_ext_capab(hapd, pos);
88 pos = hostapd_eid_interworking(hapd, pos);
89 pos = hostapd_eid_adv_proto(hapd, pos);
90 pos = hostapd_eid_roaming_consortium(hapd, pos);
96 if (add_buf(&beacon, hapd->iface->fst_ies) < 0 ||
97 add_buf(&proberesp, hapd->iface->fst_ies) < 0 ||
98 add_buf(&assocresp, hapd->iface->fst_ies) < 0)
102 if (add_buf(&beacon, hapd->wps_beacon_ie) < 0 ||
103 add_buf(&proberesp, hapd->wps_probe_resp_ie) < 0)
107 if (add_buf(&beacon, hapd->p2p_beacon_ie) < 0 ||
108 add_buf(&proberesp, hapd->p2p_probe_resp_ie) < 0)
113 if (hapd->conf->p2p & P2P_MANAGE) {
117 p = hostapd_eid_p2p_manage(hapd, start);
124 p = hostapd_eid_p2p_manage(hapd, start);
131 if (hapd->conf->wps_state) {
139 if (hapd->conf->p2p & P2P_MANAGE) {
143 p = hostapd_eid_p2p_manage(hapd, start);
150 if (hapd->p2p_group) {
152 a = p2p_group_assoc_resp_ie(hapd->p2p_group, P2P_SC_SUCCESS);
159 pos = hostapd_eid_hs20_indication(hapd, buf);
164 pos = hostapd_eid_osen(hapd, buf);
171 if (hapd->conf->mbo_enabled) {
172 pos = hostapd_eid_mbo(hapd, buf, sizeof(buf));
180 add_buf(&beacon, hapd->conf->vendor_elements);
181 add_buf(&proberesp, hapd->conf->vendor_elements);
182 add_buf(&assocresp, hapd->conf->assocresp_elements);
198 void hostapd_free_ap_extra_ies(struct hostapd_data *hapd,
209 int hostapd_reset_ap_wps_ie(struct hostapd_data *hapd)
211 if (hapd->driver == NULL || hapd->driver->set_ap_wps_ie == NULL)
214 return hapd->driver->set_ap_wps_ie(hapd->drv_priv, NULL, NULL, NULL);
218 int hostapd_set_ap_wps_ie(struct hostapd_data *hapd)
223 if (hapd->driver == NULL || hapd->driver->set_ap_wps_ie == NULL)
226 if (hostapd_build_ap_extra_ies(hapd, &beacon, &proberesp, &assocresp) <
230 ret = hapd->driver->set_ap_wps_ie(hapd->drv_priv, beacon, proberesp,
233 hostapd_free_ap_extra_ies(hapd, beacon, proberesp, assocresp);
239 int hostapd_set_authorized(struct hostapd_data *hapd,
243 return hostapd_sta_set_flags(hapd, sta->addr,
249 return hostapd_sta_set_flags(hapd, sta->addr,
255 int hostapd_set_sta_flags(struct hostapd_data *hapd, struct sta_info *sta)
260 if (((!hapd->conf->ieee802_1x && !hapd->conf->wpa) ||
266 return hostapd_sta_set_flags(hapd, sta->addr, total_flags,
271 int hostapd_set_drv_ieee8021x(struct hostapd_data *hapd, const char *ifname,
279 params.wpa = hapd->conf->wpa;
280 params.ieee802_1x = hapd->conf->ieee802_1x;
281 params.wpa_group = hapd->conf->wpa_group;
282 if ((hapd->conf->wpa & (WPA_PROTO_WPA | WPA_PROTO_RSN)) ==
284 params.wpa_pairwise = hapd->conf->wpa_pairwise |
285 hapd->conf->rsn_pairwise;
286 else if (hapd->conf->wpa & WPA_PROTO_RSN)
287 params.wpa_pairwise = hapd->conf->rsn_pairwise;
288 else if (hapd->conf->wpa & WPA_PROTO_WPA)
289 params.wpa_pairwise = hapd->conf->wpa_pairwise;
290 params.wpa_key_mgmt = hapd->conf->wpa_key_mgmt;
291 params.rsn_preauth = hapd->conf->rsn_preauth;
293 params.ieee80211w = hapd->conf->ieee80211w;
296 return hostapd_set_ieee8021x(hapd, &params);
300 int hostapd_vlan_if_add(struct hostapd_data *hapd, const char *ifname)
304 return hostapd_if_add(hapd, WPA_IF_AP_VLAN, ifname, hapd->own_addr,
309 int hostapd_vlan_if_remove(struct hostapd_data *hapd, const char *ifname)
311 return hostapd_if_remove(hapd, WPA_IF_AP_VLAN, ifname);
315 int hostapd_set_wds_sta(struct hostapd_data *hapd, char *ifname_wds,
320 if (hapd->driver == NULL || hapd->driver->set_wds_sta == NULL)
322 if (hapd->conf->wds_bridge[0])
323 bridge = hapd->conf->wds_bridge;
324 else if (hapd->conf->bridge[0])
325 bridge = hapd->conf->bridge;
326 return hapd->driver->set_wds_sta(hapd->drv_priv, addr, aid, val,
331 int hostapd_add_sta_node(struct hostapd_data *hapd, const u8 *addr,
334 if (hapd->driver == NULL || hapd->driver->add_sta_node == NULL)
336 return hapd->driver->add_sta_node(hapd->drv_priv, addr, auth_alg);
340 int hostapd_sta_auth(struct hostapd_data *hapd, const u8 *addr,
343 if (hapd->driver == NULL || hapd->driver->sta_auth == NULL)
345 return hapd->driver->sta_auth(hapd->drv_priv, hapd->own_addr, addr,
350 int hostapd_sta_assoc(struct hostapd_data *hapd, const u8 *addr,
353 if (hapd->driver == NULL || hapd->driver->sta_assoc == NULL)
355 return hapd->driver->sta_assoc(hapd->drv_priv, hapd->own_addr, addr,
360 int hostapd_sta_add(struct hostapd_data *hapd,
371 if (hapd->driver == NULL)
373 if (hapd->driver->sta_add == NULL)
391 return hapd->driver->sta_add(hapd->drv_priv, &params);
395 int hostapd_add_tspec(struct hostapd_data *hapd, const u8 *addr,
398 if (hapd->driver == NULL || hapd->driver->add_tspec == NULL)
400 return hapd->driver->add_tspec(hapd->drv_priv, addr, tspec_ie,
405 int hostapd_set_privacy(struct hostapd_data *hapd, int enabled)
407 if (hapd->driver == NULL || hapd->driver->set_privacy == NULL)
409 return hapd->driver->set_privacy(hapd->drv_priv, enabled);
413 int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
416 if (hapd->driver == NULL || hapd->driver->set_generic_elem == NULL)
418 return hapd->driver->set_generic_elem(hapd->drv_priv, elem, elem_len);
422 int hostapd_get_ssid(struct hostapd_data *hapd, u8 *buf, size_t len)
424 if (hapd->driver == NULL || hapd->driver->hapd_get_ssid == NULL)
426 return hapd->driver->hapd_get_ssid(hapd->drv_priv, buf, len);
430 int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len)
432 if (hapd->driver == NULL || hapd->driver->hapd_set_ssid == NULL)
434 return hapd->driver->hapd_set_ssid(hapd->drv_priv, buf, len);
438 int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type,
443 if (hapd->driver == NULL || hapd->driver->if_add == NULL)
445 return hapd->driver->if_add(hapd->drv_priv, type, ifname, addr,
451 int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type,
454 if (hapd->driver == NULL || hapd->drv_priv == NULL ||
455 hapd->driver->if_remove == NULL)
457 return hapd->driver->if_remove(hapd->drv_priv, type, ifname);
461 int hostapd_set_ieee8021x(struct hostapd_data *hapd,
464 if (hapd->driver == NULL || hapd->driver->set_ieee8021x == NULL)
466 return hapd->driver->set_ieee8021x(hapd->drv_priv, params);
470 int hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
473 if (hapd->driver == NULL || hapd->driver->get_seqnum == NULL)
475 return hapd->driver->get_seqnum(ifname, hapd->drv_priv, addr, idx,
480 int hostapd_flush(struct hostapd_data *hapd)
482 if (hapd->driver == NULL || hapd->driver->flush == NULL)
484 return hapd->driver->flush(hapd->drv_priv);
488 int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode,
499 hapd->iface->current_mode ?
500 hapd->iface->current_mode->vht_capab : 0))
503 if (hapd->driver == NULL)
505 if (hapd->driver->set_freq == NULL)
507 return hapd->driver->set_freq(hapd->drv_priv, &data);
510 int hostapd_set_rts(struct hostapd_data *hapd, int rts)
512 if (hapd->driver == NULL || hapd->driver->set_rts == NULL)
514 return hapd->driver->set_rts(hapd->drv_priv, rts);
518 int hostapd_set_frag(struct hostapd_data *hapd, int frag)
520 if (hapd->driver == NULL || hapd->driver->set_frag == NULL)
522 return hapd->driver->set_frag(hapd->drv_priv, frag);
526 int hostapd_sta_set_flags(struct hostapd_data *hapd, u8 *addr,
529 if (hapd->driver == NULL || hapd->driver->sta_set_flags == NULL)
531 return hapd->driver->sta_set_flags(hapd->drv_priv, addr, total_flags,
536 int hostapd_set_country(struct hostapd_data *hapd, const char *country)
538 if (hapd->driver == NULL ||
539 hapd->driver->set_country == NULL)
541 return hapd->driver->set_country(hapd->drv_priv, country);
545 int hostapd_set_tx_queue_params(struct hostapd_data *hapd, int queue, int aifs,
548 if (hapd->driver == NULL || hapd->driver->set_tx_queue_params == NULL)
550 return hapd->driver->set_tx_queue_params(hapd->drv_priv, queue, aifs,
556 hostapd_get_hw_feature_data(struct hostapd_data *hapd, u16 *num_modes,
559 if (hapd->driver == NULL ||
560 hapd->driver->get_hw_feature_data == NULL)
562 return hapd->driver->get_hw_feature_data(hapd->drv_priv, num_modes,
567 int hostapd_driver_commit(struct hostapd_data *hapd)
569 if (hapd->driver == NULL || hapd->driver->commit == NULL)
571 return hapd->driver->commit(hapd->drv_priv);
575 int hostapd_drv_none(struct hostapd_data *hapd)
577 return hapd->driver && os_strcmp(hapd->driver->name, "none") == 0;
581 int hostapd_driver_scan(struct hostapd_data *hapd,
584 if (hapd->driver && hapd->driver->scan2)
585 return hapd->driver->scan2(hapd->drv_priv, params);
591 struct hostapd_data *hapd)
593 if (hapd->driver && hapd->driver->get_scan_results2)
594 return hapd->driver->get_scan_results2(hapd->drv_priv);
599 int hostapd_driver_set_noa(struct hostapd_data *hapd, u8 count, int start,
602 if (hapd->driver && hapd->driver->set_noa)
603 return hapd->driver->set_noa(hapd->drv_priv, count, start,
609 int hostapd_drv_set_key(const char *ifname, struct hostapd_data *hapd,
615 if (hapd->driver == NULL || hapd->driver->set_key == NULL)
617 return hapd->driver->set_key(ifname, hapd->drv_priv, alg, addr,
623 int hostapd_drv_send_mlme(struct hostapd_data *hapd,
626 if (!hapd->driver || !hapd->driver->send_mlme || !hapd->drv_priv)
628 return hapd->driver->send_mlme(hapd->drv_priv, msg, len, noack, 0,
633 int hostapd_drv_send_mlme_csa(struct hostapd_data *hapd,
637 if (hapd->driver == NULL || hapd->driver->send_mlme == NULL)
639 return hapd->driver->send_mlme(hapd->drv_priv, msg, len, noack, 0,
644 int hostapd_drv_sta_deauth(struct hostapd_data *hapd,
647 if (!hapd->driver || !hapd->driver->sta_deauth || !hapd->drv_priv)
649 return hapd->driver->sta_deauth(hapd->drv_priv, hapd->own_addr, addr,
654 int hostapd_drv_sta_disassoc(struct hostapd_data *hapd,
657 if (!hapd->driver || !hapd->driver->sta_disassoc || !hapd->drv_priv)
659 return hapd->driver->sta_disassoc(hapd->drv_priv, hapd->own_addr, addr,
664 int hostapd_drv_wnm_oper(struct hostapd_data *hapd, enum wnm_oper oper,
667 if (hapd->driver == NULL || hapd->driver->wnm_oper == NULL)
669 return hapd->driver->wnm_oper(hapd->drv_priv, oper, peer, buf,
674 int hostapd_drv_send_action(struct hostapd_data *hapd, unsigned int freq,
683 if (!hapd->driver || !hapd->driver->send_action || !hapd->drv_priv)
685 bssid = hapd->own_addr;
694 sta = ap_get_sta(hapd, dst);
698 return hapd->driver->send_action(hapd->drv_priv, freq, wait, dst,
699 hapd->own_addr, bssid, data, len, 0);
703 int hostapd_drv_send_action_addr3_ap(struct hostapd_data *hapd,
708 if (hapd->driver == NULL || hapd->driver->send_action == NULL)
710 return hapd->driver->send_action(hapd->drv_priv, freq, wait, dst,
711 hapd->own_addr, hapd->own_addr, data,
722 struct hostapd_data *hapd = iface->bss[0];
726 if (!hapd->driver || !hapd->driver->start_dfs_cac)
744 res = hapd->driver->start_dfs_cac(hapd->drv_priv, &data);
754 int hostapd_drv_set_qos_map(struct hostapd_data *hapd,
757 if (!hapd->driver || !hapd->driver->set_qos_map || !hapd->drv_priv)
759 return hapd->driver->set_qos_map(hapd->drv_priv, qos_map_set,
764 static void hostapd_get_hw_mode_any_channels(struct hostapd_data *hapd,
775 freq_range_list_includes(&hapd->iface->conf->acs_ch_list,
785 struct hostapd_data *hapd = iface->bss[0];
787 if (!hapd->driver || !hapd->driver->get_ext_capab)
790 hapd->driver->get_ext_capab(hapd->drv_priv, WPA_IF_AP_BSS,
797 int hostapd_drv_do_acs(struct hostapd_data *hapd)
806 if (hapd->driver == NULL || hapd->driver->do_acs == NULL)
810 params.hw_mode = hapd->iface->conf->hw_mode;
816 if (!hapd->iface->conf->acs_ch_list.num)
819 mode = hapd->iface->current_mode;
829 &hapd->iface->conf->acs_ch_list,
838 for (i = 0; i < hapd->iface->num_hw_features; i++) {
839 mode = &hapd->iface->hw_features[i];
840 hostapd_get_hw_mode_any_channels(hapd, mode,
850 params.ht_enabled = !!(hapd->iface->conf->ieee80211n);
851 params.ht40_enabled = !!(hapd->iface->conf->ht_capab &
853 params.vht_enabled = !!(hapd->iface->conf->ieee80211ac);
855 if (hapd->iface->conf->ieee80211n && params.ht40_enabled)
860 if (hapd->iface->conf->ieee80211ac && params.ht40_enabled) {
861 if (hapd->iface->conf->vht_oper_chwidth == VHT_CHANWIDTH_80MHZ)
863 else if (hapd->iface->conf->vht_oper_chwidth ==
865 hapd->iface->conf->vht_oper_chwidth ==
870 ret = hapd->driver->do_acs(hapd->drv_priv, &params);