Skip to content

Commit a11ec0d

Browse files
SomSPjmberg-intel
authored andcommitted
wifi: cfg80211/mac80211: implement dot11ExtendedRegInfoSupport
Implement dot11ExtendedRegInfoSupport to advertise non-AP station regulatory power capability as part of regulatory connectivity element in (Re)Association request frames so that AP can achieve maximum client connectivity. Control field which was interpreted using value of 3-bits B5 to B3, now uses value of 4-bits B6 to B3 to interpret the type of AP. Hence update IEEE80211_HE_6GHZ_OPER_CTRL_REG_INFO to parse 4-bits control field. If older AP still updates only 3-bits value of control field, station can still interpret the value as per section E.2.7 of IEEE 802.11 REVme D7.0 and support the appropriate AP type. Also update IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP as the value of standard power AP is changed to 8 instead of 4 so that AP can support both LPI AP and SP AP to maximize the connectivity with stations. For backward compatibility, keeping value 4 as old AP by limiting it to SP AP only. Signed-off-by: Somashekhar Puttagangaiah <somashekhar.puttagangaiah@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250609213232.90cdef116aad.I85da390fbee59355e3855691933e6a5e55c47ac4@changeid [fix kernel-doc] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent a9681ef commit a11ec0d

File tree

5 files changed

+89
-6
lines changed

5 files changed

+89
-6
lines changed

include/linux/ieee80211.h

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2837,11 +2837,12 @@ static inline bool ieee80211_he_capa_size_ok(const u8 *data, u8 len)
28372837
#define IEEE80211_HE_OPERATION_PARTIAL_BSS_COLOR 0x40000000
28382838
#define IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED 0x80000000
28392839

2840-
#define IEEE80211_6GHZ_CTRL_REG_LPI_AP 0
2841-
#define IEEE80211_6GHZ_CTRL_REG_SP_AP 1
2842-
#define IEEE80211_6GHZ_CTRL_REG_VLP_AP 2
2843-
#define IEEE80211_6GHZ_CTRL_REG_INDOOR_LPI_AP 3
2844-
#define IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP 4
2840+
#define IEEE80211_6GHZ_CTRL_REG_LPI_AP 0
2841+
#define IEEE80211_6GHZ_CTRL_REG_SP_AP 1
2842+
#define IEEE80211_6GHZ_CTRL_REG_VLP_AP 2
2843+
#define IEEE80211_6GHZ_CTRL_REG_INDOOR_LPI_AP 3
2844+
#define IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP_OLD 4
2845+
#define IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP 8
28452846

