From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
Johannes Berg <johannes.berg@intel.com>,
Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 02/16] iwlwifi: pcie: initialize debug_rfkill to -1
Date: Tue, 23 Apr 2019 12:10:29 +0300 [thread overview]
Message-ID: <20190423091043.7156-3-luca@coelho.fi> (raw)
In-Reply-To: <20190423091043.7156-1-luca@coelho.fi>
From: Johannes Berg <johannes.berg@intel.com>
This will let us introduce a mechanism to start with rfkill
faked, and put 0 here to override it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
drivers/net/wireless/intel/iwlwifi/pcie/internal.h | 4 ++--
drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 11 ++++++-----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h
index 1f1594e136c5..b513037dc066 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h
@@ -536,7 +536,7 @@ struct iwl_trans_pcie {
int ict_index;
bool use_ict;
bool is_down, opmode_down;
- bool debug_rfkill;
+ s8 debug_rfkill;
struct isr_statistics isr_stats;
spinlock_t irq_lock;
@@ -982,7 +982,7 @@ static inline bool iwl_is_rfkill_set(struct iwl_trans *trans)
lockdep_assert_held(&trans_pcie->mutex);
- if (trans_pcie->debug_rfkill)
+ if (trans_pcie->debug_rfkill == 1)
return true;
return !(iwl_read32(trans, CSR_GP_CNTRL) &
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 717b9b5be157..d638f41efcdd 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -2688,16 +2688,17 @@ static ssize_t iwl_dbgfs_rfkill_write(struct file *file,
{
struct iwl_trans *trans = file->private_data;
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
- bool old = trans_pcie->debug_rfkill;
+ bool new_value;
int ret;
- ret = kstrtobool_from_user(user_buf, count, &trans_pcie->debug_rfkill);
+ ret = kstrtobool_from_user(user_buf, count, &new_value);
if (ret)
return ret;
- if (old == trans_pcie->debug_rfkill)
+ if (new_value == trans_pcie->debug_rfkill)
return count;
IWL_WARN(trans, "changing debug rfkill %d->%d\n",
- old, trans_pcie->debug_rfkill);
+ trans_pcie->debug_rfkill, new_value);
+ trans_pcie->debug_rfkill = new_value;
iwl_pcie_handle_rfkill_irq(trans);
return count;
@@ -3421,7 +3422,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
ret = -ENOMEM;
goto out_no_pci;
}
-
+ trans_pcie->debug_rfkill = -1;
if (!cfg->base_params->pcie_l1_allowed) {
/*
--
2.20.1
next prev parent reply other threads:[~2019-04-23 9:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-23 9:10 [PATCH 00/16] iwlwifi: updates intended for v5.2 2019-04-23 (new try) Luca Coelho
2019-04-23 9:10 ` [PATCH 01/16] iwlwifi: Use correct channel_profile iniwl_get_nvm Luca Coelho
2019-04-23 9:10 ` Luca Coelho [this message]
2019-04-23 9:10 ` [PATCH 03/16] iwlwifi: pcie: don't crash on invalid RX interrupt Luca Coelho
2019-04-23 9:10 ` [PATCH 04/16] iwlwifi: mvm: support v2 of the WoWLAN patterns command Luca Coelho
2019-04-23 9:10 ` [PATCH 05/16] iwlwifi: mvm: report FTM start time TSF when applicable Luca Coelho
2019-04-23 9:10 ` [PATCH 06/16] iwlwifi: support fseq tlv and print fseq version Luca Coelho
2019-04-23 9:10 ` [PATCH 07/16] iwlwifi: mvm: limit TLC according to our HE capabilities Luca Coelho
2019-04-23 9:10 ` [PATCH 08/16] iwlwifi: bump FW API to 48 for 22000 series Luca Coelho
2019-04-23 9:10 ` [PATCH 09/16] iwlwifi: mvm: Don't sleep in RX path Luca Coelho
2019-04-23 9:10 ` [PATCH 10/16] iwlwifi: pcie: remove stray character in iwl_pcie_rx_alloc_page() Luca Coelho
2019-04-23 9:10 ` [PATCH 11/16] iwlwifi: parse command version TLV Luca Coelho
2019-04-23 9:10 ` [PATCH 12/16] iwlwifi: dbg_ini: add lmac and umac error tables dumping support Luca Coelho
2019-04-23 9:10 ` [PATCH 13/16] iwlwifi: dbg_ini: add periodic trigger support Luca Coelho
2019-04-23 9:10 ` [PATCH 14/16] iwlwifi: dbg: replace dump info device family with HW type Luca Coelho
2019-04-23 9:10 ` [PATCH 15/16] iwlwifi: avoid allocating memory for region with disabled domain Luca Coelho
2019-04-23 9:10 ` [PATCH 16/16] iwlwifi: dbg_ini: check for valid region type during regions parsing 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=20190423091043.7156-3-luca@coelho.fi \
--to=luca@coelho.fi \
--cc=johannes.berg@intel.com \
--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