summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/mvm/link.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2023-03-28 10:58:59 +0300
committerJohannes Berg <johannes.berg@intel.com>2023-03-30 12:07:54 +0200
commitcb145863e7abbbf4248ab11d2783a1b619349d1b (patch)
treec28617dbfb47b8be88c59f6cd919efedc040fa7c /drivers/net/wireless/intel/iwlwifi/mvm/link.c
parentf551d013bd3111413a1c57214796ab3fe3b2f694 (diff)
wifi: iwlwifi: mvm: add link to firmware earlier
The firmware now allows adding a link that's not yet bound to a PHY context. Make use of that to align the driver with mac80211's API expectations. For now, just add the link at the same time as the MAC since we don't yet have real MLD support, but that'll obviously change later. This fixes an issue with apStaId tracking in the firmware. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230328104949.097e5008b637.I4e75c6c11e21c08d28ff6a066be36629d3975db6@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/link.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/link.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
index 4905dac3a048..d8902e0ed2ae 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
@@ -23,11 +23,9 @@ static int iwl_mvm_link_cmd_send(struct iwl_mvm *mvm,
int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+ struct iwl_mvm_phy_ctxt *phyctxt = mvmvif->deflink.phy_ctxt;
struct iwl_link_config_cmd cmd = {};
- if (WARN_ON_ONCE(!mvmvif->deflink.phy_ctxt))
- return -EINVAL;
-
/* Update SF - Disable if needed. if this fails, SF might still be on
* while many macs are bound, which is forbidden - so fail the binding.
*/
@@ -36,7 +34,11 @@ int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
cmd.link_id = cpu_to_le32(mvmvif->id);
cmd.mac_id = cpu_to_le32(mvmvif->id);
- cmd.phy_id = cpu_to_le32(mvmvif->deflink.phy_ctxt->id);
+ /* P2P-Device already has a valid PHY context during add */
+ if (phyctxt)
+ cmd.phy_id = cpu_to_le32(phyctxt->id);
+ else
+ cmd.phy_id = cpu_to_le32(FW_CTXT_INVALID);
memcpy(cmd.local_link_addr, vif->addr, ETH_ALEN);
@@ -54,15 +56,15 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct iwl_link_config_cmd cmd = {};
u32 ht_flag, flags = 0, flags_mask = 0;
- if (!phyctxt)
- return -EINVAL;
-
cmd.link_id = cpu_to_le32(mvmvif->id);
/* The phy_id, link address and listen_lmac can be modified only until
* the link becomes active, otherwise they will be ignored.
*/
- cmd.phy_id = cpu_to_le32(phyctxt->id);
+ if (phyctxt)
+ cmd.phy_id = cpu_to_le32(phyctxt->id);
+ else
+ cmd.phy_id = cpu_to_le32(FW_CTXT_INVALID);
cmd.mac_id = cpu_to_le32(mvmvif->id);
memcpy(cmd.local_link_addr, vif->addr, ETH_ALEN);
@@ -157,9 +159,6 @@ int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
struct iwl_link_config_cmd cmd = {};
int ret;
- if (WARN_ON_ONCE(!mvmvif->deflink.phy_ctxt))
- return -EINVAL;
-
cmd.link_id = cpu_to_le32(mvmvif->id);
ret = iwl_mvm_link_cmd_send(mvm, &cmd, FW_CTXT_ACTION_REMOVE);