* Returns true if we're done assigning the chanctx
  * (either on failure or success)
  */
-bool __iwl_mvm_assign_vif_chanctx_common(struct iwl_mvm *mvm,
-                                        struct ieee80211_vif *vif,
-                                        struct ieee80211_chanctx_conf *ctx,
-                                        bool switching_chanctx, int *ret)
+static bool
+__iwl_mvm_assign_vif_chanctx_common(struct iwl_mvm *mvm,
+                                   struct ieee80211_vif *vif,
+                                   struct ieee80211_chanctx_conf *ctx,
+                                   bool switching_chanctx, int *ret)
 {
        u16 *phy_ctxt_id = (u16 *)ctx->drv_priv;
        struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id];
 
 static int __iwl_mvm_assign_vif_chanctx(struct iwl_mvm *mvm,
                                        struct ieee80211_vif *vif,
+                                       struct ieee80211_bss_conf *link_conf,
                                        struct ieee80211_chanctx_conf *ctx,
                                        bool switching_chanctx)
 {
        struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
        int ret;
 
+       if (WARN_ON(!link_conf))
+               return -EINVAL;
+
        if (__iwl_mvm_assign_vif_chanctx_common(mvm, vif, ctx,
                                                switching_chanctx, &ret))
                goto out;
        int ret;
 
        mutex_lock(&mvm->mutex);
-       ret = __iwl_mvm_assign_vif_chanctx(mvm, vif, ctx, false);
+       ret = __iwl_mvm_assign_vif_chanctx(mvm, vif, link_conf, ctx, false);
        mutex_unlock(&mvm->mutex);
 
        return ret;
  * Returns if chanctx unassign chanctx is done
  * (either on failure or success)
  */
-bool __iwl_mvm_unassign_vif_chanctx_common(struct iwl_mvm *mvm,
-                                          struct ieee80211_vif *vif,
-                                          bool switching_chanctx)
+static bool __iwl_mvm_unassign_vif_chanctx_common(struct iwl_mvm *mvm,
+                                                 struct ieee80211_vif *vif,
+                                                 bool switching_chanctx)
 {
        struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
 
 
 static void __iwl_mvm_unassign_vif_chanctx(struct iwl_mvm *mvm,
                                           struct ieee80211_vif *vif,
+                                          struct ieee80211_bss_conf *link_conf,
                                           struct ieee80211_chanctx_conf *ctx,
                                           bool switching_chanctx)
 {
        struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
 
        mutex_lock(&mvm->mutex);
-       __iwl_mvm_unassign_vif_chanctx(mvm, vif, ctx, false);
+       __iwl_mvm_unassign_vif_chanctx(mvm, vif, link_conf, ctx, false);
        mutex_unlock(&mvm->mutex);
 }
 
        int ret;
 
        mutex_lock(&mvm->mutex);
-       ops->__unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true);
+       ops->__unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf,
+                                   vifs[0].old_ctx, true);
        __iwl_mvm_remove_chanctx(mvm, vifs[0].old_ctx);
 
        ret = __iwl_mvm_add_chanctx(mvm, vifs[0].new_ctx);
                goto out_reassign;
        }
 
-       ret = ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].new_ctx,
-                                          true);
+       ret = ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf,
+                                       vifs[0].new_ctx, true);
        if (ret) {
                IWL_ERR(mvm,
                        "failed to assign new_ctx during channel switch\n");
                goto out_restart;
        }
 
-       if (ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx,
-                                     true)) {
+       if (ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf,
+                                     vifs[0].old_ctx, true)) {
                IWL_ERR(mvm, "failed to reassign old_ctx after failure.\n");
                goto out_restart;
        }
        int ret;
 
        mutex_lock(&mvm->mutex);
-       ops->__unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true);
+       ops->__unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf,
+                                   vifs[0].old_ctx, true);
 
-       ret = ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].new_ctx,
-                                          true);
+       ret = ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf,
+                                       vifs[0].new_ctx, true);
        if (ret) {
                IWL_ERR(mvm,
                        "failed to assign new_ctx during channel switch\n");
        goto out;
 
 out_reassign:
-       if (ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx,
-                                     true)) {
+       if (ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf,
+                                     vifs[0].old_ctx, true)) {
                IWL_ERR(mvm, "failed to reassign old_ctx after failure.\n");
                goto out_restart;
        }
 
        mutex_unlock(&mvm->mutex);
 }
 
-static int __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm,
-                                           struct ieee80211_vif *vif,
-                                           struct ieee80211_chanctx_conf *ctx,
-                                           bool switching_chanctx)
+static int
+__iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm,
+                                struct ieee80211_vif *vif,
+                                struct ieee80211_bss_conf *link_conf,
+                                struct ieee80211_chanctx_conf *ctx,
+                                bool switching_chanctx)
 {
        u16 *phy_ctxt_id = (u16 *)ctx->drv_priv;
        struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id];
        struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+       unsigned int link_id = link_conf->link_id;
        int ret;
 
-       mvmvif->deflink.phy_ctxt = phy_ctxt;
+       if (WARN_ON_ONCE(!mvmvif->link[link_id]))
+               return -EINVAL;
+
+       mvmvif->link[link_id]->phy_ctxt = phy_ctxt;
 
        if (switching_chanctx) {
                /* reactivate if we turned this off during channel switch */
        }
 
        /* send it first with phy context ID */
