Skip to content

Commit d65a977

Browse files
twpedersenjmberg-intel
authored andcommitted
nl80211: advertise supported channel width in S1G
S1G supports 5 channel widths: 1, 2, 4, 8, and 16. One channel width is allowed per frequency in each operating class, so it makes more sense to advertise the specific channel width allowed. Signed-off-by: Thomas Pedersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 37050e3 commit d65a977

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

include/net/cfg80211.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ struct wiphy;
9696
* @IEEE80211_CHAN_NO_10MHZ: 10 MHz bandwidth is not permitted
9797
* on this channel.
9898
* @IEEE80211_CHAN_NO_HE: HE operation is not permitted on this channel.
99+
* @IEEE80211_CHAN_1MHZ: 1 MHz bandwidth is permitted
100+
* on this channel.
101+
* @IEEE80211_CHAN_2MHZ: 2 MHz bandwidth is permitted
102+
* on this channel.
103+
* @IEEE80211_CHAN_4MHZ: 4 MHz bandwidth is permitted
104+
* on this channel.
105+
* @IEEE80211_CHAN_8MHZ: 8 MHz bandwidth is permitted
106+
* on this channel.
107+
* @IEEE80211_CHAN_16MHZ: 16 MHz bandwidth is permitted
108+
* on this channel.
99109
*
100110
*/
101111
enum ieee80211_channel_flags {
@@ -113,6 +123,11 @@ enum ieee80211_channel_flags {
113123
IEEE80211_CHAN_NO_20MHZ = 1<<11,
114124
IEEE80211_CHAN_NO_10MHZ = 1<<12,
115125
IEEE80211_CHAN_NO_HE = 1<<13,
126+
IEEE80211_CHAN_1MHZ = 1<<14,
127+
IEEE80211_CHAN_2MHZ = 1<<15,
128+
IEEE80211_CHAN_4MHZ = 1<<16,
129+
IEEE80211_CHAN_8MHZ = 1<<17,
130+
IEEE80211_CHAN_16MHZ = 1<<18,
116131
};
117132

118133
#define IEEE80211_CHAN_NO_HT40 \

include/uapi/linux/nl80211.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3737,6 +3737,16 @@ enum nl80211_wmm_rule {
37373737
* @NL80211_FREQUENCY_ATTR_NO_HE: HE operation is not allowed on this channel
37383738
* in current regulatory domain.
37393739
* @NL80211_FREQUENCY_ATTR_OFFSET: frequency offset in KHz
3740+
* @NL80211_FREQUENCY_ATTR_1MHZ: 1 MHz operation is allowed
3741+
* on this channel in current regulatory domain.
3742+
* @NL80211_FREQUENCY_ATTR_2MHZ: 2 MHz operation is allowed
3743+
* on this channel in current regulatory domain.
3744+
* @NL80211_FREQUENCY_ATTR_4MHZ: 4 MHz operation is allowed
3745+
* on this channel in current regulatory domain.
3746+
* @NL80211_FREQUENCY_ATTR_8MHZ: 8 MHz operation is allowed
3747+
* on this channel in current regulatory domain.
3748+
* @NL80211_FREQUENCY_ATTR_16MHZ: 16 MHz operation is allowed
3749+
* on this channel in current regulatory domain.
37403750
* @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
37413751
* currently defined
37423752
* @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
@@ -3768,6 +3778,11 @@ enum nl80211_frequency_attr {
37683778
NL80211_FREQUENCY_ATTR_WMM,
37693779
NL80211_FREQUENCY_ATTR_NO_HE,
37703780
NL80211_FREQUENCY_ATTR_OFFSET,
3781+
NL80211_FREQUENCY_ATTR_1MHZ,
3782+
NL80211_FREQUENCY_ATTR_2MHZ,
3783+
NL80211_FREQUENCY_ATTR_4MHZ,
3784+
NL80211_FREQUENCY_ATTR_8MHZ,
3785+
NL80211_FREQUENCY_ATTR_16MHZ,
37713786

37723787
/* keep last */
37733788
__NL80211_FREQUENCY_ATTR_AFTER_LAST,

net/wireless/nl80211.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,21 @@ static int nl80211_msg_put_channel(struct sk_buff *msg, struct wiphy *wiphy,
10101010
if ((chan->flags & IEEE80211_CHAN_NO_HE) &&
10111011
nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_HE))
10121012
goto nla_put_failure;
1013+
if ((chan->flags & IEEE80211_CHAN_1MHZ) &&
1014+
nla_put_flag(msg, NL80211_FREQUENCY_ATTR_1MHZ))
1015+
goto nla_put_failure;
1016+
if ((chan->flags & IEEE80211_CHAN_2MHZ) &&
1017+
nla_put_flag(msg, NL80211_FREQUENCY_ATTR_2MHZ))
1018+
goto nla_put_failure;
1019+
if ((chan->flags & IEEE80211_CHAN_4MHZ) &&
1020+
nla_put_flag(msg, NL80211_FREQUENCY_ATTR_4MHZ))
1021+
goto nla_put_failure;
1022+
if ((chan->flags & IEEE80211_CHAN_8MHZ) &&
1023+
nla_put_flag(msg, NL80211_FREQUENCY_ATTR_8MHZ))
1024+
goto nla_put_failure;
1025+
if ((chan->flags & IEEE80211_CHAN_16MHZ) &&
1026+
nla_put_flag(msg, NL80211_FREQUENCY_ATTR_16MHZ))
1027+
goto nla_put_failure;
10131028
}
10141029

10151030
if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_MAX_TX_POWER,

0 commit comments

Comments
 (0)