@@ -156,15 +156,24 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
156
156
struct ieee80211_sta_ht_cap sta_ht_cap ;
157
157
u32 ht_cfreq , ret ;
158
158
159
- memcpy (& sta_ht_cap , & sband -> ht_cap , sizeof (sta_ht_cap ));
160
- ieee80211_apply_htcap_overrides (sdata , & sta_ht_cap );
161
-
162
159
memset (chandef , 0 , sizeof (struct cfg80211_chan_def ));
163
160
chandef -> chan = channel ;
164
161
chandef -> width = NL80211_CHAN_WIDTH_20_NOHT ;
165
162
chandef -> center_freq1 = channel -> center_freq ;
166
163
chandef -> freq1_offset = channel -> freq_offset ;
167
164
165
+ if (channel -> band == NL80211_BAND_6GHZ ) {
166
+ if (!ieee80211_chandef_he_6ghz_oper (sdata , he_oper , chandef ))
167
+ ret = IEEE80211_STA_DISABLE_HT |
168
+ IEEE80211_STA_DISABLE_VHT |
169
+ IEEE80211_STA_DISABLE_HE ;
170
+ vht_chandef = * chandef ;
171
+ goto out ;
172
+ }
173
+
174
+ memcpy (& sta_ht_cap , & sband -> ht_cap , sizeof (sta_ht_cap ));
175
+ ieee80211_apply_htcap_overrides (sdata , & sta_ht_cap );
176
+
168
177
if (!ht_oper || !sta_ht_cap .ht_supported ) {
169
178
ret = IEEE80211_STA_DISABLE_HT |
170
179
IEEE80211_STA_DISABLE_VHT |
@@ -914,7 +923,8 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
914
923
!(ifmgd -> flags & IEEE80211_STA_DISABLE_VHT )))
915
924
ifmgd -> flags |= IEEE80211_STA_DISABLE_VHT ;
916
925
917
- if (!(ifmgd -> flags & IEEE80211_STA_DISABLE_HT ))
926
+ if (sband -> band != NL80211_BAND_6GHZ &&
927
+ !(ifmgd -> flags & IEEE80211_STA_DISABLE_HT ))
918
928
ieee80211_add_ht_ie (sdata , skb , assoc_data -> ap_ht_param ,
919
929
sband , chan , sdata -> smps_mode );
920
930
@@ -968,7 +978,8 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
968
978
offset = noffset ;
969
979
}
970
980
971
- if (!(ifmgd -> flags & IEEE80211_STA_DISABLE_VHT ))
981
+ if (sband -> band != NL80211_BAND_6GHZ &&
982
+ !(ifmgd -> flags & IEEE80211_STA_DISABLE_VHT ))
972
983
ieee80211_add_vht_ie (sdata , skb , sband ,
973
984
& assoc_data -> ap_vht_cap );
974
985
@@ -3248,6 +3259,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
3248
3259
struct ieee80211_bss_conf * bss_conf = & sdata -> vif .bss_conf ;
3249
3260
const struct cfg80211_bss_ies * bss_ies = NULL ;
3250
3261
struct ieee80211_mgd_assoc_data * assoc_data = ifmgd -> assoc_data ;
3262
+ bool is_6ghz = cbss -> channel -> band == NL80211_BAND_6GHZ ;
3251
3263
u32 changed = 0 ;
3252
3264
int err ;
3253
3265
bool ret ;
@@ -3289,11 +3301,12 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
3289
3301
* 2G/3G/4G wifi routers, reported models include the "Onda PN51T",
3290
3302
* "Vodafone PocketWiFi 2", "ZTE MF60" and a similar T-Mobile device.
3291
3303
*/
3292
- if ((assoc_data -> wmm && !elems -> wmm_param ) ||
3293
- (!(ifmgd -> flags & IEEE80211_STA_DISABLE_HT ) &&
3294
- (!elems -> ht_cap_elem || !elems -> ht_operation )) ||
3295
- (!(ifmgd -> flags & IEEE80211_STA_DISABLE_VHT ) &&
3296
- (!elems -> vht_cap_elem || !elems -> vht_operation ))) {
3304
+ if (!is_6ghz &&
3305
+ ((assoc_data -> wmm && !elems -> wmm_param ) ||
3306
+ (!(ifmgd -> flags & IEEE80211_STA_DISABLE_HT ) &&
3307
+ (!elems -> ht_cap_elem || !elems -> ht_operation )) ||
3308
+ (!(ifmgd -> flags & IEEE80211_STA_DISABLE_VHT ) &&
3309
+ (!elems -> vht_cap_elem || !elems -> vht_operation )))) {
3297
3310
const struct cfg80211_bss_ies * ies ;
3298
3311
struct ieee802_11_elems bss_elems ;
3299
3312
@@ -3351,22 +3364,30 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
3351
3364
* We previously checked these in the beacon/probe response, so
3352
3365
* they should be present here. This is just a safety net.
3353
3366
*/
3354
- if (!(ifmgd -> flags & IEEE80211_STA_DISABLE_HT ) &&
3367
+ if (!is_6ghz && ! (ifmgd -> flags & IEEE80211_STA_DISABLE_HT ) &&
3355
3368
(!elems -> wmm_param || !elems -> ht_cap_elem || !elems -> ht_operation )) {
3356
3369
sdata_info (sdata ,
3357
3370
"HT AP is missing WMM params or HT capability/operation\n" );
3358
3371
ret = false;
3359
3372
goto out ;
3360
3373
}
3361
3374
3362
- if (!(ifmgd -> flags & IEEE80211_STA_DISABLE_VHT ) &&
3375
+ if (!is_6ghz && ! (ifmgd -> flags & IEEE80211_STA_DISABLE_VHT ) &&
3363
3376
(!elems -> vht_cap_elem || !elems -> vht_operation )) {
3364
3377
sdata_info (sdata ,
3365
3378
"VHT AP is missing VHT capability/operation\n" );
3366
3379
ret = false;
3367
3380
goto out ;
3368
3381
}
3369
3382
3383
+ if (is_6ghz && !(ifmgd -> flags & IEEE80211_STA_DISABLE_HE ) &&
3384
+ !elems -> he_6ghz_capa ) {
3385
+ sdata_info (sdata ,
3386
+ "HE 6 GHz AP is missing HE 6 GHz band capability\n" );
3387
+ ret = false;
3388
+ goto out ;
3389
+ }
3390
+
3370
3391
mutex_lock (& sdata -> local -> sta_mtx );
3371
3392
/*
3372
3393
* station info was already allocated and inserted before
@@ -4826,6 +4847,7 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
4826
4847
const struct ieee80211_he_operation * he_oper = NULL ;
4827
4848
struct ieee80211_supported_band * sband ;
4828
4849
struct cfg80211_chan_def chandef ;
4850
+ bool is_6ghz = cbss -> channel -> band == NL80211_BAND_6GHZ ;
4829
4851
struct ieee80211_bss * bss = (void * )cbss -> priv ;
4830
4852
int ret ;
4831
4853
u32 i ;
@@ -4838,21 +4860,23 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
4838
4860
IEEE80211_STA_DISABLE_160MHZ );
4839
4861
4840
4862
/* disable HT/VHT/HE if we don't support them */
4841
- if (!sband -> ht_cap .ht_supported ) {
4863
+ if (!sband -> ht_cap .ht_supported && ! is_6ghz ) {
4842
4864
ifmgd -> flags |= IEEE80211_STA_DISABLE_HT ;
4843
4865
ifmgd -> flags |= IEEE80211_STA_DISABLE_VHT ;
4844
4866
ifmgd -> flags |= IEEE80211_STA_DISABLE_HE ;
4845
4867
}
4846
4868
4847
- if (!sband -> vht_cap .vht_supported )
4869
+ if (!sband -> vht_cap .vht_supported && ! is_6ghz ) {
4848
4870
ifmgd -> flags |= IEEE80211_STA_DISABLE_VHT ;
4871
+ ifmgd -> flags |= IEEE80211_STA_DISABLE_HE ;
4872
+ }
4849
4873
4850
4874
if (!ieee80211_get_he_sta_cap (sband ))
4851
4875
ifmgd -> flags |= IEEE80211_STA_DISABLE_HE ;
4852
4876
4853
4877
rcu_read_lock ();
4854
4878
4855
- if (!(ifmgd -> flags & IEEE80211_STA_DISABLE_HT )) {
4879
+ if (!(ifmgd -> flags & IEEE80211_STA_DISABLE_HT ) && ! is_6ghz ) {
4856
4880
const u8 * ht_oper_ie , * ht_cap_ie ;
4857
4881
4858
4882
ht_oper_ie = ieee80211_bss_get_ie (cbss , WLAN_EID_HT_OPERATION );
@@ -4869,7 +4893,7 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
4869
4893
}
4870
4894
}
4871
4895
4872
- if (!(ifmgd -> flags & IEEE80211_STA_DISABLE_VHT )) {
4896
+ if (!(ifmgd -> flags & IEEE80211_STA_DISABLE_VHT ) && ! is_6ghz ) {
4873
4897
const u8 * vht_oper_ie , * vht_cap ;
4874
4898
4875
4899
vht_oper_ie = ieee80211_bss_get_ie (cbss ,
@@ -4934,6 +4958,11 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
4934
4958
4935
4959
rcu_read_unlock ();
4936
4960
4961
+ if (ifmgd -> flags & IEEE80211_STA_DISABLE_HE && is_6ghz ) {
4962
+ sdata_info (sdata , "Rejecting non-HE 6/7 GHz connection" );
4963
+ return - EINVAL ;
4964
+ }
4965
+
4937
4966
/* will change later if needed */
4938
4967
sdata -> smps_mode = IEEE80211_SMPS_OFF ;
4939
4968
@@ -5315,6 +5344,7 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
5315
5344
int ieee80211_mgd_assoc (struct ieee80211_sub_if_data * sdata ,
5316
5345
struct cfg80211_assoc_request * req )
5317
5346
{
5347
+ bool is_6ghz = req -> bss -> channel -> band == NL80211_BAND_6GHZ ;
5318
5348
struct ieee80211_local * local = sdata -> local ;
5319
5349
struct ieee80211_if_managed * ifmgd = & sdata -> u .mgd ;
5320
5350
struct ieee80211_bss * bss = (void * )req -> bss -> priv ;
@@ -5457,14 +5487,15 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
5457
5487
if (ht_ie && ht_ie [1 ] >= sizeof (struct ieee80211_ht_operation ))
5458
5488
assoc_data -> ap_ht_param =
5459
5489
((struct ieee80211_ht_operation * )(ht_ie + 2 ))-> ht_param ;
5460
- else
5490
+ else if (! is_6ghz )
5461
5491
ifmgd -> flags |= IEEE80211_STA_DISABLE_HT ;
5462
5492
vht_ie = ieee80211_bss_get_ie (req -> bss , WLAN_EID_VHT_CAPABILITY );
5463
5493
if (vht_ie && vht_ie [1 ] >= sizeof (struct ieee80211_vht_cap ))
5464
5494
memcpy (& assoc_data -> ap_vht_cap , vht_ie + 2 ,
5465
5495
sizeof (struct ieee80211_vht_cap ));
5466
- else
5467
- ifmgd -> flags |= IEEE80211_STA_DISABLE_VHT ;
5496
+ else if (!is_6ghz )
5497
+ ifmgd -> flags |= IEEE80211_STA_DISABLE_VHT |
5498
+ IEEE80211_STA_DISABLE_HE ;
5468
5499
rcu_read_unlock ();
5469
5500
5470
5501
if (WARN ((sdata -> vif .driver_flags & IEEE80211_VIF_SUPPORTS_UAPSD ) &&
0 commit comments