Commit 62e0ccb2 authored by Gregory Greenman's avatar Gregory Greenman Committed by Johannes Berg

wifi: iwlwifi: mvm: adjust internal stations to MLO

Internal stations are mcast/bcast and sniffer. They need some link
specific data like bss id/phy id. Add link_conf as a parameter.
Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230328104949.25b013fd30de.I7f9f5906123acae05040cceec470c9acb07b9d42@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 22c58834
...@@ -78,7 +78,7 @@ static int iwl_mvm_mld_mac_add_interface(struct ieee80211_hw *hw, ...@@ -78,7 +78,7 @@ static int iwl_mvm_mld_mac_add_interface(struct ieee80211_hw *hw,
if (ret) if (ret)
goto out_remove_link; goto out_remove_link;
ret = iwl_mvm_mld_add_bcast_sta(mvm, vif); ret = iwl_mvm_mld_add_bcast_sta(mvm, vif, &vif->bss_conf);
if (ret) if (ret)
goto out_remove_link; goto out_remove_link;
...@@ -194,7 +194,9 @@ static void iwl_mvm_mld_mac_remove_interface(struct ieee80211_hw *hw, ...@@ -194,7 +194,9 @@ static void iwl_mvm_mld_mac_remove_interface(struct ieee80211_hw *hw,
if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { if (vif->type == NL80211_IFTYPE_P2P_DEVICE) {
mvm->p2p_device_vif = NULL; mvm->p2p_device_vif = NULL;
iwl_mvm_mld_rm_bcast_sta(mvm, vif);
/* P2P device uses only one link */
iwl_mvm_mld_rm_bcast_sta(mvm, vif, &vif->bss_conf);
/* Link needs to be deactivated before removal */ /* Link needs to be deactivated before removal */
iwl_mvm_link_changed(mvm, vif, &vif->bss_conf, iwl_mvm_link_changed(mvm, vif, &vif->bss_conf,
LINK_CONTEXT_MODIFY_ACTIVE, false); LINK_CONTEXT_MODIFY_ACTIVE, false);
...@@ -255,7 +257,8 @@ static int __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm, ...@@ -255,7 +257,8 @@ static int __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm,
iwl_mvm_power_update_mac(mvm); iwl_mvm_power_update_mac(mvm);
if (vif->type == NL80211_IFTYPE_MONITOR) { if (vif->type == NL80211_IFTYPE_MONITOR) {
ret = iwl_mvm_mld_add_snif_sta(mvm, vif); ret = iwl_mvm_mld_add_snif_sta(mvm, vif,
&vif->bss_conf);
if (ret) if (ret)
goto deactivate; goto deactivate;
} }
...@@ -348,14 +351,14 @@ static int iwl_mvm_mld_start_ap_ibss(struct ieee80211_hw *hw, ...@@ -348,14 +351,14 @@ static int iwl_mvm_mld_start_ap_ibss(struct ieee80211_hw *hw,
if (ret) if (ret)
goto out_unlock; goto out_unlock;
ret = iwl_mvm_mld_add_mcast_sta(mvm, vif); ret = iwl_mvm_mld_add_mcast_sta(mvm, vif, link_conf);
if (ret) if (ret)
goto out_unlock; goto out_unlock;
/* Send the bcast station. At this stage the TBTT and DTIM time /* Send the bcast station. At this stage the TBTT and DTIM time
* events are added and applied to the scheduler * events are added and applied to the scheduler
*/ */
ret = iwl_mvm_mld_add_bcast_sta(mvm, vif); ret = iwl_mvm_mld_add_bcast_sta(mvm, vif, link_conf);
if (ret) if (ret)
goto out_rm_mcast; goto out_rm_mcast;
...@@ -379,9 +382,9 @@ static int iwl_mvm_mld_start_ap_ibss(struct ieee80211_hw *hw, ...@@ -379,9 +382,9 @@ static int iwl_mvm_mld_start_ap_ibss(struct ieee80211_hw *hw,
out_failed: out_failed:
iwl_mvm_power_update_mac(mvm); iwl_mvm_power_update_mac(mvm);
mvmvif->ap_ibss_active = false; mvmvif->ap_ibss_active = false;
iwl_mvm_mld_rm_bcast_sta(mvm, vif); iwl_mvm_mld_rm_bcast_sta(mvm, vif, link_conf);
out_rm_mcast: out_rm_mcast:
iwl_mvm_mld_rm_mcast_sta(mvm, vif); iwl_mvm_mld_rm_mcast_sta(mvm, vif, link_conf);
out_unlock: out_unlock:
mutex_unlock(&mvm->mutex); mutex_unlock(&mvm->mutex);
return ret; return ret;
...@@ -416,8 +419,8 @@ static void iwl_mvm_mld_stop_ap_ibss(struct ieee80211_hw *hw, ...@@ -416,8 +419,8 @@ static void iwl_mvm_mld_stop_ap_ibss(struct ieee80211_hw *hw,
iwl_mvm_ftm_responder_clear(mvm, vif); iwl_mvm_ftm_responder_clear(mvm, vif);
iwl_mvm_mld_rm_bcast_sta(mvm, vif); iwl_mvm_mld_rm_bcast_sta(mvm, vif, link_conf);
iwl_mvm_mld_rm_mcast_sta(mvm, vif); iwl_mvm_mld_rm_mcast_sta(mvm, vif, link_conf);
iwl_mvm_power_update_mac(mvm); iwl_mvm_power_update_mac(mvm);
mutex_unlock(&mvm->mutex); mutex_unlock(&mvm->mutex);
......
...@@ -166,10 +166,13 @@ static int iwl_mvm_mld_add_int_sta(struct iwl_mvm *mvm, ...@@ -166,10 +166,13 @@ static int iwl_mvm_mld_add_int_sta(struct iwl_mvm *mvm,
* and send it to the FW. * and send it to the FW.
* Note that each P2P mac should have its own broadcast station. * Note that each P2P mac should have its own broadcast station.
*/ */
int iwl_mvm_mld_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) int iwl_mvm_mld_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf)
{ {
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm_int_sta *bsta = &mvmvif->deflink.bcast_sta; struct iwl_mvm_vif_link_info *mvm_link =
mvmvif->link[link_conf->link_id];
struct iwl_mvm_int_sta *bsta = &mvm_link->bcast_sta;
static const u8 _baddr[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; static const u8 _baddr[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
const u8 *baddr = _baddr; const u8 *baddr = _baddr;
unsigned int wdg_timeout = unsigned int wdg_timeout =
...@@ -179,7 +182,7 @@ int iwl_mvm_mld_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) ...@@ -179,7 +182,7 @@ int iwl_mvm_mld_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
lockdep_assert_held(&mvm->mutex); lockdep_assert_held(&mvm->mutex);
if (vif->type == NL80211_IFTYPE_ADHOC) if (vif->type == NL80211_IFTYPE_ADHOC)
baddr = vif->bss_conf.bssid; baddr = link_conf->bssid;
if (vif->type == NL80211_IFTYPE_AP || if (vif->type == NL80211_IFTYPE_AP ||
vif->type == NL80211_IFTYPE_ADHOC) { vif->type == NL80211_IFTYPE_ADHOC) {
...@@ -202,10 +205,13 @@ int iwl_mvm_mld_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) ...@@ -202,10 +205,13 @@ int iwl_mvm_mld_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
* and send it to the FW. * and send it to the FW.
* Note that each AP/GO mac should have its own multicast station. * Note that each AP/GO mac should have its own multicast station.
*/ */
int iwl_mvm_mld_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) int iwl_mvm_mld_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf)
{ {
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm_int_sta *msta = &mvmvif->deflink.mcast_sta; struct iwl_mvm_vif_link_info *mvm_link =
mvmvif->link[link_conf->link_id];
struct iwl_mvm_int_sta *msta = &mvm_link->mcast_sta;
static const u8 _maddr[] = {0x03, 0x00, 0x00, 0x00, 0x00, 0x00}; static const u8 _maddr[] = {0x03, 0x00, 0x00, 0x00, 0x00, 0x00};
const u8 *maddr = _maddr; const u8 *maddr = _maddr;
unsigned int timeout = iwl_mvm_get_wd_timeout(mvm, vif, false, false); unsigned int timeout = iwl_mvm_get_wd_timeout(mvm, vif, false, false);
...@@ -222,9 +228,9 @@ int iwl_mvm_mld_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) ...@@ -222,9 +228,9 @@ int iwl_mvm_mld_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
* changes in mac80211 layer. * changes in mac80211 layer.
*/ */
if (vif->type == NL80211_IFTYPE_ADHOC) if (vif->type == NL80211_IFTYPE_ADHOC)
mvmvif->deflink.cab_queue = IWL_MVM_DQA_GCAST_QUEUE; mvm_link->cab_queue = IWL_MVM_DQA_GCAST_QUEUE;
return iwl_mvm_mld_add_int_sta(mvm, msta, &mvmvif->deflink.cab_queue, return iwl_mvm_mld_add_int_sta(mvm, msta, &mvm_link->cab_queue,
vif->type, STATION_TYPE_MCAST, vif->type, STATION_TYPE_MCAST,
mvmvif->id, maddr, 0, &timeout); mvmvif->id, maddr, 0, &timeout);
} }
...@@ -232,7 +238,8 @@ int iwl_mvm_mld_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) ...@@ -232,7 +238,8 @@ int iwl_mvm_mld_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
/* Allocate a new station entry for the sniffer station to the given vif, /* Allocate a new station entry for the sniffer station to the given vif,
* and send it to the FW. * and send it to the FW.
*/ */
int iwl_mvm_mld_add_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) int iwl_mvm_mld_add_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf)
{ {
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
...@@ -310,9 +317,11 @@ static int iwl_mvm_mld_rm_int_sta(struct iwl_mvm *mvm, ...@@ -310,9 +317,11 @@ static int iwl_mvm_mld_rm_int_sta(struct iwl_mvm *mvm,
return ret; return ret;
} }
int iwl_mvm_mld_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) int iwl_mvm_mld_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf)
{ {
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm_vif_link_info *link = mvmvif->link[link_conf->link_id];
u16 *queueptr; u16 *queueptr;
lockdep_assert_held(&mvm->mutex); lockdep_assert_held(&mvm->mutex);
...@@ -331,22 +340,23 @@ int iwl_mvm_mld_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) ...@@ -331,22 +340,23 @@ int iwl_mvm_mld_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
return -EINVAL; return -EINVAL;
} }
return iwl_mvm_mld_rm_int_sta(mvm, &mvmvif->deflink.bcast_sta, true, return iwl_mvm_mld_rm_int_sta(mvm, &link->bcast_sta,
IWL_MAX_TID_COUNT, queueptr); true, IWL_MAX_TID_COUNT, queueptr);
} }
/* Send the FW a request to remove the station from it's internal data /* Send the FW a request to remove the station from it's internal data
* structures, and in addition remove it from the local data structure. * structures, and in addition remove it from the local data structure.
*/ */
int iwl_mvm_mld_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) int iwl_mvm_mld_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf)
{ {
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm_vif_link_info *link = mvmvif->link[link_conf->link_id];
lockdep_assert_held(&mvm->mutex); lockdep_assert_held(&mvm->mutex);
return iwl_mvm_mld_rm_int_sta(mvm, &mvmvif->deflink.mcast_sta, true, return iwl_mvm_mld_rm_int_sta(mvm, &link->mcast_sta, true, 0,
0, &link->cab_queue);
&mvmvif->deflink.cab_queue);
} }
int iwl_mvm_mld_rm_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) int iwl_mvm_mld_rm_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
......
...@@ -619,13 +619,18 @@ int iwl_mvm_mac_sta_state_common(struct ieee80211_hw *hw, ...@@ -619,13 +619,18 @@ int iwl_mvm_mac_sta_state_common(struct ieee80211_hw *hw,
/* New MLD STA related APIs */ /* New MLD STA related APIs */
/* STA */ /* STA */
int iwl_mvm_mld_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif); int iwl_mvm_mld_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
int iwl_mvm_mld_add_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif); struct ieee80211_bss_conf *link_conf);
int iwl_mvm_mld_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif); int iwl_mvm_mld_add_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf);
int iwl_mvm_mld_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf);
int iwl_mvm_mld_add_aux_sta(struct iwl_mvm *mvm, u32 lmac_id); int iwl_mvm_mld_add_aux_sta(struct iwl_mvm *mvm, u32 lmac_id);
int iwl_mvm_mld_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif); int iwl_mvm_mld_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf);
int iwl_mvm_mld_rm_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif); int iwl_mvm_mld_rm_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
int iwl_mvm_mld_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif); int iwl_mvm_mld_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf);
int iwl_mvm_mld_rm_aux_sta(struct iwl_mvm *mvm); int iwl_mvm_mld_rm_aux_sta(struct iwl_mvm *mvm);
int iwl_mvm_mld_add_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, int iwl_mvm_mld_add_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct ieee80211_sta *sta); struct ieee80211_sta *sta);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment