History

nl80211: extend support to config spatial reuse parameter set

Allow the user to configure below Spatial Reuse Parameter Set element. * Non-SRG OBSS PD Max Offset * SRG BSS Color Bitmap * SRG Partial BSSID Bitmap

Rajkumar Manoharan committed 6 years ago

Commit f5bec331 parent 265a0704 files · +51 −2Browse files

Unified · Split

4 files
  1. include/linux/ieee80211.h +5 −2
  2. include/net/cfg80211.h +10 −0
  3. include/uapi/linux/nl80211.h +11 −0
  4. net/wireless/nl80211.c +25 −0
include/linux/ieee80211.h+5−2
@@ -2350,8 +2350,11 @@ ieee80211_he_6ghz_oper(const struct ieee80211_he_operation *he_oper) · 2349 unmodified lines
2350}2350}
2351 2351
2352/* HE Spatial Reuse defines */2352/* HE Spatial Reuse defines */
2353#define IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT 0x42353#define IEEE80211_HE_SPR_PSR_DISALLOWED BIT(0)
2354#define IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT 0x82354#define IEEE80211_HE_SPR_NON_SRG_OBSS_PD_SR_DISALLOWED BIT(1)
2355#define IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT BIT(2)
2356#define IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT BIT(3)
2357#define IEEE80211_HE_SPR_HESIGA_SR_VAL15_ALLOWED BIT(4)
2355 2358
2356/*2359/*
2357 * ieee80211_he_spr_size - calculate 802.11ax HE Spatial Reuse IE size2360 * ieee80211_he_spr_size - calculate 802.11ax HE Spatial Reuse IE size
include/net/cfg80211.h+10−0
@@ -269,13 +269,23 @@ struct ieee80211_rate { · 268 unmodified lines
269 * struct ieee80211_he_obss_pd - AP settings for spatial reuse269 * struct ieee80211_he_obss_pd - AP settings for spatial reuse
270 *270 *
271 * @enable: is the feature enabled.271 * @enable: is the feature enabled.
272 * @sr_ctrl: The SR Control field of SRP element.
273 * @non_srg_max_offset: non-SRG maximum tx power offset
272 * @min_offset: minimal tx power offset an associated station shall use274 * @min_offset: minimal tx power offset an associated station shall use
273 * @max_offset: maximum tx power offset an associated station shall use275 * @max_offset: maximum tx power offset an associated station shall use
276 * @bss_color_bitmap: bitmap that indicates the BSS color values used by
277 * members of the SRG
278 * @partial_bssid_bitmap: bitmap that indicates the partial BSSID values
279 * used by members of the SRG
274 */280 */
275struct ieee80211_he_obss_pd {281struct ieee80211_he_obss_pd {
276 bool enable;282 bool enable;
283 u8 sr_ctrl;
284 u8 non_srg_max_offset;
277 u8 min_offset;285 u8 min_offset;
278 u8 max_offset;286 u8 max_offset;
287 u8 bss_color_bitmap[8];
288 u8 partial_bssid_bitmap[8];
279};289};
280 290
281/**291/**
include/uapi/linux/nl80211.h+11−0
@@ -6991,6 +6991,13 @@ enum nl80211_peer_measurement_ftm_resp { · 6990 unmodified lines
6991 *6991 *
6992 * @NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET: the OBSS PD minimum tx power offset.6992 * @NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET: the OBSS PD minimum tx power offset.
6993 * @NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET: the OBSS PD maximum tx power offset.6993 * @NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET: the OBSS PD maximum tx power offset.
6994 * @NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET: the non-SRG OBSS PD maximum
6995 * tx power offset.
6996 * @NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP: bitmap that indicates the BSS color
6997 * values used by members of the SRG.
6998 * @NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP: bitmap that indicates the partial
6999 * BSSID values used by members of the SRG.
7000 * @NL80211_HE_OBSS_PD_ATTR_SR_CTRL: The SR Control field of SRP element.
6994 *7001 *
6995 * @__NL80211_HE_OBSS_PD_ATTR_LAST: Internal7002 * @__NL80211_HE_OBSS_PD_ATTR_LAST: Internal
6996 * @NL80211_HE_OBSS_PD_ATTR_MAX: highest OBSS PD attribute.7003 * @NL80211_HE_OBSS_PD_ATTR_MAX: highest OBSS PD attribute.
@@ -7000,6 +7007,10 @@ enum nl80211_obss_pd_attributes { · 3 unmodified lines
7000 7007
7001 NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET,7008 NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET,
7002 NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET,7009 NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET,
7010 NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET,
7011 NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP,
7012 NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP,
7013 NL80211_HE_OBSS_PD_ATTR_SR_CTRL,
7003 7014
7004 /* keep last */7015 /* keep last */
7005 __NL80211_HE_OBSS_PD_ATTR_LAST,7016 __NL80211_HE_OBSS_PD_ATTR_LAST,
net/wireless/nl80211.c+25−0
@@ -329,6 +329,13 @@ he_obss_pd_policy[NL80211_HE_OBSS_PD_ATTR_MAX + 1] = { · 328 unmodified lines
329 NLA_POLICY_RANGE(NLA_U8, 1, 20),329 NLA_POLICY_RANGE(NLA_U8, 1, 20),
330 [NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET] =330 [NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET] =
331 NLA_POLICY_RANGE(NLA_U8, 1, 20),331 NLA_POLICY_RANGE(NLA_U8, 1, 20),
332 [NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET] =
333 NLA_POLICY_RANGE(NLA_U8, 1, 20),
334 [NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP] =
335 NLA_POLICY_EXACT_LEN(8),
336 [NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP] =
337 NLA_POLICY_EXACT_LEN(8),
338 [NL80211_HE_OBSS_PD_ATTR_SR_CTRL] = { .type = NLA_U8 },
332};339};
333 340
334static const struct nla_policy341static const struct nla_policy
@@ -4857,16 +4864,34 @@ static int nl80211_parse_he_obss_pd(struct nlattr *attrs, · 4522 unmodified lines
4857 if (err)4864 if (err)
4858 return err;4865 return err;
4859 4866
4867 if (!tb[NL80211_HE_OBSS_PD_ATTR_SR_CTRL])
4868 return -EINVAL;
4869
4870 he_obss_pd->sr_ctrl = nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_SR_CTRL]);
4871
4860 if (tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET])4872 if (tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET])
4861 he_obss_pd->min_offset =4873 he_obss_pd->min_offset =
4862 nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET]);4874 nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET]);
4863 if (tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET])4875 if (tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET])
4864 he_obss_pd->max_offset =4876 he_obss_pd->max_offset =
4865 nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET]);4877 nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET]);
4878 if (tb[NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET])
4879 he_obss_pd->non_srg_max_offset =
4880 nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET]);
4866 4881
4867 if (he_obss_pd->min_offset > he_obss_pd->max_offset)4882 if (he_obss_pd->min_offset > he_obss_pd->max_offset)
4868 return -EINVAL;4883 return -EINVAL;
4869 4884
4885 if (tb[NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP])
4886 memcpy(he_obss_pd->bss_color_bitmap,
4887 nla_data(tb[NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP]),
4888 sizeof(he_obss_pd->bss_color_bitmap));
4889
4890 if (tb[NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP])
4891 memcpy(he_obss_pd->partial_bssid_bitmap,
4892 nla_data(tb[NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP]),
4893 sizeof(he_obss_pd->partial_bssid_bitmap));
4894
4870 he_obss_pd->enable = true;4895 he_obss_pd->enable = true;
4871 4896
4872 return 0;4897 return 0;