28462847
/**
28472848
* struct ieee80211_he_6ghz_oper - HE 6 GHz operation Information field
@@ -2859,13 +2860,31 @@ struct ieee80211_he_6ghz_oper {
28592860
#define IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_80MHZ 2
28602861
#define IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_160MHZ 3
28612862
#define IEEE80211_HE_6GHZ_OPER_CTRL_DUP_BEACON 0x4
2862-
#define IEEE80211_HE_6GHZ_OPER_CTRL_REG_INFO 0x38
2863+
#define IEEE80211_HE_6GHZ_OPER_CTRL_REG_INFO 0x78
28632864
u8 control;
28642865
u8 ccfs0;
28652866
u8 ccfs1;
28662867
u8 minrate;
28672868
} __packed;
28682869

2870+
/**
2871+
* enum ieee80211_reg_conn_bits - represents Regulatory connectivity field bits.
2872+
*
2873+
* This enumeration defines bit flags used to represent regulatory connectivity
2874+
* field bits.
2875+
*
2876+
* @IEEE80211_REG_CONN_LPI_VALID: Indicates whether the LPI bit is valid.
2877+
* @IEEE80211_REG_CONN_LPI_VALUE: Represents the value of the LPI bit.
2878+
* @IEEE80211_REG_CONN_SP_VALID: Indicates whether the SP bit is valid.
2879+
* @IEEE80211_REG_CONN_SP_VALUE: Represents the value of the SP bit.
2880+
*/
2881+
enum ieee80211_reg_conn_bits {
2882+
IEEE80211_REG_CONN_LPI_VALID = BIT(0),
2883+
IEEE80211_REG_CONN_LPI_VALUE = BIT(1),
2884+
IEEE80211_REG_CONN_SP_VALID = BIT(2),
2885+
IEEE80211_REG_CONN_SP_VALUE = BIT(3),
2886+
};
2887+
28692888
/* transmit power interpretation type of transmit power envelope element */
28702889
enum ieee80211_tx_power_intrpt_type {
28712890
IEEE80211_TPE_LOCAL_EIRP,
@@ -3847,6 +3866,7 @@ enum ieee80211_eid_ext {
38473866
WLAN_EID_EXT_FILS_PUBLIC_KEY = 12,
38483867
WLAN_EID_EXT_FILS_NONCE = 13,
38493868
WLAN_EID_EXT_FUTURE_CHAN_GUIDANCE = 14,
3869+
WLAN_EID_EXT_DH_PARAMETER = 32,
38503870
WLAN_EID_EXT_HE_CAPABILITY = 35,
38513871
WLAN_EID_EXT_HE_OPERATION = 36,
38523872
WLAN_EID_EXT_UORA = 37,
@@ -3870,6 +3890,8 @@ enum ieee80211_eid_ext {
38703890
WLAN_EID_EXT_EHT_CAPABILITY = 108,
38713891
WLAN_EID_EXT_TID_TO_LINK_MAPPING = 109,
38723892
WLAN_EID_EXT_BANDWIDTH_INDICATION = 135,
3893+
WLAN_EID_EXT_KNOWN_STA_IDENTIFCATION = 136,
3894+
WLAN_EID_EXT_NON_AP_STA_REG_CON = 137,
38733895
};
38743896

38753897
/* Action category code */

net/mac80211/ieee80211_i.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,6 +2642,8 @@ int ieee80211_put_eht_cap(struct sk_buff *skb,
26422642
struct ieee80211_sub_if_data *sdata,
26432643
const struct ieee80211_supported_band *sband,
26442644
const struct ieee80211_conn_settings *conn);
2645+
int ieee80211_put_reg_conn(struct sk_buff *skb,
2646+
enum ieee80211_channel_flags flags);
26452647

26462648
/* channel management */
26472649
bool ieee80211_chandef_ht_oper(const struct ieee80211_ht_operation *ht_oper,

net/mac80211/mlme.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,6 +1641,30 @@ static size_t ieee80211_add_before_he_elems(struct sk_buff *skb,
16411641
return noffset;
16421642
}
16431643

1644+
static size_t ieee80211_add_before_reg_conn(struct sk_buff *skb,
1645+
const u8 *elems, size_t elems_len,
1646+
size_t offset)
1647+
{
1648+
static const u8 before_reg_conn[] = {
1649+
/*
1650+
* no need to list the ones split off before HE
1651+
* or generated here
1652+
*/
1653+
WLAN_EID_EXTENSION, WLAN_EID_EXT_DH_PARAMETER,
1654+
WLAN_EID_EXTENSION, WLAN_EID_EXT_KNOWN_STA_IDENTIFCATION,
1655+
};
1656+
size_t noffset;
1657+
1658+
if (!elems_len)
1659+
return offset;
1660+
1661+
noffset = ieee80211_ie_split(elems, elems_len, before_reg_conn,
1662+
ARRAY_SIZE(before_reg_conn), offset);
1663+
skb_put_data(skb, elems + offset, noffset - offset);
1664+
1665+
return noffset;
1666+
}
1667+
16441668
#define PRESENT_ELEMS_MAX 8
16451669
#define PRESENT_ELEM_EXT_OFFS 0x100
16461670

@@ -1801,6 +1825,22 @@ ieee80211_add_link_elems(struct ieee80211_sub_if_data *sdata,
18011825
ieee80211_put_he_6ghz_cap(skb, sdata, smps_mode);
18021826
}
18031827

1828+
/*
1829+
* if present, add any custom IEs that go before regulatory
1830+
* connectivity element
1831+
*/
1832+
offset = ieee80211_add_before_reg_conn(skb, extra_elems,
1833+
extra_elems_len, offset);
1834+
1835+
if (sband->band == NL80211_BAND_6GHZ) {
1836+
/*
1837+
* as per Section E.2.7 of IEEE 802.11 REVme D7.0, non-AP STA
1838+
* capable of operating on the 6 GHz band shall transmit
1839+
* regulatory connectivity element.
1840+
*/
1841+
ieee80211_put_reg_conn(skb, chan->flags);
1842+
}
1843+
18041844
/*
18051845
* careful - need to know about all the present elems before
18061846
* calling ieee80211_assoc_add_ml_elem(), so add this one if
@@ -5931,6 +5971,7 @@ ieee80211_ap_power_type(u8 control)
59315971
return IEEE80211_REG_LPI_AP;
59325972
case IEEE80211_6GHZ_CTRL_REG_SP_AP:
59335973
case IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP:
5974+
case IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP_OLD:
59345975
return IEEE80211_REG_SP_AP;
59355976
case IEEE80211_6GHZ_CTRL_REG_VLP_AP:
59365977
return IEEE80211_REG_VLP_AP;

net/mac80211/util.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2556,6 +2556,23 @@ int ieee80211_put_he_cap(struct sk_buff *skb,
25562556
return 0;
25572557
}
25582558

2559+
int ieee80211_put_reg_conn(struct sk_buff *skb,
2560+
enum ieee80211_channel_flags flags)
2561+
{
2562+
u8 reg_conn = IEEE80211_REG_CONN_LPI_VALID |
2563+
IEEE80211_REG_CONN_LPI_VALUE |
2564+
IEEE80211_REG_CONN_SP_VALID;
2565+
2566+
if (!(flags & IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT))
2567+
reg_conn |= IEEE80211_REG_CONN_SP_VALUE;
2568+
2569+
skb_put_u8(skb, WLAN_EID_EXTENSION);
2570+
skb_put_u8(skb, 1 + sizeof(reg_conn));
2571+
skb_put_u8(skb, WLAN_EID_EXT_NON_AP_STA_REG_CON);
2572+
skb_put_u8(skb, reg_conn);
2573+
return 0;
2574+
}
2575+
25592576
int ieee80211_put_he_6ghz_cap(struct sk_buff *skb,
25602577
struct ieee80211_sub_if_data *sdata,
25612578
enum ieee80211_smps_mode smps_mode)

net/wireless/scan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,6 +2231,7 @@ cfg80211_get_6ghz_power_type(const u8 *elems, size_t elems_len)
22312231
return IEEE80211_REG_LPI_AP;
22322232
case IEEE80211_6GHZ_CTRL_REG_SP_AP:
22332233
case IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP:
2234+
case IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP_OLD:
22342235
return IEEE80211_REG_SP_AP;
22352236
case IEEE80211_6GHZ_CTRL_REG_VLP_AP:
22362237
return IEEE80211_REG_VLP_AP;

0 commit comments

Comments
 (0)