aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ieee80211.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ieee80211.h')
-rw-r--r--include/linux/ieee80211.h437
1 files changed, 433 insertions, 4 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 8fe7e4306816..9c03a7d5e400 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1433,11 +1433,13 @@ struct ieee80211_ht_operation {
1433#define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800 1433#define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800
1434 1434
1435/* 1435/*
1436 * A-PMDU buffer sizes 1436 * A-MPDU buffer sizes
1437 * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2) 1437 * According to HT size varies from 8 to 64 frames
1438 * HE adds the ability to have up to 256 frames.
1438 */ 1439 */
1439#define IEEE80211_MIN_AMPDU_BUF 0x8 1440#define IEEE80211_MIN_AMPDU_BUF 0x8
1440#define IEEE80211_MAX_AMPDU_BUF 0x40 1441#define IEEE80211_MAX_AMPDU_BUF_HT 0x40
1442#define IEEE80211_MAX_AMPDU_BUF 0x100
1441 1443
1442 1444
1443/* Spatial Multiplexing Power Save Modes (for capability) */ 1445/* Spatial Multiplexing Power Save Modes (for capability) */
@@ -1539,6 +1541,106 @@ struct ieee80211_vht_operation {
1539 __le16 basic_mcs_set; 1541 __le16 basic_mcs_set;
1540} __packed; 1542} __packed;
1541 1543
1544/**
1545 * struct ieee80211_he_cap_elem - HE capabilities element
1546 *
1547 * This structure is the "HE capabilities element" fixed fields as
1548 * described in P802.11ax_D2.0 section 9.4.2.237.2 and 9.4.2.237.3
1549 */
1550struct ieee80211_he_cap_elem {
1551 u8 mac_cap_info[5];
1552 u8 phy_cap_info[9];
1553} __packed;
1554
1555#define IEEE80211_TX_RX_MCS_NSS_DESC_MAX_LEN 5
1556
1557/**
1558 * enum ieee80211_he_mcs_support - HE MCS support definitions
1559 * @IEEE80211_HE_MCS_SUPPORT_0_7: MCSes 0-7 are supported for the
1560 * number of streams
1561 * @IEEE80211_HE_MCS_SUPPORT_0_9: MCSes 0-9 are supported
1562 * @IEEE80211_HE_MCS_SUPPORT_0_11: MCSes 0-11 are supported
1563 * @IEEE80211_HE_MCS_NOT_SUPPORTED: This number of streams isn't supported
1564 *
1565 * These definitions are used in each 2-bit subfield of the rx_mcs_*
1566 * and tx_mcs_* fields of &struct ieee80211_he_mcs_nss_supp, which are
1567 * both split into 8 subfields by number of streams. These values indicate
1568 * which MCSes are supported for the number of streams the value appears
1569 * for.
1570 */
1571enum ieee80211_he_mcs_support {
1572 IEEE80211_HE_MCS_SUPPORT_0_7 = 0,
1573 IEEE80211_HE_MCS_SUPPORT_0_9 = 1,
1574 IEEE80211_HE_MCS_SUPPORT_0_11 = 2,
1575 IEEE80211_HE_MCS_NOT_SUPPORTED = 3,
1576};
1577
1578/**
1579 * struct ieee80211_he_mcs_nss_supp - HE Tx/Rx HE MCS NSS Support Field
1580 *
1581 * This structure holds the data required for the Tx/Rx HE MCS NSS Support Field
1582 * described in P802.11ax_D2.0 section 9.4.2.237.4
1583 *
1584 * @rx_mcs_80: Rx MCS map 2 bits for each stream, total 8 streams, for channel
1585 * widths less than 80MHz.
1586 * @tx_mcs_80: Tx MCS map 2 bits for each stream, total 8 streams, for channel
1587 * widths less than 80MHz.
1588 * @rx_mcs_160: Rx MCS map 2 bits for each stream, total 8 streams, for channel
1589 * width 160MHz.
1590 * @tx_mcs_160: Tx MCS map 2 bits for each stream, total 8 streams, for channel
1591 * width 160MHz.
1592 * @rx_mcs_80p80: Rx MCS map 2 bits for each stream, total 8 streams, for
1593 * channel width 80p80MHz.
1594 * @tx_mcs_80p80: Tx MCS map 2 bits for each stream, total 8 streams, for
1595 * channel width 80p80MHz.
1596 */
1597struct ieee80211_he_mcs_nss_supp {
1598 __le16 rx_mcs_80;
1599 __le16 tx_mcs_80;
1600 __le16 rx_mcs_160;
1601 __le16 tx_mcs_160;
1602 __le16 rx_mcs_80p80;
1603 __le16 tx_mcs_80p80;
1604} __packed;
1605
1606/**
1607 * struct ieee80211_he_operation - HE capabilities element
1608 *
1609 * This structure is the "HE operation element" fields as
1610 * described in P802.11ax_D2.0 section 9.4.2.238
1611 */
1612struct ieee80211_he_operation {
1613 __le32 he_oper_params;
1614 __le16 he_mcs_nss_set;
1615 /* Optional 0,1,3 or 4 bytes: depends on @he_oper_params */
1616 u8 optional[0];
1617} __packed;
1618
1619/**
1620 * struct ieee80211_he_mu_edca_param_ac_rec - MU AC Parameter Record field
1621 *
1622 * This structure is the "MU AC Parameter Record" fields as
1623 * described in P802.11ax_D2.0 section 9.4.2.240
1624 */
1625struct ieee80211_he_mu_edca_param_ac_rec {
1626 u8 aifsn;
1627 u8 ecw_min_max;
1628 u8 mu_edca_timer;
1629} __packed;
1630
1631/**
1632 * struct ieee80211_mu_edca_param_set - MU EDCA Parameter Set element
1633 *
1634 * This structure is the "MU EDCA Parameter Set element" fields as
1635 * described in P802.11ax_D2.0 section 9.4.2.240
1636 */
1637struct ieee80211_mu_edca_param_set {
1638 u8 mu_qos_info;
1639 struct ieee80211_he_mu_edca_param_ac_rec ac_be;
1640 struct ieee80211_he_mu_edca_param_ac_rec ac_bk;
1641 struct ieee80211_he_mu_edca_param_ac_rec ac_vi;
1642 struct ieee80211_he_mu_edca_param_ac_rec ac_vo;
1643} __packed;
1542 1644
1543/* 802.11ac VHT Capabilities */ 1645/* 802.11ac VHT Capabilities */
1544#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000 1646#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000
@@ -1577,6 +1679,328 @@ struct ieee80211_vht_operation {
1577#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000 1679#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000
1578#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000 1680#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000
1579 1681
1682/* 802.11ax HE MAC capabilities */
1683#define IEEE80211_HE_MAC_CAP0_HTC_HE 0x01
1684#define IEEE80211_HE_MAC_CAP0_TWT_REQ 0x02
1685#define IEEE80211_HE_MAC_CAP0_TWT_RES 0x04
1686#define IEEE80211_HE_MAC_CAP0_DYNAMIC_FRAG_NOT_SUPP 0x00
1687#define IEEE80211_HE_MAC_CAP0_DYNAMIC_FRAG_LEVEL_1 0x08
1688#define IEEE80211_HE_MAC_CAP0_DYNAMIC_FRAG_LEVEL_2 0x10
1689#define IEEE80211_HE_MAC_CAP0_DYNAMIC_FRAG_LEVEL_3 0x18
1690#define IEEE80211_HE_MAC_CAP0_DYNAMIC_FRAG_MASK 0x18
1691#define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_1 0x00
1692#define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_2 0x20
1693#define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_4 0x40
1694#define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_8 0x60
1695#define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_16 0x80
1696#define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_32 0xa0
1697#define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_64 0xc0
1698#define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_UNLIMITED 0xe0
1699#define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_MASK 0xe0
1700
1701#define IEEE80211_HE_MAC_CAP1_MIN_FRAG_SIZE_UNLIMITED 0x00
1702#define IEEE80211_HE_MAC_CAP1_MIN_FRAG_SIZE_128 0x01
1703#define IEEE80211_HE_MAC_CAP1_MIN_FRAG_SIZE_256 0x02
1704#define IEEE80211_HE_MAC_CAP1_MIN_FRAG_SIZE_512 0x03
1705#define IEEE80211_HE_MAC_CAP1_MIN_FRAG_SIZE_MASK 0x03
1706#define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_0US 0x00
1707#define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_8US 0x04
1708#define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US 0x08
1709#define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK 0x0c
1710#define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_QOS_1 0x00
1711#define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_QOS_2 0x10
1712#define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_QOS_3 0x20
1713#define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_QOS_4 0x30
1714#define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_QOS_5 0x40
1715#define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_QOS_6 0x50
1716#define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_QOS_7 0x60
1717#define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_QOS_8 0x70
1718#define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_QOS_MASK 0x70
1719
1720/* Link adaptation is split between byte HE_MAC_CAP1 and
1721 * HE_MAC_CAP2. It should be set only if IEEE80211_HE_MAC_CAP0_HTC_HE
1722 * in which case the following values apply:
1723 * 0 = No feedback.
1724 * 1 = reserved.
1725 * 2 = Unsolicited feedback.
1726 * 3 = both
1727 */
1728#define IEEE80211_HE_MAC_CAP1_LINK_ADAPTATION 0x80
1729
1730#define IEEE80211_HE_MAC_CAP2_LINK_ADAPTATION 0x01
1731#define IEEE80211_HE_MAC_CAP2_ALL_ACK 0x02
1732#define IEEE80211_HE_MAC_CAP2_UL_MU_RESP_SCHED 0x04
1733#define IEEE80211_HE_MAC_CAP2_BSR 0x08
1734#define IEEE80211_HE_MAC_CAP2_BCAST_TWT 0x10
1735#define IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP 0x20
1736#define IEEE80211_HE_MAC_CAP2_MU_CASCADING 0x40
1737#define IEEE80211_HE_MAC_CAP2_ACK_EN 0x80
1738
1739#define IEEE80211_HE_MAC_CAP3_GRP_ADDR_MULTI_STA_BA_DL_MU 0x01
1740#define IEEE80211_HE_MAC_CAP3_OMI_CONTROL 0x02
1741#define IEEE80211_HE_MAC_CAP3_OFDMA_RA 0x04
1742
1743/* The maximum length of an A-MDPU is defined by the combination of the Maximum
1744 * A-MDPU Length Exponent field in the HT capabilities, VHT capabilities and the
1745 * same field in the HE capabilities.
1746 */
1747#define IEEE80211_HE_MAC_CAP3_MAX_A_AMPDU_LEN_EXP_USE_VHT 0x00
1748#define IEEE80211_HE_MAC_CAP3_MAX_A_AMPDU_LEN_EXP_VHT_1 0x08
1749#define IEEE80211_HE_MAC_CAP3_MAX_A_AMPDU_LEN_EXP_VHT_2 0x10
1750#define IEEE80211_HE_MAC_CAP3_MAX_A_AMPDU_LEN_EXP_RESERVED 0x18
1751#define IEEE80211_HE_MAC_CAP3_MAX_A_AMPDU_LEN_EXP_MASK 0x18
1752#define IEEE80211_HE_MAC_CAP3_A_AMSDU_FRAG 0x20
1753#define IEEE80211_HE_MAC_CAP3_FLEX_TWT_SCHED 0x40
1754#define IEEE80211_HE_MAC_CAP3_RX_CTRL_FRAME_TO_MULTIBSS 0x80
1755
1756#define IEEE80211_HE_MAC_CAP4_BSRP_BQRP_A_MPDU_AGG 0x01
1757#define IEEE80211_HE_MAC_CAP4_QTP 0x02
1758#define IEEE80211_HE_MAC_CAP4_BQR 0x04
1759#define IEEE80211_HE_MAC_CAP4_SR_RESP 0x08
1760#define IEEE80211_HE_MAC_CAP4_NDP_FB_REP 0x10
1761#define IEEE80211_HE_MAC_CAP4_OPS 0x20
1762#define IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU 0x40
1763
1764/* 802.11ax HE PHY capabilities */
1765#define IEEE80211_HE_PHY_CAP0_DUAL_BAND 0x01
1766#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G 0x02
1767#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G 0x04
1768#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G 0x08
1769#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G 0x10
1770#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_2G 0x20
1771#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_5G 0x40
1772#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_MASK 0xfe
1773
1774#define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_80MHZ_ONLY_SECOND_20MHZ 0x01
1775#define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_80MHZ_ONLY_SECOND_40MHZ 0x02
1776#define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_160MHZ_ONLY_SECOND_20MHZ 0x04
1777#define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_160MHZ_ONLY_SECOND_40MHZ 0x08
1778#define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK 0x0f
1779#define IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A 0x10
1780#define IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD 0x20
1781#define IEEE80211_HE_PHY_CAP1_HE_LTF_AND_GI_FOR_HE_PPDUS_0_8US 0x40
1782/* Midamble RX Max NSTS is split between byte #2 and byte #3 */
1783#define IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_MAX_NSTS 0x80
1784
1785#define IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_MAX_NSTS 0x01
1786#define IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US 0x02
1787#define IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ 0x04
1788#define IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ 0x08
1789#define IEEE80211_HE_PHY_CAP2_DOPPLER_TX 0x10
1790#define IEEE80211_HE_PHY_CAP2_DOPPLER_RX 0x20
1791
1792/* Note that the meaning of UL MU below is different between an AP and a non-AP
1793 * sta, where in the AP case it indicates support for Rx and in the non-AP sta
1794 * case it indicates support for Tx.
1795 */
1796#define IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO 0x40
1797#define IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO 0x80
1798
1799#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_NO_DCM 0x00
1800#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK 0x01
1801#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_QPSK 0x02
1802#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_16_QAM 0x03
1803#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_MASK 0x03
1804#define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 0x00
1805#define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_2 0x04
1806#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_NO_DCM 0x00
1807#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK 0x08
1808#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_QPSK 0x10
1809#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_16_QAM 0x18
1810#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_MASK 0x18
1811#define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1 0x00
1812#define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_2 0x20
1813#define IEEE80211_HE_PHY_CAP3_RX_HE_MU_PPDU_FROM_NON_AP_STA 0x40
1814#define IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER 0x80
1815
1816#define IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE 0x01
1817#define IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER 0x02
1818
1819/* Minimal allowed value of Max STS under 80MHz is 3 */
1820#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 0x0c
1821#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_5 0x10
1822#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_6 0x14
1823#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_7 0x18
1824#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8 0x1c
1825#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_MASK 0x1c
1826
1827/* Minimal allowed value of Max STS above 80MHz is 3 */
1828#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4 0x60
1829#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_5 0x80
1830#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_6 0xa0
1831#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_7 0xc0
1832#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_8 0xe0
1833#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_MASK 0xe0
1834
1835#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_1 0x00
1836#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 0x01
1837#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_3 0x02
1838#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_4 0x03
1839#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_5 0x04
1840#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_6 0x05
1841#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_7 0x06
1842#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_8 0x07
1843#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK 0x07
1844
1845#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_1 0x00
1846#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2 0x08
1847#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_3 0x10
1848#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_4 0x18
1849#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_5 0x20
1850#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_6 0x28
1851#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_7 0x30
1852#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_8 0x38
1853#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK 0x38
1854
1855#define IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK 0x40
1856#define IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK 0x80
1857
1858#define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU 0x01
1859#define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU 0x02
1860#define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB 0x04
1861#define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB 0x08
1862#define IEEE80211_HE_PHY_CAP6_TRIG_CQI_FB 0x10
1863#define IEEE80211_HE_PHY_CAP6_PARTIAL_BW_EXT_RANGE 0x20
1864#define IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO 0x40
1865#define IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT 0x80
1866
1867#define IEEE80211_HE_PHY_CAP7_SRP_BASED_SR 0x01
1868#define IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_AR 0x02
1869#define IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI 0x04
1870#define IEEE80211_HE_PHY_CAP7_MAX_NC_1 0x08
1871#define IEEE80211_HE_PHY_CAP7_MAX_NC_2 0x10
1872#define IEEE80211_HE_PHY_CAP7_MAX_NC_3 0x18
1873#define IEEE80211_HE_PHY_CAP7_MAX_NC_4 0x20
1874#define IEEE80211_HE_PHY_CAP7_MAX_NC_5 0x28
1875#define IEEE80211_HE_PHY_CAP7_MAX_NC_6 0x30
1876#define IEEE80211_HE_PHY_CAP7_MAX_NC_7 0x38
1877#define IEEE80211_HE_PHY_CAP7_MAX_NC_MASK 0x38
1878#define IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ 0x40
1879#define IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ 0x80
1880
1881#define IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI 0x01
1882#define IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G 0x02
1883#define IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU 0x04
1884#define IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU 0x08
1885#define IEEE80211_HE_PHY_CAP8_HE_ER_SU_1XLTF_AND_08_US_GI 0x10
1886#define IEEE80211_HE_PHY_CAP8_MIDAMBLE_RX_2X_AND_1XLTF 0x20
1887
1888/* 802.11ax HE TX/RX MCS NSS Support */
1889#define IEEE80211_TX_RX_MCS_NSS_SUPP_HIGHEST_MCS_POS (3)
1890#define IEEE80211_TX_RX_MCS_NSS_SUPP_TX_BITMAP_POS (6)
1891#define IEEE80211_TX_RX_MCS_NSS_SUPP_RX_BITMAP_POS (11)
1892#define IEEE80211_TX_RX_MCS_NSS_SUPP_TX_BITMAP_MASK 0x07c0
1893#define IEEE80211_TX_RX_MCS_NSS_SUPP_RX_BITMAP_MASK 0xf800
1894
1895/* TX/RX HE MCS Support field Highest MCS subfield encoding */
1896enum ieee80211_he_highest_mcs_supported_subfield_enc {
1897 HIGHEST_MCS_SUPPORTED_MCS7 = 0,
1898 HIGHEST_MCS_SUPPORTED_MCS8,
1899 HIGHEST_MCS_SUPPORTED_MCS9,
1900 HIGHEST_MCS_SUPPORTED_MCS10,
1901 HIGHEST_MCS_SUPPORTED_MCS11,
1902};
1903
1904/* Calculate 802.11ax HE capabilities IE Tx/Rx HE MCS NSS Support Field size */
1905static inline u8
1906ieee80211_he_mcs_nss_size(const struct ieee80211_he_cap_elem *he_cap)
1907{
1908 u8 count = 4;
1909
1910 if (he_cap->phy_cap_info[0] &
1911 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G)
1912 count += 4;
1913
1914 if (he_cap->phy_cap_info[0] &
1915 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
1916 count += 4;
1917
1918 return count;
1919}
1920
1921/* 802.11ax HE PPE Thresholds */
1922#define IEEE80211_PPE_THRES_NSS_SUPPORT_2NSS (1)
1923#define IEEE80211_PPE_THRES_NSS_POS (0)
1924#define IEEE80211_PPE_THRES_NSS_MASK (7)
1925#define IEEE80211_PPE_THRES_RU_INDEX_BITMASK_2x966_AND_966_RU \
1926 (BIT(5) | BIT(6))
1927#define IEEE80211_PPE_THRES_RU_INDEX_BITMASK_MASK 0x78
1928#define IEEE80211_PPE_THRES_RU_INDEX_BITMASK_POS (3)
1929#define IEEE80211_PPE_THRES_INFO_PPET_SIZE (3)
1930
1931/*
1932 * Calculate 802.11ax HE capabilities IE PPE field size
1933 * Input: Header byte of ppe_thres (first byte), and HE capa IE's PHY cap u8*
1934 */
1935static inline u8
1936ieee80211_he_ppe_size(u8 ppe_thres_hdr, const u8 *phy_cap_info)
1937{
1938 u8 n;
1939
1940 if ((phy_cap_info[6] &
1941 IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT) == 0)
1942 return 0;
1943
1944 n = hweight8(ppe_thres_hdr &
1945 IEEE80211_PPE_THRES_RU_INDEX_BITMASK_MASK);
1946 n *= (1 + ((ppe_thres_hdr & IEEE80211_PPE_THRES_NSS_MASK) >>
1947 IEEE80211_PPE_THRES_NSS_POS));
1948
1949 /*
1950 * Each pair is 6 bits, and we need to add the 7 "header" bits to the
1951 * total size.
1952 */
1953 n = (n * IEEE80211_PPE_THRES_INFO_PPET_SIZE * 2) + 7;
1954 n = DIV_ROUND_UP(n, 8);
1955
1956 return n;
1957}
1958
1959/* HE Operation defines */
1960#define IEEE80211_HE_OPERATION_BSS_COLOR_MASK 0x0000003f
1961#define IEEE80211_HE_OPERATION_DFLT_PE_DURATION_MASK 0x000001c0
1962#define IEEE80211_HE_OPERATION_DFLT_PE_DURATION_OFFSET 6
1963#define IEEE80211_HE_OPERATION_TWT_REQUIRED 0x00000200
1964#define IEEE80211_HE_OPERATION_RTS_THRESHOLD_MASK 0x000ffc00
1965#define IEEE80211_HE_OPERATION_RTS_THRESHOLD_OFFSET 10
1966#define IEEE80211_HE_OPERATION_PARTIAL_BSS_COLOR 0x000100000
1967#define IEEE80211_HE_OPERATION_VHT_OPER_INFO 0x000200000
1968#define IEEE80211_HE_OPERATION_MULTI_BSSID_AP 0x10000000
1969#define IEEE80211_HE_OPERATION_TX_BSSID_INDICATOR 0x20000000
1970#define IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED 0x40000000
1971
1972/*
1973 * ieee80211_he_oper_size - calculate 802.11ax HE Operations IE size
1974 * @he_oper_ie: byte data of the He Operations IE, stating from the the byte
1975 * after the ext ID byte. It is assumed that he_oper_ie has at least
1976 * sizeof(struct ieee80211_he_operation) bytes, checked already in
1977 * ieee802_11_parse_elems_crc()
1978 * @return the actual size of the IE data (not including header), or 0 on error
1979 */
1980static inline u8
1981ieee80211_he_oper_size(const u8 *he_oper_ie)
1982{
1983 struct ieee80211_he_operation *he_oper = (void *)he_oper_ie;
1984 u8 oper_len = sizeof(struct ieee80211_he_operation);
1985 u32 he_oper_params;
1986
1987 /* Make sure the input is not NULL */
1988 if (!he_oper_ie)
1989 return 0;
1990
1991 /* Calc required length */
1992 he_oper_params = le32_to_cpu(he_oper->he_oper_params);
1993 if (he_oper_params & IEEE80211_HE_OPERATION_VHT_OPER_INFO)
1994 oper_len += 3;
1995 if (he_oper_params & IEEE80211_HE_OPERATION_MULTI_BSSID_AP)
1996 oper_len++;
1997
1998 /* Add the first byte (extension ID) to the total length */
1999 oper_len++;
2000
2001 return oper_len;
2002}
2003
1580/* Authentication algorithms */ 2004/* Authentication algorithms */
1581#define WLAN_AUTH_OPEN 0 2005#define WLAN_AUTH_OPEN 0
1582#define WLAN_AUTH_SHARED_KEY 1 2006#define WLAN_AUTH_SHARED_KEY 1
@@ -1992,6 +2416,11 @@ enum ieee80211_eid_ext {
1992 WLAN_EID_EXT_FILS_WRAPPED_DATA = 8, 2416 WLAN_EID_EXT_FILS_WRAPPED_DATA = 8,
1993 WLAN_EID_EXT_FILS_PUBLIC_KEY = 12, 2417 WLAN_EID_EXT_FILS_PUBLIC_KEY = 12,
1994 WLAN_EID_EXT_FILS_NONCE = 13, 2418 WLAN_EID_EXT_FILS_NONCE = 13,
2419 WLAN_EID_EXT_FUTURE_CHAN_GUIDANCE = 14,
2420 WLAN_EID_EXT_HE_CAPABILITY = 35,
2421 WLAN_EID_EXT_HE_OPERATION = 36,
2422 WLAN_EID_EXT_UORA = 37,
2423 WLAN_EID_EXT_HE_MU_EDCA = 38,
1995}; 2424};
1996 2425
1997/* Action category code */ 2426/* Action category code */