Commit f2abcfa6 authored by Luca Coelho's avatar Luca Coelho

iwlwifi: remove dflt_pwr_limit from the transport

The default power limit read from the SPLC method in ACPI doesn't
have anything to do with the transport and is only used in the opmode,
so we can remove it from the trans.  Additionally, this value is only
user when the opmode is starting, so we don't need to store it
anywhere.

Remove the dflt_pwr_limit element from the trans and move call to
iwl_acpi_get_pwr_limit() call to mvm.
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 42fa5e0e
...@@ -749,8 +749,6 @@ struct iwl_trans { ...@@ -749,8 +749,6 @@ struct iwl_trans {
struct lockdep_map sync_cmd_lockdep_map; struct lockdep_map sync_cmd_lockdep_map;
#endif #endif
u64 dflt_pwr_limit;
const struct iwl_fw_dbg_dest_tlv *dbg_dest_tlv; const struct iwl_fw_dbg_dest_tlv *dbg_dest_tlv;
const struct iwl_fw_dbg_conf_tlv *dbg_conf_tlv[FW_DBG_CONF_MAX]; const struct iwl_fw_dbg_conf_tlv *dbg_conf_tlv[FW_DBG_CONF_MAX];
struct iwl_fw_dbg_trigger_tlv * const *dbg_trigger_tlv; struct iwl_fw_dbg_trigger_tlv * const *dbg_trigger_tlv;
......
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
#include "time-event.h" #include "time-event.h"
#include "fw-api.h" #include "fw-api.h"
#include "fw/api/scan.h" #include "fw/api/scan.h"
#include "fw/acpi.h"
#define DRV_DESCRIPTION "The new Intel(R) wireless AGN driver for Linux" #define DRV_DESCRIPTION "The new Intel(R) wireless AGN driver for Linux"
MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_DESCRIPTION(DRV_DESCRIPTION);
...@@ -488,18 +489,21 @@ static const struct iwl_hcmd_arr iwl_mvm_groups[] = { ...@@ -488,18 +489,21 @@ static const struct iwl_hcmd_arr iwl_mvm_groups[] = {
static void iwl_mvm_async_handlers_wk(struct work_struct *wk); static void iwl_mvm_async_handlers_wk(struct work_struct *wk);
static void iwl_mvm_d0i3_exit_work(struct work_struct *wk); static void iwl_mvm_d0i3_exit_work(struct work_struct *wk);
static u32 calc_min_backoff(struct iwl_trans *trans, const struct iwl_cfg *cfg) static u32 iwl_mvm_min_backoff(struct iwl_mvm *mvm)
{ {
const struct iwl_pwr_tx_backoff *pwr_tx_backoff = cfg->pwr_tx_backoffs; const struct iwl_pwr_tx_backoff *backoff = mvm->cfg->pwr_tx_backoffs;
u64 dflt_pwr_limit;
if (!pwr_tx_backoff) if (!backoff)
return 0; return 0;
while (pwr_tx_backoff->pwr) { dflt_pwr_limit = iwl_acpi_get_pwr_limit(mvm->dev);
if (trans->dflt_pwr_limit >= pwr_tx_backoff->pwr)
return pwr_tx_backoff->backoff;
pwr_tx_backoff++; while (backoff->pwr) {
if (dflt_pwr_limit >= backoff->pwr)
return backoff->backoff;
backoff++;
} }
return 0; return 0;
...@@ -769,7 +773,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, ...@@ -769,7 +773,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
goto out_free; goto out_free;
mvm->hw_registered = true; mvm->hw_registered = true;
min_backoff = calc_min_backoff(trans, cfg); min_backoff = iwl_mvm_min_backoff(mvm);
iwl_mvm_thermal_initialize(mvm, min_backoff); iwl_mvm_thermal_initialize(mvm, min_backoff);
err = iwl_mvm_dbgfs_register(mvm, dbgfs_dir); err = iwl_mvm_dbgfs_register(mvm, dbgfs_dir);
......
...@@ -78,7 +78,6 @@ ...@@ -78,7 +78,6 @@
#include "iwl-trans.h" #include "iwl-trans.h"
#include "iwl-drv.h" #include "iwl-drv.h"
#include "internal.h" #include "internal.h"
#include "fw/acpi.h"
#define IWL_PCI_DEVICE(dev, subdev, cfg) \ #define IWL_PCI_DEVICE(dev, subdev, cfg) \
.vendor = PCI_VENDOR_ID_INTEL, .device = (dev), \ .vendor = PCI_VENDOR_ID_INTEL, .device = (dev), \
...@@ -651,8 +650,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -651,8 +650,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto out_free_trans; goto out_free_trans;
} }
iwl_trans->dflt_pwr_limit = iwl_acpi_get_pwr_limit(iwl_trans->dev);
/* register transport layer debugfs here */ /* register transport layer debugfs here */
ret = iwl_trans_pcie_dbgfs_register(iwl_trans); ret = iwl_trans_pcie_dbgfs_register(iwl_trans);
if (ret) if (ret)
......
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