From: Rajkumar Manoharan <rmanohar@codeaurora.org>
To: johannes@sipsolutions.net, kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
Rajkumar Manoharan <rmanohar@codeaurora.org>,
Vamsi Krishna <vamsin@codeaurora.org>
Subject: [PATCH v2 01/11] cfg80211: use only HE capability to set prohibited flags in 6 GHz
Date: Thu, 30 Apr 2020 15:20:42 -0700 [thread overview]
Message-ID: <1588285252-30034-1-git-send-email-rmanohar@codeaurora.org> (raw)
The prohibited flags to determine whether configured bandwidth
is supported by driver are validated only against HT and VHT capability.
In 6 GHz band, Only HE capability should be validated to find out
given chandef is usable.
Co-developed-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
---
net/wireless/chan.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 50 insertions(+), 4 deletions(-)
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index fcac5c6366e1..582b487576e1 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -19,6 +19,11 @@ static bool cfg80211_valid_60g_freq(u32 freq)
return freq >= 58320 && freq <= 70200;
}
+static bool cfg80211_is_6ghz_freq(u32 freq)
+{
+ return (freq > 5940 && freq < 7105);
+}
+
void cfg80211_chandef_create(struct cfg80211_chan_def *chandef,
struct ieee80211_channel *chan,
enum nl80211_channel_type chan_type)
@@ -882,6 +887,7 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
struct ieee80211_sta_ht_cap *ht_cap;
struct ieee80211_sta_vht_cap *vht_cap;
struct ieee80211_edmg *edmg_cap;
+ const struct ieee80211_sta_he_cap *he_cap;
u32 width, control_freq, cap;
if (WARN_ON(!cfg80211_chandef_valid(chandef)))
@@ -890,6 +896,7 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
ht_cap = &wiphy->bands[chandef->chan->band]->ht_cap;
vht_cap = &wiphy->bands[chandef->chan->band]->vht_cap;
edmg_cap = &wiphy->bands[chandef->chan->band]->edmg_cap;
+ he_cap = ieee80211_get_he_sta_cap(wiphy->bands[chandef->chan->band]);
if (edmg_cap->channels &&
!cfg80211_edmg_usable(wiphy,
@@ -919,6 +926,16 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
break;
case NL80211_CHAN_WIDTH_40:
width = 40;
+ if (cfg80211_is_6ghz_freq(chandef->center_freq1)) {
+ if (!he_cap)
+ return false;
+ if (!he_cap->has_he_6ghz)
+ return false;
+ if (!(he_cap->he_cap_elem.phy_cap_info[0] &
+ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G))
+ return false;
+ break;
+ }
if (!ht_cap->ht_supported)
return false;
if (!(ht_cap->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) ||
@@ -933,24 +950,53 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
break;
case NL80211_CHAN_WIDTH_80P80:
cap = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
- if (cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
+ if (!cfg80211_is_6ghz_freq(chandef->center_freq1) &&
+ cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
return false;
+ if (cfg80211_is_6ghz_freq(chandef->center_freq1)) {
+ if (!he_cap)
+ return false;
+ if (!he_cap->has_he_6ghz)
+ return false;
+ if (!(he_cap->he_cap_elem.phy_cap_info[0] &
+ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G))
+ return false;
+ }
/* fall through */
case NL80211_CHAN_WIDTH_80:
- if (!vht_cap->vht_supported)
+ if (cfg80211_is_6ghz_freq(chandef->center_freq1)) {
+ if (!he_cap)
+ return false;
+ if (!he_cap->has_he_6ghz)
+ return false;
+ if (!(he_cap->he_cap_elem.phy_cap_info[0] &
+ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G))
+ return false;
+ } else if (!vht_cap->vht_supported) {
return false;
+ }
prohibited_flags |= IEEE80211_CHAN_NO_80MHZ;
width = 80;
break;
case NL80211_CHAN_WIDTH_160:
+ prohibited_flags |= IEEE80211_CHAN_NO_160MHZ;
+ width = 160;
+ if (cfg80211_is_6ghz_freq(chandef->center_freq1)) {
+ if (!he_cap)
+ return false;
+ if (!he_cap->has_he_6ghz)
+ return false;
+ if (!(he_cap->he_cap_elem.phy_cap_info[0] &
+ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G))
+ return false;
+ break;
+ }
if (!vht_cap->vht_supported)
return false;
cap = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
if (cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ &&
cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
return false;
- prohibited_flags |= IEEE80211_CHAN_NO_160MHZ;
- width = 160;
break;
default:
WARN_ON_ONCE(1);
--
2.7.4
next reply other threads:[~2020-04-30 22:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 22:20 Rajkumar Manoharan [this message]
2020-04-30 22:20 ` [PATCH v2 02/11] cfg80211: handle 6 GHz capability of new station Rajkumar Manoharan
2020-04-30 22:20 ` [PATCH v2 03/11] nl80211: add HE 6 GHz Band Capability support Rajkumar Manoharan
2020-04-30 22:20 ` [PATCH v2 04/11] mac80211: add HE 6 GHz Band Capabilities into parse extension Rajkumar Manoharan
2020-04-30 22:20 ` [PATCH v2 05/11] mac80211: fix memory overlap due to variable length param Rajkumar Manoharan
2020-04-30 22:20 ` [PATCH v2 06/11] mac80211: handle HE 6 GHz Capability in HE STA processing Rajkumar Manoharan
2020-04-30 22:20 ` [PATCH v2 07/11] mac80211: add HE 6 GHz Band Capability IE in Assoc. Request Rajkumar Manoharan
2020-04-30 22:20 ` [PATCH v2 08/11] mac80211: build HE operation with 6 GHz oper information Rajkumar Manoharan
2020-04-30 22:20 ` [PATCH v2 09/11] mac80211: do not allow HT/VHT IEs in 6 GHz mesh mode Rajkumar Manoharan
2020-04-30 22:20 ` [PATCH v2 10/11] mac80211: determine chantype from HE operation in 6 GHz Rajkumar Manoharan
2020-05-08 22:53 ` Pradeep Kumar Chitrapu
2020-05-08 23:45 ` Rajkumar Manoharan
2020-04-30 22:20 ` [PATCH v2 11/11] ath11k: build HE 6 GHz capability Rajkumar Manoharan
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=1588285252-30034-1-git-send-email-rmanohar@codeaurora.org \
--to=rmanohar@codeaurora.org \
--cc=johannes@sipsolutions.net \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=vamsin@codeaurora.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).