-       ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf, 0, false);
+       ret = iwl_mvm_link_changed(mvm, vif, link_conf, 0, false);
        if (ret)
                goto out;
 
        /* then activate */
-       ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf,
+       ret = iwl_mvm_link_changed(mvm, vif, link_conf,
                                   LINK_CONTEXT_MODIFY_ACTIVE |
                                   LINK_CONTEXT_MODIFY_RATES_INFO,
                                   true);
        iwl_mvm_power_update_mac(mvm);
 
        if (vif->type == NL80211_IFTYPE_MONITOR) {
-               ret = iwl_mvm_mld_add_snif_sta(mvm, vif,
-                                              &vif->bss_conf);
+               ret = iwl_mvm_mld_add_snif_sta(mvm, vif, link_conf);
                if (ret)
                        goto deactivate;
        }
        return 0;
 
 deactivate:
-       iwl_mvm_link_changed(mvm, vif, &vif->bss_conf,
-                            LINK_CONTEXT_MODIFY_ACTIVE, false);
+       iwl_mvm_link_changed(mvm, vif, link_conf, LINK_CONTEXT_MODIFY_ACTIVE,
+                            false);
 out:
-       mvmvif->deflink.phy_ctxt = NULL;
+       mvmvif->link[link_id]->phy_ctxt = NULL;
        iwl_mvm_power_update_mac(mvm);
        return ret;
 }
        int ret;
 
        mutex_lock(&mvm->mutex);
-       ret = __iwl_mvm_mld_assign_vif_chanctx(mvm, vif, ctx, false);
+       ret = __iwl_mvm_mld_assign_vif_chanctx(mvm, vif, link_conf, ctx, false);
        mutex_unlock(&mvm->mutex);
 
        return ret;
 }
 
-static void __iwl_mvm_mld_unassign_vif_chanctx(struct iwl_mvm *mvm,
-                                              struct ieee80211_vif *vif,
-                                              struct ieee80211_chanctx_conf *ctx,
-                                              bool switching_chanctx)
+static void
+__iwl_mvm_mld_unassign_vif_chanctx(struct iwl_mvm *mvm,
+                                  struct ieee80211_vif *vif,
+                                  struct ieee80211_bss_conf *link_conf,
+                                  struct ieee80211_chanctx_conf *ctx,
+                                  bool switching_chanctx)
 {
        struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+       unsigned int link_id = link_conf->link_id;
+
+       /* shouldn't happen, but verify link_id is valid before accessing */
+       if (WARN_ON_ONCE(!mvmvif->link[link_id]))
+               return;
 
        if (vif->type == NL80211_IFTYPE_AP && switching_chanctx) {
                mvmvif->csa_countdown = false;
        if (vif->type == NL80211_IFTYPE_MONITOR)
                iwl_mvm_mld_rm_snif_sta(mvm, vif);
 
-       iwl_mvm_link_changed(mvm, vif, &vif->bss_conf,
+       iwl_mvm_link_changed(mvm, vif, link_conf,
                             LINK_CONTEXT_MODIFY_ACTIVE, false);
 
        if (switching_chanctx)
                return;
-       mvmvif->deflink.phy_ctxt = NULL;
+       mvmvif->link[link_id]->phy_ctxt = NULL;
        iwl_mvm_power_update_mac(mvm);
 }
 
        struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
 
        mutex_lock(&mvm->mutex);
-       __iwl_mvm_mld_unassign_vif_chanctx(mvm, vif, ctx, false);
+       __iwl_mvm_mld_unassign_vif_chanctx(mvm, vif, link_conf, ctx, false);
        mutex_unlock(&mvm->mutex);
 }
 
 
 struct iwl_mvm_switch_vif_chanctx_ops {
        int (*__assign_vif_chanctx)(struct iwl_mvm *mvm,
                                    struct ieee80211_vif *vif,
+                                   struct ieee80211_bss_conf *link_conf,
                                    struct ieee80211_chanctx_conf *ctx,
                                    bool switching_chanctx);
        void (*__unassign_vif_chanctx)(struct iwl_mvm *mvm,
                                       struct ieee80211_vif *vif,
+                                      struct ieee80211_bss_conf *link_conf,
                                       struct ieee80211_chanctx_conf *ctx,
                                       bool switching_chanctx);
 };
                                  enum ieee80211_chanctx_switch_mode mode,
                                  struct iwl_mvm_switch_vif_chanctx_ops *ops);
 
-bool __iwl_mvm_assign_vif_chanctx_common(struct iwl_mvm *mvm,
-                                        struct ieee80211_vif *vif,
-                                        struct ieee80211_chanctx_conf *ctx,
-                                        bool switching_chanctx, int *ret);
-bool __iwl_mvm_unassign_vif_chanctx_common(struct iwl_mvm *mvm,
-                                          struct ieee80211_vif *vif,
-                                          bool switching_chanctx);
-
 /* Channel info utils */
 static inline bool iwl_mvm_has_ultra_hb_channel(struct iwl_mvm *mvm)
 {