Lines Matching +full:channel +full:- +full:9
3 * Copyright (c) 2002-2019, Jouni Malinen <j@w1.fi>
15 #include "qca-vendor.h"
28 * sub-type. */ in ieee802_11_parse_vendor_specific()
35 return -1; in ieee802_11_parse_vendor_specific()
41 /* Microsoft/Wi-Fi information elements are further typed and in ieee802_11_parse_vendor_specific()
47 elems->wpa_ie = pos; in ieee802_11_parse_vendor_specific()
48 elems->wpa_ie_len = elen; in ieee802_11_parse_vendor_specific()
57 return -1; in ieee802_11_parse_vendor_specific()
68 elems->wmm = pos; in ieee802_11_parse_vendor_specific()
69 elems->wmm_len = elen; in ieee802_11_parse_vendor_specific()
72 elems->wmm_tspec = pos; in ieee802_11_parse_vendor_specific()
73 elems->wmm_tspec_len = elen; in ieee802_11_parse_vendor_specific()
80 return -1; in ieee802_11_parse_vendor_specific()
84 /* Wi-Fi Protected Setup (WPS) IE */ in ieee802_11_parse_vendor_specific()
85 elems->wps_ie = pos; in ieee802_11_parse_vendor_specific()
86 elems->wps_ie_len = elen; in ieee802_11_parse_vendor_specific()
93 return -1; in ieee802_11_parse_vendor_specific()
100 /* Wi-Fi Alliance - P2P IE */ in ieee802_11_parse_vendor_specific()
101 elems->p2p = pos; in ieee802_11_parse_vendor_specific()
102 elems->p2p_len = elen; in ieee802_11_parse_vendor_specific()
105 /* Wi-Fi Alliance - WFD IE */ in ieee802_11_parse_vendor_specific()
106 elems->wfd = pos; in ieee802_11_parse_vendor_specific()
107 elems->wfd_len = elen; in ieee802_11_parse_vendor_specific()
111 elems->hs20 = pos; in ieee802_11_parse_vendor_specific()
112 elems->hs20_len = elen; in ieee802_11_parse_vendor_specific()
116 elems->osen = pos; in ieee802_11_parse_vendor_specific()
117 elems->osen_len = elen; in ieee802_11_parse_vendor_specific()
120 /* MBO-OCE */ in ieee802_11_parse_vendor_specific()
121 elems->mbo = pos; in ieee802_11_parse_vendor_specific()
122 elems->mbo_len = elen; in ieee802_11_parse_vendor_specific()
126 elems->roaming_cons_sel = pos; in ieee802_11_parse_vendor_specific()
127 elems->roaming_cons_sel_len = elen; in ieee802_11_parse_vendor_specific()
130 elems->multi_ap = pos; in ieee802_11_parse_vendor_specific()
131 elems->multi_ap_len = elen; in ieee802_11_parse_vendor_specific()
140 elems->sae_pk = pos + 4; in ieee802_11_parse_vendor_specific()
141 elems->sae_pk_len = elen - 4; in ieee802_11_parse_vendor_specific()
148 return -1; in ieee802_11_parse_vendor_specific()
155 elems->vendor_ht_cap = pos; in ieee802_11_parse_vendor_specific()
156 elems->vendor_ht_cap_len = elen; in ieee802_11_parse_vendor_specific()
162 elems->vendor_vht = pos; in ieee802_11_parse_vendor_specific()
163 elems->vendor_vht_len = elen; in ieee802_11_parse_vendor_specific()
165 return -1; in ieee802_11_parse_vendor_specific()
172 return -1; in ieee802_11_parse_vendor_specific()
179 elems->pref_freq_list = pos; in ieee802_11_parse_vendor_specific()
180 elems->pref_freq_list_len = elen; in ieee802_11_parse_vendor_specific()
186 return -1; in ieee802_11_parse_vendor_specific()
195 return -1; in ieee802_11_parse_vendor_specific()
210 elems->basic_mle = pos; in ieee802_11_parse_mle()
211 elems->basic_mle_len = elen; in ieee802_11_parse_mle()
212 *total_len = &elems->basic_mle_len; in ieee802_11_parse_mle()
215 elems->probe_req_mle = pos; in ieee802_11_parse_mle()
216 elems->probe_req_mle_len = elen; in ieee802_11_parse_mle()
217 *total_len = &elems->probe_req_mle_len; in ieee802_11_parse_mle()
220 elems->reconf_mle = pos; in ieee802_11_parse_mle()
221 elems->reconf_mle_len = elen; in ieee802_11_parse_mle()
222 *total_len = &elems->reconf_mle_len; in ieee802_11_parse_mle()
225 elems->tdls_mle = pos; in ieee802_11_parse_mle()
226 elems->tdls_mle_len = elen; in ieee802_11_parse_mle()
227 *total_len = &elems->tdls_mle_len; in ieee802_11_parse_mle()
230 elems->prior_access_mle = pos; in ieee802_11_parse_mle()
231 elems->prior_access_mle_len = elen; in ieee802_11_parse_mle()
232 *total_len = &elems->prior_access_mle_len; in ieee802_11_parse_mle()
237 "Unknown Multi-Link element type %u", in ieee802_11_parse_mle()
240 return -1; in ieee802_11_parse_mle()
254 if (elem->id != WLAN_EID_FRAGMENT) in ieee802_11_fragments_length()
257 frags_len += elem->datalen + 2; in ieee802_11_fragments_length()
258 elems->num_frag_elems++; in ieee802_11_fragments_length()
278 return -1; in ieee802_11_parse_extension()
282 elen--; in ieee802_11_parse_extension()
288 elems->assoc_delay_info = pos; in ieee802_11_parse_extension()
293 elems->fils_req_params = pos; in ieee802_11_parse_extension()
294 elems->fils_req_params_len = elen; in ieee802_11_parse_extension()
297 elems->fils_key_confirm = pos; in ieee802_11_parse_extension()
298 elems->fils_key_confirm_len = elen; in ieee802_11_parse_extension()
303 elems->fils_session = pos; in ieee802_11_parse_extension()
308 elems->fils_hlp = pos; in ieee802_11_parse_extension()
309 elems->fils_hlp_len = elen; in ieee802_11_parse_extension()
310 total_len = &elems->fils_hlp_len; in ieee802_11_parse_extension()
315 elems->fils_ip_addr_assign = pos; in ieee802_11_parse_extension()
316 elems->fils_ip_addr_assign_len = elen; in ieee802_11_parse_extension()
321 elems->key_delivery = pos; in ieee802_11_parse_extension()
322 elems->key_delivery_len = elen; in ieee802_11_parse_extension()
325 elems->wrapped_data = pos; in ieee802_11_parse_extension()
326 elems->wrapped_data_len = elen; in ieee802_11_parse_extension()
327 total_len = &elems->wrapped_data_len; in ieee802_11_parse_extension()
332 elems->fils_pk = pos; in ieee802_11_parse_extension()
333 elems->fils_pk_len = elen; in ieee802_11_parse_extension()
338 elems->fils_nonce = pos; in ieee802_11_parse_extension()
343 elems->owe_dh = pos; in ieee802_11_parse_extension()
344 elems->owe_dh_len = elen; in ieee802_11_parse_extension()
347 elems->password_id = pos; in ieee802_11_parse_extension()
348 elems->password_id_len = elen; in ieee802_11_parse_extension()
351 elems->he_capabilities = pos; in ieee802_11_parse_extension()
352 elems->he_capabilities_len = elen; in ieee802_11_parse_extension()
355 elems->he_operation = pos; in ieee802_11_parse_extension()
356 elems->he_operation_len = elen; in ieee802_11_parse_extension()
359 elems->oci = pos; in ieee802_11_parse_extension()
360 elems->oci_len = elen; in ieee802_11_parse_extension()
363 elems->short_ssid_list = pos; in ieee802_11_parse_extension()
364 elems->short_ssid_list_len = elen; in ieee802_11_parse_extension()
369 elems->he_6ghz_band_cap = pos; in ieee802_11_parse_extension()
372 elems->pasn_params = pos; in ieee802_11_parse_extension()
373 elems->pasn_params_len = elen; in ieee802_11_parse_extension()
376 elems->eht_capabilities = pos; in ieee802_11_parse_extension()
377 elems->eht_capabilities_len = elen; in ieee802_11_parse_extension()
380 elems->eht_operation = pos; in ieee802_11_parse_extension()
381 elems->eht_operation_len = elen; in ieee802_11_parse_extension()
388 return -1; in ieee802_11_parse_extension()
391 elems->mbssid_known_bss = pos; in ieee802_11_parse_extension()
392 elems->mbssid_known_bss_len = elen; in ieee802_11_parse_extension()
400 return -1; in ieee802_11_parse_extension()
405 elems, pos + elen, (start + len) - (pos + elen)); in ieee802_11_parse_extension()
422 u8 id = elem->id, elen = elem->datalen; in __ieee802_11_parse_elems()
423 const u8 *pos = elem->data; in __ieee802_11_parse_elems()
426 if (id == WLAN_EID_FRAGMENT && elems->num_frag_elems > 0) { in __ieee802_11_parse_elems()
427 elems->num_frag_elems--; in __ieee802_11_parse_elems()
430 elems->num_frag_elems = 0; in __ieee802_11_parse_elems()
440 if (elems->ssid) { in __ieee802_11_parse_elems()
445 elems->ssid = pos; in __ieee802_11_parse_elems()
446 elems->ssid_len = elen; in __ieee802_11_parse_elems()
449 elems->supp_rates = pos; in __ieee802_11_parse_elems()
450 elems->supp_rates_len = elen; in __ieee802_11_parse_elems()
455 elems->ds_params = pos; in __ieee802_11_parse_elems()
461 elems->challenge = pos; in __ieee802_11_parse_elems()
462 elems->challenge_len = elen; in __ieee802_11_parse_elems()
467 elems->erp_info = pos; in __ieee802_11_parse_elems()
470 elems->ext_supp_rates = pos; in __ieee802_11_parse_elems()
471 elems->ext_supp_rates_len = elen; in __ieee802_11_parse_elems()
480 elems->rsn_ie = pos; in __ieee802_11_parse_elems()
481 elems->rsn_ie_len = elen; in __ieee802_11_parse_elems()
484 elems->rsnxe = pos; in __ieee802_11_parse_elems()
485 elems->rsnxe_len = elen; in __ieee802_11_parse_elems()
490 elems->power_capab = pos; in __ieee802_11_parse_elems()
491 elems->power_capab_len = elen; in __ieee802_11_parse_elems()
494 elems->supp_channels = pos; in __ieee802_11_parse_elems()
495 elems->supp_channels_len = elen; in __ieee802_11_parse_elems()
500 elems->mdie = pos; in __ieee802_11_parse_elems()
501 elems->mdie_len = elen; in __ieee802_11_parse_elems()
506 elems->ftie = pos; in __ieee802_11_parse_elems()
507 elems->ftie_len = elen; in __ieee802_11_parse_elems()
508 elems->fte_defrag_len = elen; in __ieee802_11_parse_elems()
509 total_len = &elems->fte_defrag_len; in __ieee802_11_parse_elems()
514 elems->timeout_int = pos; in __ieee802_11_parse_elems()
519 elems->ht_capabilities = pos; in __ieee802_11_parse_elems()
524 elems->ht_operation = pos; in __ieee802_11_parse_elems()
527 elems->mesh_config = pos; in __ieee802_11_parse_elems()
528 elems->mesh_config_len = elen; in __ieee802_11_parse_elems()
531 elems->mesh_id = pos; in __ieee802_11_parse_elems()
532 elems->mesh_id_len = elen; in __ieee802_11_parse_elems()
535 elems->peer_mgmt = pos; in __ieee802_11_parse_elems()
536 elems->peer_mgmt_len = elen; in __ieee802_11_parse_elems()
541 elems->vht_capabilities = pos; in __ieee802_11_parse_elems()
546 elems->vht_operation = pos; in __ieee802_11_parse_elems()
551 elems->opmode_notif = pos; in __ieee802_11_parse_elems()
556 elems->link_id = pos; in __ieee802_11_parse_elems()
559 elems->interworking = pos; in __ieee802_11_parse_elems()
560 elems->interworking_len = elen; in __ieee802_11_parse_elems()
565 elems->qos_map_set = pos; in __ieee802_11_parse_elems()
566 elems->qos_map_set_len = elen; in __ieee802_11_parse_elems()
569 elems->ext_capab = pos; in __ieee802_11_parse_elems()
570 elems->ext_capab_len = elen; in __ieee802_11_parse_elems()
575 elems->bss_max_idle_period = pos; in __ieee802_11_parse_elems()
578 elems->ssid_list = pos; in __ieee802_11_parse_elems()
579 elems->ssid_list_len = elen; in __ieee802_11_parse_elems()
582 elems->ampe = pos; in __ieee802_11_parse_elems()
583 elems->ampe_len = elen; in __ieee802_11_parse_elems()
586 elems->mic = pos; in __ieee802_11_parse_elems()
587 elems->mic_len = elen; in __ieee802_11_parse_elems()
591 if (elems->mb_ies.nof_ies >= MAX_NOF_MB_IES_SUPPORTED) { in __ieee802_11_parse_elems()
598 elems->mb_ies.ies[elems->mb_ies.nof_ies].ie = pos; in __ieee802_11_parse_elems()
599 elems->mb_ies.ies[elems->mb_ies.nof_ies].ie_len = elen; in __ieee802_11_parse_elems()
600 elems->mb_ies.nof_ies++; in __ieee802_11_parse_elems()
603 elems->supp_op_classes = pos; in __ieee802_11_parse_elems()
604 elems->supp_op_classes_len = elen; in __ieee802_11_parse_elems()
607 elems->rrm_enabled = pos; in __ieee802_11_parse_elems()
608 elems->rrm_enabled_len = elen; in __ieee802_11_parse_elems()
613 elems->mbssid = pos; in __ieee802_11_parse_elems()
614 elems->mbssid_len = elen; in __ieee802_11_parse_elems()
617 elems->cag_number = pos; in __ieee802_11_parse_elems()
618 elems->cag_number_len = elen; in __ieee802_11_parse_elems()
623 elems->ap_csn = pos; in __ieee802_11_parse_elems()
628 elems->fils_indic = pos; in __ieee802_11_parse_elems()
629 elems->fils_indic_len = elen; in __ieee802_11_parse_elems()
634 elems->dils = pos; in __ieee802_11_parse_elems()
635 elems->dils_len = elen; in __ieee802_11_parse_elems()
640 elems->s1g_capab = pos; in __ieee802_11_parse_elems()
644 "Fragment without a valid last element - skip"); in __ieee802_11_parse_elems()
665 (start + len) - (pos + elen)); in __ieee802_11_parse_elems()
673 (int) (start + len - (const u8 *) elem)); in __ieee802_11_parse_elems()
685 * ieee802_11_parse_elems - Parse information elements in management frames
703 * ieee802_11_elems_clear_ids - Clear the data for the given element IDs
715 elems->ssid = NULL; in ieee802_11_elems_clear_ids()
716 elems->ssid_len = 0; in ieee802_11_elems_clear_ids()
719 elems->supp_rates = NULL; in ieee802_11_elems_clear_ids()
720 elems->supp_rates_len = 0; in ieee802_11_elems_clear_ids()
723 elems->ds_params = NULL; in ieee802_11_elems_clear_ids()
726 elems->challenge = NULL; in ieee802_11_elems_clear_ids()
727 elems->challenge_len = 0; in ieee802_11_elems_clear_ids()
730 elems->erp_info = NULL; in ieee802_11_elems_clear_ids()
733 elems->ext_supp_rates = NULL; in ieee802_11_elems_clear_ids()
734 elems->ext_supp_rates_len = 0; in ieee802_11_elems_clear_ids()
737 elems->rsn_ie = NULL; in ieee802_11_elems_clear_ids()
738 elems->rsn_ie_len = 0; in ieee802_11_elems_clear_ids()
741 elems->rsnxe = NULL; in ieee802_11_elems_clear_ids()
742 elems->rsnxe_len = 0; in ieee802_11_elems_clear_ids()
745 elems->power_capab = NULL; in ieee802_11_elems_clear_ids()
746 elems->power_capab_len = 0; in ieee802_11_elems_clear_ids()
749 elems->supp_channels = NULL; in ieee802_11_elems_clear_ids()
750 elems->supp_channels_len = 0; in ieee802_11_elems_clear_ids()
753 elems->mdie = NULL; in ieee802_11_elems_clear_ids()
754 elems->mdie_len = 0; in ieee802_11_elems_clear_ids()
757 elems->ftie = NULL; in ieee802_11_elems_clear_ids()
758 elems->ftie_len = 0; in ieee802_11_elems_clear_ids()
761 elems->timeout_int = NULL; in ieee802_11_elems_clear_ids()
764 elems->ht_capabilities = NULL; in ieee802_11_elems_clear_ids()
767 elems->ht_operation = NULL; in ieee802_11_elems_clear_ids()
770 elems->mesh_config = NULL; in ieee802_11_elems_clear_ids()
771 elems->mesh_config_len = 0; in ieee802_11_elems_clear_ids()
774 elems->mesh_id = NULL; in ieee802_11_elems_clear_ids()
775 elems->mesh_id_len = 0; in ieee802_11_elems_clear_ids()
778 elems->peer_mgmt = NULL; in ieee802_11_elems_clear_ids()
779 elems->peer_mgmt_len = 0; in ieee802_11_elems_clear_ids()
782 elems->vht_capabilities = NULL; in ieee802_11_elems_clear_ids()
785 elems->vht_operation = NULL; in ieee802_11_elems_clear_ids()
788 elems->opmode_notif = NULL; in ieee802_11_elems_clear_ids()
791 elems->link_id = NULL; in ieee802_11_elems_clear_ids()
794 elems->interworking = NULL; in ieee802_11_elems_clear_ids()
795 elems->interworking_len = 0; in ieee802_11_elems_clear_ids()
798 elems->qos_map_set = NULL; in ieee802_11_elems_clear_ids()
799 elems->qos_map_set_len = 0; in ieee802_11_elems_clear_ids()
802 elems->ext_capab = NULL; in ieee802_11_elems_clear_ids()
803 elems->ext_capab_len = 0; in ieee802_11_elems_clear_ids()
806 elems->bss_max_idle_period = NULL; in ieee802_11_elems_clear_ids()
809 elems->ssid_list = NULL; in ieee802_11_elems_clear_ids()
810 elems->ssid_list_len = 0; in ieee802_11_elems_clear_ids()
813 elems->ampe = NULL; in ieee802_11_elems_clear_ids()
814 elems->ampe_len = 0; in ieee802_11_elems_clear_ids()
817 elems->mic = NULL; in ieee802_11_elems_clear_ids()
818 elems->mic_len = 0; in ieee802_11_elems_clear_ids()
821 os_memset(&elems->mb_ies, 0, sizeof(elems->mb_ies)); in ieee802_11_elems_clear_ids()
822 elems->mb_ies.nof_ies = 0; in ieee802_11_elems_clear_ids()
825 elems->supp_op_classes = NULL; in ieee802_11_elems_clear_ids()
826 elems->supp_op_classes_len = 0; in ieee802_11_elems_clear_ids()
829 elems->rrm_enabled = NULL; in ieee802_11_elems_clear_ids()
830 elems->rrm_enabled_len = 0; in ieee802_11_elems_clear_ids()
833 elems->cag_number = NULL; in ieee802_11_elems_clear_ids()
834 elems->cag_number_len = 0; in ieee802_11_elems_clear_ids()
837 elems->ap_csn = NULL; in ieee802_11_elems_clear_ids()
840 elems->fils_indic = NULL; in ieee802_11_elems_clear_ids()
841 elems->fils_indic_len = 0; in ieee802_11_elems_clear_ids()
844 elems->dils = NULL; in ieee802_11_elems_clear_ids()
845 elems->dils_len = 0; in ieee802_11_elems_clear_ids()
848 elems->s1g_capab = NULL; in ieee802_11_elems_clear_ids()
856 * ieee802_11_elems_clear_ext_ids - Clear the data for the given element
869 elems->assoc_delay_info = NULL; in ieee802_11_elems_clear_ext_ids()
872 elems->fils_req_params = NULL; in ieee802_11_elems_clear_ext_ids()
873 elems->fils_req_params_len = 0; in ieee802_11_elems_clear_ext_ids()
876 elems->fils_key_confirm = NULL; in ieee802_11_elems_clear_ext_ids()
877 elems->fils_key_confirm_len = 0; in ieee802_11_elems_clear_ext_ids()
880 elems->fils_session = NULL; in ieee802_11_elems_clear_ext_ids()
883 elems->fils_hlp = NULL; in ieee802_11_elems_clear_ext_ids()
884 elems->fils_hlp_len = 0; in ieee802_11_elems_clear_ext_ids()
887 elems->fils_ip_addr_assign = NULL; in ieee802_11_elems_clear_ext_ids()
888 elems->fils_ip_addr_assign_len = 0; in ieee802_11_elems_clear_ext_ids()
891 elems->key_delivery = NULL; in ieee802_11_elems_clear_ext_ids()
892 elems->key_delivery_len = 0; in ieee802_11_elems_clear_ext_ids()
895 elems->wrapped_data = NULL; in ieee802_11_elems_clear_ext_ids()
896 elems->wrapped_data_len = 0; in ieee802_11_elems_clear_ext_ids()
899 elems->fils_pk = NULL; in ieee802_11_elems_clear_ext_ids()
900 elems->fils_pk_len = 0; in ieee802_11_elems_clear_ext_ids()
903 elems->fils_nonce = NULL; in ieee802_11_elems_clear_ext_ids()
906 elems->owe_dh = NULL; in ieee802_11_elems_clear_ext_ids()
907 elems->owe_dh_len = 0; in ieee802_11_elems_clear_ext_ids()
910 elems->password_id = NULL; in ieee802_11_elems_clear_ext_ids()
911 elems->password_id_len = 0; in ieee802_11_elems_clear_ext_ids()
914 elems->he_capabilities = NULL; in ieee802_11_elems_clear_ext_ids()
915 elems->he_capabilities_len = 0; in ieee802_11_elems_clear_ext_ids()
918 elems->he_operation = NULL; in ieee802_11_elems_clear_ext_ids()
919 elems->he_operation_len = 0; in ieee802_11_elems_clear_ext_ids()
922 elems->oci = NULL; in ieee802_11_elems_clear_ext_ids()
923 elems->oci_len = 0; in ieee802_11_elems_clear_ext_ids()
926 elems->short_ssid_list = NULL; in ieee802_11_elems_clear_ext_ids()
927 elems->short_ssid_list_len = 0; in ieee802_11_elems_clear_ext_ids()
930 elems->he_6ghz_band_cap = NULL; in ieee802_11_elems_clear_ext_ids()
933 elems->pasn_params = NULL; in ieee802_11_elems_clear_ext_ids()
934 elems->pasn_params_len = 0; in ieee802_11_elems_clear_ext_ids()
937 elems->basic_mle = NULL; in ieee802_11_elems_clear_ext_ids()
938 elems->probe_req_mle = NULL; in ieee802_11_elems_clear_ext_ids()
939 elems->reconf_mle = NULL; in ieee802_11_elems_clear_ext_ids()
940 elems->tdls_mle = NULL; in ieee802_11_elems_clear_ext_ids()
941 elems->prior_access_mle = NULL; in ieee802_11_elems_clear_ext_ids()
943 elems->basic_mle_len = 0; in ieee802_11_elems_clear_ext_ids()
944 elems->probe_req_mle_len = 0; in ieee802_11_elems_clear_ext_ids()
945 elems->reconf_mle_len = 0; in ieee802_11_elems_clear_ext_ids()
946 elems->tdls_mle_len = 0; in ieee802_11_elems_clear_ext_ids()
947 elems->prior_access_mle_len = 0; in ieee802_11_elems_clear_ext_ids()
950 elems->eht_capabilities = NULL; in ieee802_11_elems_clear_ext_ids()
951 elems->eht_capabilities_len = 0; in ieee802_11_elems_clear_ext_ids()
954 elems->eht_operation = NULL; in ieee802_11_elems_clear_ext_ids()
955 elems->eht_operation_len = 0; in ieee802_11_elems_clear_ext_ids()
980 /* As we are interested with the Per-STA profile, ignore other types */ in ieee802_11_parse_link_assoc_req()
981 if ((le_to_host16(ml->ml_control) & MULTI_LINK_CONTROL_TYPE_MASK) != in ieee802_11_parse_link_assoc_req()
986 len -= sizeof(*ml) + pos[sizeof(*ml)]; in ieee802_11_parse_link_assoc_req()
1009 len -= 2 + sub_elem_len; in ieee802_11_parse_link_assoc_req()
1025 len -= 2 + sub_elem_len; in ieee802_11_parse_link_assoc_req()
1039 sub_elem_len -= sta_info_len + 2; in ieee802_11_parse_link_assoc_req()
1049 sub_elem_len -= 2; in ieee802_11_parse_link_assoc_req()
1051 /* Handle non-inheritance */ in ieee802_11_parse_link_assoc_req()
1055 u8 non_inherit_len = non_inherit[1] - 1; in ieee802_11_parse_link_assoc_req()
1058 * Do not include the Non-Inheritance element when in ieee802_11_parse_link_assoc_req()
1064 sub_elem_len -= 3 + non_inherit_len; in ieee802_11_parse_link_assoc_req()
1079 non_inherit_len -= 1 + non_inherit[0]; in ieee802_11_parse_link_assoc_req()
1132 if (elem->datalen >= 4 && in ieee802_11_vendor_ie_concat()
1133 WPA_GET_BE32(elem->data) == oui_type) { in ieee802_11_vendor_ie_concat()
1151 if (elem->datalen >= 4 && WPA_GET_BE32(elem->data) == oui_type) in ieee802_11_vendor_ie_concat()
1152 wpabuf_put_data(buf, elem->data + 4, elem->datalen - 4); in ieee802_11_vendor_ie_concat()
1164 * PS-Poll frames are 16 bytes. All other frames are in get_hdr_bssid()
1170 fc = le_to_host16(hdr->frame_control); in get_hdr_bssid()
1181 return hdr->addr1; in get_hdr_bssid()
1183 return hdr->addr2; in get_hdr_bssid()
1190 return hdr->addr1; in get_hdr_bssid()
1192 return hdr->addr3; in get_hdr_bssid()
1222 return -1; in hostapd_config_wmm_ac()
1231 return -1; in hostapd_config_wmm_ac()
1233 ac->aifs = v; in hostapd_config_wmm_ac()
1238 return -1; in hostapd_config_wmm_ac()
1240 ac->cwmin = v; in hostapd_config_wmm_ac()
1245 return -1; in hostapd_config_wmm_ac()
1247 ac->cwmax = v; in hostapd_config_wmm_ac()
1252 return -1; in hostapd_config_wmm_ac()
1254 ac->txop_limit = v; in hostapd_config_wmm_ac()
1259 return -1; in hostapd_config_wmm_ac()
1261 ac->admission_control_mandatory = v; in hostapd_config_wmm_ac()
1264 return -1; in hostapd_config_wmm_ac()
1284 if (*pos >= '0' && *pos <= '9') in hostapd_config_read_int10()
1285 d = *pos - '0'; in hostapd_config_read_int10()
1309 pos = name + 9; in hostapd_config_tx_queue()
1311 pos[4] >= '0' && pos[4] <= '9' && pos[5] == '_') { in hostapd_config_tx_queue()
1312 num = pos[4] - '0'; in hostapd_config_tx_queue()
1320 return -1; in hostapd_config_tx_queue()
1332 queue->aifs = atoi(val); in hostapd_config_tx_queue()
1333 if (queue->aifs < 0 || queue->aifs > 255) { in hostapd_config_tx_queue()
1335 queue->aifs); in hostapd_config_tx_queue()
1336 return -1; in hostapd_config_tx_queue()
1339 queue->cwmin = atoi(val); in hostapd_config_tx_queue()
1340 if (!valid_cw(queue->cwmin)) { in hostapd_config_tx_queue()
1342 queue->cwmin); in hostapd_config_tx_queue()
1343 return -1; in hostapd_config_tx_queue()
1346 queue->cwmax = atoi(val); in hostapd_config_tx_queue()
1347 if (!valid_cw(queue->cwmax)) { in hostapd_config_tx_queue()
1349 queue->cwmax); in hostapd_config_tx_queue()
1350 return -1; in hostapd_config_tx_queue()
1353 queue->burst = hostapd_config_read_int10(val); in hostapd_config_tx_queue()
1356 return -1; in hostapd_config_tx_queue()
1363 enum hostapd_hw_mode ieee80211_freq_to_chan(int freq, u8 *channel) in ieee80211_freq_to_chan() argument
1368 &op_class, channel); in ieee80211_freq_to_chan()
1373 * ieee80211_freq_to_channel_ext - Convert frequency into channel info
1376 * @sec_channel: 0 = non-HT40, 1 = sec. channel above, -1 = sec. channel below
1377 * @chanwidth: VHT/EDMG/etc. channel width
1379 * @channel: Buffer for returning channel number
1385 u8 *op_class, u8 *channel) in ieee80211_freq_to_channel_ext() argument
1391 if (sec_channel > 1 || sec_channel < -1) in ieee80211_freq_to_channel_ext()
1395 if ((freq - 2407) % 5) in ieee80211_freq_to_channel_ext()
1404 else if (sec_channel == -1) in ieee80211_freq_to_channel_ext()
1409 *channel = (freq - 2407) / 5; in ieee80211_freq_to_channel_ext()
1418 *op_class = 82; /* channel 14 */ in ieee80211_freq_to_channel_ext()
1419 *channel = 14; in ieee80211_freq_to_channel_ext()
1425 if ((freq - 4000) % 5) in ieee80211_freq_to_channel_ext()
1427 *channel = (freq - 4000) / 5; in ieee80211_freq_to_channel_ext()
1449 if ((freq - 5000) % 5) in ieee80211_freq_to_channel_ext()
1456 else if (sec_channel == -1) in ieee80211_freq_to_channel_ext()
1461 *channel = (freq - 5000) / 5; in ieee80211_freq_to_channel_ext()
1468 if ((freq - 5000) % 5) in ieee80211_freq_to_channel_ext()
1475 else if (sec_channel == -1) in ieee80211_freq_to_channel_ext()
1480 *channel = (freq - 5000) / 5; in ieee80211_freq_to_channel_ext()
1487 if ((freq - 5000) % 5) in ieee80211_freq_to_channel_ext()
1494 else if (sec_channel == -1) in ieee80211_freq_to_channel_ext()
1499 *channel = (freq - 5000) / 5; in ieee80211_freq_to_channel_ext()
1506 if ((freq - 5000) % 5) in ieee80211_freq_to_channel_ext()
1513 else if (sec_channel == -1) in ieee80211_freq_to_channel_ext()
1518 *channel = (freq - 5000) / 5; in ieee80211_freq_to_channel_ext()
1524 if ((freq - 5000) % 5) in ieee80211_freq_to_channel_ext()
1526 *channel = (freq - 5000) / 5; in ieee80211_freq_to_channel_ext()
1532 if ((freq - 5950) % 5) in ieee80211_freq_to_channel_ext()
1556 *channel = (freq - 5950) / 5; in ieee80211_freq_to_channel_ext()
1562 *channel = (freq - 5925) / 5; in ieee80211_freq_to_channel_ext()
1566 /* 56.16 GHz, channel 1..6 */ in ieee80211_freq_to_channel_ext()
1574 *channel = (freq - 56160) / 2160; in ieee80211_freq_to_channel_ext()
1578 /* EDMG channels 9 - 13 */ in ieee80211_freq_to_channel_ext()
1582 *channel = (freq - 56160) / 2160 + 8; in ieee80211_freq_to_channel_ext()
1586 /* EDMG channels 17 - 20 */ in ieee80211_freq_to_channel_ext()
1590 *channel = (freq - 56160) / 2160 + 16; in ieee80211_freq_to_channel_ext()
1594 /* EDMG channels 25 - 27 */ in ieee80211_freq_to_channel_ext()
1598 *channel = (freq - 56160) / 2160 + 24; in ieee80211_freq_to_channel_ext()
1613 int sec_channel, u8 *op_class, u8 *channel) in ieee80211_chaninfo_to_channel() argument
1651 channel) == NUM_HOSTAPD_MODES) { in ieee80211_chaninfo_to_channel()
1653 "Cannot determine operating class and channel (freq=%u chanwidth=%d sec_channel=%d)", in ieee80211_chaninfo_to_channel()
1655 return -1; in ieee80211_chaninfo_to_channel()
1704 return -1; in ieee80211_chan_to_freq_us()
1713 return -1; in ieee80211_chan_to_freq_us()
1715 case 4: /* channels 100-144 */ in ieee80211_chan_to_freq_us()
1716 case 24: /* channels 100-140; 40 MHz */ in ieee80211_chan_to_freq_us()
1718 return -1; in ieee80211_chan_to_freq_us()
1726 return -1; in ieee80211_chan_to_freq_us()
1730 return -1; in ieee80211_chan_to_freq_us()
1734 return -1; in ieee80211_chan_to_freq_us()
1736 case 37: /* 60 GHz band, EDMG CB2, channels 9..15 */ in ieee80211_chan_to_freq_us()
1737 if (chan < 9 || chan > 15) in ieee80211_chan_to_freq_us()
1738 return -1; in ieee80211_chan_to_freq_us()
1739 return 56160 + 2160 * (chan - 8); in ieee80211_chan_to_freq_us()
1742 return -1; in ieee80211_chan_to_freq_us()
1743 return 56160 + 2160 * (chan - 16); in ieee80211_chan_to_freq_us()
1746 return -1; in ieee80211_chan_to_freq_us()
1747 return 56160 + 2160 * (chan - 24); in ieee80211_chan_to_freq_us()
1749 return -1; in ieee80211_chan_to_freq_us()
1758 case 11: /* channels 1..9; 40 MHz */ in ieee80211_chan_to_freq_eu()
1761 return -1; in ieee80211_chan_to_freq_eu()
1768 case 9: /* channels 56,64; 40 MHz */ in ieee80211_chan_to_freq_eu()
1770 return -1; in ieee80211_chan_to_freq_eu()
1772 case 3: /* channels 100-140 */ in ieee80211_chan_to_freq_eu()
1773 case 7: /* channels 100-132; 40 MHz */ in ieee80211_chan_to_freq_eu()
1774 case 10: /* channels 104-136; 40 MHz */ in ieee80211_chan_to_freq_eu()
1775 case 16: /* channels 100-140 */ in ieee80211_chan_to_freq_eu()
1777 return -1; in ieee80211_chan_to_freq_eu()
1781 return -1; in ieee80211_chan_to_freq_eu()
1785 return -1; in ieee80211_chan_to_freq_eu()
1787 case 21: /* 60 GHz band, EDMG CB2, channels 9..11 */ in ieee80211_chan_to_freq_eu()
1788 if (chan < 9 || chan > 11) in ieee80211_chan_to_freq_eu()
1789 return -1; in ieee80211_chan_to_freq_eu()
1790 return 56160 + 2160 * (chan - 8); in ieee80211_chan_to_freq_eu()
1793 return -1; in ieee80211_chan_to_freq_eu()
1794 return 56160 + 2160 * (chan - 16); in ieee80211_chan_to_freq_eu()
1797 return -1; in ieee80211_chan_to_freq_eu()
1798 return 56160 + 2160 * (chan - 24); in ieee80211_chan_to_freq_eu()
1800 return -1; in ieee80211_chan_to_freq_eu()
1807 /* Table E-3 in IEEE Std 802.11-2020 - Operating classes in Japan */ in ieee80211_chan_to_freq_jp()
1810 case 56: /* channels 1..9; 40 MHz */ in ieee80211_chan_to_freq_jp()
1813 return -1; in ieee80211_chan_to_freq_jp()
1815 case 31: /* channel 14 */ in ieee80211_chan_to_freq_jp()
1817 return -1; in ieee80211_chan_to_freq_jp()
1829 return -1; in ieee80211_chan_to_freq_jp()
1831 case 34: /* channels 100-144 */ in ieee80211_chan_to_freq_jp()
1833 case 39: /* channels 100-140; 40 MHz */ in ieee80211_chan_to_freq_jp()
1835 case 44: /* channels 104-144; 40 MHz */ in ieee80211_chan_to_freq_jp()
1837 case 58: /* channels 100-144 */ in ieee80211_chan_to_freq_jp()
1839 return -1; in ieee80211_chan_to_freq_jp()
1843 return -1; in ieee80211_chan_to_freq_jp()
1845 case 62: /* 60 GHz band, EDMG CB2, channels 9..11 */ in ieee80211_chan_to_freq_jp()
1846 if (chan < 9 || chan > 11) in ieee80211_chan_to_freq_jp()
1847 return -1; in ieee80211_chan_to_freq_jp()
1848 return 56160 + 2160 * (chan - 8); in ieee80211_chan_to_freq_jp()
1851 return -1; in ieee80211_chan_to_freq_jp()
1852 return 56160 + 2160 * (chan - 16); in ieee80211_chan_to_freq_jp()
1853 case 64: /* 60 GHz band, EDMG CB4, channel 25 */ in ieee80211_chan_to_freq_jp()
1855 return -1; in ieee80211_chan_to_freq_jp()
1856 return 56160 + 2160 * (chan - 24); in ieee80211_chan_to_freq_jp()
1858 return -1; in ieee80211_chan_to_freq_jp()
1867 case 8: /* channels 1..9; 40 MHz */ in ieee80211_chan_to_freq_cn()
1868 case 9: /* channels 5..13; 40 MHz */ in ieee80211_chan_to_freq_cn()
1870 return -1; in ieee80211_chan_to_freq_cn()
1877 return -1; in ieee80211_chan_to_freq_cn()
1882 return -1; in ieee80211_chan_to_freq_cn()
1885 return -1; in ieee80211_chan_to_freq_cn()
1892 /* Table E-4 in IEEE Std 802.11-2020 - Global operating classes */ in ieee80211_chan_to_freq_global()
1897 return -1; in ieee80211_chan_to_freq_global()
1900 /* channel 14 */ in ieee80211_chan_to_freq_global()
1902 return -1; in ieee80211_chan_to_freq_global()
1904 case 83: /* channels 1..9; 40 MHz */ in ieee80211_chan_to_freq_global()
1907 return -1; in ieee80211_chan_to_freq_global()
1916 return -1; in ieee80211_chan_to_freq_global()
1918 case 121: /* channels 100-144 */ in ieee80211_chan_to_freq_global()
1919 case 122: /* channels 100-140; 40 MHz */ in ieee80211_chan_to_freq_global()
1920 case 123: /* channels 104-144; 40 MHz */ in ieee80211_chan_to_freq_global()
1922 return -1; in ieee80211_chan_to_freq_global()
1926 return -1; in ieee80211_chan_to_freq_global()
1932 return -1; in ieee80211_chan_to_freq_global()
1937 return -1; in ieee80211_chan_to_freq_global()
1941 return -1; in ieee80211_chan_to_freq_global()
1943 case 131: /* UHB channels, 20 MHz: 1, 5, 9.. */ in ieee80211_chan_to_freq_global()
1950 return -1; in ieee80211_chan_to_freq_global()
1955 return -1; in ieee80211_chan_to_freq_global()
1958 return -1; in ieee80211_chan_to_freq_global()
1960 case 181: /* 60 GHz band, EDMG CB2, channels 9..15 */ in ieee80211_chan_to_freq_global()
1961 if (chan < 9 || chan > 15) in ieee80211_chan_to_freq_global()
1962 return -1; in ieee80211_chan_to_freq_global()
1963 return 56160 + 2160 * (chan - 8); in ieee80211_chan_to_freq_global()
1966 return -1; in ieee80211_chan_to_freq_global()
1967 return 56160 + 2160 * (chan - 16); in ieee80211_chan_to_freq_global()
1968 case 183: /* 60 GHz band, EDMG CB4, channel 25..29 */ in ieee80211_chan_to_freq_global()
1970 return -1; in ieee80211_chan_to_freq_global()
1971 return 56160 + 2160 * (chan - 24); in ieee80211_chan_to_freq_global()
1973 return -1; in ieee80211_chan_to_freq_global()
1978 * ieee80211_chan_to_freq - Convert channel info to frequency
1981 * @chan: Channel number
1982 * Returns: Frequency in MHz or -1 if the specified channel is unknown
2038 * 802.11-2020: Table E-4 - Global operating classes
2049 /* Operating classes with "80+" behavior indication in Table E-4 */ in is_80plus_op_class()
2065 if (elems->supp_rates == NULL && elems->ext_supp_rates == NULL) in supp_rates_11b_only()
2068 for (i = 0; elems->supp_rates && i < elems->supp_rates_len; i++) { in supp_rates_11b_only()
2069 if (is_11b(elems->supp_rates[i])) in supp_rates_11b_only()
2075 for (i = 0; elems->ext_supp_rates && i < elems->ext_supp_rates_len; in supp_rates_11b_only()
2077 if (is_11b(elems->ext_supp_rates[i])) in supp_rates_11b_only()
2340 if (info->nof_ies >= MAX_NOF_MB_IES_SUPPORTED) in mb_ies_info_by_ies()
2344 elem->datalen + 2); in mb_ies_info_by_ies()
2345 info->ies[info->nof_ies].ie = elem->data; in mb_ies_info_by_ies()
2346 info->ies[info->nof_ies].ie_len = elem->datalen; in mb_ies_info_by_ies()
2347 info->nof_ies++; in mb_ies_info_by_ies()
2352 return -1; in mb_ies_info_by_ies()
2365 if (info->nof_ies) { in mb_ies_by_info()
2369 for (i = 0; i < info->nof_ies; i++) in mb_ies_by_info()
2370 mb_ies_size += 2 + info->ies[i].ie_len; in mb_ies_by_info()
2374 for (i = 0; i < info->nof_ies; i++) { in mb_ies_by_info()
2376 wpabuf_put_u8(mb_ies, info->ies[i].ie_len); in mb_ies_by_info()
2378 info->ies[i].ie, in mb_ies_by_info()
2379 info->ies[i].ie_len); in mb_ies_by_info()
2393 { HOSTAPD_MODE_IEEE80211G, 83, 1, 9, 1, BW40PLUS, NO_P2P_SUPP },
2411 * IEEE Std 802.11ax-2021, Table E-4 actually talks about channel center
2413 * and 135, but currently use the lowest 20 MHz channel for simplicity
2417 * channel center frequency index value, but it happens to be a 20 MHz
2418 * channel and the channel number in the channel set would match the
2422 * MHz channel on the 5 GHz band. 130 is identified with "80+", so this
2424 * value pair 133 and 135 is used to describe a 80+80 MHz channel on
2426 * operating classes listed here are used as 1-octet values.
2438 /* IEEE P802.11be/D5.0, Table E-4 (Global operating classes) */
2442 * IEEE Std 802.11ad-2012 and P802.ay/D5.0 60 GHz operating classes.
2443 * Class 180 has the legacy channels 1-6. Classes 181-183 include
2444 * channels which implement channel bonding features.
2447 { HOSTAPD_MODE_IEEE80211AD, 181, 9, 13, 1, BW4320, P2P_SUPP },
2451 { -1, 0, 0, 0, 0, BW20, NO_P2P_SUPP }
2458 u8 channel; in ieee80211_phy_type_by_freq() local
2460 hw_mode = ieee80211_freq_to_chan(freq, &channel); in ieee80211_phy_type_by_freq()
2477 /* ieee80211_get_phy_type - Derive the phy type by freq and bandwidth */
2493 * get_ie - Fetch a specified information element from IEs buffer
2510 return &elem->id; in get_ie()
2517 * get_ie_ext - Fetch a specified extended information element from IEs buffer
2534 return &elem->id; in get_ie_ext()
2545 if (elem->datalen >= 4 && in get_vendor_ie()
2546 vendor_type == WPA_GET_BE32(elem->data)) in get_vendor_ie()
2547 return &elem->id; in get_vendor_ie()
2587 /* Default profile is 1, when Multi-AP profile subelement is not in check_multi_ap_ie()
2589 multi_ap->profile = 1; in check_multi_ap_ie()
2592 u8 id = elem->id, elen = elem->datalen; in check_multi_ap_ie()
2593 const u8 *pos = elem->data; in check_multi_ap_ie()
2598 multi_ap->capability = *pos; in check_multi_ap_ie()
2602 "Multi-AP invalid Multi-AP subelement"); in check_multi_ap_ie()
2609 "Multi-AP IE invalid Multi-AP profile subelement"); in check_multi_ap_ie()
2613 multi_ap->profile = *pos; in check_multi_ap_ie()
2614 if (multi_ap->profile > MULTI_AP_PROFILE_MAX) { in check_multi_ap_ie()
2616 "Multi-AP IE with invalid profile 0x%02x", in check_multi_ap_ie()
2617 multi_ap->profile); in check_multi_ap_ie()
2622 if (multi_ap->profile < MULTI_AP_PROFILE_2) { in check_multi_ap_ie()
2624 "Multi-AP IE invalid profile to read VLAN IE"); in check_multi_ap_ie()
2629 "Multi-AP IE invalid Multi-AP VLAN subelement"); in check_multi_ap_ie()
2636 "Multi-AP IE invalid Multi-AP VLAN ID %d", in check_multi_ap_ie()
2640 multi_ap->vlanid = vlan_id; in check_multi_ap_ie()
2644 "Ignore unknown subelement %u in Multi-AP IE", in check_multi_ap_ie()
2652 (int) (multi_ap_ie + multi_ap_len - in check_multi_ap_ie()
2659 "Multi-AP element without Multi-AP Extension subelement"); in check_multi_ap_ie()
2683 /* Multi-AP Extension subelement */ in add_multi_ap_ie()
2684 if (buf + len - pos < 3) in add_multi_ap_ie()
2688 *pos++ = multi_ap->capability; in add_multi_ap_ie()
2690 /* Add Multi-AP Profile subelement only for R2 or newer configuration */ in add_multi_ap_ie()
2691 if (multi_ap->profile >= MULTI_AP_PROFILE_2) { in add_multi_ap_ie()
2692 if (buf + len - pos < 3) in add_multi_ap_ie()
2696 *pos++ = multi_ap->profile; in add_multi_ap_ie()
2699 /* Add Multi-AP Default 802.1Q Setting subelement only for backhaul BSS in add_multi_ap_ie()
2701 if (multi_ap->vlanid && in add_multi_ap_ie()
2702 multi_ap->profile >= MULTI_AP_PROFILE_2 && in add_multi_ap_ie()
2703 (multi_ap->capability & MULTI_AP_BACKHAUL_BSS)) { in add_multi_ap_ie()
2704 if (buf + len - pos < 4) in add_multi_ap_ie()
2708 WPA_PUT_LE16(pos, multi_ap->vlanid); in add_multi_ap_ie()
2712 *len_ptr = pos - len_ptr - 1; in add_multi_ap_ie()
2714 return pos - buf; in add_multi_ap_ie()
2749 { 9, 120 },
2790 { 9, 84 },
2853 while (op->op_class && op->op_class != op_class) in get_oper_class()
2856 if (!op->op_class) in get_oper_class()
2865 switch (map->bw) { in oper_class_bw_to_int()
2889 /* Channel: 2 */ in center_idx_to_bw_6ghz()
2892 /* channels: 1, 5, 9, 13... */ in center_idx_to_bw_6ghz()
2908 return -1; in center_idx_to_bw_6ghz()
2920 if (center_idx_to_bw_6ghz((freq - 5950) / 5) < 0) in is_6ghz_freq()
2939 if ((((freq - 5950) / 5) & 0x3) != 0x1) in is_6ghz_psc_frequency()
2942 i = (freq - 5950 + 55) % 80; in is_6ghz_psc_frequency()
2944 i = (freq - 5950 + 55) / 80; in is_6ghz_psc_frequency()
2954 * get_6ghz_sec_channel - Get the relative position of the secondary channel
2955 * to the primary channel in 6 GHz
2956 * @channel: Primary channel to be checked for (in global op class 131)
2957 * Returns: 1 = secondary channel above, -1 = secondary channel below
2960 int get_6ghz_sec_channel(int channel) in get_6ghz_sec_channel() argument
2963 * In the 6 GHz band, primary channels are numbered as 1, 5, 9, 13.., so in get_6ghz_sec_channel()
2964 * the 40 MHz channels are formed with the channel pairs as (1,5), in get_6ghz_sec_channel()
2965 * (9,13), (17,21).. in get_6ghz_sec_channel()
2966 * The secondary channel for a given primary channel is below the in get_6ghz_sec_channel()
2967 * primary channel for the channels 5, 13, 21.. and it is above the in get_6ghz_sec_channel()
2968 * primary channel for the channels 1, 9, 17.. in get_6ghz_sec_channel()
2971 if (((channel - 1) / 4) % 2) in get_6ghz_sec_channel()
2972 return -1; in get_6ghz_sec_channel()
2999 * BSS Transition Candidate List Entries - Neighbor Report elements in ieee802_11_parse_candidate_list()
3001 * <Channel Number>,<PHY Type>[,<hexdump of Optional Subelements>] in ieee802_11_parse_candidate_list()
3014 return -1; in ieee802_11_parse_candidate_list()
3024 return -1; in ieee802_11_parse_candidate_list()
3030 return -1; in ieee802_11_parse_candidate_list()
3039 return -1; in ieee802_11_parse_candidate_list()
3046 wpa_printf(MSG_DEBUG, "Missing Channel Number"); in ieee802_11_parse_candidate_list()
3047 return -1; in ieee802_11_parse_candidate_list()
3051 *nei_pos++ = atoi(pos); /* Channel Number */ in ieee802_11_parse_candidate_list()
3055 return -1; in ieee802_11_parse_candidate_list()
3069 len = end - pos; in ieee802_11_parse_candidate_list()
3075 return -1; in ieee802_11_parse_candidate_list()
3081 return -1; in ieee802_11_parse_candidate_list()
3087 nei_start[1] = nei_pos - nei_start - 2; in ieee802_11_parse_candidate_list()
3090 return nei_pos - nei_rep; in ieee802_11_parse_candidate_list()
3136 edmg->channels = 0; in hostapd_encode_edmg_chan()
3137 edmg->bw_config = 0; in hostapd_encode_edmg_chan()
3144 edmg->channels = EDMG_CHANNEL_9_SUBCHANNELS; in hostapd_encode_edmg_chan()
3145 edmg->bw_config = EDMG_BW_CONFIG_5; in hostapd_encode_edmg_chan()
3148 edmg->channels = EDMG_CHANNEL_10_SUBCHANNELS; in hostapd_encode_edmg_chan()
3149 edmg->bw_config = EDMG_BW_CONFIG_5; in hostapd_encode_edmg_chan()
3152 edmg->channels = EDMG_CHANNEL_11_SUBCHANNELS; in hostapd_encode_edmg_chan()
3153 edmg->bw_config = EDMG_BW_CONFIG_5; in hostapd_encode_edmg_chan()
3156 edmg->channels = EDMG_CHANNEL_12_SUBCHANNELS; in hostapd_encode_edmg_chan()
3157 edmg->bw_config = EDMG_BW_CONFIG_5; in hostapd_encode_edmg_chan()
3160 edmg->channels = EDMG_CHANNEL_13_SUBCHANNELS; in hostapd_encode_edmg_chan()
3161 edmg->bw_config = EDMG_BW_CONFIG_5; in hostapd_encode_edmg_chan()
3165 edmg->channels = BIT(primary_channel - 1); in hostapd_encode_edmg_chan()
3166 edmg->bw_config = EDMG_BW_CONFIG_4; in hostapd_encode_edmg_chan()
3168 edmg->channels = 0; in hostapd_encode_edmg_chan()
3169 edmg->bw_config = 0; in hostapd_encode_edmg_chan()
3190 * Between this 4 groups, there is no subset relation - as a result of in ieee802_edmg_is_allowed()
3209 case 83: /* channels 1..9; 40 MHz */ in op_class_to_bandwidth()
3222 case 121: /* channels 100-144 */ in op_class_to_bandwidth()
3224 case 122: /* channels 100-140; 40 MHz */ in op_class_to_bandwidth()
3225 case 123: /* channels 104-144; 40 MHz */ in op_class_to_bandwidth()
3239 case 131: /* UHB channels, 20 MHz: 1, 5, 9.. */ in op_class_to_bandwidth()
3254 case 181: /* 60 GHz band, EDMG CB2, channels 9..15 */ in op_class_to_bandwidth()
3258 case 183: /* 60 GHz band, EDMG CB4, channel 25..29 */ in op_class_to_bandwidth()
3272 case 83: /* channels 1..9; 40 MHz */ in op_class_to_ch_width()
3285 case 121: /* channels 100-144 */ in op_class_to_ch_width()
3287 case 122: /* channels 100-140; 40 MHz */ in op_class_to_ch_width()
3288 case 123: /* channels 104-144; 40 MHz */ in op_class_to_ch_width()
3302 case 131: /* UHB channels, 20 MHz: 1, 5, 9.. */ in op_class_to_ch_width()
3318 case 181: /* 60 GHz band, EDMG CB2, channels 9..15 */ in op_class_to_ch_width()
3322 case 183: /* 60 GHz band, EDMG CB4, channel 25..29 */ in op_class_to_ch_width()
3331 * chwidth_freq2_to_ch_width - Determine channel width as enum oper_chan_width
3332 * @chwidth: Channel width integer
3334 * Returns: enum oper_chan_width, -1 on failure
3339 return -1; in chwidth_freq2_to_ch_width()
3357 return -1; in chwidth_freq2_to_ch_width()
3374 buf = wpabuf_alloc_copy(data, min_defrag_len - 1); in ieee802_11_defrag()
3378 pos = &data[min_defrag_len - 1]; in ieee802_11_defrag()
3379 len -= min_defrag_len - 1; in ieee802_11_defrag()
3384 if (elen > (size_t) (end - pos) || elen > len) in ieee802_11_defrag()
3395 len -= elen; in ieee802_11_defrag()
3410 if (elem->datalen >= 2 && in get_ml_ie()
3411 (elem->data[1] & MULTI_LINK_CONTROL_TYPE_MASK) == type) in get_ml_ie()
3412 return &elem->id; in get_ml_ie()