Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wifi: ieee80211: add some initial UHR definitions

This is based on Draft P802.11bn_D1.2, but that's still very
incomplete, so don't handle a number of things and make some
local decisions such as using 40 bits for MAC capabilities
and 8 bits for PHY capabilities.

Link: https://patch.msgid.link/20260130164259.b28c9456ff94.I5b11fb0345a933bf497fd802aecc72932d58dd68@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+251 -2
+220
include/linux/ieee80211-uhr.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + /* 3 + * IEEE 802.11 UHR definitions 4 + * 5 + * Copyright (c) 2025-2026 Intel Corporation 6 + */ 7 + #ifndef LINUX_IEEE80211_UHR_H 8 + #define LINUX_IEEE80211_UHR_H 9 + 10 + #include <linux/types.h> 11 + #include <linux/if_ether.h> 12 + 13 + #define IEEE80211_UHR_OPER_PARAMS_DPS_ENA 0x0001 14 + #define IEEE80211_UHR_OPER_PARAMS_NPCA_ENA 0x0002 15 + #define IEEE80211_UHR_OPER_PARAMS_DBE_ENA 0x0004 16 + #define IEEE80211_UHR_OPER_PARAMS_PEDCA_ENA 0x0008 17 + 18 + struct ieee80211_uhr_operation { 19 + __le16 params; 20 + u8 basic_mcs_nss_set[4]; 21 + u8 variable[]; 22 + } __packed; 23 + 24 + #define IEEE80211_UHR_NPCA_PARAMS_PRIMARY_CHAN_OFFS 0x0000000F 25 + #define IEEE80211_UHR_NPCA_PARAMS_MIN_DUR_THRESH 0x000000F0 26 + #define IEEE80211_UHR_NPCA_PARAMS_SWITCH_DELAY 0x00003F00 27 + #define IEEE80211_UHR_NPCA_PARAMS_SWITCH_BACK_DELAY 0x000FC000 28 + #define IEEE80211_UHR_NPCA_PARAMS_INIT_QSRC 0x00300000 29 + #define IEEE80211_UHR_NPCA_PARAMS_MOPLEN 0x00400000 30 + #define IEEE80211_UHR_NPCA_PARAMS_DIS_SUBCH_BMAP_PRES 0x00800000 31 + 32 + struct ieee80211_uhr_npca_info { 33 + __le32 params; 34 + __le16 dis_subch_bmap[]; 35 + } __packed; 36 + 37 + static inline bool ieee80211_uhr_oper_size_ok(const u8 *data, u8 len, 38 + bool beacon) 39 + { 40 + const struct ieee80211_uhr_operation *oper = (const void *)data; 41 + u8 needed = sizeof(*oper); 42 + 43 + if (len < needed) 44 + return false; 45 + 46 + /* nothing else present in beacons */ 47 + if (beacon) 48 + return true; 49 + 50 + /* FIXME: DPS, DBE, P-EDCA (consider order, also relative to NPCA) */ 51 + 52 + if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_NPCA_ENA)) { 53 + const struct ieee80211_uhr_npca_info *npca = 54 + (const void *)oper->variable; 55 + 56 + needed += sizeof(*npca); 57 + 58 + if (len < needed) 59 + return false; 60 + 61 + if (npca->params & cpu_to_le32(IEEE80211_UHR_NPCA_PARAMS_DIS_SUBCH_BMAP_PRES)) 62 + needed += sizeof(npca->dis_subch_bmap[0]); 63 + } 64 + 65 + return len >= needed; 66 + } 67 + 68 + /* 69 + * Note: cannot call this on the element coming from a beacon, 70 + * must ensure ieee80211_uhr_oper_size_ok(..., false) first 71 + */ 72 + static inline const struct ieee80211_uhr_npca_info * 73 + ieee80211_uhr_npca_info(const struct ieee80211_uhr_operation *oper) 74 + { 75 + if (!(oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_NPCA_ENA))) 76 + return NULL; 77 + 78 + /* FIXME: DPS */ 79 + 80 + return (const void *)oper->variable; 81 + } 82 + 83 + static inline const __le16 * 84 + ieee80211_uhr_npca_dis_subch_bitmap(const struct ieee80211_uhr_operation *oper) 85 + { 86 + const struct ieee80211_uhr_npca_info *npca; 87 + 88 + npca = ieee80211_uhr_npca_info(oper); 89 + if (!npca) 90 + return NULL; 91 + if (!(npca->params & cpu_to_le32(IEEE80211_UHR_NPCA_PARAMS_DIS_SUBCH_BMAP_PRES))) 92 + return NULL; 93 + return npca->dis_subch_bmap; 94 + } 95 + 96 + #define IEEE80211_UHR_MAC_CAP0_DPS_SUPP 0x01 97 + #define IEEE80211_UHR_MAC_CAP0_DPS_ASSIST_SUPP 0x02 98 + #define IEEE80211_UHR_MAC_CAP0_DPS_AP_STATIC_HCM_SUPP 0x04 99 + #define IEEE80211_UHR_MAC_CAP0_NPCA_SUPP 0x10 100 + #define IEEE80211_UHR_MAC_CAP0_ENH_BSR_SUPP 0x20 101 + #define IEEE80211_UHR_MAC_CAP0_ADD_MAP_TID_SUPP 0x40 102 + #define IEEE80211_UHR_MAC_CAP0_EOTSP_SUPP 0x80 103 + 104 + #define IEEE80211_UHR_MAC_CAP1_DSO_SUPP 0x01 105 + #define IEEE80211_UHR_MAC_CAP1_PEDCA_SUPP 0x02 106 + #define IEEE80211_UHR_MAC_CAP1_DBE_SUPP 0x04 107 + #define IEEE80211_UHR_MAC_CAP1_UL_LLI_SUPP 0x08 108 + #define IEEE80211_UHR_MAC_CAP1_P2P_LLI_SUPP 0x10 109 + #define IEEE80211_UHR_MAC_CAP1_PUO_SUPP 0x20 110 + #define IEEE80211_UHR_MAC_CAP1_AP_PUO_SUPP 0x40 111 + #define IEEE80211_UHR_MAC_CAP1_DUO_SUPP 0x80 112 + 113 + #define IEEE80211_UHR_MAC_CAP2_OMC_UL_MU_DIS_RX_SUPP 0x01 114 + #define IEEE80211_UHR_MAC_CAP2_AOM_SUPP 0x02 115 + #define IEEE80211_UHR_MAC_CAP2_IFCS_LOC_SUPP 0x04 116 + #define IEEE80211_UHR_MAC_CAP2_UHR_TRS_SUPP 0x08 117 + #define IEEE80211_UHR_MAC_CAP2_TXSPG_SUPP 0x10 118 + #define IEEE80211_UHR_MAC_CAP2_TXOP_RET_IN_TXSPG 0x20 119 + #define IEEE80211_UHR_MAC_CAP2_UHR_OM_PU_TO_LOW 0xC0 120 + 121 + #define IEEE80211_UHR_MAC_CAP3_UHR_OM_PU_TO_HIGH 0x03 122 + #define IEEE80211_UHR_MAC_CAP3_PARAM_UPD_ADV_NOTIF_INTV 0x1C 123 + #define IEEE80211_UHR_MAC_CAP3_UPD_IND_TIM_INTV_LOW 0xE0 124 + 125 + #define IEEE80211_UHR_MAC_CAP4_UPD_IND_TIM_INTV_HIGH 0x03 126 + #define IEEE80211_UHR_MAC_CAP4_BOUNDED_ESS 0x04 127 + #define IEEE80211_UHR_MAC_CAP4_BTM_ASSURANCE 0x08 128 + #define IEEE80211_UHR_MAC_CAP4_CO_BF_SUPP 0x10 129 + 130 + #define IEEE80211_UHR_MAC_CAP_DBE_MAX_BW 0x07 131 + #define IEEE80211_UHR_MAC_CAP_DBE_EHT_MCS_MAP_160_PRES 0x08 132 + #define IEEE80211_UHR_MAC_CAP_DBE_EHT_MCS_MAP_320_PRES 0x10 133 + 134 + struct ieee80211_uhr_cap_mac { 135 + u8 mac_cap[5]; 136 + } __packed; 137 + 138 + struct ieee80211_uhr_cap { 139 + struct ieee80211_uhr_cap_mac mac; 140 + /* DBE, PHY capabilities */ 141 + u8 variable[]; 142 + } __packed; 143 + 144 + #define IEEE80211_UHR_PHY_CAP_MAX_NSS_RX_SND_NDP_LE80 0x01 145 + #define IEEE80211_UHR_PHY_CAP_MAX_NSS_RX_DL_MU_LE80 0x02 146 + #define IEEE80211_UHR_PHY_CAP_MAX_NSS_RX_SND_NDP_160 0x04 147 + #define IEEE80211_UHR_PHY_CAP_MAX_NSS_RX_DL_MU_160 0x08 148 + #define IEEE80211_UHR_PHY_CAP_MAX_NSS_RX_SND_NDP_320 0x10 149 + #define IEEE80211_UHR_PHY_CAP_MAX_NSS_RX_DL_MU_320 0x20 150 + #define IEEE80211_UHR_PHY_CAP_ELR_RX 0x40 151 + #define IEEE80211_UHR_PHY_CAP_ELR_TX 0x80 152 + 153 + struct ieee80211_uhr_cap_phy { 154 + u8 cap; 155 + } __packed; 156 + 157 + static inline bool ieee80211_uhr_capa_size_ok(const u8 *data, u8 len, 158 + bool from_ap) 159 + { 160 + const struct ieee80211_uhr_cap *cap = (const void *)data; 161 + size_t needed = sizeof(*cap) + sizeof(struct ieee80211_uhr_cap_phy); 162 + 163 + if (len < needed) 164 + return false; 165 + 166 + /* 167 + * A non-AP STA does not include the DBE Capability Parameters field 168 + * in the UHR MAC Capabilities Information field. 169 + */ 170 + if (from_ap && cap->mac.mac_cap[1] & IEEE80211_UHR_MAC_CAP1_DBE_SUPP) { 171 + u8 dbe; 172 + 173 + needed += 1; 174 + if (len < needed) 175 + return false; 176 + 177 + dbe = cap->variable[0]; 178 + 179 + if (dbe & IEEE80211_UHR_MAC_CAP_DBE_EHT_MCS_MAP_160_PRES) 180 + needed += 3; 181 + 182 + if (dbe & IEEE80211_UHR_MAC_CAP_DBE_EHT_MCS_MAP_320_PRES) 183 + needed += 3; 184 + } 185 + 186 + return len >= needed; 187 + } 188 + 189 + static inline const struct ieee80211_uhr_cap_phy * 190 + ieee80211_uhr_phy_cap(const struct ieee80211_uhr_cap *cap, bool from_ap) 191 + { 192 + u8 offs = 0; 193 + 194 + if (from_ap && cap->mac.mac_cap[1] & IEEE80211_UHR_MAC_CAP1_DBE_SUPP) { 195 + u8 dbe = cap->variable[0]; 196 + 197 + offs += 1; 198 + 199 + if (dbe & IEEE80211_UHR_MAC_CAP_DBE_EHT_MCS_MAP_160_PRES) 200 + offs += 3; 201 + 202 + if (dbe & IEEE80211_UHR_MAC_CAP_DBE_EHT_MCS_MAP_320_PRES) 203 + offs += 3; 204 + } 205 + 206 + return (const void *)&cap->variable[offs]; 207 + } 208 + 209 + #define IEEE80211_SMD_INFO_CAPA_DL_DATA_FWD 0x01 210 + #define IEEE80211_SMD_INFO_CAPA_MAX_NUM_PREP 0x0E 211 + #define IEEE80211_SMD_INFO_CAPA_TYPE 0x10 212 + #define IEEE80211_SMD_INFO_CAPA_PTK_PER_AP_MLD 0x20 213 + 214 + struct ieee80211_smd_info { 215 + u8 id[ETH_ALEN]; 216 + u8 capa; 217 + __le16 timeout; 218 + } __packed; 219 + 220 + #endif /* LINUX_IEEE80211_UHR_H */
+31 -2
include/linux/ieee80211.h
··· 9 9 * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net> 10 10 * Copyright (c) 2013 - 2014 Intel Mobile Communications GmbH 11 11 * Copyright (c) 2016 - 2017 Intel Deutschland GmbH 12 - * Copyright (c) 2018 - 2025 Intel Corporation 12 + * Copyright (c) 2018 - 2026 Intel Corporation 13 13 */ 14 14 15 15 #ifndef LINUX_IEEE80211_H ··· 1200 1200 #define BSS_MEMBERSHIP_SELECTOR_SAE_H2E 123 1201 1201 #define BSS_MEMBERSHIP_SELECTOR_HE_PHY 122 1202 1202 #define BSS_MEMBERSHIP_SELECTOR_EHT_PHY 121 1203 + #define BSS_MEMBERSHIP_SELECTOR_UHR_PHY 120 1203 1204 1204 - #define BSS_MEMBERSHIP_SELECTOR_MIN BSS_MEMBERSHIP_SELECTOR_EHT_PHY 1205 + #define BSS_MEMBERSHIP_SELECTOR_MIN BSS_MEMBERSHIP_SELECTOR_UHR_PHY 1205 1206 1206 1207 /* mgmt header + 1 byte category code */ 1207 1208 #define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u) ··· 1803 1802 WLAN_EID_EXT_BANDWIDTH_INDICATION = 135, 1804 1803 WLAN_EID_EXT_KNOWN_STA_IDENTIFCATION = 136, 1805 1804 WLAN_EID_EXT_NON_AP_STA_REG_CON = 137, 1805 + WLAN_EID_EXT_UHR_OPER = 151, 1806 + WLAN_EID_EXT_UHR_CAPA = 152, 1807 + WLAN_EID_EXT_MACP = 153, 1808 + WLAN_EID_EXT_SMD = 154, 1809 + WLAN_EID_EXT_BSS_SMD_TRANS_PARAMS = 155, 1810 + WLAN_EID_EXT_CHAN_USAGE = 156, 1811 + WLAN_EID_EXT_UHR_MODE_CHG = 157, 1812 + WLAN_EID_EXT_UHR_PARAM_UPD = 158, 1813 + WLAN_EID_EXT_TXPI = 159, 1806 1814 }; 1807 1815 1808 1816 /* Action category code */ ··· 2755 2745 #define WLAN_RSNX_CAPA_PROTECTED_TWT BIT(4) 2756 2746 #define WLAN_RSNX_CAPA_SAE_H2E BIT(5) 2757 2747 2748 + /* EBPCC = Enhanced BSS Parameter Change Count */ 2749 + #define IEEE80211_ENH_CRIT_UPD_EBPCC 0x0F 2750 + #define IEEE80211_ENH_CRIT_UPD_TYPE 0x70 2751 + #define IEEE80211_ENH_CRIT_UPD_TYPE_NO_UHR 0 2752 + #define IEEE80211_ENH_CRIT_UPD_TYPE_UHR 1 2753 + #define IEEE80211_ENH_CRIT_UPD_ALL 0x80 2754 + 2755 + /** 2756 + * struct ieee80211_enh_crit_upd - enhanced critical update (UHR) 2757 + * @v: value of the enhanced critical update data, 2758 + * see %IEEE80211_ENH_CRIT_UPD_* to parse the bits 2759 + */ 2760 + struct ieee80211_enh_crit_upd { 2761 + u8 v; 2762 + } __packed; 2763 + 2758 2764 /* 2759 2765 * reduced neighbor report, based on Draft P802.11ax_D6.1, 2760 2766 * section 9.4.2.170 and accepted contributions. ··· 2789 2763 #define IEEE80211_RNR_TBTT_PARAMS_COLOC_ESS 0x10 2790 2764 #define IEEE80211_RNR_TBTT_PARAMS_PROBE_ACTIVE 0x20 2791 2765 #define IEEE80211_RNR_TBTT_PARAMS_COLOC_AP 0x40 2766 + #define IEEE80211_RNR_TBTT_PARAMS_SAME_SMD 0x80 2792 2767 2793 2768 #define IEEE80211_RNR_TBTT_PARAMS_PSD_NO_LIMIT 127 2794 2769 #define IEEE80211_RNR_TBTT_PARAMS_PSD_RESERVED -128 ··· 2842 2815 u8 bss_params; 2843 2816 s8 psd_20; 2844 2817 struct ieee80211_rnr_mld_params mld_params; 2818 + struct ieee80211_enh_crit_upd enh_crit_upd; 2845 2819 } __packed; 2846 2820 2847 2821 #include "ieee80211-ht.h" 2848 2822 #include "ieee80211-vht.h" 2849 2823 #include "ieee80211-he.h" 2850 2824 #include "ieee80211-eht.h" 2825 + #include "ieee80211-uhr.h" 2851 2826 #include "ieee80211-mesh.h" 2852 2827 #include "ieee80211-s1g.h" 2853 2828 #include "ieee80211-p2p.h"