@@ -189,17 +189,13 @@ static void iwl_mvm_mld_mac_remove_interface(struct ieee80211_hw *hw,
189
189
mutex_unlock (& mvm -> mutex );
190
190
}
191
191
192
- static unsigned int iwl_mvm_mld_count_active_links (struct ieee80211_vif * vif )
192
+ static unsigned int iwl_mvm_mld_count_active_links (struct iwl_mvm_vif * mvmvif )
193
193
{
194
194
unsigned int n_active = 0 ;
195
195
int i ;
196
196
197
197
for (i = 0 ; i < IEEE80211_MLD_MAX_NUM_LINKS ; i ++ ) {
198
- struct ieee80211_bss_conf * link_conf ;
199
-
200
- link_conf = link_conf_dereference_protected (vif , i );
201
- if (link_conf &&
202
- rcu_access_pointer (link_conf -> chanctx_conf ))
198
+ if (mvmvif -> link [i ] && mvmvif -> link [i ]-> phy_ctxt )
203
199
n_active ++ ;
204
200
}
205
201
@@ -245,18 +241,18 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm,
245
241
{
246
242
u16 * phy_ctxt_id = (u16 * )ctx -> drv_priv ;
247
243
struct iwl_mvm_phy_ctxt * phy_ctxt = & mvm -> phy_ctxts [* phy_ctxt_id ];
248
- unsigned int n_active = iwl_mvm_mld_count_active_links (vif );
249
244
struct iwl_mvm_vif * mvmvif = iwl_mvm_vif_from_mac80211 (vif );
245
+ unsigned int n_active = iwl_mvm_mld_count_active_links (mvmvif );
250
246
unsigned int link_id = link_conf -> link_id ;
251
247
int ret ;
252
248
253
- /* if the assigned one was not counted yet, count it now */
254
- if (!rcu_access_pointer (link_conf -> chanctx_conf ))
255
- n_active ++ ;
256
-
257
249
if (WARN_ON_ONCE (!mvmvif -> link [link_id ]))
258
250
return - EINVAL ;
259
251
252
+ /* if the assigned one was not counted yet, count it now */
253
+ if (!mvmvif -> link [link_id ]-> phy_ctxt )
254
+ n_active ++ ;
255
+
260
256
/* mac parameters such as HE support can change at this stage
261
257
* For sta, need first to configure correct state from drv_sta_state
262
258
* and only after that update mac config.
@@ -416,7 +412,7 @@ __iwl_mvm_mld_unassign_vif_chanctx(struct iwl_mvm *mvm,
416
412
417
413
{
418
414
struct iwl_mvm_vif * mvmvif = iwl_mvm_vif_from_mac80211 (vif );
419
- unsigned int n_active = iwl_mvm_mld_count_active_links (vif );
415
+ unsigned int n_active = iwl_mvm_mld_count_active_links (mvmvif );
420
416
unsigned int link_id = link_conf -> link_id ;
421
417
422
418
/* shouldn't happen, but verify link_id is valid before accessing */
0 commit comments