Lines Matching +full:ftm +full:- +full:timer

1 /* SPDX-License-Identifier: GPL-2.0-only */
5 * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
7 * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
10 * Copyright (c) 2013 - 2014 Intel Mobile Communications GmbH
11 * Copyright (c) 2016 - 2017 Intel Deutschland GmbH
12 * Copyright (c) 2018 - 2024 Intel Corporation
34 * -----------------------------------------------------------------
35 * 0 0 DA SA BSSID - IBSS/DLS
36 * 0 1 DA BSSID SA - AP -> STA
37 * 1 0 BSSID SA DA - AP <- STA
115 /* see 802.11ah-2016 9.9 NDP CMAC frames */
159 /* control extension - for IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTL_EXT */
175 /* PV1 Layout IEEE 802.11-2020 9.8.3.1 */
191 return ((sn1 - sn2) & IEEE80211_SN_MASK) > (IEEE80211_SN_MODULO >> 1); in ieee80211_sn_less()
196 return ((sn2 - sn1) & IEEE80211_SN_MASK) <= (IEEE80211_SN_MODULO >> 1); in ieee80211_sn_less_eq()
211 return (sn1 - sn2) & IEEE80211_SN_MASK; in ieee80211_sn_sub()
224 /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
237 /* Maximal size of an A-MSDU that can be transported in a HT BA session */
240 /* Maximal size of an A-MSDU */
273 /* A-MSDU 802.11n */
283 /* U-APSD queue for WMM IEs sent by AP */
287 /* U-APSD queues for WMM IEs sent by STA */
294 /* U-APSD max SP length for WMM IEs sent by STA */
315 /* UL-bandwidth within common_info of trigger frame */
374 * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set
375 * @fc: frame control bytes in little-endian byteorder
376 * Return: whether or not the frame has to-DS set
384 * ieee80211_has_fromds - check if IEEE80211_FCTL_FROMDS is set
385 * @fc: frame control bytes in little-endian byteorder
386 * Return: whether or not the frame has from-DS set
394 * ieee80211_has_a4 - check if IEEE80211_FCTL_TODS and IEEE80211_FCTL_FROMDS are set
395 * @fc: frame control bytes in little-endian byteorder
396 * Return: whether or not it's a 4-address frame (from-DS and to-DS set)
405 * ieee80211_has_morefrags - check if IEEE80211_FCTL_MOREFRAGS is set
406 * @fc: frame control bytes in little-endian byteorder
415 * ieee80211_has_retry - check if IEEE80211_FCTL_RETRY is set
416 * @fc: frame control bytes in little-endian byteorder
425 * ieee80211_has_pm - check if IEEE80211_FCTL_PM is set
426 * @fc: frame control bytes in little-endian byteorder
435 * ieee80211_has_moredata - check if IEEE80211_FCTL_MOREDATA is set
436 * @fc: frame control bytes in little-endian byteorder
445 * ieee80211_has_protected - check if IEEE80211_FCTL_PROTECTED is set
446 * @fc: frame control bytes in little-endian byteorder
455 * ieee80211_has_order - check if IEEE80211_FCTL_ORDER is set
456 * @fc: frame control bytes in little-endian byteorder
465 * ieee80211_is_mgmt - check if type is IEEE80211_FTYPE_MGMT
466 * @fc: frame control bytes in little-endian byteorder
476 * ieee80211_is_ctl - check if type is IEEE80211_FTYPE_CTL
477 * @fc: frame control bytes in little-endian byteorder
487 * ieee80211_is_data - check if type is IEEE80211_FTYPE_DATA
488 * @fc: frame control bytes in little-endian byteorder
498 * ieee80211_is_ext - check if type is IEEE80211_FTYPE_EXT
499 * @fc: frame control bytes in little-endian byteorder
510 * ieee80211_is_data_qos - check if type is IEEE80211_FTYPE_DATA and IEEE80211_STYPE_QOS_DATA is set
511 * @fc: frame control bytes in little-endian byteorder
525 * ieee80211_is_data_present - check if type is IEEE80211_FTYPE_DATA and has data
526 * @fc: frame control bytes in little-endian byteorder
534 * for the data-containing substypes. in ieee80211_is_data_present()
541 * ieee80211_is_assoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_REQ
542 * @fc: frame control bytes in little-endian byteorder
552 * ieee80211_is_assoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_RESP
553 * @fc: frame control bytes in little-endian byteorder
563 * ieee80211_is_reassoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_REQ
564 * @fc: frame control bytes in little-endian byteorder
574 * ieee80211_is_reassoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_RESP
575 * @fc: frame control bytes in little-endian byteorder
585 * ieee80211_is_probe_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_REQ
586 * @fc: frame control bytes in little-endian byteorder
596 * ieee80211_is_probe_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_RESP
597 * @fc: frame control bytes in little-endian byteorder
607 * ieee80211_is_beacon - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_BEACON
608 * @fc: frame control bytes in little-endian byteorder
618 * ieee80211_is_s1g_beacon - check if IEEE80211_FTYPE_EXT &&
620 * @fc: frame control bytes in little-endian byteorder
631 * ieee80211_is_s1g_short_beacon - check if frame is an S1G short beacon
632 * @fc: frame control bytes in little-endian byteorder
643 * ieee80211_is_atim - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ATIM
644 * @fc: frame control bytes in little-endian byteorder
654 * ieee80211_is_disassoc - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DISASSOC
655 * @fc: frame control bytes in little-endian byteorder
665 * ieee80211_is_auth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_AUTH
666 * @fc: frame control bytes in little-endian byteorder
676 * ieee80211_is_deauth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DEAUTH
677 * @fc: frame control bytes in little-endian byteorder
687 * ieee80211_is_action - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ACTION
688 * @fc: frame control bytes in little-endian byteorder
698 * ieee80211_is_back_req - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK_REQ
699 * @fc: frame control bytes in little-endian byteorder
700 * Return: whether or not the frame is a block-ACK request frame
709 * ieee80211_is_back - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK
710 * @fc: frame control bytes in little-endian byteorder
711 * Return: whether or not the frame is a block-ACK frame
720 * ieee80211_is_pspoll - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_PSPOLL
721 * @fc: frame control bytes in little-endian byteorder
722 * Return: whether or not the frame is a PS-poll frame
731 * ieee80211_is_rts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_RTS
732 * @fc: frame control bytes in little-endian byteorder
742 * ieee80211_is_cts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CTS
743 * @fc: frame control bytes in little-endian byteorder
753 * ieee80211_is_ack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_ACK
754 * @fc: frame control bytes in little-endian byteorder
764 * ieee80211_is_cfend - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFEND
765 * @fc: frame control bytes in little-endian byteorder
766 * Return: whether or not the frame is a CF-end frame
775 * ieee80211_is_cfendack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFENDACK
776 * @fc: frame control bytes in little-endian byteorder
777 * Return: whether or not the frame is a CF-end-ack frame
786 * ieee80211_is_nullfunc - check if frame is a regular (non-QoS) nullfunc frame
787 * @fc: frame control bytes in little-endian byteorder
797 * ieee80211_is_qos_nullfunc - check if frame is a QoS nullfunc frame
798 * @fc: frame control bytes in little-endian byteorder
808 * ieee80211_is_trigger - check if frame is trigger frame
809 * @fc: frame control field in little-endian byteorder
819 * ieee80211_is_any_nullfunc - check if frame is regular or QoS nullfunc frame
820 * @fc: frame control bytes in little-endian byteorder
829 * ieee80211_is_first_frag - check if IEEE80211_SCTL_FRAG is not set
830 * @seq_ctrl: frame sequence control bytes in little-endian byteorder
840 * ieee80211_is_frag - check if a frame is a fragment
846 return ieee80211_has_morefrags(hdr->frame_control) || in ieee80211_is_frag()
847 hdr->seq_ctrl & cpu_to_le16(IEEE80211_SCTL_FRAG); in ieee80211_is_frag()
852 return le16_get_bits(hdr->seq_ctrl, IEEE80211_SCTL_SEQ); in ieee80211_get_sn()
870 * enum ieee80211_preq_flags - mesh PREQ element flags
879 * enum ieee80211_preq_target_flags - mesh PREQ element per target flags
890 * struct ieee80211_quiet_ie - Quiet element
897 * described in IEEE Std 802.11-2020 section 9.4.2.22.
907 * struct ieee80211_msrment_ie - Measurement element
915 * in IEEE Std 802.11-2020 sections 9.4.2.20 and 9.4.2.21.
925 * struct ieee80211_channel_sw_ie - Channel Switch Announcement element
931 * Announcement element" as described in IEEE Std 802.11-2020 section
941 * struct ieee80211_ext_chansw_ie - Extended Channel Switch Announcement element
948 * element" as described in IEEE Std 802.11-2020 section 9.4.2.52.
958 * struct ieee80211_sec_chan_offs_ie - secondary channel offset IE
968 * struct ieee80211_mesh_chansw_params_ie - mesh channel switch parameters IE
975 * Parameters element" as described in IEEE Std 802.11-2020 section
986 * struct ieee80211_wide_bw_chansw_ie - wide bandwidth channel switch IE
992 * Channel Switch element" as described in IEEE Std 802.11-2020
1001 * struct ieee80211_tim_ie - Traffic Indication Map information element
1006 * minimum valid size when carried in a non-S1G PPDU
1010 * described in IEEE Std 802.11-2020 section 9.4.2.5. Note that this
1012 * non-S1G PPDU. When the TIM is carried in an S1G PPDU, the Bitmap
1026 * struct ieee80211_meshconf_ie - Mesh Configuration element
1036 * element" as described in IEEE Std 802.11-2020 section 9.4.2.97.
1049 * enum mesh_config_capab_flags - Mesh Configuration IE capability field flags
1060 * 802.11-2020 section 9.4.2.97.7.
1080 * struct ieee80211_rann_ie - RANN (root announcement) element
1090 * described in IEEE Std 802.11-2020 section 9.4.2.111.
1112 * enum ieee80211_vht_opmode_bits - VHT operating mode field bits
1122 * @IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF: indicates streams in SU-MIMO PPDU
1138 * enum ieee80211_s1g_chanwidth - S1G channel widths
1139 * These are defined in IEEE802.11-2016ah Table 10-20
1161 * struct ieee80211_tpc_report_ie - TPC Report element
1166 * described in IEEE Std 802.11-2020 section 9.4.2.16.
1184 * struct ieee80211_s1g_bcn_compat_ie - S1G Beacon Compatibility element
1190 * Compatibility element" as described in IEEE Std 802.11-2020 section
1200 * struct ieee80211_s1g_oper_ie - S1G Operation element
1205 * @basic_mcs_nss: Basic S1G-MCS and NSS Set
1208 * element" as described in IEEE Std 802.11-2020 section 9.4.2.212.
1219 * struct ieee80211_aid_response_ie - AID Response element
1225 * as described in IEEE Std 802.11-2020 section 9.4.2.194.
1312 * struct ieee80211_ttlm_elem - TID-To-Link Mapping element
1325 * struct ieee80211_bss_load_elem - BSS Load elemen
1327 * Defined in section 9.4.2.26 in IEEE 802.11-REVme D4.1
1507 } __packed ftm; member
1580 /* Management MIC information element (IEEE 802.11w) for GMAC and CMAC-256 */
1598 u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */
1645 /* Link-id information element */
1699 * Peer-to-Peer IE attribute related definitions.
1702 * enum ieee80211_p2p_attr_id - identifies type of peer-to-peer attribute.
1724 /* 19 - 220: Reserved */
1730 /* Notice of Absence attribute - described in P2P spec 4.1.14 */
1751 * struct ieee80211_bar - Block Ack Request frame format
1757 * @start_seq_num: Starting Sequence Number (see Figure 9-37)
1760 * as described in IEEE Std 802.11-2020 section 9.3.1.7.
1781 * struct ieee80211_mcs_info - Supported MCS Set field
1791 * described in IEEE Std 802.11-2020 section 9.4.2.55.4.
1814 * - indices 0 to 7 and 32 are single spatial stream
1815 * - 8 to 31 are multiple spatial streams using equal modulation
1817 * - remainder are multiple spatial streams using unequal modulation
1824 * struct ieee80211_ht_cap - HT capabilities element
1826 * @ampdu_params_info: A-MPDU Parameters
1833 * element" as described in IEEE Std 802.11-2020 section 9.4.2.55.
1880 * Maximum length of AMPDU that the STA can receive in high-throughput (HT).
1881 * Length = 2 ^ (13 + max_ampdu_length_exp) - 1 (octets)
1892 * Length = 2 ^ (13 + max_ampdu_length_exp) - 1 (octets)
1920 * struct ieee80211_ht_operation - HT operation IE
1925 * @basic_set: Basic HT-MCS Set
1928 * element" as described in IEEE Std 802.11-2020 section 9.4.2.56.
1966 /* block-ack parameters */
1975 * A-MPDU buffer sizes
1998 * struct ieee80211_vht_mcs_info - VHT MCS information
2030 * enum ieee80211_vht_mcs_support - VHT MCS support definitions
2031 * @IEEE80211_VHT_MCS_SUPPORT_0_7: MCSes 0-7 are supported for the
2033 * @IEEE80211_VHT_MCS_SUPPORT_0_8: MCSes 0-8 are supported
2034 * @IEEE80211_VHT_MCS_SUPPORT_0_9: MCSes 0-9 are supported
2037 * These definitions are used in each 2-bit subfield of the @rx_mcs_map
2051 * struct ieee80211_vht_cap - VHT capabilities
2064 * enum ieee80211_vht_chanwidth - VHT channel width
2079 * struct ieee80211_vht_operation - VHT operation IE
2096 * struct ieee80211_he_cap_elem - HE capabilities element
2101 * "HE capabilities element" as described in IEEE Std 802.11ax-2021
2112 * enum ieee80211_he_mcs_support - HE MCS support definitions
2113 * @IEEE80211_HE_MCS_SUPPORT_0_7: MCSes 0-7 are supported for the
2115 * @IEEE80211_HE_MCS_SUPPORT_0_9: MCSes 0-9 are supported
2116 * @IEEE80211_HE_MCS_SUPPORT_0_11: MCSes 0-11 are supported
2119 * These definitions are used in each 2-bit subfield of the rx_mcs_*
2133 * struct ieee80211_he_mcs_nss_supp - HE Tx/Rx HE MCS NSS Support Field
2161 * struct ieee80211_he_operation - HE Operation element
2163 * @he_mcs_nss_set: Basic HE-MCS And NSS Set
2164 * @optional: Optional fields VHT Operation Information, Max Co-Hosted
2168 * element" as described in IEEE Std 802.11ax-2021 section 9.4.2.249.
2177 * struct ieee80211_he_spr - Spatial Reuse Parameter Set element
2179 * @optional: Optional fields Non-SRG OBSS PD Max Offset, SRG OBSS PD
2184 * Parameter Set element" as described in IEEE Std 802.11ax-2021
2193 * struct ieee80211_he_mu_edca_param_ac_rec - MU AC Parameter Record field
2196 * @mu_edca_timer: MU EDCA Timer
2199 * in IEEE Std 802.11ax-2021 section 9.4.2.251, Figure 9-788p.
2208 * struct ieee80211_mu_edca_param_set - MU EDCA Parameter Set element
2216 * element" as described in IEEE Std 802.11ax-2021 section 9.4.2.251.
2230 * struct ieee80211_eht_mcs_nss_supp_20mhz_only - EHT 20MHz only station max
2233 * For each field below, bits 0 - 3 indicate the maximal number of spatial
2234 * streams for Rx, and bits 4 - 7 indicate the maximal number of spatial streams
2239 * supported for transmission for MCS 0 - 7.
2242 * supported for transmission for MCS 8 - 9.
2245 * supported for transmission for MCS 10 - 11.
2248 * supported for transmission for MCS 12 - 13.
2264 * struct ieee80211_eht_mcs_nss_supp_bw - EHT max supported NSS per MCS (except
2267 * For each field below, bits 0 - 3 indicate the maximal number of spatial
2268 * streams for Rx, and bits 4 - 7 indicate the maximal number of spatial streams
2273 * supported for transmission for MCS 0 - 9.
2276 * supported for transmission for MCS 10 - 11.
2279 * supported for transmission for MCS 12 - 13.
2294 * struct ieee80211_eht_cap_elem_fixed - EHT capabilities fixed data
2308 * struct ieee80211_eht_cap_elem - EHT capabilities element
2317 * Supported EHT-MCS And NSS Set field: 4, 3, 6 or 9 octets.
2330 * struct ieee80211_eht_operation - eht operation element
2336 * @basic_mcs_nss: indicates the EHT-MCSs for each number of spatial streams in
2348 * struct ieee80211_eht_operation_info - eht operation information
2405 * ieee80211_get_vht_max_nss - return max NSS for a given bandwidth/MCS
2488 /* The maximum length of an A-MDPU is defined by the combination of the Maximum
2489 * A-MDPU Length Exponent field in the HT capabilities, VHT capabilities and the
2555 /* Note that the meaning of UL MU below is different between an AP and a non-AP
2556 * sta, where in the AP case it indicates support for Rx and in the non-AP sta
2693 if (he_cap->phy_cap_info[0] & in ieee80211_he_mcs_nss_size()
2697 if (he_cap->phy_cap_info[0] & in ieee80211_he_mcs_nss_size()
2755 if (he_cap_ie_elem->phy_cap_info[6] & in ieee80211_he_capa_size_ok()
2760 he_cap_ie_elem->phy_cap_info); in ieee80211_he_capa_size_ok()
2787 * struct ieee80211_he_6ghz_oper - HE 6 GHz operation Information field
2836 * struct ieee80211_tx_pwr_env - Transmit Power Envelope
2841 * Envelope element" as described in IEEE Std 802.11ax-2021 section
2865 count = u8_get_bits(env->info, IEEE80211_TX_PWR_ENV_INFO_COUNT); in ieee80211_valid_tpe_element()
2866 interpret = u8_get_bits(env->info, IEEE80211_TX_PWR_ENV_INFO_INTERPRET); in ieee80211_valid_tpe_element()
2867 category = u8_get_bits(env->info, IEEE80211_TX_PWR_ENV_INFO_CATEGORY); in ieee80211_valid_tpe_element()
2897 N = count ? 1 << (count - 1) : 1; in ieee80211_valid_tpe_element()
2904 u8 K = u8_get_bits(env->variable[N], in ieee80211_valid_tpe_element()
2919 * ieee80211_he_oper_size - calculate 802.11ax HE Operations IE size
2938 he_oper_params = le32_to_cpu(he_oper->he_oper_params); in ieee80211_he_oper_size()
2953 * ieee80211_he_6ghz_oper - obtain 6 GHz operation field
2954 * @he_oper: HE operation element (must be pre-validated for size)
2968 ret = (const void *)&he_oper->optional; in ieee80211_he_6ghz_oper()
2970 he_oper_params = le32_to_cpu(he_oper->he_oper_params); in ieee80211_he_6ghz_oper()
2990 * ieee80211_he_spr_size - calculate 802.11ax HE Spatial Reuse IE size
3009 he_spr_params = he_spr->he_sr_control; in ieee80211_he_spr_size()
3209 if (he_cap->phy_cap_info[0] & in ieee80211_eht_mcs_nss_size()
3214 if (he_cap->phy_cap_info[0] & in ieee80211_eht_mcs_nss_size()
3218 if (he_cap->phy_cap_info[0] & in ieee80211_eht_mcs_nss_size()
3222 if (eht_cap->phy_cap_info[0] & IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ) in ieee80211_eht_mcs_nss_size()
3279 if (elem->phy_cap_info[5] & in ieee80211_eht_capa_size_ok()
3288 elem->phy_cap_info); in ieee80211_eht_capa_size_ok()
3303 if (elem->params & IEEE80211_EHT_OPER_INFO_PRESENT) { in ieee80211_eht_oper_size_ok()
3306 if (elem->params & in ieee80211_eht_oper_size_ok()
3319 (const void *)eht_oper->optional; in ieee80211_eht_oper_dis_subchan_bitmap()
3321 if (!(eht_oper->params & IEEE80211_EHT_OPER_INFO_PRESENT)) in ieee80211_eht_oper_dis_subchan_bitmap()
3324 if (!(eht_oper->params & IEEE80211_EHT_OPER_DISABLED_SUBCHANNEL_BITMAP_PRESENT)) in ieee80211_eht_oper_dis_subchan_bitmap()
3327 return get_unaligned_le16(info->optional); in ieee80211_eht_oper_dis_subchan_bitmap()
3345 if (bwi->params & IEEE80211_BW_IND_DIS_SUBCH_PRESENT && in ieee80211_bandwidth_indication_size_ok()
3399 /* type - bits 0..1 */
3438 IEEE80211_BANDID_SUB1 = 1, /* Sub-1 GHz (excluding TV white spaces) */
3594 /* 17-31 reserved for challenge text extension */
3695 /* 133-136 reserved for Cisco */
3714 /* 155-156 reserved for Cisco */
3736 /* 178-179 reserved for Symbol */
3976 /* Public action codes (IEEE Std 802.11-2016, 9.6.8.1, Table 9-307) */
4066 /* Defines the maximal number of MSDUs in an A-MSDU. */
4071 * Fine Timing Measurement Initiator - bit 71 of @WLAN_EID_EXT_CAPABILITY
4081 * When set, indicates that the AP is able to tolerate 26-tone RU UL
4083 * 26-tone RU UL OFDMA transmissions as radar pulses).
4087 /* Defines support for enhanced multi-bssid advertisement*/
4097 * enum ieee80211_mesh_sync_method - mesh synchronization method identifier
4109 * enum ieee80211_mesh_path_protocol - mesh path selection protocol identifier
4121 * enum ieee80211_mesh_path_metric - mesh path selection metric identifier
4133 * enum ieee80211_root_mode_identifier - root mesh STA mode identifier
4156 * IEEE 802.11-2007 7.3.2.9 Country information element
4169 * For regulatory extension stuff see IEEE 802.11-2007
4177 * - Regulatory extension ID - when generating IE this just needs
4180 * - Regulatory class - index into set of rules
4181 * - Coverage class - index into air propagation time (Table 7-27),
4184 * of 10 us. Valid values are 0-31, values 32-255 are not defined
4227 * struct ieee80211_timeout_interval_ie - Timeout Interval element
4237 * enum ieee80211_idle_options - BSS idle options
4239 * protected frame to the AP to reset the idle timer at the AP for
4247 * struct ieee80211_bss_max_idle_period_ie - BSS max idle period element struct
4269 /* BACK (block-ack) parties */
4282 * struct ieee80211_bssid_index - multiple BSSID index element structure
4284 * This structure refers to "Multiple BSSID-index element"
4297 * struct ieee80211_multiple_bssid_configuration - multiple BSSID configuration
4427 * ieee80211_get_qos_ctl - get pointer to qos control bytes
4443 if (ieee80211_has_a4(qos->addr3.frame_control)) in ieee80211_get_qos_ctl()
4444 return (u8 *)&qos->addr4.qos_ctrl; in ieee80211_get_qos_ctl()
4446 return (u8 *)&qos->addr3.qos_ctrl; in ieee80211_get_qos_ctl()
4450 * ieee80211_get_tid - get qos TID
4462 * ieee80211_get_SA - get pointer to SA
4474 if (ieee80211_has_a4(hdr->frame_control)) in ieee80211_get_SA()
4475 return hdr->addr4; in ieee80211_get_SA()
4476 if (ieee80211_has_fromds(hdr->frame_control)) in ieee80211_get_SA()
4477 return hdr->addr3; in ieee80211_get_SA()
4478 return hdr->addr2; in ieee80211_get_SA()
4482 * ieee80211_get_DA - get pointer to DA
4494 if (ieee80211_has_tods(hdr->frame_control)) in ieee80211_get_DA()
4495 return hdr->addr3; in ieee80211_get_DA()
4497 return hdr->addr1; in ieee80211_get_DA()
4501 * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU
4507 struct ieee80211_mgmt *mgmt = (void *)skb->data; in ieee80211_is_bufferable_mmpdu()
4508 __le16 fc = mgmt->frame_control; in ieee80211_is_bufferable_mmpdu()
4523 if (skb->len < offsetofend(typeof(*mgmt), u.action.u.ftm.action_code)) in ieee80211_is_bufferable_mmpdu()
4526 /* action frame - additionally check for non-bufferable FTM */ in ieee80211_is_bufferable_mmpdu()
4528 if (mgmt->u.action.category != WLAN_CATEGORY_PUBLIC && in ieee80211_is_bufferable_mmpdu()
4529 mgmt->u.action.category != WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION) in ieee80211_is_bufferable_mmpdu()
4532 if (mgmt->u.action.u.ftm.action_code == WLAN_PUB_ACTION_FTM_REQUEST || in ieee80211_is_bufferable_mmpdu()
4533 mgmt->u.action.u.ftm.action_code == WLAN_PUB_ACTION_FTM_RESPONSE) in ieee80211_is_bufferable_mmpdu()
4540 * _ieee80211_is_robust_mgmt_frame - check if frame is a robust management frame
4546 if (ieee80211_is_disassoc(hdr->frame_control) || in _ieee80211_is_robust_mgmt_frame()
4547 ieee80211_is_deauth(hdr->frame_control)) in _ieee80211_is_robust_mgmt_frame()
4550 if (ieee80211_is_action(hdr->frame_control)) { in _ieee80211_is_robust_mgmt_frame()
4560 if (ieee80211_has_protected(hdr->frame_control)) in _ieee80211_is_robust_mgmt_frame()
4577 * ieee80211_is_robust_mgmt_frame - check if skb contains a robust mgmt frame
4583 if (skb->len < IEEE80211_MIN_ACTION_SIZE) in ieee80211_is_robust_mgmt_frame()
4585 return _ieee80211_is_robust_mgmt_frame((void *)skb->data); in ieee80211_is_robust_mgmt_frame()
4589 * ieee80211_is_public_action - check if frame is a public action frame
4601 if (!ieee80211_is_action(hdr->frame_control)) in ieee80211_is_public_action()
4603 return mgmt->u.action.category == WLAN_CATEGORY_PUBLIC; in ieee80211_is_public_action()
4607 * ieee80211_is_protected_dual_of_public_action - check if skb contains a
4619 if (!ieee80211_is_public_action((void *)skb->data, skb->len) || in ieee80211_is_protected_dual_of_public_action()
4620 skb->len < IEEE80211_MIN_ACTION_SIZE + 1) in ieee80211_is_protected_dual_of_public_action()
4623 action = *(u8 *)(skb->data + IEEE80211_MIN_ACTION_SIZE); in ieee80211_is_protected_dual_of_public_action()
4637 * _ieee80211_is_group_privacy_action - check if frame is a group addressed
4646 if (!ieee80211_is_action(hdr->frame_control) || in _ieee80211_is_group_privacy_action()
4647 !is_multicast_ether_addr(hdr->addr1)) in _ieee80211_is_group_privacy_action()
4650 return mgmt->u.action.category == WLAN_CATEGORY_MESH_ACTION || in _ieee80211_is_group_privacy_action()
4651 mgmt->u.action.category == WLAN_CATEGORY_MULTIHOP_ACTION; in _ieee80211_is_group_privacy_action()
4655 * ieee80211_is_group_privacy_action - check if frame is a group addressed
4662 if (skb->len < IEEE80211_MIN_ACTION_SIZE) in ieee80211_is_group_privacy_action()
4664 return _ieee80211_is_group_privacy_action((void *)skb->data); in ieee80211_is_group_privacy_action()
4668 * ieee80211_tu_to_usec - convert time units (TU) to microseconds
4678 * ieee80211_check_tim - check if AID bit is set in TIM
4697 indexn1 = tim->bitmap_ctrl & 0xfe; in ieee80211_check_tim()
4698 indexn2 = tim_len + indexn1 - 4; in ieee80211_check_tim()
4703 index -= indexn1; in ieee80211_check_tim()
4705 return !!(tim->virtual_map[index] & mask); in ieee80211_check_tim()
4709 * ieee80211_get_tdls_action - get TDLS action code
4711 * Return: the TDLS action code, or -1 if it's not an encapsulated TDLS action
4720 skb->len > (skb_network_offset(skb) + 2)) { in ieee80211_get_tdls_action()
4722 const u8 *tdls_data = skb_network_header(skb) - 2; in ieee80211_get_tdls_action()
4730 return -1; in ieee80211_get_tdls_action()
4750 * ieee80211_action_contains_tpc - checks if the frame contains TPC element
4755 * Measurement report action frame as defined in IEEE Std. 802.11-2012 8.5.2.5
4760 struct ieee80211_mgmt *mgmt = (void *)skb->data; in ieee80211_action_contains_tpc()
4762 if (!ieee80211_is_action(mgmt->frame_control)) in ieee80211_action_contains_tpc()
4765 if (skb->len < IEEE80211_MIN_ACTION_SIZE + in ieee80211_action_contains_tpc()
4766 sizeof(mgmt->u.action.u.tpc_report)) in ieee80211_action_contains_tpc()
4770 * TPC report - check that: in ieee80211_action_contains_tpc()
4780 if (mgmt->u.action.category != WLAN_CATEGORY_SPECTRUM_MGMT && in ieee80211_action_contains_tpc()
4781 mgmt->u.action.category != WLAN_CATEGORY_RADIO_MEASUREMENT) in ieee80211_action_contains_tpc()
4785 if (mgmt->u.action.u.tpc_report.action_code != in ieee80211_action_contains_tpc()
4789 if (mgmt->u.action.u.tpc_report.tpc_elem_id != WLAN_EID_TPC_REPORT || in ieee80211_action_contains_tpc()
4790 mgmt->u.action.u.tpc_report.tpc_elem_length != in ieee80211_action_contains_tpc()
4798 * ieee80211_is_timing_measurement - check if frame is timing measurement response
4804 struct ieee80211_mgmt *mgmt = (void *)skb->data; in ieee80211_is_timing_measurement()
4806 if (skb->len < IEEE80211_MIN_ACTION_SIZE) in ieee80211_is_timing_measurement()
4809 if (!ieee80211_is_action(mgmt->frame_control)) in ieee80211_is_timing_measurement()
4812 if (mgmt->u.action.category == WLAN_CATEGORY_WNM_UNPROTECTED && in ieee80211_is_timing_measurement()
4813 mgmt->u.action.u.wnm_timing_msr.action_code == in ieee80211_is_timing_measurement()
4815 skb->len >= offsetofend(typeof(*mgmt), u.action.u.wnm_timing_msr)) in ieee80211_is_timing_measurement()
4822 * ieee80211_is_ftm - check if frame is FTM response
4824 * Return: whether or not the frame is a valid FTM response action frame
4828 struct ieee80211_mgmt *mgmt = (void *)skb->data; in ieee80211_is_ftm()
4830 if (!ieee80211_is_public_action((void *)mgmt, skb->len)) in ieee80211_is_ftm()
4833 if (mgmt->u.action.u.ftm.action_code == in ieee80211_is_ftm()
4835 skb->len >= offsetofend(typeof(*mgmt), u.action.u.ftm)) in ieee80211_is_ftm()
4850 (const u8 *)(_data) + (_datalen) - (const u8 *)_elem >= \
4852 (const u8 *)(_data) + (_datalen) - (const u8 *)_elem >= \
4853 (int)sizeof(*_elem) + _elem->datalen; \
4854 _elem = (const struct element *)(_elem->data + _elem->datalen))
4858 if (element->id == (_id))
4862 if (element->id == WLAN_EID_EXTENSION && \
4863 element->datalen > 0 && \
4864 element->data[0] == (extid))
4867 for_each_element(sub, (element)->data, (element)->datalen)
4870 for_each_element_id(sub, id, (element)->data, (element)->datalen)
4873 for_each_element_extid(sub, extid, (element)->data, (element)->datalen)
4876 * for_each_element_completed - determine if element parsing consumed all data
4897 * bits 0-3: Field length (n-1)
4922 #define IEEE80211_RNR_TBTT_PARAMS_PSD_RESERVED -128
4974 /* multi-link device */
5005 * dot11MSDOFDMEDthreshold defaults to -72 (i.e. 0)
5087 * ieee80211_mle_common_size - check multi-link element common size
5088 * @data: multi-link element, must already be checked for size using
5090 * Return: the size of the multi-link element's "common" subfield
5095 u16 control = le16_to_cpu(mle->control); in ieee80211_mle_common_size()
5104 * The length is the first octet pointed by mle->variable so no in ieee80211_mle_common_size()
5113 return sizeof(*mle) + mle->variable[0]; in ieee80211_mle_common_size()
5117 * ieee80211_mle_get_link_id - returns the link ID
5119 * Return: the link ID, or -1 if not present
5127 u16 control = le16_to_cpu(mle->control); in ieee80211_mle_get_link_id()
5128 const u8 *common = mle->variable; in ieee80211_mle_get_link_id()
5134 return -1; in ieee80211_mle_get_link_id()
5140 * ieee80211_mle_get_bss_param_ch_cnt - returns the BSS parameter change count
5142 * Return: the BSS Parameter Change Count field value, or -1 if not present
5151 u16 control = le16_to_cpu(mle->control); in ieee80211_mle_get_bss_param_ch_cnt()
5152 const u8 *common = mle->variable; in ieee80211_mle_get_bss_param_ch_cnt()
5158 return -1; in ieee80211_mle_get_bss_param_ch_cnt()
5167 * ieee80211_mle_get_eml_med_sync_delay - returns the medium sync delay
5168 * @data: pointer to the multi-link element
5169 * Return: the medium synchronization delay field value from the multi-link
5179 u16 control = le16_to_cpu(mle->control); in ieee80211_mle_get_eml_med_sync_delay()
5180 const u8 *common = mle->variable; in ieee80211_mle_get_eml_med_sync_delay()
5197 * ieee80211_mle_get_eml_cap - returns the EML capability
5198 * @data: pointer to the multi-link element
5199 * Return: the EML capability field value from the multi-link element,
5208 u16 control = le16_to_cpu(mle->control); in ieee80211_mle_get_eml_cap()
5209 const u8 *common = mle->variable; in ieee80211_mle_get_eml_cap()
5228 * ieee80211_mle_get_mld_capa_op - returns the MLD capabilities and operations.
5229 * @data: pointer to the multi-link element
5230 * Return: the MLD capabilities and operations field value from the multi-link
5239 u16 control = le16_to_cpu(mle->control); in ieee80211_mle_get_mld_capa_op()
5240 const u8 *common = mle->variable; in ieee80211_mle_get_mld_capa_op()
5264 * ieee80211_mle_get_ext_mld_capa_op - returns the extended MLD capabilities
5266 * @data: pointer to the multi-link element
5268 * the multi-link element, or 0 if not present
5276 u16 control = le16_to_cpu(mle->control); in ieee80211_mle_get_ext_mld_capa_op()
5277 const u8 *common = mle->variable; in ieee80211_mle_get_ext_mld_capa_op()
5305 * ieee80211_mle_get_mld_id - returns the MLD ID
5306 * @data: pointer to the multi-link element
5307 * Return: The MLD ID in the given multi-link element, or 0 if not present
5315 u16 control = le16_to_cpu(mle->control); in ieee80211_mle_get_mld_id()
5316 const u8 *common = mle->variable; in ieee80211_mle_get_mld_id()
5342 * ieee80211_mle_size_ok - validate multi-link element size
5345 * Return: whether or not the multi-link element size is OK
5358 control = le16_to_cpu(mle->control); in ieee80211_mle_size_ok()
5414 return mle->variable[0] >= common; in ieee80211_mle_size_ok()
5418 * ieee80211_mle_type_ok - validate multi-link element type and size
5422 * Return: whether or not the multi-link element type matches and size is OK
5432 control = le16_to_cpu(mle->control); in ieee80211_mle_type_ok()
5462 * ieee80211_mle_basic_sta_prof_size_ok - validate basic multi-link element sta
5479 control = le16_to_cpu(prof->control); in ieee80211_mle_basic_sta_prof_size_ok()
5499 return prof->sta_info_len >= info_len && in ieee80211_mle_basic_sta_prof_size_ok()
5500 fixed + prof->sta_info_len - 1 <= len; in ieee80211_mle_basic_sta_prof_size_ok()
5504 * ieee80211_mle_basic_sta_prof_bss_param_ch_cnt - get per-STA profile BSS
5506 * @prof: the per-STA profile, having been checked with
5514 u16 control = le16_to_cpu(prof->control); in ieee80211_mle_basic_sta_prof_bss_param_ch_cnt()
5515 const u8 *pos = prof->variable; in ieee80211_mle_basic_sta_prof_bss_param_ch_cnt()
5552 * ieee80211_mle_reconf_sta_prof_size_ok - validate reconfiguration multi-link
5569 control = le16_to_cpu(prof->control); in ieee80211_mle_reconf_sta_prof_size_ok()
5578 return prof->sta_info_len >= info_len && in ieee80211_mle_reconf_sta_prof_size_ok()
5579 fixed + prof->sta_info_len - 1 <= len; in ieee80211_mle_reconf_sta_prof_size_ok()
5593 control = t2l->control; in ieee80211_tid_to_link_map_size_ok()
5612 elem_len += hweight8(t2l->optional[0]) * bm_size; in ieee80211_tid_to_link_map_size_ok()
5622 _len - ieee80211_mle_common_size(_data))