linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 02/12] mac80211: add twt_protected flag to the bss_conf structure
Date: Thu, 26 Mar 2020 14:00:32 +0200	[thread overview]
Message-ID: <20200326120042.578777-3-luca@coelho.fi> (raw)
In-Reply-To: <20200326120042.578777-1-luca@coelho.fi>

From: Shaul Triebitz <shaul.triebitz@intel.com>

Add a flag to the BSS conf whether the BSS and STA support protected TWT.

Change-Id: I74d7c007dad2601d2e39f54612fe6554dd5ab386
Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 include/net/mac80211.h | 2 ++
 net/mac80211/mlme.c    | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index b6b4de0e4b5e..f2b0a7795d0a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -508,6 +508,7 @@ struct ieee80211_ftm_responder_params {
  *	mode only, set if the AP advertises TWT responder role)
  * @twt_responder: does this BSS support TWT requester (relevant for managed
  *	mode only, set if the AP advertises TWT responder role)
+ * @twt_protected: does this BSS support protected TWT frames
  * @assoc: association status
  * @ibss_joined: indicates whether this station is part of an IBSS
  *	or not
@@ -618,6 +619,7 @@ struct ieee80211_bss_conf {
 	bool he_support;
 	bool twt_requester;
 	bool twt_responder;
+	bool twt_protected;
 	/* association related data */
 	bool assoc, ibss_joined;
 	bool ibss_creator;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 16d75da0996a..f1f518790c12 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3384,10 +3384,19 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
 						  sta);
 
 		bss_conf->he_support = sta->sta.he_cap.has_he;
+		if (elems->rsnx && elems->rsnx_len &&
+		    (elems->rsnx[0] & WLAN_RSNX_CAPA_PROTECTED_TWT) &&
+		    wiphy_ext_feature_isset(local->hw.wiphy,
+					    NL80211_EXT_FEATURE_PROTECTED_TWT))
+			bss_conf->twt_protected = true;
+		else
+			bss_conf->twt_protected = false;
+
 		changed |= ieee80211_recalc_twt_req(sdata, sta, elems);
 	} else {
 		bss_conf->he_support = false;
 		bss_conf->twt_requester = false;
+		bss_conf->twt_protected = false;
 	}
 
 	if (bss_conf->he_support) {
-- 
2.25.1


  parent reply	other threads:[~2020-03-26 12:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 12:00 [PATCH 00/12] cfg80211/mac80211 patches from our internal tree 2020-03-26 Luca Coelho
2020-03-26 12:00 ` [PATCH 01/12] mac80211: implement Operating Mode Notification extended NSS support Luca Coelho
2020-03-26 12:56   ` Kalle Valo
2020-03-26 13:03     ` Luca Coelho
2020-03-26 12:00 ` Luca Coelho [this message]
2020-03-26 12:00 ` [PATCH 03/12] mac80211: Don't destroy auth data in case of anti-clogging Luca Coelho
2020-03-26 12:00 ` [PATCH 04/12] cfg80211: Parse HE membership selector Luca Coelho
2020-03-26 12:00 ` [PATCH 05/12] mac80211: Skip entries with " Luca Coelho
2020-03-26 12:00 ` [PATCH 06/12] mac80211: agg-tx: refactor sending addba Luca Coelho
2020-03-26 12:00 ` [PATCH 07/12] mac80211: agg-tx: add an option to defer ADDBA transmit Luca Coelho
2020-03-26 12:00 ` [PATCH 08/12] mac80211: Fail association when AP has no legacy rates Luca Coelho
2020-03-26 12:00 ` [PATCH 09/12] mac80211: minstrel_ht_assign_best_tp_rates: remove redundant test Luca Coelho
2020-03-26 12:00 ` [PATCH 10/12] mac80211_hwsim: indicate in IBSS that we have transmitted beacons Luca Coelho
2020-03-26 12:00 ` [PATCH 11/12] mac80211: drop data frames without key on encrypted links Luca Coelho
2020-03-27 15:03   ` Sasha Levin
2020-03-26 12:00 ` [PATCH 12/12] cfg80211: Do not warn on same channel at the end of CSA Luca Coelho
2020-03-30  6:55   ` Sergey Matyukevich

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=20200326120042.578777-3-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).