wifi: iwlwifi: mvm: Refactor iwl_mvm_get_lmac_id()
authorAriel Malamud <ariel.malamud@intel.com>
Tue, 13 Jun 2023 12:57:18 +0000 (15:57 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 14 Jun 2023 10:32:20 +0000 (12:32 +0200)
The iwl_mvm_get_lmac_id() function is currently
defined as a static inline function under fw/api
and receives mvm's fw pointer. It will need the
ability to access other mvm struct members for
future capabilities such as debug. Move the function
out of the fw/api and into mvm proper as a regular
function and have it receive the pointer to mvm.

Signed-off-by: Ariel Malamud <ariel.malamud@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230613155501.507b2f9f64eb.I0ec91310e1911c33faf396b5e17bcb11a164f6ea@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/api/binding.h
drivers/net/wireless/intel/iwlwifi/mvm/binding.c
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
drivers/net/wireless/intel/iwlwifi/mvm/tx.c

index b6b5959cb2595d6d0e70ea5d96c1ae5d4cdb9db0..d9044ada6a431dac1aa9d3763a93d7289162bfcf 100644 (file)
@@ -59,14 +59,6 @@ struct iwl_binding_cmd {
 #define IWL_LMAC_24G_INDEX             0
 #define IWL_LMAC_5G_INDEX              1
 
-static inline u32 iwl_mvm_get_lmac_id(const struct iwl_fw *fw,
-                                     enum nl80211_band band){
-       if (!fw_has_capa(&fw->ucode_capa, IWL_UCODE_TLV_CAPA_CDB_SUPPORT) ||
-           band == NL80211_BAND_2GHZ)
-               return IWL_LMAC_24G_INDEX;
-       return IWL_LMAC_5G_INDEX;
-}
-
 /* The maximal number of fragments in the FW's schedule session */
 #define IWL_MVM_MAX_QUOTA 128
 
index ef50ccabcc73bae65673843f67c9c5cb2e338886..458b97930059ecde4acb100fa2b90a69130eddf3 100644 (file)
@@ -32,7 +32,7 @@ static int iwl_mvm_binding_cmd(struct iwl_mvm *mvm, u32 action,
        if (fw_has_capa(&mvm->fw->ucode_capa,
                        IWL_UCODE_TLV_CAPA_BINDING_CDB_SUPPORT)) {
                size = sizeof(cmd);
-               cmd.lmac_id = cpu_to_le32(iwl_mvm_get_lmac_id(mvm->fw,
+               cmd.lmac_id = cpu_to_le32(iwl_mvm_get_lmac_id(mvm,
                                                              phyctxt->channel->band));
        } else {
                size = IWL_BINDING_CMD_SIZE_V1;
@@ -164,3 +164,11 @@ int iwl_mvm_binding_remove_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 
        return ret;
 }
+
+u32 iwl_mvm_get_lmac_id(struct iwl_mvm *mvm, enum nl80211_band band)
+{
+       if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_CDB_SUPPORT) ||
+           band == NL80211_BAND_2GHZ)
+               return IWL_LMAC_24G_INDEX;
+       return IWL_LMAC_5G_INDEX;
+}
index bf78b7df47002352ff98ec29d08d74ab7ef317b5..f1c7d0bef60941c36dcc2094abc6bd778cb3c092 100644 (file)
@@ -4595,7 +4595,7 @@ int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 
        switch (vif->type) {
        case NL80211_IFTYPE_STATION:
-               lmac_id = iwl_mvm_get_lmac_id(mvm->fw, channel->band);
+               lmac_id = iwl_mvm_get_lmac_id(mvm, channel->band);
 
                /* Use aux roc framework (HS20) */
                ret = ops->add_aux_sta_for_hs20(mvm, lmac_id);
index 143c79f62cfde5435c0f77ee18ba612c54cb26a9..b04631195535031999ba588d2a15f4056b21ba09 100644 (file)
@@ -1841,6 +1841,7 @@ void iwl_mvm_channel_switch_error_notif(struct iwl_mvm *mvm,
 /* Bindings */
 int iwl_mvm_binding_add_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
 int iwl_mvm_binding_remove_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
+u32 iwl_mvm_get_lmac_id(struct iwl_mvm *mvm, enum nl80211_band band);
 
 /* Links */
 int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
index 3ab6fb83a1756efb98b88ca17c24fbd32449169d..55541e90770a412f9bc0ed74a875f7f181634c87 100644 (file)
@@ -151,7 +151,7 @@ static void iwl_mvm_phy_ctxt_cmd_data(struct iwl_mvm *mvm,
                                      struct cfg80211_chan_def *chandef,
                                      u8 chains_static, u8 chains_dynamic)
 {
-       cmd->lmac_id = cpu_to_le32(iwl_mvm_get_lmac_id(mvm->fw,
+       cmd->lmac_id = cpu_to_le32(iwl_mvm_get_lmac_id(mvm,
                                                       chandef->chan->band));
 
        /* Set the channel info data */
index 547694c89ffa606a687e87d5daa07a87d93fcb70..bacc3045ea165ae459889e5884e3842fc5634ed1 100644 (file)
@@ -896,7 +896,7 @@ unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm,
                        band = mvmsta->vif->bss_conf.chandef.chan->band;
                }
 
-               lmac = iwl_mvm_get_lmac_id(mvm->fw, band);
+               lmac = iwl_mvm_get_lmac_id(mvm, band);
        } else if (fw_has_capa(&mvm->fw->ucode_capa,
                               IWL_UCODE_TLV_CAPA_CDB_SUPPORT)) {
                /* for real MLO restrict to both LMACs if they exist */