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
23502350 }
23512351
23522352 /* HE Spatial Reuse defines */
2353−#define IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT 0x4
2354−#define IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT 0x8
2353+#define IEEE80211_HE_SPR_PSR_DISALLOWED BIT(0)
2354+#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)
23552358
23562359 /*
23572360 * 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
269269 * struct ieee80211_he_obss_pd - AP settings for spatial reuse
270270 *
271271 * @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
272274 * @min_offset: minimal tx power offset an associated station shall use
273275 * @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
274280 */
275281 struct ieee80211_he_obss_pd {
276282 bool enable;
283+ u8 sr_ctrl;
284+ u8 non_srg_max_offset;
277285 u8 min_offset;
278286 u8 max_offset;
287+ u8 bss_color_bitmap[8];
288+ u8 partial_bssid_bitmap[8];
279289 };
280290
281291 /**
include/uapi/linux/nl80211.h+11−0
@@ -6991,6 +6991,13 @@ enum nl80211_peer_measurement_ftm_resp { · 6990 unmodified lines
69916991 *
69926992 * @NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET: the OBSS PD minimum tx power offset.
69936993 * @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.
69947001 *
69957002 * @__NL80211_HE_OBSS_PD_ATTR_LAST: Internal
69967003 * @NL80211_HE_OBSS_PD_ATTR_MAX: highest OBSS PD attribute.
@@ -7000,6 +7007,10 @@ enum nl80211_obss_pd_attributes { · 3 unmodified lines
70007007
70017008 NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET,
70027009 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,
70037014
70047015 /* keep last */
70057016 __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
329329 NLA_POLICY_RANGE(NLA_U8, 1, 20),
330330 [NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET] =
331331 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 },
332339 };
333340
334341 static const struct nla_policy
@@ -4857,16 +4864,34 @@ static int nl80211_parse_he_obss_pd(struct nlattr *attrs, · 4522 unmodified lines
48574864 if (err)
48584865 return err;
48594866
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+
48604872 if (tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET])
48614873 he_obss_pd->min_offset =
48624874 nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET]);
48634875 if (tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET])
48644876 he_obss_pd->max_offset =
48654877 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]);
48664881
48674882 if (he_obss_pd->min_offset > he_obss_pd->max_offset)
48684883 return -EINVAL;
48694884
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+
48704895 he_obss_pd->enable = true;
48714896
48724897 return 0;