From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org, Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH v2 07/17] iwlwifi: mvm: protect D0i3 code behind CONFIG_PM
Date: Tue, 21 Aug 2018 08:09:42 +0300 [thread overview]
Message-ID: <20180821050952.31603-8-luca@coelho.fi> (raw)
In-Reply-To: <20180821050952.31603-1-luca@coelho.fi>
From: Luca Coelho <luciano.coelho@intel.com>
Runtime PM can only be used if CONFIG_PM is set. Move all the d0i3
code (which is essentially runtime PM) behind the CONFIG_PM flag.
This prevents undefined usage of some functions when CONFIG_PM is not
defined.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index bce5d150eb58..421509c63f23 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -495,7 +495,9 @@ static const struct iwl_hcmd_arr iwl_mvm_groups[] = {
/* this forward declaration can avoid to export the function */
static void iwl_mvm_async_handlers_wk(struct work_struct *wk);
+#ifdef CONFIG_PM
static void iwl_mvm_d0i3_exit_work(struct work_struct *wk);
+#endif
static u32 iwl_mvm_min_backoff(struct iwl_mvm *mvm)
{
@@ -665,7 +667,9 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
INIT_WORK(&mvm->async_handlers_wk, iwl_mvm_async_handlers_wk);
INIT_WORK(&mvm->roc_done_wk, iwl_mvm_roc_done_wk);
+#ifdef CONFIG_PM
INIT_WORK(&mvm->d0i3_exit_work, iwl_mvm_d0i3_exit_work);
+#endif
INIT_DELAYED_WORK(&mvm->tdls_cs.dwork, iwl_mvm_tdls_ch_switch_work);
INIT_DELAYED_WORK(&mvm->scan_timeout_dwork, iwl_mvm_scan_timeout_wk);
INIT_WORK(&mvm->add_stream_wk, iwl_mvm_add_new_dqa_stream_wk);
@@ -1278,6 +1282,7 @@ static void iwl_mvm_cmd_queue_full(struct iwl_op_mode *op_mode)
iwl_mvm_nic_restart(mvm, true);
}
+#ifdef CONFIG_PM
struct iwl_d0i3_iter_data {
struct iwl_mvm *mvm;
struct ieee80211_vif *connected_vif;
@@ -1689,6 +1694,13 @@ int iwl_mvm_exit_d0i3(struct iwl_op_mode *op_mode)
return _iwl_mvm_exit_d0i3(mvm);
}
+#define IWL_MVM_D0I3_OPS \
+ .enter_d0i3 = iwl_mvm_enter_d0i3, \
+ .exit_d0i3 = iwl_mvm_exit_d0i3,
+#else /* CONFIG_PM */
+#define IWL_MVM_D0I3_OPS
+#endif /* CONFIG_PM */
+
#define IWL_MVM_COMMON_OPS \
/* these could be differentiated */ \
.async_cb = iwl_mvm_async_cb, \
@@ -1699,8 +1711,7 @@ int iwl_mvm_exit_d0i3(struct iwl_op_mode *op_mode)
.nic_error = iwl_mvm_nic_error, \
.cmd_queue_full = iwl_mvm_cmd_queue_full, \
.nic_config = iwl_mvm_nic_config, \
- .enter_d0i3 = iwl_mvm_enter_d0i3, \
- .exit_d0i3 = iwl_mvm_exit_d0i3, \
+ IWL_MVM_D0I3_OPS \
/* as we only register one, these MUST be common! */ \
.start = iwl_op_mode_mvm_start, \
.stop = iwl_op_mode_mvm_stop
--
2.18.0
next prev parent reply other threads:[~2018-08-21 8:28 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-21 5:09 [PATCH v2 00/17] iwlwifi: updates intended for v4.20 2018-08-18 Luca Coelho
2018-08-21 5:09 ` [PATCH v2 01/17] iwlwifi: turn timestamp marker cmd off by default Luca Coelho
2018-08-21 5:09 ` [PATCH v2 02/17] iwlwifi: remove unused TLC debugging commands Luca Coelho
2018-08-21 5:09 ` [PATCH v2 03/17] iwlwifi: runtime: avoid calling debugfs read functions more than once Luca Coelho
2018-08-21 5:09 ` [PATCH v2 04/17] iwlwifi: set the tid for non-QOS frames to zero Luca Coelho
2018-08-21 5:09 ` [PATCH v2 05/17] iwlwifi: add d3 debug data support Luca Coelho
2018-08-22 11:37 ` Kalle Valo
2018-08-22 11:40 ` Luca Coelho
2018-08-21 5:09 ` [PATCH v2 06/17] iwlwifi: mvm: remove duplicate if in iwl_mvm_setup_connection_keep() Luca Coelho
2018-08-21 5:09 ` Luca Coelho [this message]
2018-08-21 5:09 ` [PATCH v2 08/17] iwlwifi: mvm: support new WoWLAN status FW API Luca Coelho
2018-08-21 5:09 ` [PATCH v2 09/17] iwlwifi: mvm: add NOA and CSA to a probe response Luca Coelho
2018-08-21 5:09 ` [PATCH v2 10/17] iwlwifi: add required include to iwl-fh.h Luca Coelho
2018-08-21 5:09 ` [PATCH v2 11/17] iwlwifi: mvm: add bss color to radiotap Luca Coelho
2018-08-21 5:09 ` [PATCH v2 12/17] iwlwifi: mvm: add support for RX_AMPDU_EOF bit for HE SU Luca Coelho
2018-08-21 5:09 ` [PATCH v2 13/17] iwlwifi: mvm: move he RX handling to a separate function Luca Coelho
2018-08-21 5:09 ` [PATCH v2 14/17] iwlwifi: enable reading the value of delay in timestamp_marker cmd Luca Coelho
2018-08-21 5:09 ` [PATCH v2 15/17] iwlwifi: drop packets with bad status in CD Luca Coelho
2018-08-21 5:09 ` [PATCH v2 16/17] iwlwifi: pcie: allow using tx init for other queues but the command queue Luca Coelho
2018-08-21 5:09 ` [PATCH v2 17/17] iwlwifi: pcie: make non-static hcmd and rx code Luca Coelho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180821050952.31603-8-luca@coelho.fi \
--to=luca@coelho.fi \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luciano.coelho@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox