6
6
*
7
7
* Copyright 2009 Johannes Berg <[email protected] >
8
8
* Copyright 2013-2014 Intel Mobile Communications GmbH
9
- * Copyright 2018 Intel Corporation
9
+ * Copyright 2018-2020 Intel Corporation
10
10
*/
11
11
12
12
#include <linux/export.h>
@@ -919,7 +919,8 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
919
919
width = 10 ;
920
920
break ;
921
921
case NL80211_CHAN_WIDTH_20 :
922
- if (!ht_cap -> ht_supported )
922
+ if (!ht_cap -> ht_supported &&
923
+ chandef -> chan -> band != NL80211_BAND_6GHZ )
923
924
return false;
924
925
/* fall through */
925
926
case NL80211_CHAN_WIDTH_20_NOHT :
@@ -928,6 +929,8 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
928
929
break ;
929
930
case NL80211_CHAN_WIDTH_40 :
930
931
width = 40 ;
932
+ if (chandef -> chan -> band == NL80211_BAND_6GHZ )
933
+ break ;
931
934
if (!ht_cap -> ht_supported )
932
935
return false;
933
936
if (!(ht_cap -> cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 ) ||
@@ -942,24 +945,29 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
942
945
break ;
943
946
case NL80211_CHAN_WIDTH_80P80 :
944
947
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 )
946
950
return false;
947
951
/* fall through */
948
952
case NL80211_CHAN_WIDTH_80 :
949
- if (!vht_cap -> vht_supported )
950
- return false;
951
953
prohibited_flags |= IEEE80211_CHAN_NO_80MHZ ;
952
954
width = 80 ;
955
+ if (chandef -> chan -> band == NL80211_BAND_6GHZ )
956
+ break ;
957
+ if (!vht_cap -> vht_supported )
958
+ return false;
953
959
break ;
954
960
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 ;
955
965
if (!vht_cap -> vht_supported )
956
966
return false;
957
967
cap = vht_cap -> cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK ;
958
968
if (cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ &&
959
969
cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ )
960
970
return false;
961
- prohibited_flags |= IEEE80211_CHAN_NO_160MHZ ;
962
- width = 160 ;
963
971
break ;
964
972
default :
965
973
WARN_ON_ONCE (1 );
0 commit comments