Skip to content

Commit ba8f6a0

Browse files
committed
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@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 2ad2274 commit ba8f6a0

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

net/wireless/chan.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright 2009 Johannes Berg <[email protected]>
88
* Copyright 2013-2014 Intel Mobile Communications GmbH
9-
* Copyright 2018 Intel Corporation
9+
* Copyright 2018-2020 Intel Corporation
1010
*/
1111

1212
#include <linux/export.h>
@@ -919,7 +919,8 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
919919
width = 10;
920920
break;
921921
case NL80211_CHAN_WIDTH_20:
922-
if (!ht_cap->ht_supported)
922+
if (!ht_cap->ht_supported &&
923+
chandef->chan->band != NL80211_BAND_6GHZ)
923924
return false;
924925
/* fall through */
925926
case NL80211_CHAN_WIDTH_20_NOHT:
@@ -928,6 +929,8 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
928929
break;
929930
case NL80211_CHAN_WIDTH_40:
930931
width = 40;
932+
if (chandef->chan->band == NL80211_BAND_6GHZ)
933+
break;
931934
if (!ht_cap->ht_supported)
932935
return false;
933936
if (!(ht_cap->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) ||
@@ -942,24 +945,29 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
942945
break;
943946
case NL80211_CHAN_WIDTH_80P80:
944947
cap = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
945-
if (cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
948+
if (chandef->chan->band != NL80211_BAND_6GHZ &&
949+
cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
946950
return false;
947951
/* fall through */
948952
case NL80211_CHAN_WIDTH_80:
949-
if (!vht_cap->vht_supported)
950-
return false;
951953
prohibited_flags |= IEEE80211_CHAN_NO_80MHZ;
952954
width = 80;
955+
if (chandef->chan->band == NL80211_BAND_6GHZ)
956+
break;
957+
if (!vht_cap->vht_supported)
958+
return false;
953959
break;
954960
case NL80211_CHAN_WIDTH_160:
961+
prohibited_flags |= IEEE80211_CHAN_NO_160MHZ;
962+
width = 160;
963+
if (chandef->chan->band == NL80211_BAND_6GHZ)
964+
break;
955965
if (!vht_cap->vht_supported)
956966
return false;
957967
cap = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
958968
if (cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ &&
959969
cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
960970
return false;
961-
prohibited_flags |= IEEE80211_CHAN_NO_160MHZ;
962-
width = 160;
963971
break;
964972
default:
965973
WARN_ON_ONCE(1);

0 commit comments

Comments
 (0)