All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Crispin <john@phrozen.org>
To: Johannes Berg <johannes@sipsolutions.net>,
	Kalle Valo <kvalo@codeaurora.org>
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org,
	John Crispin <john@phrozen.org>,
	Shashidhar Lakkavalli <slakkavalli@datto.com>
Subject: [PATCH 6/7] mac80211: propagate spatial reuse info into ieee80211_sta
Date: Mon, 20 May 2019 13:02:03 +0200	[thread overview]
Message-ID: <20190520110204.27588-7-john@phrozen.org> (raw)
In-Reply-To: <20190520110204.27588-1-john@phrozen.org>

Upon a successful assoc a station shall store the content of the SPR
element inside ieee80211_sta so that the driver can setup the hardware
accordingly.

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
---
 include/net/mac80211.h     |  1 +
 net/mac80211/he.c          | 24 ++++++++++++++++++++++++
 net/mac80211/ieee80211_i.h |  4 ++++
 net/mac80211/mlme.c        |  1 +
 4 files changed, 30 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index d81eea9140e5..f73a210b122b 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1952,6 +1952,7 @@ struct ieee80211_sta {
 	struct ieee80211_sta_vht_cap vht_cap;
 	struct ieee80211_sta_he_cap he_cap;
 	struct ieee80211_he_operation he_operation;
+	struct ieee80211_he_obss_pd he_obss_pd;
 	u16 max_rx_aggregation_subframes;
 	bool wme;
 	u8 uapsd_queues;
diff --git a/net/mac80211/he.c b/net/mac80211/he.c
index 62ef029e5c48..e41ee4a29257 100644
--- a/net/mac80211/he.c
+++ b/net/mac80211/he.c
@@ -67,3 +67,27 @@ ieee80211_he_op_ie_to_sta_he_op(struct ieee80211_sub_if_data *sdata,
 	}
 	memcpy(he_operation, he_op_ie_elem, sizeof(*he_operation));
 }
+
+void
+ieee80211_he_spr_ie_to_sta_he_obss_pd(struct ieee80211_sub_if_data *sdata,
+			      const struct ieee80211_he_spr *he_spr_ie_elem,
+			      struct sta_info *sta)
+{
+	struct ieee80211_he_obss_pd *he_obss_pd = &sta->sta.he_obss_pd;
+	const u8 *data = he_spr_ie_elem->optional;
+
+	memset(he_obss_pd, 0, sizeof(*he_obss_pd));
+
+	if (!he_spr_ie_elem)
+		return;
+
+	if (he_spr_ie_elem->he_sr_control &
+	    IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT)
+		data++;
+	if (he_spr_ie_elem->he_sr_control &
+	    IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT) {
+		he_obss_pd->max_offset = *data++;
+		he_obss_pd->min_offset = *data++;
+		he_obss_pd->enable = true;
+	}
+}
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index e931e114fba4..d82469754d34 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1870,6 +1870,10 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
 				  struct ieee80211_supported_band *sband,
 				  const u8 *he_cap_ie, u8 he_cap_len,
 				  struct sta_info *sta);
+void
+ieee80211_he_spr_ie_to_sta_he_obss_pd(struct ieee80211_sub_if_data *sdata,
+				const struct ieee80211_he_spr *he_spr_ie_elem,
+				struct sta_info *sta);
 
 void
 ieee80211_he_op_ie_to_sta_he_op(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 996439a288c0..098335f34aa3 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3377,6 +3377,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
 			bss_conf->uora_ocw_range = elems.uora_element[0];
 
 		ieee80211_he_op_ie_to_sta_he_op(sdata, elems.he_operation, sta);
+		ieee80211_he_spr_ie_to_sta_he_obss_pd(sdata, elems.he_spr, sta);
 		/* TODO: OPEN: what happens if BSS color disable is set? */
 	}
 
-- 
2.20.1


WARNING: multiple messages have this Message-ID (diff)
From: John Crispin <john@phrozen.org>
To: Johannes Berg <johannes@sipsolutions.net>,
	Kalle Valo <kvalo@codeaurora.org>
Cc: Shashidhar Lakkavalli <slakkavalli@datto.com>,
	linux-wireless@vger.kernel.org, ath11k@lists.infradead.org,
	John Crispin <john@phrozen.org>
Subject: [PATCH 6/7] mac80211: propagate spatial reuse info into ieee80211_sta
Date: Mon, 20 May 2019 13:02:03 +0200	[thread overview]
Message-ID: <20190520110204.27588-7-john@phrozen.org> (raw)
In-Reply-To: <20190520110204.27588-1-john@phrozen.org>

