@@ -797,6 +797,7 @@ static int ieee80211_assign_link_chanctx(struct ieee80211_link_data *link,
797
797
struct ieee80211_local * local = sdata -> local ;
798
798
struct ieee80211_chanctx_conf * conf ;
799
799
struct ieee80211_chanctx * curr_ctx = NULL ;
800
+ bool new_idle ;
800
801
int ret = 0 ;
801
802
802
803
if (WARN_ON (sdata -> vif .type == NL80211_IFTYPE_NAN ))
@@ -829,8 +830,6 @@ static int ieee80211_assign_link_chanctx(struct ieee80211_link_data *link,
829
830
out :
830
831
rcu_assign_pointer (link -> conf -> chanctx_conf , conf );
831
832
832
- sdata -> vif .cfg .idle = !conf ;
833
-
834
833
if (curr_ctx && ieee80211_chanctx_num_assigned (local , curr_ctx ) > 0 ) {
835
834
ieee80211_recalc_chanctx_chantype (local , curr_ctx );
836
835
ieee80211_recalc_smps_chanctx (local , curr_ctx );
@@ -843,9 +842,27 @@ static int ieee80211_assign_link_chanctx(struct ieee80211_link_data *link,
843
842
ieee80211_recalc_chanctx_min_def (local , new_ctx , NULL );
844
843
}
845
844
846
- if (sdata -> vif .type != NL80211_IFTYPE_P2P_DEVICE &&
847
- sdata -> vif .type != NL80211_IFTYPE_MONITOR )
848
- ieee80211_vif_cfg_change_notify (sdata , BSS_CHANGED_IDLE );
845
+ if (conf ) {
846
+ new_idle = false;
847
+ } else {
848
+ struct ieee80211_link_data * tmp ;
849
+
850
+ new_idle = true;
851
+ for_each_sdata_link (local , tmp ) {
852
+ if (rcu_access_pointer (tmp -> conf -> chanctx_conf )) {
853
+ new_idle = false;
854
+ break ;
855
+ }
856
+ }
857
+ }
858
+
859
+ if (new_idle != sdata -> vif .cfg .idle ) {
860
+ sdata -> vif .cfg .idle = new_idle ;
861
+
862
+ if (sdata -> vif .type != NL80211_IFTYPE_P2P_DEVICE &&
863
+ sdata -> vif .type != NL80211_IFTYPE_MONITOR )
864
+ ieee80211_vif_cfg_change_notify (sdata , BSS_CHANGED_IDLE );
865
+ }
849
866
850
867
ieee80211_check_fast_xmit_iface (sdata );
851
868
0 commit comments