}
 
 static void
-ath10k_mac_update_rx_channel(struct ath10k *ar)
+ath10k_mac_update_rx_channel(struct ath10k *ar,
+                            struct ieee80211_chanctx_conf *ctx,
+                            struct ieee80211_vif_chanctx_switch *vifs,
+                            int n_vifs)
 {
        struct cfg80211_chan_def *def = NULL;
 
        lockdep_assert_held(&ar->conf_mutex);
        lockdep_assert_held(&ar->data_lock);
 
+       WARN_ON(ctx && vifs);
+       WARN_ON(vifs && n_vifs != 1);
+
        /* FIXME: Sort of an optimization and a workaround. Peers and vifs are
         * on a linked list now. Doing a lookup peer -> vif -> chanctx for each
         * ppdu on Rx may reduce performance on low-end systems. It should be
         * affected much.
         */
        rcu_read_lock();
-       if (ath10k_mac_num_chanctxs(ar) == 1) {
+       if (!ctx && ath10k_mac_num_chanctxs(ar) == 1) {
                ieee80211_iter_chan_contexts_atomic(ar->hw,
                                        ath10k_mac_get_any_chandef_iter,
                                        &def);
+
+               if (vifs)
+                       def = &vifs[0].new_ctx->def;
+
                ar->rx_channel = def->chan;
+       } else if (ctx && ath10k_mac_num_chanctxs(ar) == 0) {
+               ar->rx_channel = ctx->def.chan;
        } else {
                ar->rx_channel = NULL;
        }
 
        spin_lock_bh(&ar->data_lock);
        ath10k_mac_chan_ctx_init(ar, arctx, ctx);
-       ath10k_mac_update_rx_channel(ar);
+       ath10k_mac_update_rx_channel(ar, ctx, NULL, 0);
        spin_unlock_bh(&ar->data_lock);
 
        ath10k_recalc_radar_detection(ar);
        mutex_lock(&ar->conf_mutex);
 
        spin_lock_bh(&ar->data_lock);
-       ath10k_mac_update_rx_channel(ar);
+       ath10k_mac_update_rx_channel(ar, NULL, NULL, 0);
        spin_unlock_bh(&ar->data_lock);
 
        ath10k_recalc_radar_detection(ar);
                 */
                arctx_old->conf = *vifs[i].new_ctx;
        }
-       ath10k_mac_update_rx_channel(ar);
+       ath10k_mac_update_rx_channel(ar, NULL, vifs, n_vifs);
        spin_unlock_bh(&ar->data_lock);
 
        /* FIXME: Reconfigure only affected vifs */