Upon a successful assoc a station shall store the content of the SPR
element inside ieee80211_sta so that the driver can setup the hardware
accordingly.

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
---
 include/net/mac80211.h     |  1 +
 net/mac80211/he.c          | 24 ++++++++++++++++++++++++
 net/mac80211/ieee80211_i.h |  4 ++++
 net/mac80211/mlme.c        |  1 +
 4 files changed, 30 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index d81eea9140e5..f73a210b122b 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1952,6 +1952,7 @@ struct ieee80211_sta {
 	struct ieee80211_sta_vht_cap vht_cap;
 	struct ieee80211_sta_he_cap he_cap;
 	struct ieee80211_he_operation he_operation;
+	struct ieee80211_he_obss_pd he_obss_pd;
 	u16 max_rx_aggregation_subframes;
 	bool wme;
 	u8 uapsd_queues;
diff --git a/net/mac80211/he.c b/net/mac80211/he.c
index 62ef029e5c48..e41ee4a29257 100644
--- a/net/mac80211/he.c
+++ b/net/mac80211/he.c
@@ -67,3 +67,27 @@ ieee80211_he_op_ie_to_sta_he_op(struct ieee80211_sub_if_data *sdata,
 	}
 	memcpy(he_operation, he_op_ie_elem, sizeof(*he_operation));
 }
+
+void
+ieee80211_he_spr_ie_to_sta_he_obss_pd(struct ieee80211_sub_if_data *sdata,
+			      const struct ieee80211_he_spr *he_spr_ie_elem,
+			      struct sta_info *sta)
+{
+	struct ieee80211_he_obss_pd *he_obss_pd = &sta->sta.he_obss_pd;
+	const u8 *data = he_spr_ie_elem->optional;
+
+	memset(he_obss_pd, 0, sizeof(*he_obss_pd));
+
+	if (!he_spr_ie_elem)
+		return;
+
+	if (he_spr_ie_elem->he_sr_control &
+	    IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT)
+		data++;
+	if (he_spr_ie_elem->he_sr_control &
+	    IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT) {
+		he_obss_pd->max_offset = *data++;
+		he_obss_pd->min_offset = *data++;
+		he_obss_pd->enable = true;
+	}
+}
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index e931e114fba4..d82469754d34 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1870,6 +1870,10 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
 				  struct ieee80211_supported_band *sband,
 				  const u8 *he_cap_ie, u8 he_cap_len,
 				  struct sta_info *sta);
+void
+ieee80211_he_spr_ie_to_sta_he_obss_pd(struct ieee80211_sub_if_data *sdata,
+				const struct ieee80211_he_spr *he_spr_ie_elem,
+				struct sta_info *sta);
 
 void
 ieee80211_he_op_ie_to_sta_he_op(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 996439a288c0..098335f34aa3 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3377,6 +3377,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
 			bss_conf->uora_ocw_range = elems.uora_element[0];
 
 		ieee80211_he_op_ie_to_sta_he_op(sdata, elems.he_operation, sta);
+		ieee80211_he_spr_ie_to_sta_he_obss_pd(sdata, elems.he_spr, sta);
 		/* TODO: OPEN: what happens if BSS color disable is set? */
 	}
 
-- 
2.20.1


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  parent reply	other threads:[~2019-05-20 11:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20 11:01 [PATCH 0/7] mac80211: HE: add TWT and SPR/OBSSPD support John Crispin
2019-05-20 11:01 ` John Crispin
2019-05-20 11:01 ` [PATCH 1/7] mac80211: HE: dynamically enable the TWT requester support on STA interfaces John Crispin
2019-05-20 11:01   ` John Crispin
2019-05-20 11:01 ` [PATCH 2/7] mac80211: HE: allow turning TWT responder support on and off via netlink John Crispin
2019-05-20 11:01   ` John Crispin
2019-05-20 11:02 ` [PATCH 3/7] ath11k: add TWT support John Crispin
2019-05-20 11:02   ` John Crispin
2019-05-20 11:02 ` [PATCH 4/7] mac80211: HE: add Spatial Reuse IE parsing support John Crispin
2019-05-20 11:02   ` John Crispin
2019-05-20 11:02 ` [PATCH 5/7] mac80211: HE: allow setting spatial reuse parameters when bringing up an AP John Crispin
2019-05-20 11:02   ` John Crispin
2019-05-20 11:02 ` John Crispin [this message]
2019-05-20 11:02   ` [PATCH 6/7] mac80211: propagate spatial reuse info into ieee80211_sta John Crispin
2019-05-20 11:02 ` [PATCH 7/7] ath11k: add spatial reuse support John Crispin
2019-05-20 11:02   ` John Crispin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190520110204.27588-7-john@phrozen.org \
    --to=john@phrozen.org \
    --cc=ath11k@lists.infradead.org \
    --cc=johannes@sipsolutions.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=slakkavalli@datto.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.