Commit ba8f6a03 authored by Johannes Berg's avatar Johannes Berg

cfg80211: treat 6 GHz channels as valid regardless of capability

If a 6 GHz channel exists, then we can probably safely assume that
the device actually supports it, and then it should support most
bandwidths.

This will probably need to be extended to check the interface type
and then dig into the HE capabilities for that though, to have the
correct bandwidth check.

Link: https://lore.kernel.org/r/20200528213443.d4864ef52e92.I82f09b2b14a56413ce20376d09967fe954a033eb@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 2ad2274c
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright 2009 Johannes Berg <johannes@sipsolutions.net> * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
* Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2013-2014 Intel Mobile Communications GmbH
* Copyright 2018 Intel Corporation * Copyright 2018-2020 Intel Corporation
*/ */
#include <linux/export.h> #include <linux/export.h>
...@@ -919,7 +919,8 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy, ...@@ -919,7 +919,8 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
width = 10; width = 10;
break; break;
case NL80211_CHAN_WIDTH_20: case NL80211_CHAN_WIDTH_20:
if (!ht_cap->ht_supported) if (!ht_cap->ht_supported &&
chandef->chan->band != NL80211_BAND_6GHZ)
return false; return false;
/* fall through */ /* fall through */
case NL80211_CHAN_WIDTH_20_NOHT: case NL80211_CHAN_WIDTH_20_NOHT:
...@@ -928,6 +929,8 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy, ...@@ -928,6 +929,8 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
break; break;
case NL80211_CHAN_WIDTH_40: case NL80211_CHAN_WIDTH_40:
width = 40; width = 40;
if (chandef->chan->band == NL80211_BAND_6GHZ)
break;
if (!ht_cap->ht_supported) if (!ht_cap->ht_supported)
return false; return false;
if (!(ht_cap->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) || if (!(ht_cap->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) ||
...@@ -942,24 +945,29 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy, ...@@ -942,24 +945,29 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
break; break;
case NL80211_CHAN_WIDTH_80P80: case NL80211_CHAN_WIDTH_80P80:
cap = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK; cap = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
if (cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ) if (chandef->chan->band != NL80211_BAND_6GHZ &&
cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
return false; return false;
/* fall through */ /* fall through */
case NL80211_CHAN_WIDTH_80: case NL80211_CHAN_WIDTH_80:
if (!vht_cap->vht_supported)
return false;
prohibited_flags |= IEEE80211_CHAN_NO_80MHZ; prohibited_flags |= IEEE80211_CHAN_NO_80MHZ;
width = 80; width = 80;
if (chandef->chan->band == NL80211_BAND_6GHZ)
break;
if (!vht_cap->vht_supported)
return false;
break; break;
case NL80211_CHAN_WIDTH_160: case NL80211_CHAN_WIDTH_160:
prohibited_flags |= IEEE80211_CHAN_NO_160MHZ;
width = 160;
if (chandef->chan->band == NL80211_BAND_6GHZ)
break;
if (!vht_cap->vht_supported) if (!vht_cap->vht_supported)
return false; return false;
cap = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK; cap = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
if (cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ && if (cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ &&
cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ) cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
return false; return false;
prohibited_flags |= IEEE80211_CHAN_NO_160MHZ;
width = 160;
break; break;
default: default:
WARN_ON_ONCE(1); WARN_ON_ONCE(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment