@@ -343,6 +343,23 @@ void cfg80211_oper_and_ht_capa(struct ieee80211_ht_cap *ht_capa,
343343 p1 [i ] &= p2 [i ];
344344}
345345
346+ /* Do a logical ht_capa &= ht_capa_mask. */
347+ void cfg80211_oper_and_vht_capa (struct ieee80211_vht_cap * vht_capa ,
348+ const struct ieee80211_vht_cap * vht_capa_mask )
349+ {
350+ int i ;
351+ u8 * p1 , * p2 ;
352+ if (!vht_capa_mask ) {
353+ memset (vht_capa , 0 , sizeof (* vht_capa ));
354+ return ;
355+ }
356+
357+ p1 = (u8 * )(vht_capa );
358+ p2 = (u8 * )(vht_capa_mask );
359+ for (i = 0 ; i < sizeof (* vht_capa ); i ++ )
360+ p1 [i ] &= p2 [i ];
361+ }
362+
346363int __cfg80211_mlme_assoc (struct cfg80211_registered_device * rdev ,
347364 struct net_device * dev ,
348365 struct ieee80211_channel * chan ,
@@ -351,7 +368,9 @@ int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
351368 const u8 * ie , int ie_len , bool use_mfp ,
352369 struct cfg80211_crypto_settings * crypt ,
353370 u32 assoc_flags , struct ieee80211_ht_cap * ht_capa ,
354- struct ieee80211_ht_cap * ht_capa_mask )
371+ struct ieee80211_ht_cap * ht_capa_mask ,
372+ struct ieee80211_vht_cap * vht_capa ,
373+ struct ieee80211_vht_cap * vht_capa_mask )
355374{
356375 struct wireless_dev * wdev = dev -> ieee80211_ptr ;
357376 struct cfg80211_assoc_request req ;
@@ -388,6 +407,13 @@ int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
388407 sizeof (req .ht_capa_mask ));
389408 cfg80211_oper_and_ht_capa (& req .ht_capa_mask ,
390409 rdev -> wiphy .ht_capa_mod_mask );
410+ if (vht_capa )
411+ memcpy (& req .vht_capa , vht_capa , sizeof (req .vht_capa ));
412+ if (vht_capa_mask )
413+ memcpy (& req .vht_capa_mask , vht_capa_mask ,
414+ sizeof (req .vht_capa_mask ));
415+ cfg80211_oper_and_vht_capa (& req .vht_capa_mask ,
416+ rdev -> wiphy .vht_capa_mod_mask );
391417
392418 req .bss = cfg80211_get_bss (& rdev -> wiphy , chan , bssid , ssid , ssid_len ,
393419 WLAN_CAPABILITY_ESS , WLAN_CAPABILITY_ESS );
@@ -422,7 +448,9 @@ int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
422448 const u8 * ie , int ie_len , bool use_mfp ,
423449 struct cfg80211_crypto_settings * crypt ,
424450 u32 assoc_flags , struct ieee80211_ht_cap * ht_capa ,
425- struct ieee80211_ht_cap * ht_capa_mask )
451+ struct ieee80211_ht_cap * ht_capa_mask ,
452+ struct ieee80211_vht_cap * vht_capa ,
453+ struct ieee80211_vht_cap * vht_capa_mask )
426454{
427455 struct wireless_dev * wdev = dev -> ieee80211_ptr ;
428456 int err ;
@@ -431,7 +459,8 @@ int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
431459 wdev_lock (wdev );
432460 err = __cfg80211_mlme_assoc (rdev , dev , chan , bssid , prev_bssid ,
433461 ssid , ssid_len , ie , ie_len , use_mfp , crypt ,
434- assoc_flags , ht_capa , ht_capa_mask );
462+ assoc_flags , ht_capa , ht_capa_mask ,
463+ vht_capa , vht_capa_mask );
435464 wdev_unlock (wdev );
436465 mutex_unlock (& rdev -> devlist_mtx );
437466
0 commit comments