Commit aa4936b1 authored by Nathan Errera's avatar Nathan Errera Committed by Kalle Valo

iwlwifi: mvm: add a get lmac id function

As some functions need to check which lmac id to use, add
a new function to find the lmac id instead of open coding it
in every function.
Signed-off-by: default avatarNathan Errera <nathan.errera@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20201008180656.ac3b43e97aa8.I308f8ed2238e32d5eef9c35ad7962f0e8b9c1902@changeid
parent f9084775
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* GPL LICENSE SUMMARY * GPL LICENSE SUMMARY
* *
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2012 - 2014, 2020 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
* *
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* *
* BSD LICENSE * BSD LICENSE
* *
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2012 - 2014, 2020 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
* All rights reserved. * All rights reserved.
...@@ -59,10 +59,12 @@ ...@@ -59,10 +59,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*****************************************************************************/ *****************************************************************************/
#ifndef __iwl_fw_api_binding_h__ #ifndef __iwl_fw_api_binding_h__
#define __iwl_fw_api_binding_h__ #define __iwl_fw_api_binding_h__
#include <fw/file.h>
#include <fw/img.h>
#define MAX_MACS_IN_BINDING (3) #define MAX_MACS_IN_BINDING (3)
#define MAX_BINDINGS (4) #define MAX_BINDINGS (4)
...@@ -112,6 +114,14 @@ struct iwl_binding_cmd { ...@@ -112,6 +114,14 @@ struct iwl_binding_cmd {
#define IWL_LMAC_24G_INDEX 0 #define IWL_LMAC_24G_INDEX 0
#define IWL_LMAC_5G_INDEX 1 #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 */ /* The maximal number of fragments in the FW's schedule session */
#define IWL_MVM_MAX_QUOTA 128 #define IWL_MVM_MAX_QUOTA 128
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* GPL LICENSE SUMMARY * GPL LICENSE SUMMARY
* *
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2012 - 2014, 2020 Intel Corporation. All rights reserved.
* Copyright(c) 2016 Intel Deutschland GmbH * Copyright(c) 2016 Intel Deutschland GmbH
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* *
* BSD LICENSE * BSD LICENSE
* *
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2012 - 2014, 2020 Intel Corporation. All rights reserved.
* Copyright(c) 2016 Intel Deutschland GmbH * Copyright(c) 2016 Intel Deutschland GmbH
* All rights reserved. * All rights reserved.
* *
...@@ -86,11 +86,8 @@ static int iwl_mvm_binding_cmd(struct iwl_mvm *mvm, u32 action, ...@@ -86,11 +86,8 @@ static int iwl_mvm_binding_cmd(struct iwl_mvm *mvm, u32 action,
if (fw_has_capa(&mvm->fw->ucode_capa, if (fw_has_capa(&mvm->fw->ucode_capa,
IWL_UCODE_TLV_CAPA_BINDING_CDB_SUPPORT)) { IWL_UCODE_TLV_CAPA_BINDING_CDB_SUPPORT)) {
size = sizeof(cmd); size = sizeof(cmd);
if (phyctxt->channel->band == NL80211_BAND_2GHZ || cmd.lmac_id = cpu_to_le32(iwl_mvm_get_lmac_id(mvm->fw,
!iwl_mvm_is_cdb_supported(mvm)) phyctxt->channel->band));
cmd.lmac_id = cpu_to_le32(IWL_LMAC_24G_INDEX);
else
cmd.lmac_id = cpu_to_le32(IWL_LMAC_5G_INDEX);
} else { } else {
size = IWL_BINDING_CMD_SIZE_V1; size = IWL_BINDING_CMD_SIZE_V1;
} }
......
...@@ -194,11 +194,8 @@ static void iwl_mvm_phy_ctxt_cmd_data(struct iwl_mvm *mvm, ...@@ -194,11 +194,8 @@ static void iwl_mvm_phy_ctxt_cmd_data(struct iwl_mvm *mvm,
struct cfg80211_chan_def *chandef, struct cfg80211_chan_def *chandef,
u8 chains_static, u8 chains_dynamic) u8 chains_static, u8 chains_dynamic)
{ {
if (chandef->chan->band == NL80211_BAND_2GHZ || cmd->lmac_id = cpu_to_le32(iwl_mvm_get_lmac_id(mvm->fw,
!iwl_mvm_is_cdb_supported(mvm)) chandef->chan->band));
cmd->lmac_id = cpu_to_le32(IWL_LMAC_24G_INDEX);
else
cmd->lmac_id = cpu_to_le32(IWL_LMAC_5G_INDEX);
/* Set the channel info data */ /* Set the channel info data */
iwl_mvm_set_chan_info_chandef(mvm, &cmd->ci, chandef); iwl_mvm_set_chan_info_chandef(mvm, &cmd->ci, chandef);
......
...@@ -793,11 +793,7 @@ unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm, ...@@ -793,11 +793,7 @@ unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm,
enum nl80211_band band = mvmsta->vif->bss_conf.chandef.chan->band; enum nl80211_band band = mvmsta->vif->bss_conf.chandef.chan->band;
u8 ac = tid_to_mac80211_ac[tid]; u8 ac = tid_to_mac80211_ac[tid];
unsigned int txf; unsigned int txf;
int lmac = IWL_LMAC_24G_INDEX; int lmac = iwl_mvm_get_lmac_id(mvm->fw, band);
if (iwl_mvm_is_cdb_supported(mvm) &&
band == NL80211_BAND_5GHZ)
lmac = IWL_LMAC_5G_INDEX;
/* For HE redirect to trigger based fifos */ /* For HE redirect to trigger based fifos */
if (sta->he_cap.has_he && !WARN_ON(!iwl_mvm_has_new_tx_api(mvm))) if (sta->he_cap.has_he && !WARN_ON(!iwl_mvm_has_new_tx_api(mvm)))
......
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