mirror of
https://github.com/torvalds/linux
synced 2024-09-19 18:46:35 +00:00
wifi: mac80211: add support to call csa_finish on a link
Currently ieee80211_csa_finish() function finalizes CSA by scheduling a finalizing worker using the deflink. With MLO, there is a need to do it on a given link basis. Pass link ID of the link on which CSA needs to be finalized. Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com> Link: https://msgid.link/20240130140918.1172387-6-quic_adisi@quicinc.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
1a96bb4e8a
commit
04ada8599c
|
@ -2047,7 +2047,7 @@ static void ath10k_mac_vif_ap_csa_count_down(struct ath10k_vif *arvif)
|
|||
ath10k_warn(ar, "failed to update prb tmpl during csa: %d\n",
|
||||
ret);
|
||||
} else {
|
||||
ieee80211_csa_finish(vif);
|
||||
ieee80211_csa_finish(vif, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3885,7 +3885,7 @@ void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)
|
|||
*/
|
||||
if (arvif->vif->bss_conf.csa_active &&
|
||||
ieee80211_beacon_cntdwn_is_complete(arvif->vif)) {
|
||||
ieee80211_csa_finish(arvif->vif);
|
||||
ieee80211_csa_finish(arvif->vif, 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -8226,7 +8226,7 @@ ath11k_wmi_process_csa_switch_count_event(struct ath11k_base *ab,
|
|||
}
|
||||
|
||||
if (arvif->is_up && arvif->vif->bss_conf.csa_active)
|
||||
ieee80211_csa_finish(arvif->vif);
|
||||
ieee80211_csa_finish(arvif->vif, 0);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
|
|
@ -6448,7 +6448,7 @@ ath12k_wmi_process_csa_switch_count_event(struct ath12k_base *ab,
|
|||
}
|
||||
|
||||
if (arvif->is_up && arvif->vif->bss_conf.csa_active)
|
||||
ieee80211_csa_finish(arvif->vif);
|
||||
ieee80211_csa_finish(arvif->vif, 0);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
|
|
@ -368,7 +368,7 @@ bool ath9k_csa_is_finished(struct ath_softc *sc, struct ieee80211_vif *vif)
|
|||
if (!ieee80211_beacon_cntdwn_is_complete(vif))
|
||||
return false;
|
||||
|
||||
ieee80211_csa_finish(vif);
|
||||
ieee80211_csa_finish(vif, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -517,7 +517,7 @@ bool ath9k_htc_csa_is_finished(struct ath9k_htc_priv *priv)
|
|||
if (!ieee80211_beacon_cntdwn_is_complete(vif))
|
||||
return false;
|
||||
|
||||
ieee80211_csa_finish(vif);
|
||||
ieee80211_csa_finish(vif, 0);
|
||||
|
||||
priv->csa_vif = NULL;
|
||||
return true;
|
||||
|
|
|
@ -1486,7 +1486,7 @@ static void iwl_mvm_csa_count_down(struct iwl_mvm *mvm,
|
|||
}
|
||||
} else if (!iwl_mvm_te_scheduled(&mvmvif->time_event_data)) {
|
||||
/* we don't have CSA NoA scheduled yet, switch now */
|
||||
ieee80211_csa_finish(csa_vif);
|
||||
ieee80211_csa_finish(csa_vif, 0);
|
||||
RCU_INIT_POINTER(mvm->csa_vif, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -1836,7 +1836,7 @@ void iwl_mvm_channel_switch_start_notif(struct iwl_mvm *mvm,
|
|||
msecs_to_jiffies(IWL_MVM_CS_UNBLOCK_TX_TIMEOUT *
|
||||
csa_vif->bss_conf.beacon_int));
|
||||
|
||||
ieee80211_csa_finish(csa_vif);
|
||||
ieee80211_csa_finish(csa_vif, 0);
|
||||
|
||||
rcu_read_unlock();
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ static void iwl_mvm_csa_noa_start(struct iwl_mvm *mvm)
|
|||
goto out_unlock;
|
||||
}
|
||||
|
||||
ieee80211_csa_finish(csa_vif);
|
||||
ieee80211_csa_finish(csa_vif, 0);
|
||||
|
||||
rcu_read_unlock();
|
||||
|
||||
|
|
|
@ -1614,7 +1614,7 @@ static void
|
|||
__mt76_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
|
||||
{
|
||||
if (vif->bss_conf.csa_active && ieee80211_beacon_cntdwn_is_complete(vif))
|
||||
ieee80211_csa_finish(vif);
|
||||
ieee80211_csa_finish(vif, 0);
|
||||
}
|
||||
|
||||
void mt76_csa_finish(struct mt76_dev *dev)
|
||||
|
|
|
@ -353,7 +353,7 @@ static void
|
|||
mt7615_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
|
||||
{
|
||||
if (vif->bss_conf.csa_active)
|
||||
ieee80211_csa_finish(vif);
|
||||
ieee80211_csa_finish(vif, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -228,7 +228,7 @@ mt7915_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
|
|||
if (!vif->bss_conf.csa_active || vif->type == NL80211_IFTYPE_STATION)
|
||||
return;
|
||||
|
||||
ieee80211_csa_finish(vif);
|
||||
ieee80211_csa_finish(vif, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -341,7 +341,7 @@ mt7996_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
|
|||
if (!vif->bss_conf.csa_active || vif->type == NL80211_IFTYPE_STATION)
|
||||
return;
|
||||
|
||||
ieee80211_csa_finish(vif);
|
||||
ieee80211_csa_finish(vif, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -5740,7 +5740,7 @@ static void rtl8xxxu_update_beacon_work_callback(struct work_struct *work)
|
|||
|
||||
if (vif->bss_conf.csa_active) {
|
||||
if (ieee80211_beacon_cntdwn_is_complete(vif)) {
|
||||
ieee80211_csa_finish(vif);
|
||||
ieee80211_csa_finish(vif, 0);
|
||||
return;
|
||||
}
|
||||
schedule_delayed_work(&priv->update_beacon_work,
|
||||
|
|
|
@ -233,7 +233,7 @@ void wlcore_event_channel_switch(struct wl1271 *wl,
|
|||
cancel_delayed_work(&wlvif->channel_switch_work);
|
||||
} else {
|
||||
set_bit(WLVIF_FLAG_BEACON_DISABLED, &wlvif->flags);
|
||||
ieee80211_csa_finish(vif);
|
||||
ieee80211_csa_finish(vif, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2303,7 +2303,7 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
|
|||
}
|
||||
|
||||
if (link_conf->csa_active && ieee80211_beacon_cntdwn_is_complete(vif))
|
||||
ieee80211_csa_finish(vif);
|
||||
ieee80211_csa_finish(vif, link_id);
|
||||
}
|
||||
|
||||
static enum hrtimer_restart
|
||||
|
|
|
@ -5555,12 +5555,13 @@ void ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter);
|
|||
/**
|
||||
* ieee80211_csa_finish - notify mac80211 about channel switch
|
||||
* @vif: &struct ieee80211_vif pointer from the add_interface callback.
|
||||
* @link_id: valid link_id during MLO or 0 for non-MLO
|
||||
*
|
||||
* After a channel switch announcement was scheduled and the counter in this
|
||||
* announcement hits 1, this function must be called by the driver to
|
||||
* notify mac80211 that the channel can be changed.
|
||||
*/
|
||||
void ieee80211_csa_finish(struct ieee80211_vif *vif);
|
||||
void ieee80211_csa_finish(struct ieee80211_vif *vif, unsigned int link_id);
|
||||
|
||||
/**
|
||||
* ieee80211_beacon_cntdwn_is_complete - find out if countdown reached 1
|
||||
|
|
|
@ -3547,13 +3547,24 @@ cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon)
|
|||
return new_beacon;
|
||||
}
|
||||
|
||||
void ieee80211_csa_finish(struct ieee80211_vif *vif)
|
||||
void ieee80211_csa_finish(struct ieee80211_vif *vif, unsigned int link_id)
|
||||
{
|
||||
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
|
||||
struct ieee80211_local *local = sdata->local;
|
||||
struct ieee80211_link_data *link_data;
|
||||
|
||||
if (WARN_ON(link_id >= IEEE80211_MLD_MAX_NUM_LINKS))
|
||||
return;
|
||||
|
||||
rcu_read_lock();
|
||||
|
||||
link_data = rcu_dereference(sdata->link[link_id]);
|
||||
if (WARN_ON(!link_data)) {
|
||||
rcu_read_unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
/* TODO: MBSSID with MLO changes */
|
||||
if (vif->mbssid_tx_vif == vif) {
|
||||
/* Trigger ieee80211_csa_finish() on the non-transmitting
|
||||
* interfaces when channel switch is received on
|
||||
|
@ -3572,7 +3583,7 @@ void ieee80211_csa_finish(struct ieee80211_vif *vif)
|
|||
&iter->deflink.csa_finalize_work);
|
||||
}
|
||||
}
|
||||
wiphy_work_queue(local->hw.wiphy, &sdata->deflink.csa_finalize_work);
|
||||
wiphy_work_queue(local->hw.wiphy, &link_data->csa_finalize_work);
|
||||
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue