2023-03-14 19:49:21 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
|
|
|
|
/*
|
2024-01-29 19:34:49 +01:00
|
|
|
* Copyright (C) 2022-2024 Intel Corporation
|
2023-03-14 19:49:21 +02:00
|
|
|
*/
|
|
|
|
#include "mvm.h"
|
|
|
|
|
|
|
|
static int iwl_mvm_mld_mac_add_interface(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif)
|
|
|
|
{
|
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
|
int ret;
|
2023-10-22 17:55:47 +03:00
|
|
|
int i;
|
2023-03-14 19:49:21 +02:00
|
|
|
|
|
|
|
mutex_lock(&mvm->mutex);
|
|
|
|
|
2024-04-16 13:54:05 +03:00
|
|
|
iwl_mvm_mac_init_mvmvif(mvm, mvmvif);
|
|
|
|
|
2023-03-28 10:58:59 +03:00
|
|
|
mvmvif->mvm = mvm;
|
2023-03-14 19:49:21 +02:00
|
|
|
|
2023-03-28 10:58:59 +03:00
|
|
|
/* Not much to do here. The stack will not allow interface
|
|
|
|
* types or combinations that we didn't advertise, so we
|
|
|
|
* don't really have to check the types.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* make sure that beacon statistics don't go backwards with FW reset */
|
|
|
|
if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
|
2023-10-22 17:55:47 +03:00
|
|
|
for_each_mvm_vif_valid_link(mvmvif, i)
|
|
|
|
mvmvif->link[i]->beacon_stats.accu_num_beacons +=
|
|
|
|
mvmvif->link[i]->beacon_stats.num_beacons;
|
2023-03-28 10:58:59 +03:00
|
|
|
|
|
|
|
/* Allocate resources for the MAC context, and add it to the fw */
|
|
|
|
ret = iwl_mvm_mac_ctxt_init(mvm, vif);
|
2023-03-14 19:49:21 +02:00
|
|
|
if (ret)
|
|
|
|
goto out_unlock;
|
|
|
|
|
2023-03-28 10:58:59 +03:00
|
|
|
rcu_assign_pointer(mvm->vif_id_to_mac[mvmvif->id], vif);
|
|
|
|
|
|
|
|
mvmvif->features |= hw->netdev_features;
|
|
|
|
|
2023-03-28 10:59:11 +03:00
|
|
|
/* reset deflink MLO parameters */
|
2023-03-28 10:59:06 +03:00
|
|
|
mvmvif->deflink.fw_link_id = IWL_MVM_FW_LINK_ID_INVALID;
|
2023-03-28 10:59:11 +03:00
|
|
|
mvmvif->deflink.active = 0;
|
|
|
|
/* the first link always points to the default one */
|
2023-03-28 10:58:59 +03:00
|
|
|
mvmvif->link[0] = &mvmvif->deflink;
|
|
|
|
|
|
|
|
ret = iwl_mvm_mld_mac_ctxt_add(mvm, vif);
|
2023-03-14 19:49:21 +02:00
|
|
|
if (ret)
|
2023-03-28 10:58:59 +03:00
|
|
|
goto out_unlock;
|
2023-03-14 19:49:21 +02:00
|
|
|
|
|
|
|
/* beacon filtering */
|
2024-02-06 18:02:10 +02:00
|
|
|
ret = iwl_mvm_disable_beacon_filter(mvm, vif);
|
2023-03-14 19:49:21 +02:00
|
|
|
if (ret)
|
|
|
|
goto out_remove_mac;
|
|
|
|
|
|
|
|
if (!mvm->bf_allowed_vif &&
|
|
|
|
vif->type == NL80211_IFTYPE_STATION && !vif->p2p) {
|
|
|
|
mvm->bf_allowed_vif = mvmvif;
|
|
|
|
vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER |
|
|
|
|
IEEE80211_VIF_SUPPORTS_CQM_RSSI;
|
|
|
|
}
|
|
|
|
|
2023-10-04 12:36:30 +03:00
|
|
|
ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf);
|
|
|
|
if (ret)
|
|
|
|
goto out_free_bf;
|
2023-03-14 19:49:21 +02:00
|
|
|
|
2023-10-04 12:36:30 +03:00
|
|
|
/* Save a pointer to p2p device vif, so it can later be used to
|
|
|
|
* update the p2p device MAC when a GO is started/stopped
|
|
|
|
*/
|
|
|
|
if (vif->type == NL80211_IFTYPE_P2P_DEVICE)
|
2023-03-14 19:49:21 +02:00
|
|
|
mvm->p2p_device_vif = vif;
|
|
|
|
|
2023-03-28 10:58:59 +03:00
|
|
|
ret = iwl_mvm_power_update_mac(mvm);
|
|
|
|
if (ret)
|
|
|
|
goto out_free_bf;
|
|
|
|
|
2023-03-14 19:49:21 +02:00
|
|
|
iwl_mvm_tcm_add_vif(mvm, vif);
|
|
|
|
INIT_DELAYED_WORK(&mvmvif->csa_work,
|
|
|
|
iwl_mvm_channel_switch_disconnect_wk);
|
|
|
|
|
|
|
|
if (vif->type == NL80211_IFTYPE_MONITOR) {
|
|
|
|
mvm->monitor_on = true;
|
|
|
|
ieee80211_hw_set(mvm->hw, RX_INCLUDES_FCS);
|
|
|
|
}
|
|
|
|
|
2024-01-23 20:08:19 +02:00
|
|
|
if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
|
|
|
|
iwl_mvm_vif_dbgfs_add_link(mvm, vif);
|
2023-03-14 19:49:21 +02:00
|
|
|
|
|
|
|
if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) &&
|
|
|
|
vif->type == NL80211_IFTYPE_STATION && !vif->p2p &&
|
|
|
|
!mvm->csme_vif && mvm->mei_registered) {
|
|
|
|
iwl_mei_set_nic_info(vif->addr, mvm->nvm_data->hw_addr);
|
|
|
|
iwl_mei_set_netdev(ieee80211_vif_to_wdev(vif)->netdev);
|
|
|
|
mvm->csme_vif = vif;
|
|
|
|
}
|
|
|
|
|
2024-03-20 23:26:35 +02:00
|
|
|
if (vif->p2p || iwl_fw_lookup_cmd_ver(mvm->fw, PHY_CONTEXT_CMD, 1) < 5)
|
|
|
|
vif->driver_flags |= IEEE80211_VIF_IGNORE_OFDMA_WIDER_BW;
|
|
|
|
|
2023-03-14 19:49:21 +02:00
|
|
|
goto out_unlock;
|
|
|
|
|
|
|
|
out_free_bf:
|
|
|
|
if (mvm->bf_allowed_vif == mvmvif) {
|
|
|
|
mvm->bf_allowed_vif = NULL;
|
|
|
|
vif->driver_flags &= ~(IEEE80211_VIF_BEACON_FILTER |
|
|
|
|
IEEE80211_VIF_SUPPORTS_CQM_RSSI);
|
|
|
|
}
|
|
|
|
out_remove_mac:
|
wifi: iwlwifi: mvm: vif preparation for MLO
In MLO, some fields of iwl_mvm_vif should be defined in the
context of a link. Define a separate structure for these fields and
add a deflink object to hold it as part of iwl_mvm_vif. Non-MLO legacy
code will use only deflink object while MLO related code will use the
corresponding link from the link array.
It follows the strategy applied in mac80211 for introducing MLO
changes.
The below spatch takes care of updating all driver code to access
fields separated into MLD specific data structure via deflink (need
to convert all references to the fields listed in var to deflink.var
and also to take care of calls like iwl_mvm_vif_from_mac80211(vif)->field).
@iwl_mld_vif@
struct iwl_mvm_vif *v;
struct ieee80211_vif *vv;
identifier fn;
identifier var = {bssid, ap_sta_id, bcast_sta, mcast_sta,
beacon_stats, smps_requests, probe_resp_data,
he_ru_2mhz_block, cab_queue, phy_ctxt,
queue_params};
@@
(
v->
- var
+ deflink.var
|
fn(vv)->
- var
+ deflink.var
)
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230328104948.4896576f0a9f.Ifaf0187c96b9fe52b24bd629331165831a877691@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-28 10:58:41 +03:00
|
|
|
mvmvif->link[0] = NULL;
|
2023-03-14 19:49:21 +02:00
|
|
|
iwl_mvm_mld_mac_ctxt_remove(mvm, vif);
|
|
|
|
out_unlock:
|
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2023-03-14 19:49:22 +02:00
|
|
|
static void iwl_mvm_mld_mac_remove_interface(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif)
|
|
|
|
{
|
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
2023-03-28 10:58:59 +03:00
|
|
|
struct iwl_probe_resp_data *probe_data;
|
2023-03-14 19:49:22 +02:00
|
|
|
|
2023-03-28 10:58:59 +03:00
|
|
|
iwl_mvm_prepare_mac_removal(mvm, vif);
|
|
|
|
|
|
|
|
if (!(vif->type == NL80211_IFTYPE_AP ||
|
|
|
|
vif->type == NL80211_IFTYPE_ADHOC))
|
|
|
|
iwl_mvm_tcm_rm_vif(mvm, vif);
|
|
|
|
|
|
|
|
mutex_lock(&mvm->mutex);
|
|
|
|
|
|
|
|
if (vif == mvm->csme_vif) {
|
|
|
|
iwl_mei_set_netdev(NULL);
|
|
|
|
mvm->csme_vif = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mvm->bf_allowed_vif == mvmvif) {
|
|
|
|
mvm->bf_allowed_vif = NULL;
|
|
|
|
vif->driver_flags &= ~(IEEE80211_VIF_BEACON_FILTER |
|
|
|
|
IEEE80211_VIF_SUPPORTS_CQM_RSSI);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (vif->bss_conf.ftm_responder)
|
|
|
|
memset(&mvm->ftm_resp_stats, 0, sizeof(mvm->ftm_resp_stats));
|
|
|
|
|
2023-10-04 12:36:23 +03:00
|
|
|
iwl_mvm_vif_dbgfs_rm_link(mvm, vif);
|
2023-03-28 10:58:59 +03:00
|
|
|
|
|
|
|
/* For AP/GO interface, the tear down of the resources allocated to the
|
|
|
|
* interface is be handled as part of the stop_ap flow.
|
|
|
|
*/
|
|
|
|
if (vif->type == NL80211_IFTYPE_AP ||
|
|
|
|
vif->type == NL80211_IFTYPE_ADHOC) {
|
|
|
|
#ifdef CONFIG_NL80211_TESTMODE
|
|
|
|
if (vif == mvm->noa_vif) {
|
|
|
|
mvm->noa_vif = NULL;
|
|
|
|
mvm->noa_duration = 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
iwl_mvm_power_update_mac(mvm);
|
2023-03-14 19:49:22 +02:00
|
|
|
|
2023-10-04 12:36:30 +03:00
|
|
|
/* Before the interface removal, mac80211 would cancel the ROC, and the
|
|
|
|
* ROC worker would be scheduled if needed. The worker would be flushed
|
|
|
|
* in iwl_mvm_prepare_mac_removal() and thus at this point the link is
|
|
|
|
* not active. So need only to remove the link.
|
|
|
|
*/
|
2023-03-14 19:49:22 +02:00
|
|
|
if (vif->type == NL80211_IFTYPE_P2P_DEVICE) {
|
2023-10-04 12:36:30 +03:00
|
|
|
if (mvmvif->deflink.phy_ctxt) {
|
|
|
|
iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt);
|
|
|
|
mvmvif->deflink.phy_ctxt = NULL;
|
|
|
|
}
|
2023-03-14 19:49:22 +02:00
|
|
|
mvm->p2p_device_vif = NULL;
|
2023-10-04 12:36:30 +03:00
|
|
|
iwl_mvm_remove_link(mvm, vif, &vif->bss_conf);
|
2023-03-28 10:58:59 +03:00
|
|
|
} else {
|
2023-03-28 10:59:11 +03:00
|
|
|
iwl_mvm_disable_link(mvm, vif, &vif->bss_conf);
|
2023-03-14 19:49:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
iwl_mvm_mld_mac_ctxt_remove(mvm, vif);
|
|
|
|
|
|
|
|
RCU_INIT_POINTER(mvm->vif_id_to_mac[mvmvif->id], NULL);
|
|
|
|
|
2023-03-29 10:05:38 +03:00
|
|
|
probe_data = rcu_dereference_protected(mvmvif->deflink.probe_resp_data,
|
|
|
|
lockdep_is_held(&mvm->mutex));
|
|
|
|
RCU_INIT_POINTER(mvmvif->deflink.probe_resp_data, NULL);
|
|
|
|
if (probe_data)
|
|
|
|
kfree_rcu(probe_data, rcu_head);
|
|
|
|
|
2023-03-14 19:49:22 +02:00
|
|
|
if (vif->type == NL80211_IFTYPE_MONITOR) {
|
|
|
|
mvm->monitor_on = false;
|
|
|
|
__clear_bit(IEEE80211_HW_RX_INCLUDES_FCS, mvm->hw->flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
|
}
|
|
|
|
|
2024-03-20 23:26:25 +02:00
|
|
|
static unsigned int iwl_mvm_mld_count_active_links(struct iwl_mvm_vif *mvmvif)
|
2023-06-15 09:47:17 +03:00
|
|
|
{
|
|
|
|
unsigned int n_active = 0;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {
|
2024-03-20 23:26:25 +02:00
|
|
|
if (mvmvif->link[i] && mvmvif->link[i]->phy_ctxt)
|
2023-06-15 09:47:17 +03:00
|
|
|
n_active++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return n_active;
|
|
|
|
}
|
|
|
|
|
2024-05-05 09:19:50 +03:00
|
|
|
static void iwl_mvm_restart_mpdu_count(struct iwl_mvm *mvm,
|
|
|
|
struct iwl_mvm_vif *mvmvif)
|
|
|
|
{
|
|
|
|
struct ieee80211_sta *ap_sta = mvmvif->ap_sta;
|
|
|
|
struct iwl_mvm_sta *mvmsta;
|
|
|
|
|
|
|
|
lockdep_assert_held(&mvm->mutex);
|
|
|
|
|
|
|
|
if (!ap_sta)
|
|
|
|
return;
|
|
|
|
|
|
|
|
mvmsta = iwl_mvm_sta_from_mac80211(ap_sta);
|
|
|
|
if (!mvmsta->mpdu_counters)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (int q = 0; q < mvm->trans->num_rx_queues; q++) {
|
|
|
|
spin_lock_bh(&mvmsta->mpdu_counters[q].lock);
|
|
|
|
memset(mvmsta->mpdu_counters[q].per_link, 0,
|
|
|
|
sizeof(mvmsta->mpdu_counters[q].per_link));
|
|
|
|
mvmsta->mpdu_counters[q].window_start = jiffies;
|
|
|
|
spin_unlock_bh(&mvmsta->mpdu_counters[q].lock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-15 09:47:17 +03:00
|
|
|
static int iwl_mvm_esr_mode_active(struct iwl_mvm *mvm,
|
|
|
|
struct ieee80211_vif *vif)
|
|
|
|
{
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
|
int link_id, ret = 0;
|
|
|
|
|
|
|
|
mvmvif->esr_active = true;
|
|
|
|
|
2023-09-28 17:35:27 +03:00
|
|
|
/* Indicate to mac80211 that EML is enabled */
|
|
|
|
vif->driver_flags |= IEEE80211_VIF_EML_ACTIVE;
|
2023-06-15 09:47:17 +03:00
|
|
|
|
|
|
|
iwl_mvm_update_smps_on_active_links(mvm, vif, IWL_MVM_SMPS_REQ_FW,
|
|
|
|
IEEE80211_SMPS_OFF);
|
|
|
|
|
|
|
|
for_each_mvm_vif_valid_link(mvmvif, link_id) {
|
|
|
|
struct iwl_mvm_vif_link_info *link = mvmvif->link[link_id];
|
|
|
|
|
|
|
|
if (!link->phy_ctxt)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
ret = iwl_mvm_phy_send_rlc(mvm, link->phy_ctxt, 2, 2);
|
|
|
|
if (ret)
|
|
|
|
break;
|
|
|
|
|
|
|
|
link->phy_ctxt->rlc_disabled = true;
|
|
|
|
}
|
|
|
|
|
2024-04-16 13:54:03 +03:00
|
|
|
if (vif->active_links == mvmvif->link_selection_res &&
|
|
|
|
!WARN_ON(!(vif->active_links & BIT(mvmvif->link_selection_primary))))
|
|
|
|
mvmvif->primary_link = mvmvif->link_selection_primary;
|
|
|
|
else
|
|
|
|
mvmvif->primary_link = __ffs(vif->active_links);
|
|
|
|
|
2024-04-16 13:54:09 +03:00
|
|
|
/* Needed for tracking RSSI */
|
|
|
|
iwl_mvm_request_periodic_system_statistics(mvm, true);
|
|
|
|
|
2024-05-05 09:19:50 +03:00
|
|
|
/*
|
|
|
|
* Restart the MPDU counters and the counting window, so when the
|
|
|
|
* statistics arrive (which is where we look at the counters) we
|
|
|
|
* will be at the end of the window.
|
|
|
|
*/
|
|
|
|
iwl_mvm_restart_mpdu_count(mvm, mvmvif);
|
|
|
|
|
2023-06-15 09:47:17 +03:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2023-03-28 10:59:07 +03:00
|
|
|
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)
|
2023-03-14 19:49:24 +02:00
|
|
|
{
|
2023-03-28 10:58:59 +03:00
|
|
|
u16 *phy_ctxt_id = (u16 *)ctx->drv_priv;
|
|
|
|
struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id];
|
2023-03-14 19:49:24 +02:00
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
2024-03-20 23:26:25 +02:00
|
|
|
unsigned int n_active = iwl_mvm_mld_count_active_links(mvmvif);
|
2023-03-28 10:59:07 +03:00
|
|
|
unsigned int link_id = link_conf->link_id;
|
2023-03-14 19:49:24 +02:00
|
|
|
int ret;
|
|
|
|
|
2023-03-28 10:59:07 +03:00
|
|
|
if (WARN_ON_ONCE(!mvmvif->link[link_id]))
|
|
|
|
return -EINVAL;
|
|
|
|
|
2024-03-20 23:26:25 +02:00
|
|
|
/* if the assigned one was not counted yet, count it now */
|
|
|
|
if (!mvmvif->link[link_id]->phy_ctxt)
|
|
|
|
n_active++;
|
|
|
|
|
2023-03-29 10:05:33 +03:00
|
|
|
/* mac parameters such as HE support can change at this stage
|
|
|
|
* For sta, need first to configure correct state from drv_sta_state
|
|
|
|
* and only after that update mac config.
|
|
|
|
*/
|
|
|
|
if (vif->type == NL80211_IFTYPE_AP) {
|
|
|
|
ret = iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
|
|
|
|
if (ret) {
|
|
|
|
IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-19 21:58:56 +02:00
|
|
|
mvmvif->link[link_id]->phy_ctxt = phy_ctxt;
|
|
|
|
|
2023-06-15 09:47:17 +03:00
|
|
|
if (iwl_mvm_is_esr_supported(mvm->fwrt.trans) && n_active > 1) {
|
|
|
|
mvmvif->link[link_id]->listen_lmac = true;
|
|
|
|
ret = iwl_mvm_esr_mode_active(mvm, vif);
|
|
|
|
if (ret) {
|
|
|
|
IWL_ERR(mvm, "failed to activate ESR mode (%d)\n", ret);
|
2024-04-16 13:54:09 +03:00
|
|
|
iwl_mvm_request_periodic_system_statistics(mvm, false);
|
2023-12-19 21:58:56 +02:00
|
|
|
goto out;
|
2023-06-15 09:47:17 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-28 10:58:59 +03:00
|
|
|
if (switching_chanctx) {
|
|
|
|
/* reactivate if we turned this off during channel switch */
|
|
|
|
if (vif->type == NL80211_IFTYPE_AP)
|
|
|
|
mvmvif->ap_ibss_active = true;
|
2023-03-28 10:58:53 +03:00
|
|
|
}
|
|
|
|
|
2023-03-28 10:58:59 +03:00
|
|
|
/* send it first with phy context ID */
|
2023-03-28 10:59:07 +03:00
|
|
|
ret = iwl_mvm_link_changed(mvm, vif, link_conf, 0, false);
|
2023-03-28 10:58:59 +03:00
|
|
|
if (ret)
|
|
|
|
goto out;
|
|
|
|
|
2023-04-17 11:41:31 +03:00
|
|
|
/* Initialize rate control for the AP station, since we might be
|
|
|
|
* doing a link switch here - we cannot initialize it before since
|
|
|
|
* this needs the phy context assigned (and in FW?), and we cannot
|
|
|
|
* do it later because it needs to be initialized as soon as we're
|
|
|
|
* able to TX on the link, i.e. when active.
|
|
|
|
*/
|
2024-03-20 23:26:38 +02:00
|
|
|
if (mvmvif->ap_sta) {
|
2023-04-17 11:41:31 +03:00
|
|
|
struct ieee80211_link_sta *link_sta;
|
|
|
|
|
|
|
|
rcu_read_lock();
|
|
|
|
link_sta = rcu_dereference(mvmvif->ap_sta->link[link_id]);
|
|
|
|
|
|
|
|
if (!WARN_ON_ONCE(!link_sta))
|
|
|
|
iwl_mvm_rs_rate_init(mvm, vif, mvmvif->ap_sta,
|
|
|
|
link_conf, link_sta,
|
|
|
|
phy_ctxt->channel->band);
|
|
|
|
rcu_read_unlock();
|
|
|
|
}
|
|
|
|
|
2023-03-28 10:58:59 +03:00
|
|
|
/* then activate */
|
2023-03-28 10:59:07 +03:00
|
|
|
ret = iwl_mvm_link_changed(mvm, vif, link_conf,
|
2023-03-28 10:59:03 +03:00
|
|
|
LINK_CONTEXT_MODIFY_ACTIVE |
|
2023-03-28 10:58:51 +03:00
|
|
|
LINK_CONTEXT_MODIFY_RATES_INFO,
|
2023-03-14 19:49:24 +02:00
|
|
|
true);
|
|
|
|
if (ret)
|
2023-03-28 10:58:59 +03:00
|
|
|
goto out;
|
2023-03-14 19:49:24 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Power state must be updated before quotas,
|
|
|
|
* otherwise fw will complain.
|
|
|
|
*/
|
|
|
|
iwl_mvm_power_update_mac(mvm);
|
|
|
|
|
|
|
|
if (vif->type == NL80211_IFTYPE_MONITOR) {
|
2023-03-28 10:59:07 +03:00
|
|
|
ret = iwl_mvm_mld_add_snif_sta(mvm, vif, link_conf);
|
2023-03-14 19:49:24 +02:00
|
|
|
if (ret)
|
2023-03-28 10:58:59 +03:00
|
|
|
goto deactivate;
|
2023-03-14 19:49:24 +02:00
|
|
|
}
|
|
|
|
|
2023-03-28 10:58:59 +03:00
|
|
|
return 0;
|
2023-03-14 19:49:24 +02:00
|
|
|
|
2023-03-28 10:58:59 +03:00
|
|
|
deactivate:
|
2023-03-28 10:59:07 +03:00
|
|
|
iwl_mvm_link_changed(mvm, vif, link_conf, LINK_CONTEXT_MODIFY_ACTIVE,
|
|
|
|
false);
|
2023-03-14 19:49:24 +02:00
|
|
|
out:
|
2023-03-28 10:59:07 +03:00
|
|
|
mvmvif->link[link_id]->phy_ctxt = NULL;
|
2023-03-28 10:58:59 +03:00
|
|
|
iwl_mvm_power_update_mac(mvm);
|
2023-03-14 19:49:24 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int iwl_mvm_mld_assign_vif_chanctx(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_bss_conf *link_conf,
|
|
|
|
struct ieee80211_chanctx_conf *ctx)
|
|
|
|
{
|
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
|
int ret;
|
|
|
|
|
2024-05-05 09:19:57 +03:00
|
|
|
/* update EMLSR mode */
|
|
|
|
if (ieee80211_vif_type_p2p(vif) != NL80211_IFTYPE_STATION) {
|
|
|
|
ret = iwl_mvm_esr_non_bss_link(mvm, vif, link_conf->link_id,
|
|
|
|
true);
|
|
|
|
/*
|
|
|
|
* Don't activate this link if failed to exit EMLSR in
|
|
|
|
* the BSS interface
|
|
|
|
*/
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2023-03-14 19:49:24 +02:00
|
|
|
mutex_lock(&mvm->mutex);
|
2023-03-28 10:59:07 +03:00
|
|
|
ret = __iwl_mvm_mld_assign_vif_chanctx(mvm, vif, link_conf, ctx, false);
|
2023-03-14 19:49:24 +02:00
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2023-03-14 19:49:26 +02:00
|
|
|
|
2023-06-15 09:47:17 +03:00
|
|
|
static int iwl_mvm_esr_mode_inactive(struct iwl_mvm *mvm,
|
|
|
|
struct ieee80211_vif *vif)
|
|
|
|
{
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
|
struct ieee80211_bss_conf *link_conf;
|
|
|
|
int link_id, ret = 0;
|
|
|
|
|
|
|
|
mvmvif->esr_active = false;
|
|
|
|
|
2023-09-28 17:35:27 +03:00
|
|
|
vif->driver_flags &= ~IEEE80211_VIF_EML_ACTIVE;
|
2023-06-15 09:47:17 +03:00
|
|
|
|
|
|
|
iwl_mvm_update_smps_on_active_links(mvm, vif, IWL_MVM_SMPS_REQ_FW,
|
|
|
|
IEEE80211_SMPS_AUTOMATIC);
|
|
|
|
|
|
|
|
for_each_vif_active_link(vif, link_conf, link_id) {
|
|
|
|
struct ieee80211_chanctx_conf *chanctx_conf;
|
|
|
|
struct iwl_mvm_phy_ctxt *phy_ctxt;
|
|
|
|
u8 static_chains, dynamic_chains;
|
|
|
|
|
|
|
|
mvmvif->link[link_id]->listen_lmac = false;
|
|
|
|
|
|
|
|
rcu_read_lock();
|
|
|
|
|
|
|
|
chanctx_conf = rcu_dereference(link_conf->chanctx_conf);
|
|
|
|
phy_ctxt = mvmvif->link[link_id]->phy_ctxt;
|
|
|
|
|
|
|
|
if (!chanctx_conf || !phy_ctxt) {
|
|
|
|
rcu_read_unlock();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
phy_ctxt->rlc_disabled = false;
|
|
|
|
static_chains = chanctx_conf->rx_chains_static;
|
|
|
|
dynamic_chains = chanctx_conf->rx_chains_dynamic;
|
|
|
|
|
|
|
|
rcu_read_unlock();
|
|
|
|
|
|
|
|
ret = iwl_mvm_phy_send_rlc(mvm, phy_ctxt, static_chains,
|
|
|
|
dynamic_chains);
|
|
|
|
if (ret)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2024-04-16 13:54:09 +03:00
|
|
|
iwl_mvm_request_periodic_system_statistics(mvm, false);
|
|
|
|
|
2024-05-05 09:19:50 +03:00
|
|
|
/* Start a new counting window */
|
|
|
|
iwl_mvm_restart_mpdu_count(mvm, mvmvif);
|
|
|
|
|
2023-06-15 09:47:17 +03:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2023-03-28 10:59:07 +03:00
|
|
|
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)
|
2023-06-15 09:47:17 +03:00
|
|
|
|
2023-03-14 19:49:26 +02:00
|
|
|
{
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
2024-03-20 23:26:25 +02:00
|
|
|
unsigned int n_active = iwl_mvm_mld_count_active_links(mvmvif);
|
2023-03-28 10:59:07 +03:00
|
|
|
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;
|
2023-03-14 19:49:26 +02:00
|
|
|
|
2023-03-28 10:58:59 +03:00
|
|
|
if (vif->type == NL80211_IFTYPE_AP && switching_chanctx) {
|
|
|
|
mvmvif->csa_countdown = false;
|
|
|
|
|
|
|
|
/* Set CS bit on all the stations */
|
|
|
|
iwl_mvm_modify_all_sta_disable_tx(mvm, mvmvif, true);
|
|
|
|
|
|
|
|
/* Save blocked iface, the timeout is set on the next beacon */
|
|
|
|
rcu_assign_pointer(mvm->csa_tx_blocked_vif, vif);
|
|
|
|
|
|
|
|
mvmvif->ap_ibss_active = false;
|
|
|
|
}
|
2023-03-14 19:49:26 +02:00
|
|
|
|
2024-02-01 16:17:39 +02:00
|
|
|
iwl_mvm_link_changed(mvm, vif, link_conf,
|
|
|
|
LINK_CONTEXT_MODIFY_ACTIVE, false);
|
|
|
|
|
2023-06-15 09:47:17 +03:00
|
|
|
if (iwl_mvm_is_esr_supported(mvm->fwrt.trans) && n_active > 1) {
|
|
|
|
int ret = iwl_mvm_esr_mode_inactive(mvm, vif);
|
|
|
|
|
|
|
|
if (ret)
|
|
|
|
IWL_ERR(mvm, "failed to deactivate ESR mode (%d)\n",
|
|
|
|
ret);
|
|
|
|
}
|
|
|
|
|
2023-03-14 19:49:26 +02:00
|
|
|
if (vif->type == NL80211_IFTYPE_MONITOR)
|
|
|
|
iwl_mvm_mld_rm_snif_sta(mvm, vif);
|
|
|
|
|
|
|
|
if (switching_chanctx)
|
|
|
|
return;
|
2023-03-28 10:59:07 +03:00
|
|
|
mvmvif->link[link_id]->phy_ctxt = NULL;
|
2023-03-14 19:49:26 +02:00
|
|
|
iwl_mvm_power_update_mac(mvm);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void iwl_mvm_mld_unassign_vif_chanctx(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_bss_conf *link_conf,
|
|
|
|
struct ieee80211_chanctx_conf *ctx)
|
|
|
|
{
|
wifi: iwlwifi: mvm: cycle FW link on chanctx removal
When the vif is in MLD mode, we'll get a vif links change from
non-zero to zero on disassociation, which removes all links in
the firmware and adds the 'deflink' the driver/mac80211 has.
This causes the firmware to clear some internal state.
However, in non-MLD mode, this doesn't happen, and causes some
state to be left around in firmware, which can particularly
cause trouble with the ref-BSSID in multi-BSSID, leading to an
assert later if immediately making a new multi-BSSID connection
with a different ref-BSSID.
Fix this by removing/re-adding the link in the non-MLD case
when the channel is removed from the vif. This way, all of the
state will get cleared out, even if we need the deflink, which
is more for software architecture purposes than otherwise.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231022173519.90c82837ba4d.I341fa30c480f7673b14b48a0e29a2241472c2e13@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-10-22 17:55:53 +03:00
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
2023-03-14 19:49:26 +02:00
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
|
|
|
|
|
mutex_lock(&mvm->mutex);
|
2023-03-28 10:59:07 +03:00
|
|
|
__iwl_mvm_mld_unassign_vif_chanctx(mvm, vif, link_conf, ctx, false);
|
wifi: iwlwifi: mvm: cycle FW link on chanctx removal
When the vif is in MLD mode, we'll get a vif links change from
non-zero to zero on disassociation, which removes all links in
the firmware and adds the 'deflink' the driver/mac80211 has.
This causes the firmware to clear some internal state.
However, in non-MLD mode, this doesn't happen, and causes some
state to be left around in firmware, which can particularly
cause trouble with the ref-BSSID in multi-BSSID, leading to an
assert later if immediately making a new multi-BSSID connection
with a different ref-BSSID.
Fix this by removing/re-adding the link in the non-MLD case
when the channel is removed from the vif. This way, all of the
state will get cleared out, even if we need the deflink, which
is more for software architecture purposes than otherwise.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231022173519.90c82837ba4d.I341fa30c480f7673b14b48a0e29a2241472c2e13@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-10-22 17:55:53 +03:00
|
|
|
/* in the non-MLD case, remove/re-add the link to clean up FW state */
|
|
|
|
if (!ieee80211_vif_is_mld(vif) && !mvmvif->ap_sta &&
|
|
|
|
!WARN_ON_ONCE(vif->cfg.assoc)) {
|
|
|
|
iwl_mvm_remove_link(mvm, vif, link_conf);
|
|
|
|
iwl_mvm_add_link(mvm, vif, link_conf);
|
|
|
|
}
|
2023-03-14 19:49:26 +02:00
|
|
|
mutex_unlock(&mvm->mutex);
|
2024-05-05 09:19:57 +03:00
|
|
|
|
|
|
|
/* update EMLSR mode */
|
|
|
|
if (ieee80211_vif_type_p2p(vif) != NL80211_IFTYPE_STATION)
|
|
|
|
iwl_mvm_esr_non_bss_link(mvm, vif, link_conf->link_id, false);
|
2023-03-14 19:49:26 +02:00
|
|
|
}
|
2023-03-20 12:33:09 +02:00
|
|
|
|
2024-04-16 13:53:57 +03:00
|
|
|
static void
|
|
|
|
iwl_mvm_send_ap_tx_power_constraint_cmd(struct iwl_mvm *mvm,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_bss_conf *bss_conf)
|
|
|
|
{
|
|
|
|
struct iwl_txpower_constraints_cmd cmd = {};
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
|
struct iwl_mvm_vif_link_info *link_info =
|
|
|
|
mvmvif->link[bss_conf->link_id];
|
|
|
|
u32 cmd_id = WIDE_ID(PHY_OPS_GROUP, AP_TX_POWER_CONSTRAINTS_CMD);
|
|
|
|
u32 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id,
|
|
|
|
IWL_FW_CMD_VER_UNKNOWN);
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
lockdep_assert_held(&mvm->mutex);
|
|
|
|
|
|
|
|
if (cmd_ver == IWL_FW_CMD_VER_UNKNOWN)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!link_info->active ||
|
|
|
|
link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (bss_conf->chanreq.oper.chan->band != NL80211_BAND_6GHZ ||
|
|
|
|
bss_conf->chanreq.oper.chan->flags &
|
|
|
|
IEEE80211_CHAN_NO_6GHZ_VLP_CLIENT)
|
|
|
|
return;
|
|
|
|
|
|
|
|
cmd.link_id = cpu_to_le16(link_info->fw_link_id);
|
|
|
|
/*
|
|
|
|
* Currently supporting VLP Soft AP only.
|
|
|
|
*/
|
|
|
|
cmd.ap_type = cpu_to_le16(IWL_6GHZ_AP_TYPE_VLP);
|
|
|
|
memset(cmd.psd_pwr, DEFAULT_TPE_TX_POWER, sizeof(cmd.psd_pwr));
|
|
|
|
memset(cmd.eirp_pwr, DEFAULT_TPE_TX_POWER, sizeof(cmd.eirp_pwr));
|
|
|
|
|
|
|
|
ret = iwl_mvm_send_cmd_pdu(mvm,
|
|
|
|
WIDE_ID(PHY_OPS_GROUP,
|
|
|
|
AP_TX_POWER_CONSTRAINTS_CMD),
|
|
|
|
0, sizeof(cmd), &cmd);
|
|
|
|
if (ret)
|
|
|
|
IWL_ERR(mvm,
|
|
|
|
"failed to send AP_TX_POWER_CONSTRAINTS_CMD (%d)\n",
|
|
|
|
ret);
|
|
|
|
}
|
|
|
|
|
2023-03-20 12:33:09 +02:00
|
|
|
static int iwl_mvm_mld_start_ap_ibss(struct ieee80211_hw *hw,
|
2023-03-28 10:58:50 +03:00
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_bss_conf *link_conf)
|
2023-03-20 12:33:09 +02:00
|
|
|
{
|
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
mutex_lock(&mvm->mutex);
|
2024-04-16 13:53:57 +03:00
|
|
|
|
|
|
|
if (vif->type == NL80211_IFTYPE_AP)
|
|
|
|
iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif, link_conf);
|
|
|
|
|
2023-03-28 10:58:57 +03:00
|
|
|
/* Send the beacon template */
|
|
|
|
ret = iwl_mvm_mac_ctxt_beacon_changed(mvm, vif, link_conf);
|
|
|
|
if (ret)
|
|
|
|
goto out_unlock;
|
|
|
|
|
2023-03-28 10:59:11 +03:00
|
|
|
/* the link should be already activated when assigning chan context */
|
|
|
|
ret = iwl_mvm_link_changed(mvm, vif, link_conf,
|
|
|
|
LINK_CONTEXT_MODIFY_ALL &
|
|
|
|
~LINK_CONTEXT_MODIFY_ACTIVE,
|
2023-03-20 12:33:09 +02:00
|
|
|
true);
|
|
|
|
if (ret)
|
2023-03-28 10:58:59 +03:00
|
|
|
goto out_unlock;
|
2023-03-20 12:33:09 +02:00
|
|
|
|
2023-03-28 10:59:05 +03:00
|
|
|
ret = iwl_mvm_mld_add_mcast_sta(mvm, vif, link_conf);
|
2023-03-20 12:33:09 +02:00
|
|
|
if (ret)
|
2023-03-28 10:58:59 +03:00
|
|
|
goto out_unlock;
|
2023-03-20 12:33:09 +02:00
|
|
|
|
|
|
|
/* Send the bcast station. At this stage the TBTT and DTIM time
|
|
|
|
* events are added and applied to the scheduler
|
|
|
|
*/
|
2023-03-28 10:59:05 +03:00
|
|
|
ret = iwl_mvm_mld_add_bcast_sta(mvm, vif, link_conf);
|
2023-03-20 12:33:09 +02:00
|
|
|
if (ret)
|
|
|
|
goto out_rm_mcast;
|
|
|
|
|
|
|
|
if (iwl_mvm_start_ap_ibss_common(hw, vif, &ret))
|
|
|
|
goto out_failed;
|
|
|
|
|
|
|
|
/* Need to update the P2P Device MAC (only GO, IBSS is single vif) */
|
|
|
|
if (vif->p2p && mvm->p2p_device_vif)
|
|
|
|
iwl_mvm_mld_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false);
|
|
|
|
|
|
|
|
iwl_mvm_bt_coex_vif_change(mvm);
|
|
|
|
|
|
|
|
/* we don't support TDLS during DCM */
|
|
|
|
if (iwl_mvm_phy_ctx_count(mvm) > 1)
|
|
|
|
iwl_mvm_teardown_tdls_peers(mvm);
|
|
|
|
|
2023-06-12 18:51:15 +03:00
|
|
|
iwl_mvm_ftm_restart_responder(mvm, vif, link_conf);
|
2023-03-20 12:33:09 +02:00
|
|
|
|
|
|
|
goto out_unlock;
|
|
|
|
|
|
|
|
out_failed:
|
|
|
|
iwl_mvm_power_update_mac(mvm);
|
|
|
|
mvmvif->ap_ibss_active = false;
|
2023-03-28 10:59:05 +03:00
|
|
|
iwl_mvm_mld_rm_bcast_sta(mvm, vif, link_conf);
|
2023-03-20 12:33:09 +02:00
|
|
|
out_rm_mcast:
|
2023-03-28 10:59:05 +03:00
|
|
|
iwl_mvm_mld_rm_mcast_sta(mvm, vif, link_conf);
|
2023-03-20 12:33:09 +02:00
|
|
|
out_unlock:
|
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2023-03-28 10:58:50 +03:00
|
|
|
static int iwl_mvm_mld_start_ap(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_bss_conf *link_conf)
|
|
|
|
{
|
|
|
|
return iwl_mvm_mld_start_ap_ibss(hw, vif, link_conf);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int iwl_mvm_mld_start_ibss(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif)
|
|
|
|
{
|
|
|
|
return iwl_mvm_mld_start_ap_ibss(hw, vif, &vif->bss_conf);
|
|
|
|
}
|
|
|
|
|
2023-03-20 12:33:10 +02:00
|
|
|
static void iwl_mvm_mld_stop_ap_ibss(struct ieee80211_hw *hw,
|
2023-03-28 10:58:50 +03:00
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_bss_conf *link_conf)
|
2023-03-20 12:33:10 +02:00
|
|
|
{
|
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
|
|
|
|
|
mutex_lock(&mvm->mutex);
|
|
|
|
|
|
|
|
iwl_mvm_stop_ap_ibss_common(mvm, vif);
|
|
|
|
|
|
|
|
/* Need to update the P2P Device MAC (only GO, IBSS is single vif) */
|
|
|
|
if (vif->p2p && mvm->p2p_device_vif)
|
|
|
|
iwl_mvm_mld_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false);
|
|
|
|
|
|
|
|
iwl_mvm_ftm_responder_clear(mvm, vif);
|
|
|
|
|
2023-03-28 10:59:05 +03:00
|
|
|
iwl_mvm_mld_rm_bcast_sta(mvm, vif, link_conf);
|
|
|
|
iwl_mvm_mld_rm_mcast_sta(mvm, vif, link_conf);
|
2023-03-20 12:33:10 +02:00
|
|
|
|
|
|
|
iwl_mvm_power_update_mac(mvm);
|
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
|
}
|
|
|
|
|
2023-03-28 10:58:50 +03:00
|
|
|
static void iwl_mvm_mld_stop_ap(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_bss_conf *link_conf)
|
|
|
|
{
|
|
|
|
iwl_mvm_mld_stop_ap_ibss(hw, vif, link_conf);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void iwl_mvm_mld_stop_ibss(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif)
|
|
|
|
{
|
|
|
|
iwl_mvm_mld_stop_ap_ibss(hw, vif, &vif->bss_conf);
|
|
|
|
}
|
|
|
|
|
2023-03-28 10:58:44 +03:00
|
|
|
static int iwl_mvm_mld_mac_sta_state(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_sta *sta,
|
|
|
|
enum ieee80211_sta_state old_state,
|
|
|
|
enum ieee80211_sta_state new_state)
|
|
|
|
{
|
2023-05-24 20:42:00 +03:00
|
|
|
static const struct iwl_mvm_sta_state_ops callbacks = {
|
2023-03-28 10:58:44 +03:00
|
|
|
.add_sta = iwl_mvm_mld_add_sta,
|
|
|
|
.update_sta = iwl_mvm_mld_update_sta,
|
|
|
|
.rm_sta = iwl_mvm_mld_rm_sta,
|
|
|
|
.mac_ctxt_changed = iwl_mvm_mld_mac_ctxt_changed,
|
|
|
|
};
|
|
|
|
|
|
|
|
return iwl_mvm_mac_sta_state_common(hw, vif, sta, old_state, new_state,
|
|
|
|
&callbacks);
|
|
|
|
}
|
|
|
|
|
2024-05-05 09:19:54 +03:00
|
|
|
static bool iwl_mvm_esr_bw_criteria(struct iwl_mvm *mvm,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_bss_conf *link_conf)
|
|
|
|
{
|
|
|
|
struct ieee80211_bss_conf *other_link;
|
|
|
|
int link_id;
|
|
|
|
|
|
|
|
/* Exit EMLSR if links don't have equal bandwidths */
|
|
|
|
for_each_vif_active_link(vif, other_link, link_id) {
|
|
|
|
if (link_id == link_conf->link_id)
|
|
|
|
continue;
|
|
|
|
if (link_conf->chanreq.oper.width ==
|
|
|
|
other_link->chanreq.oper.width)
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-03-28 10:58:45 +03:00
|
|
|
static void
|
2023-03-28 10:59:04 +03:00
|
|
|
iwl_mvm_mld_link_info_changed_station(struct iwl_mvm *mvm,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_bss_conf *link_conf,
|
|
|
|
u64 changes)
|
2023-03-28 10:58:45 +03:00
|
|
|
{
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
2023-03-28 10:59:04 +03:00
|
|
|
bool has_he, has_eht;
|
2023-03-28 10:58:45 +03:00
|
|
|
u32 link_changes = 0;
|
2023-03-28 10:59:04 +03:00
|
|
|
int ret;
|
|
|
|
|
|
|
|
if (WARN_ON_ONCE(!mvmvif->link[link_conf->link_id]))
|
|
|
|
return;
|
|
|
|
|
|
|
|
has_he = link_conf->he_support && !iwlwifi_mod_params.disable_11ax;
|
|
|
|
has_eht = link_conf->eht_support && !iwlwifi_mod_params.disable_11be;
|
2023-03-28 10:58:45 +03:00
|
|
|
|
2023-03-28 10:59:04 +03:00
|
|
|
/* Update EDCA params */
|
|
|
|
if (changes & BSS_CHANGED_QOS && vif->cfg.assoc && link_conf->qos)
|
|
|
|
link_changes |= LINK_CONTEXT_MODIFY_QOS_PARAMS;
|
|
|
|
|
|
|
|
if (changes & BSS_CHANGED_ERP_SLOT)
|
|
|
|
link_changes |= LINK_CONTEXT_MODIFY_RATES_INFO;
|
|
|
|
|
|
|
|
if (vif->cfg.assoc && (has_he || has_eht)) {
|
2023-03-28 10:58:45 +03:00
|
|
|
IWL_DEBUG_MAC80211(mvm, "Associated in HE mode\n");
|
|
|
|
link_changes |= LINK_CONTEXT_MODIFY_HE_PARAMS;
|
|
|
|
}
|
|
|
|
|
2024-05-05 09:19:54 +03:00
|
|
|
if ((changes & BSS_CHANGED_BANDWIDTH) &&
|
|
|
|
ieee80211_vif_link_active(vif, link_conf->link_id) &&
|
|
|
|
mvmvif->esr_active &&
|
|
|
|
!iwl_mvm_esr_bw_criteria(mvm, vif, link_conf))
|
|
|
|
iwl_mvm_exit_esr(mvm, vif,
|
|
|
|
IWL_MVM_ESR_EXIT_BANDWIDTH,
|
|
|
|
iwl_mvm_get_primary_link(vif));
|
|
|
|
|
2024-01-29 19:34:49 +01:00
|
|
|
/* if associated, maybe puncturing changed - we'll check later */
|
|
|
|
if (vif->cfg.assoc)
|
2023-03-28 10:58:45 +03:00
|
|
|
link_changes |= LINK_CONTEXT_MODIFY_EHT_PARAMS;
|
|
|
|
|
|
|
|
if (link_changes) {
|
2023-03-28 10:59:04 +03:00
|
|
|
ret = iwl_mvm_link_changed(mvm, vif, link_conf, link_changes,
|
|
|
|
true);
|
2023-03-28 10:58:45 +03:00
|
|
|
if (ret)
|
|
|
|
IWL_ERR(mvm, "failed to update link\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
|
|
|
|
if (ret)
|
|
|
|
IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
|
|
|
|
|
2023-03-28 10:59:04 +03:00
|
|
|
memcpy(mvmvif->link[link_conf->link_id]->bssid, link_conf->bssid,
|
|
|
|
ETH_ALEN);
|
|
|
|
|
|
|
|
iwl_mvm_bss_info_changed_station_common(mvm, vif, link_conf, changes);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool iwl_mvm_mld_vif_have_valid_ap_sta(struct iwl_mvm_vif *mvmvif)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for_each_mvm_vif_valid_link(mvmvif, i) {
|
|
|
|
if (mvmvif->link[i]->ap_sta_id != IWL_MVM_INVALID_STA)
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void iwl_mvm_mld_vif_delete_all_stas(struct iwl_mvm *mvm,
|
|
|
|
struct ieee80211_vif *vif)
|
|
|
|
{
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
|
int i, ret;
|
|
|
|
|
|
|
|
if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
|
|
|
|
return;
|
|
|
|
|
|
|
|
for_each_mvm_vif_valid_link(mvmvif, i) {
|
|
|
|
struct iwl_mvm_vif_link_info *link = mvmvif->link[i];
|
|
|
|
|
|
|
|
if (!link)
|
|
|
|
continue;
|
|
|
|
|
2023-03-29 10:05:24 +03:00
|
|
|
iwl_mvm_sec_key_remove_ap(mvm, vif, link, i);
|
2023-03-29 10:05:30 +03:00
|
|
|
ret = iwl_mvm_mld_rm_sta_id(mvm, link->ap_sta_id);
|
2023-03-28 10:59:04 +03:00
|
|
|
if (ret)
|
|
|
|
IWL_ERR(mvm, "failed to remove AP station\n");
|
|
|
|
|
|
|
|
link->ap_sta_id = IWL_MVM_INVALID_STA;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void iwl_mvm_mld_vif_cfg_changed_station(struct iwl_mvm *mvm,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
u64 changes)
|
|
|
|
{
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
|
struct ieee80211_bss_conf *link_conf;
|
|
|
|
bool protect = false;
|
|
|
|
unsigned int i;
|
|
|
|
int ret;
|
|
|
|
|
2023-03-29 10:05:25 +03:00
|
|
|
/* This might get called without active links during the
|
|
|
|
* chanctx switch, but we don't care about it anyway.
|
|
|
|
*/
|
|
|
|
if (changes == BSS_CHANGED_IDLE)
|
|
|
|
return;
|
|
|
|
|
2023-03-28 10:59:04 +03:00
|
|
|
ret = iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
|
|
|
|
if (ret)
|
|
|
|
IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
|
|
|
|
|
2023-03-28 10:58:45 +03:00
|
|
|
mvmvif->associated = vif->cfg.assoc;
|
|
|
|
|
2023-09-05 16:29:57 +03:00
|
|
|
if (changes & BSS_CHANGED_ASSOC) {
|
|
|
|
if (vif->cfg.assoc) {
|
|
|
|
/* clear statistics to get clean beacon counter */
|
|
|
|
iwl_mvm_request_statistics(mvm, true);
|
|
|
|
iwl_mvm_sf_update(mvm, vif, false);
|
|
|
|
iwl_mvm_power_vif_assoc(mvm, vif);
|
|
|
|
|
|
|
|
for_each_mvm_vif_valid_link(mvmvif, i) {
|
|
|
|
memset(&mvmvif->link[i]->beacon_stats, 0,
|
|
|
|
sizeof(mvmvif->link[i]->beacon_stats));
|
|
|
|
|
|
|
|
if (vif->p2p) {
|
|
|
|
iwl_mvm_update_smps(mvm, vif,
|
|
|
|
IWL_MVM_SMPS_REQ_PROT,
|
|
|
|
IEEE80211_SMPS_DYNAMIC, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
rcu_read_lock();
|
|
|
|
link_conf = rcu_dereference(vif->link_conf[i]);
|
|
|
|
if (link_conf && !link_conf->dtim_period)
|
|
|
|
protect = true;
|
|
|
|
rcu_read_unlock();
|
|
|
|
}
|
2023-03-28 10:58:45 +03:00
|
|
|
|
2023-09-05 16:29:57 +03:00
|
|
|
if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) &&
|
|
|
|
protect) {
|
wifi: iwlwifi: make time_events MLO aware
As session protection API is moving to be per link instead of per mac,
move the time events to be per link too.
Since there is only one concurrent time event per mac, it feels
unnecessary to have the time_event as a member of iwl_mvm_link_info.
(That way we will have to iterate over all links each time we want to
clear a time event, and also we will need mac80211 to tell us the link
id when mgd_tx_complete() is called.)
So leave this as a member of iwl_mvm_vif, but add the link id to the
time_event structure.
The link id in time_event will only be maintained and used for:
1. When SESSION_PROTECTION_CMD is supported (before it, we don't have MLO)
2. For time_events of types SESSION_PROTECT_CONF_ASSOC,
SESSION_PROTECT_CONF_P2P_DEVICE_DISCOV, and
SESSION_PROTECT_CONF_P2P_GO_NEGOTIATION
(not for aux roc/ Hot Spot time_events).
For P2P, non-MLO connections, and pre-MLD API, deflink id, meaning 0,
will be used
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.21496bcacb18.I79d037325b4fae4c12a22d9477e53fc9c537ad46@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-10-17 12:16:36 +03:00
|
|
|
/* We are in assoc so only one link is active-
|
|
|
|
* The association link
|
|
|
|
*/
|
|
|
|
unsigned int link_id =
|
|
|
|
ffs(vif->active_links) - 1;
|
|
|
|
|
2023-09-05 16:29:57 +03:00
|
|
|
/* If we're not restarting and still haven't
|
|
|
|
* heard a beacon (dtim period unknown) then
|
|
|
|
* make sure we still have enough minimum time
|
|
|
|
* remaining in the time event, since the auth
|
|
|
|
* might actually have taken quite a while
|
|
|
|
* (especially for SAE) and so the remaining
|
|
|
|
* time could be small without us having heard
|
|
|
|
* a beacon yet.
|
|
|
|
*/
|
wifi: iwlwifi: make time_events MLO aware
As session protection API is moving to be per link instead of per mac,
move the time events to be per link too.
Since there is only one concurrent time event per mac, it feels
unnecessary to have the time_event as a member of iwl_mvm_link_info.
(That way we will have to iterate over all links each time we want to
clear a time event, and also we will need mac80211 to tell us the link
id when mgd_tx_complete() is called.)
So leave this as a member of iwl_mvm_vif, but add the link id to the
time_event structure.
The link id in time_event will only be maintained and used for:
1. When SESSION_PROTECTION_CMD is supported (before it, we don't have MLO)
2. For time_events of types SESSION_PROTECT_CONF_ASSOC,
SESSION_PROTECT_CONF_P2P_DEVICE_DISCOV, and
SESSION_PROTECT_CONF_P2P_GO_NEGOTIATION
(not for aux roc/ Hot Spot time_events).
For P2P, non-MLO connections, and pre-MLD API, deflink id, meaning 0,
will be used
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.21496bcacb18.I79d037325b4fae4c12a22d9477e53fc9c537ad46@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-10-17 12:16:36 +03:00
|
|
|
iwl_mvm_protect_assoc(mvm, vif, 0, link_id);
|
2023-03-28 10:58:45 +03:00
|
|
|
}
|
2023-03-28 10:59:04 +03:00
|
|
|
|
2023-09-05 16:29:57 +03:00
|
|
|
iwl_mvm_sf_update(mvm, vif, false);
|
|
|
|
|
|
|
|
/* FIXME: need to decide about misbehaving AP handling */
|
|
|
|
iwl_mvm_power_vif_assoc(mvm, vif);
|
|
|
|
} else if (iwl_mvm_mld_vif_have_valid_ap_sta(mvmvif)) {
|
|
|
|
iwl_mvm_mei_host_disassociated(mvm);
|
2023-03-28 10:59:04 +03:00
|
|
|
|
2023-09-05 16:29:57 +03:00
|
|
|
/* If update fails - SF might be running in associated
|
|
|
|
* mode while disassociated - which is forbidden.
|
2023-03-28 10:58:45 +03:00
|
|
|
*/
|
2023-09-05 16:29:57 +03:00
|
|
|
ret = iwl_mvm_sf_update(mvm, vif, false);
|
|
|
|
WARN_ONCE(ret &&
|
|
|
|
!test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED,
|
|
|
|
&mvm->status),
|
|
|
|
"Failed to update SF upon disassociation\n");
|
|
|
|
|
|
|
|
/* If we get an assert during the connection (after the
|
|
|
|
* station has been added, but before the vif is set
|
|
|
|
* to associated), mac80211 will re-add the station and
|
|
|
|
* then configure the vif. Since the vif is not
|
|
|
|
* associated, we would remove the station here and
|
|
|
|
* this would fail the recovery.
|
|
|
|
*/
|
|
|
|
iwl_mvm_mld_vif_delete_all_stas(mvm, vif);
|
2023-03-28 10:58:45 +03:00
|
|
|
}
|
|
|
|
|
2023-09-05 16:29:57 +03:00
|
|
|
iwl_mvm_bss_info_changed_station_assoc(mvm, vif, changes);
|
2023-03-28 10:58:45 +03:00
|
|
|
}
|
|
|
|
|
2023-09-05 16:29:57 +03:00
|
|
|
if (changes & BSS_CHANGED_PS) {
|
|
|
|
ret = iwl_mvm_power_update_mac(mvm);
|
|
|
|
if (ret)
|
|
|
|
IWL_ERR(mvm, "failed to update power mode\n");
|
|
|
|
}
|
2024-05-05 09:19:52 +03:00
|
|
|
|
|
|
|
if (changes & (BSS_CHANGED_MLD_VALID_LINKS | BSS_CHANGED_MLD_TTLM) &&
|
|
|
|
ieee80211_vif_is_mld(vif) && mvmvif->authorized)
|
|
|
|
wiphy_delayed_work_queue(mvm->hw->wiphy,
|
|
|
|
&mvmvif->mlo_int_scan_wk, 0);
|
2023-03-28 10:58:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2023-03-28 10:59:04 +03:00
|
|
|
iwl_mvm_mld_link_info_changed_ap_ibss(struct iwl_mvm *mvm,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_bss_conf *link_conf,
|
|
|
|
u64 changes)
|
2023-03-28 10:58:45 +03:00
|
|
|
{
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
|
u32 link_changes = LINK_CONTEXT_MODIFY_PROTECT_FLAGS |
|
|
|
|
LINK_CONTEXT_MODIFY_QOS_PARAMS;
|
|
|
|
|
|
|
|
/* Changes will be applied when the AP/IBSS is started */
|
|
|
|
if (!mvmvif->ap_ibss_active)
|
|
|
|
return;
|
|
|
|
|
2023-03-28 10:59:04 +03:00
|
|
|
if (link_conf->he_support)
|
|
|
|
link_changes |= LINK_CONTEXT_MODIFY_HE_PARAMS;
|
|
|
|
|
2023-06-12 18:51:16 +03:00
|
|
|
if (changes & BSS_CHANGED_ERP_SLOT)
|
|
|
|
link_changes |= LINK_CONTEXT_MODIFY_RATES_INFO;
|
|
|
|
|
|
|
|
if (changes & (BSS_CHANGED_ERP_CTS_PROT | BSS_CHANGED_ERP_SLOT |
|
|
|
|
BSS_CHANGED_HT |
|
2023-03-28 10:59:04 +03:00
|
|
|
BSS_CHANGED_BANDWIDTH | BSS_CHANGED_QOS |
|
|
|
|
BSS_CHANGED_HE_BSS_COLOR) &&
|
|
|
|
iwl_mvm_link_changed(mvm, vif, link_conf,
|
2023-03-28 10:59:03 +03:00
|
|
|
link_changes, true))
|
2023-03-28 10:58:45 +03:00
|
|
|
IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
|
|
|
|
|
|
|
|
/* Need to send a new beacon template to the FW */
|
|
|
|
if (changes & BSS_CHANGED_BEACON &&
|
2023-03-28 10:59:04 +03:00
|
|
|
iwl_mvm_mac_ctxt_beacon_changed(mvm, vif, link_conf))
|
2023-03-28 10:58:45 +03:00
|
|
|
IWL_WARN(mvm, "Failed updating beacon data\n");
|
|
|
|
|
2023-03-28 10:59:04 +03:00
|
|
|
/* FIXME: need to decide if we need FTM responder per link */
|
2023-03-28 10:58:45 +03:00
|
|
|
if (changes & BSS_CHANGED_FTM_RESPONDER) {
|
2023-06-12 18:51:15 +03:00
|
|
|
int ret = iwl_mvm_ftm_start_responder(mvm, vif, link_conf);
|
2023-03-28 10:58:45 +03:00
|
|
|
|
|
|
|
if (ret)
|
|
|
|
IWL_WARN(mvm, "Failed to enable FTM responder (%d)\n",
|
|
|
|
ret);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-28 10:59:04 +03:00
|
|
|
static void iwl_mvm_mld_link_info_changed(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_bss_conf *link_conf,
|
|
|
|
u64 changes)
|
|
|
|
{
|
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
|
|
|
|
|
mutex_lock(&mvm->mutex);
|
|
|
|
|
|
|
|
switch (vif->type) {
|
|
|
|
case NL80211_IFTYPE_STATION:
|
|
|
|
iwl_mvm_mld_link_info_changed_station(mvm, vif, link_conf,
|
|
|
|
changes);
|
|
|
|
break;
|
|
|
|
case NL80211_IFTYPE_AP:
|
|
|
|
case NL80211_IFTYPE_ADHOC:
|
|
|
|
iwl_mvm_mld_link_info_changed_ap_ibss(mvm, vif, link_conf,
|
|
|
|
changes);
|
|
|
|
break;
|
|
|
|
case NL80211_IFTYPE_MONITOR:
|
|
|
|
if (changes & BSS_CHANGED_MU_GROUPS)
|
|
|
|
iwl_mvm_update_mu_groups(mvm, vif);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* shouldn't happen */
|
|
|
|
WARN_ON_ONCE(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (changes & BSS_CHANGED_TXPOWER) {
|
|
|
|
IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d dBm\n",
|
|
|
|
link_conf->txpower);
|
|
|
|
iwl_mvm_set_tx_power(mvm, vif, link_conf->txpower);
|
|
|
|
}
|
|
|
|
|
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void iwl_mvm_mld_vif_cfg_changed(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
u64 changes)
|
2023-03-28 10:58:45 +03:00
|
|
|
{
|
2023-03-28 10:59:04 +03:00
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
2023-03-28 10:58:45 +03:00
|
|
|
|
2023-03-28 10:59:04 +03:00
|
|
|
mutex_lock(&mvm->mutex);
|
|
|
|
|
|
|
|
if (changes & BSS_CHANGED_IDLE && !vif->cfg.idle)
|
|
|
|
iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_SCHED, true);
|
|
|
|
|
|
|
|
if (vif->type == NL80211_IFTYPE_STATION)
|
|
|
|
iwl_mvm_mld_vif_cfg_changed_station(mvm, vif, changes);
|
|
|
|
|
|
|
|
mutex_unlock(&mvm->mutex);
|
2023-03-28 10:58:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
iwl_mvm_mld_switch_vif_chanctx(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif_chanctx_switch *vifs,
|
|
|
|
int n_vifs,
|
|
|
|
enum ieee80211_chanctx_switch_mode mode)
|
|
|
|
{
|
2023-05-24 20:42:00 +03:00
|
|
|
static const struct iwl_mvm_switch_vif_chanctx_ops ops = {
|
2023-03-28 10:58:45 +03:00
|
|
|
.__assign_vif_chanctx = __iwl_mvm_mld_assign_vif_chanctx,
|
|
|
|
.__unassign_vif_chanctx = __iwl_mvm_mld_unassign_vif_chanctx,
|
|
|
|
};
|
|
|
|
|
|
|
|
return iwl_mvm_switch_vif_chanctx_common(hw, vifs, n_vifs, mode, &ops);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void iwl_mvm_mld_config_iface_filter(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
unsigned int filter_flags,
|
|
|
|
unsigned int changed_flags)
|
|
|
|
{
|
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
|
|
|
|
|
/* We support only filter for probe requests */
|
|
|
|
if (!(changed_flags & FIF_PROBE_REQ))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Supported only for p2p client interfaces */
|
|
|
|
if (vif->type != NL80211_IFTYPE_STATION || !vif->cfg.assoc ||
|
|
|
|
!vif->p2p)
|
|
|
|
return;
|
|
|
|
|
|
|
|
mutex_lock(&mvm->mutex);
|
|
|
|
iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
|
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
iwl_mvm_mld_mac_conf_tx(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
unsigned int link_id, u16 ac,
|
|
|
|
const struct ieee80211_tx_queue_params *params)
|
|
|
|
{
|
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
2023-06-14 12:41:28 +03:00
|
|
|
struct iwl_mvm_vif_link_info *mvm_link = mvmvif->link[link_id];
|
2023-03-28 10:58:45 +03:00
|
|
|
|
2023-06-14 12:41:28 +03:00
|
|
|
if (!mvm_link)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
mvm_link->queue_params[ac] = *params;
|
2023-03-28 10:58:45 +03:00
|
|
|
|
|
|
|
/* No need to update right away, we'll get BSS_CHANGED_QOS
|
|
|
|
* The exception is P2P_DEVICE interface which needs immediate update.
|
|
|
|
*/
|
|
|
|
if (vif->type == NL80211_IFTYPE_P2P_DEVICE) {
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
mutex_lock(&mvm->mutex);
|
2023-03-28 10:59:03 +03:00
|
|
|
ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf,
|
2023-03-28 10:58:45 +03:00
|
|
|
LINK_CONTEXT_MODIFY_QOS_PARAMS,
|
|
|
|
true);
|
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-10-04 12:36:30 +03:00
|
|
|
static int iwl_mvm_mld_roc_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
|
2023-03-28 10:58:47 +03:00
|
|
|
{
|
2023-10-04 12:36:30 +03:00
|
|
|
int ret;
|
2023-03-28 10:58:47 +03:00
|
|
|
|
|
|
|
lockdep_assert_held(&mvm->mutex);
|
|
|
|
|
2023-10-04 12:36:30 +03:00
|
|
|
/* The PHY context ID might have changed so need to set it */
|
|
|
|
ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf, 0, false);
|
|
|
|
if (WARN(ret, "Failed to set PHY context ID\n"))
|
2023-03-28 10:58:47 +03:00
|
|
|
return ret;
|
|
|
|
|
2023-10-04 12:36:30 +03:00
|
|
|
ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf,
|
|
|
|
LINK_CONTEXT_MODIFY_ACTIVE |
|
|
|
|
LINK_CONTEXT_MODIFY_RATES_INFO,
|
|
|
|
true);
|
2023-03-28 10:58:47 +03:00
|
|
|
|
2023-10-04 12:36:30 +03:00
|
|
|
if (WARN(ret, "Failed linking P2P_DEVICE\n"))
|
2023-03-28 10:58:47 +03:00
|
|
|
return ret;
|
|
|
|
|
2023-10-04 12:36:30 +03:00
|
|
|
/* The station and queue allocation must be done only after the linking
|
|
|
|
* is done, as otherwise the FW might incorrectly configure its state.
|
|
|
|
*/
|
|
|
|
return iwl_mvm_mld_add_bcast_sta(mvm, vif, &vif->bss_conf);
|
2023-03-28 10:58:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static int iwl_mvm_mld_roc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_channel *channel, int duration,
|
|
|
|
enum ieee80211_roc_type type)
|
|
|
|
{
|
2023-05-24 20:42:00 +03:00
|
|
|
static const struct iwl_mvm_roc_ops ops = {
|
2023-03-28 10:58:47 +03:00
|
|
|
.add_aux_sta_for_hs20 = iwl_mvm_mld_add_aux_sta,
|
2023-10-04 12:36:30 +03:00
|
|
|
.link = iwl_mvm_mld_roc_link,
|
2023-03-28 10:58:47 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
return iwl_mvm_roc_common(hw, vif, channel, duration, type, &ops);
|
|
|
|
}
|
2023-03-28 10:59:11 +03:00
|
|
|
|
|
|
|
static int
|
|
|
|
iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
u16 old_links, u16 new_links,
|
|
|
|
struct ieee80211_bss_conf *old[IEEE80211_MLD_MAX_NUM_LINKS])
|
|
|
|
{
|
|
|
|
struct iwl_mvm_vif_link_info *new_link[IEEE80211_MLD_MAX_NUM_LINKS] = {};
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
|
u16 removed = old_links & ~new_links;
|
|
|
|
u16 added = new_links & ~old_links;
|
|
|
|
int err, i;
|
|
|
|
|
|
|
|
for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {
|
|
|
|
int r;
|
|
|
|
|
|
|
|
if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (!(added & BIT(i)))
|
|
|
|
continue;
|
|
|
|
new_link[i] = kzalloc(sizeof(*new_link[i]), GFP_KERNEL);
|
|
|
|
if (!new_link[i]) {
|
|
|
|
err = -ENOMEM;
|
|
|
|
goto free;
|
|
|
|
}
|
|
|
|
|
|
|
|
new_link[i]->bcast_sta.sta_id = IWL_MVM_INVALID_STA;
|
|
|
|
new_link[i]->mcast_sta.sta_id = IWL_MVM_INVALID_STA;
|
|
|
|
new_link[i]->ap_sta_id = IWL_MVM_INVALID_STA;
|
|
|
|
new_link[i]->fw_link_id = IWL_MVM_FW_LINK_ID_INVALID;
|
|
|
|
|
|
|
|
for (r = 0; r < NUM_IWL_MVM_SMPS_REQ; r++)
|
|
|
|
new_link[i]->smps_requests[r] =
|
|
|
|
IEEE80211_SMPS_AUTOMATIC;
|
|
|
|
}
|
|
|
|
|
|
|
|
mutex_lock(&mvm->mutex);
|
|
|
|
|
|
|
|
if (old_links == 0) {
|
|
|
|
err = iwl_mvm_disable_link(mvm, vif, &vif->bss_conf);
|
|
|
|
if (err)
|
|
|
|
goto out_err;
|
|
|
|
mvmvif->link[0] = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {
|
|
|
|
if (removed & BIT(i)) {
|
|
|
|
struct ieee80211_bss_conf *link_conf = old[i];
|
|
|
|
|
|
|
|
err = iwl_mvm_disable_link(mvm, vif, link_conf);
|
|
|
|
if (err)
|
|
|
|
goto out_err;
|
|
|
|
kfree(mvmvif->link[i]);
|
|
|
|
mvmvif->link[i] = NULL;
|
2023-06-15 09:47:17 +03:00
|
|
|
} else if (added & BIT(i)) {
|
2023-03-28 10:59:11 +03:00
|
|
|
struct ieee80211_bss_conf *link_conf;
|
|
|
|
|
2023-03-29 10:05:27 +03:00
|
|
|
link_conf = link_conf_dereference_protected(vif, i);
|
2023-03-28 10:59:11 +03:00
|
|
|
if (WARN_ON(!link_conf))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART,
|
|
|
|
&mvm->status))
|
|
|
|
mvmvif->link[i] = new_link[i];
|
|
|
|
new_link[i] = NULL;
|
|
|
|
err = iwl_mvm_add_link(mvm, vif, link_conf);
|
|
|
|
if (err)
|
|
|
|
goto out_err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
err = 0;
|
|
|
|
if (new_links == 0) {
|
|
|
|
mvmvif->link[0] = &mvmvif->deflink;
|
|
|
|
err = iwl_mvm_add_link(mvm, vif, &vif->bss_conf);
|
2024-04-16 13:54:03 +03:00
|
|
|
if (err == 0)
|
|
|
|
mvmvif->primary_link = 0;
|
|
|
|
} else if (!(new_links & BIT(mvmvif->primary_link))) {
|
|
|
|
/*
|
|
|
|
* Ensure we always have a valid primary_link, the real
|
|
|
|
* decision happens later when PHY is activated.
|
|
|
|
*/
|
2024-05-06 10:04:06 +03:00
|
|
|
mvmvif->primary_link = __ffs(new_links);
|
2023-03-28 10:59:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
out_err:
|
|
|
|
/* we really don't have a good way to roll back here ... */
|
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
|
|
|
|
|
free:
|
|
|
|
for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++)
|
|
|
|
kfree(new_link[i]);
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
iwl_mvm_mld_change_sta_links(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_sta *sta,
|
|
|
|
u16 old_links, u16 new_links)
|
|
|
|
{
|
2023-03-29 10:05:18 +03:00
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
mutex_lock(&mvm->mutex);
|
|
|
|
ret = iwl_mvm_mld_update_sta_links(mvm, vif, sta, old_links, new_links);
|
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
|
|
|
|
|
return ret;
|
2023-03-28 10:59:11 +03:00
|
|
|
}
|
|
|
|
|
2024-05-05 09:19:48 +03:00
|
|
|
bool iwl_mvm_vif_has_esr_cap(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
|
2024-04-16 13:54:02 +03:00
|
|
|
{
|
|
|
|
const struct wiphy_iftype_ext_capab *ext_capa;
|
|
|
|
|
|
|
|
lockdep_assert_held(&mvm->mutex);
|
|
|
|
|
|
|
|
if (!ieee80211_vif_is_mld(vif) || !vif->cfg.assoc ||
|
|
|
|
hweight16(ieee80211_vif_usable_links(vif)) == 1)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!(vif->cfg.eml_cap & IEEE80211_EML_CAP_EMLSR_SUPP))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
ext_capa = cfg80211_get_iftype_ext_capa(mvm->hw->wiphy,
|
|
|
|
ieee80211_vif_type_p2p(vif));
|
2024-05-05 09:19:48 +03:00
|
|
|
return (ext_capa &&
|
|
|
|
(ext_capa->eml_capabilities & IEEE80211_EML_CAP_EMLSR_SUPP));
|
2024-04-16 13:54:02 +03:00
|
|
|
}
|
|
|
|
|
2024-01-23 20:08:22 +02:00
|
|
|
static bool iwl_mvm_mld_can_activate_links(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
u16 desired_links)
|
|
|
|
{
|
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
2024-01-31 22:56:32 +02:00
|
|
|
int n_links = hweight16(desired_links);
|
|
|
|
bool ret = true;
|
|
|
|
|
|
|
|
if (n_links <= 1)
|
|
|
|
return true;
|
2024-01-23 20:08:22 +02:00
|
|
|
|
2024-01-31 22:56:32 +02:00
|
|
|
mutex_lock(&mvm->mutex);
|
|
|
|
|
|
|
|
/* Check if HW supports the wanted number of links */
|
|
|
|
if (n_links > iwl_mvm_max_active_links(mvm, vif)) {
|
|
|
|
ret = false;
|
|
|
|
goto unlock;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If it is an eSR device, check that we can enter eSR */
|
2024-04-16 13:54:08 +03:00
|
|
|
ret = iwl_mvm_is_esr_supported(mvm->fwrt.trans) &&
|
2024-05-05 09:19:48 +03:00
|
|
|
iwl_mvm_vif_has_esr_cap(mvm, vif);
|
2024-04-16 13:54:08 +03:00
|
|
|
|
2024-01-31 22:56:32 +02:00
|
|
|
unlock:
|
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
|
return ret;
|
2024-01-23 20:08:22 +02:00
|
|
|
}
|
|
|
|
|
2024-01-29 21:21:50 +02:00
|
|
|
static enum ieee80211_neg_ttlm_res
|
|
|
|
iwl_mvm_mld_can_neg_ttlm(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_neg_ttlm *neg_ttlm)
|
|
|
|
{
|
|
|
|
u16 map;
|
|
|
|
u8 i;
|
|
|
|
|
|
|
|
/* Verify all TIDs are mapped to the same links set */
|
|
|
|
map = neg_ttlm->downlink[0];
|
|
|
|
for (i = 0; i < IEEE80211_TTLM_NUM_TIDS; i++) {
|
|
|
|
if (neg_ttlm->downlink[i] != neg_ttlm->uplink[i] ||
|
|
|
|
neg_ttlm->uplink[i] != map)
|
|
|
|
return NEG_TTLM_RES_REJECT;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NEG_TTLM_RES_ACCEPT;
|
|
|
|
}
|
|
|
|
|
2024-05-05 09:19:55 +03:00
|
|
|
static int
|
|
|
|
iwl_mvm_mld_mac_pre_channel_switch(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_channel_switch *chsw)
|
|
|
|
{
|
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
mutex_lock(&mvm->mutex);
|
|
|
|
if (mvmvif->esr_active) {
|
|
|
|
u8 primary = iwl_mvm_get_primary_link(vif);
|
|
|
|
int selected;
|
|
|
|
|
|
|
|
/* prefer primary unless quiet CSA on it */
|
|
|
|
if (chsw->link_id == primary && chsw->block_tx)
|
|
|
|
selected = iwl_mvm_get_other_link(vif, primary);
|
|
|
|
else
|
|
|
|
selected = primary;
|
|
|
|
|
|
|
|
iwl_mvm_exit_esr(mvm, vif, IWL_MVM_ESR_EXIT_CSA, selected);
|
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If we've not kept the link active that's doing the CSA
|
|
|
|
* then we don't need to do anything else, just return.
|
|
|
|
*/
|
|
|
|
if (selected != chsw->link_id)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
mutex_lock(&mvm->mutex);
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = iwl_mvm_pre_channel_switch(mvm, vif, chsw);
|
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2023-03-14 19:49:21 +02:00
|
|
|
const struct ieee80211_ops iwl_mvm_mld_hw_ops = {
|
2023-03-28 10:58:50 +03:00
|
|
|
.tx = iwl_mvm_mac_tx,
|
|
|
|
.wake_tx_queue = iwl_mvm_mac_wake_tx_queue,
|
|
|
|
.ampdu_action = iwl_mvm_mac_ampdu_action,
|
|
|
|
.get_antenna = iwl_mvm_op_get_antenna,
|
2023-09-21 11:57:59 +03:00
|
|
|
.set_antenna = iwl_mvm_op_set_antenna,
|
2023-03-28 10:58:50 +03:00
|
|
|
.start = iwl_mvm_mac_start,
|
|
|
|
.reconfig_complete = iwl_mvm_mac_reconfig_complete,
|
|
|
|
.stop = iwl_mvm_mac_stop,
|
2023-03-14 19:49:21 +02:00
|
|
|
.add_interface = iwl_mvm_mld_mac_add_interface,
|
2023-03-14 19:49:22 +02:00
|
|
|
.remove_interface = iwl_mvm_mld_mac_remove_interface,
|
2023-03-28 10:58:50 +03:00
|
|
|
.config = iwl_mvm_mac_config,
|
|
|
|
.prepare_multicast = iwl_mvm_prepare_multicast,
|
|
|
|
.configure_filter = iwl_mvm_configure_filter,
|
2023-03-28 10:58:45 +03:00
|
|
|
.config_iface_filter = iwl_mvm_mld_config_iface_filter,
|
2023-03-28 10:59:04 +03:00
|
|
|
.link_info_changed = iwl_mvm_mld_link_info_changed,
|
|
|
|
.vif_cfg_changed = iwl_mvm_mld_vif_cfg_changed,
|
2023-03-28 10:58:50 +03:00
|
|
|
.hw_scan = iwl_mvm_mac_hw_scan,
|
|
|
|
.cancel_hw_scan = iwl_mvm_mac_cancel_hw_scan,
|
|
|
|
.sta_pre_rcu_remove = iwl_mvm_sta_pre_rcu_remove,
|
|
|
|
.sta_state = iwl_mvm_mld_mac_sta_state,
|
|
|
|
.sta_notify = iwl_mvm_mac_sta_notify,
|
|
|
|
.allow_buffered_frames = iwl_mvm_mac_allow_buffered_frames,
|
|
|
|
.release_buffered_frames = iwl_mvm_mac_release_buffered_frames,
|
|
|
|
.set_rts_threshold = iwl_mvm_mac_set_rts_threshold,
|
|
|
|
.sta_rc_update = iwl_mvm_sta_rc_update,
|
|
|
|
.conf_tx = iwl_mvm_mld_mac_conf_tx,
|
|
|
|
.mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx,
|
|
|
|
.mgd_complete_tx = iwl_mvm_mac_mgd_complete_tx,
|
|
|
|
.mgd_protect_tdls_discover = iwl_mvm_mac_mgd_protect_tdls_discover,
|
|
|
|
.flush = iwl_mvm_mac_flush,
|
2023-06-20 13:04:00 +03:00
|
|
|
.flush_sta = iwl_mvm_mac_flush_sta,
|
2023-03-28 10:58:50 +03:00
|
|
|
.sched_scan_start = iwl_mvm_mac_sched_scan_start,
|
|
|
|
.sched_scan_stop = iwl_mvm_mac_sched_scan_stop,
|
|
|
|
.set_key = iwl_mvm_mac_set_key,
|
|
|
|
.update_tkip_key = iwl_mvm_mac_update_tkip_key,
|
2023-03-28 10:58:47 +03:00
|
|
|
.remain_on_channel = iwl_mvm_mld_roc,
|
|
|
|
.cancel_remain_on_channel = iwl_mvm_cancel_roc,
|
2023-03-28 10:58:50 +03:00
|
|
|
.add_chanctx = iwl_mvm_add_chanctx,
|
|
|
|
.remove_chanctx = iwl_mvm_remove_chanctx,
|
|
|
|
.change_chanctx = iwl_mvm_change_chanctx,
|
2023-03-14 19:49:24 +02:00
|
|
|
.assign_vif_chanctx = iwl_mvm_mld_assign_vif_chanctx,
|
2023-03-14 19:49:26 +02:00
|
|
|
.unassign_vif_chanctx = iwl_mvm_mld_unassign_vif_chanctx,
|
2023-03-28 10:58:45 +03:00
|
|
|
.switch_vif_chanctx = iwl_mvm_mld_switch_vif_chanctx,
|
2023-03-28 10:58:50 +03:00
|
|
|
|
|
|
|
.start_ap = iwl_mvm_mld_start_ap,
|
|
|
|
.stop_ap = iwl_mvm_mld_stop_ap,
|
|
|
|
.join_ibss = iwl_mvm_mld_start_ibss,
|
|
|
|
.leave_ibss = iwl_mvm_mld_stop_ibss,
|
|
|
|
|
|
|
|
.tx_last_beacon = iwl_mvm_tx_last_beacon,
|
|
|
|
|
|
|
|
.channel_switch = iwl_mvm_channel_switch,
|
2024-05-05 09:19:55 +03:00
|
|
|
.pre_channel_switch = iwl_mvm_mld_mac_pre_channel_switch,
|
2023-03-28 10:58:49 +03:00
|
|
|
.post_channel_switch = iwl_mvm_post_channel_switch,
|
2023-03-28 10:58:50 +03:00
|
|
|
.abort_channel_switch = iwl_mvm_abort_channel_switch,
|
|
|
|
.channel_switch_rx_beacon = iwl_mvm_channel_switch_rx_beacon,
|
|
|
|
|
|
|
|
.tdls_channel_switch = iwl_mvm_tdls_channel_switch,
|
|
|
|
.tdls_cancel_channel_switch = iwl_mvm_tdls_cancel_channel_switch,
|
|
|
|
.tdls_recv_channel_switch = iwl_mvm_tdls_recv_channel_switch,
|
|
|
|
|
|
|
|
.event_callback = iwl_mvm_mac_event_callback,
|
|
|
|
|
|
|
|
.sync_rx_queues = iwl_mvm_sync_rx_queues,
|
|
|
|
|
|
|
|
CFG80211_TESTMODE_CMD(iwl_mvm_mac_testmode_cmd)
|
|
|
|
|
|
|
|
#ifdef CONFIG_PM_SLEEP
|
|
|
|
/* look at d3.c */
|
|
|
|
.suspend = iwl_mvm_suspend,
|
|
|
|
.resume = iwl_mvm_resume,
|
|
|
|
.set_wakeup = iwl_mvm_set_wakeup,
|
|
|
|
.set_rekey_data = iwl_mvm_set_rekey_data,
|
|
|
|
#if IS_ENABLED(CONFIG_IPV6)
|
|
|
|
.ipv6_addr_change = iwl_mvm_ipv6_addr_change,
|
|
|
|
#endif
|
|
|
|
.set_default_unicast_key = iwl_mvm_set_default_unicast_key,
|
|
|
|
#endif
|
|
|
|
.get_survey = iwl_mvm_mac_get_survey,
|
|
|
|
.sta_statistics = iwl_mvm_mac_sta_statistics,
|
|
|
|
.get_ftm_responder_stats = iwl_mvm_mac_get_ftm_responder_stats,
|
|
|
|
.start_pmsr = iwl_mvm_start_pmsr,
|
|
|
|
.abort_pmsr = iwl_mvm_abort_pmsr,
|
|
|
|
|
|
|
|
#ifdef CONFIG_IWLWIFI_DEBUGFS
|
2023-10-04 12:36:23 +03:00
|
|
|
.vif_add_debugfs = iwl_mvm_vif_add_debugfs,
|
2023-10-04 12:36:24 +03:00
|
|
|
.link_add_debugfs = iwl_mvm_link_add_debugfs,
|
2023-06-12 18:51:02 +03:00
|
|
|
.link_sta_add_debugfs = iwl_mvm_link_sta_add_debugfs,
|
2023-03-28 10:58:50 +03:00
|
|
|
#endif
|
2023-03-28 10:59:00 +03:00
|
|
|
.set_hw_timestamp = iwl_mvm_set_hw_timestamp,
|
2023-03-28 10:59:11 +03:00
|
|
|
|
|
|
|
.change_vif_links = iwl_mvm_mld_change_vif_links,
|
|
|
|
.change_sta_links = iwl_mvm_mld_change_sta_links,
|
2024-01-23 20:08:22 +02:00
|
|
|
.can_activate_links = iwl_mvm_mld_can_activate_links,
|
2024-01-29 21:21:50 +02:00
|
|
|
.can_neg_ttlm = iwl_mvm_mld_can_neg_ttlm,
|
2023-03-14 19:49:21 +02:00
|
|
|
};
|