From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: linux-wireless@vger.kernel.org
Cc: Golan Ben-Ami <golan.ben.ami@intel.com>,
Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 20/41] iwlwifi: export the _no_grab version of PRPH IO functions
Date: Tue, 1 Dec 2015 11:58:46 +0200 [thread overview]
Message-ID: <1448963947-24302-20-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <0BA3FCBA62E2DC44AF3030971E174FB32E905B07@hasmsx107.ger.corp.intel.com>
From: Golan Ben-Ami <golan.ben.ami@intel.com>
Expose _no_grab prph i/o functions that allow performing i/o
outside the transport, without requiring grab and release NIC access
for each operation. In addition, rename the functions so they reflect
their non-grabbing behavior.
This can be very useful for consecutive prph i/o operation that occur
outside trans, such as fw dumps.
Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
drivers/net/wireless/intel/iwlwifi/iwl-io.c | 25 +++++++++++++++----------
drivers/net/wireless/intel/iwlwifi/iwl-io.h | 4 ++--
drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 13 +++++++------
3 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-io.c b/drivers/net/wireless/intel/iwlwifi/iwl-io.c
index 0bd9d4a..603c894 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-io.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-io.c
@@ -1,6 +1,7 @@
/******************************************************************************
*
* Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
+ * Copyright(c) 2015 Intel Deutschland GmbH
*
* Portions of this file are derived from the ipw3945 project.
*
@@ -117,18 +118,20 @@ int iwl_poll_direct_bit(struct iwl_trans *trans, u32 addr, u32 mask,
}
IWL_EXPORT_SYMBOL(iwl_poll_direct_bit);
-u32 __iwl_read_prph(struct iwl_trans *trans, u32 ofs)
+u32 iwl_read_prph_no_grab(struct iwl_trans *trans, u32 ofs)
{
u32 val = iwl_trans_read_prph(trans, ofs);
trace_iwlwifi_dev_ioread_prph32(trans->dev, ofs, val);
return val;
}
+IWL_EXPORT_SYMBOL(iwl_read_prph_no_grab);
-void __iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val)
+void iwl_write_prph_no_grab(struct iwl_trans *trans, u32 ofs, u32 val)
{
trace_iwlwifi_dev_iowrite_prph32(trans->dev, ofs, val);
iwl_trans_write_prph(trans, ofs, val);
}
+IWL_EXPORT_SYMBOL(iwl_write_prph_no_grab);
u32 iwl_read_prph(struct iwl_trans *trans, u32 ofs)
{
@@ -136,7 +139,7 @@ u32 iwl_read_prph(struct iwl_trans *trans, u32 ofs)
u32 val = 0x5a5a5a5a;
if (iwl_trans_grab_nic_access(trans, false, &flags)) {
- val = __iwl_read_prph(trans, ofs);
+ val = iwl_read_prph_no_grab(trans, ofs);
iwl_trans_release_nic_access(trans, &flags);
}
return val;
@@ -148,7 +151,7 @@ void iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val)
unsigned long flags;
if (iwl_trans_grab_nic_access(trans, false, &flags)) {
- __iwl_write_prph(trans, ofs, val);
+ iwl_write_prph_no_grab(trans, ofs, val);
iwl_trans_release_nic_access(trans, &flags);
}
}
@@ -174,8 +177,9 @@ void iwl_set_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask)
unsigned long flags;
if (iwl_trans_grab_nic_access(trans, false, &flags)) {
- __iwl_write_prph(trans, ofs,
- __iwl_read_prph(trans, ofs) | mask);
+ iwl_write_prph_no_grab(trans, ofs,
+ iwl_read_prph_no_grab(trans, ofs) |
+ mask);
iwl_trans_release_nic_access(trans, &flags);
}
}
@@ -187,8 +191,9 @@ void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 ofs,
unsigned long flags;
if (iwl_trans_grab_nic_access(trans, false, &flags)) {
- __iwl_write_prph(trans, ofs,
- (__iwl_read_prph(trans, ofs) & mask) | bits);
+ iwl_write_prph_no_grab(trans, ofs,
+ (iwl_read_prph_no_grab(trans, ofs) &
+ mask) | bits);
iwl_trans_release_nic_access(trans, &flags);
}
}
@@ -200,8 +205,8 @@ void iwl_clear_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask)
u32 val;
if (iwl_trans_grab_nic_access(trans, false, &flags)) {
- val = __iwl_read_prph(trans, ofs);
- __iwl_write_prph(trans, ofs, (val & ~mask));
+ val = iwl_read_prph_no_grab(trans, ofs);
+ iwl_write_prph_no_grab(trans, ofs, (val & ~mask));
iwl_trans_release_nic_access(trans, &flags);
}
}
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-io.h b/drivers/net/wireless/intel/iwlwifi/iwl-io.h
index 501d056..2f4e12c 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-io.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-io.h
@@ -55,9 +55,9 @@ u32 iwl_read_direct32(struct iwl_trans *trans, u32 reg);
void iwl_write_direct32(struct iwl_trans *trans, u32 reg, u32 value);
-u32 __iwl_read_prph(struct iwl_trans *trans, u32 ofs);
+u32 iwl_read_prph_no_grab(struct iwl_trans *trans, u32 ofs);
u32 iwl_read_prph(struct iwl_trans *trans, u32 ofs);
-void __iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val);
+void iwl_write_prph_no_grab(struct iwl_trans *trans, u32 ofs, u32 val);
void iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val);
int iwl_poll_prph_bit(struct iwl_trans *trans, u32 addr,
u32 bits, u32 mask, int timeout);
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 889227c..3c9035d 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -2382,10 +2382,11 @@ iwl_trans_pci_dump_marbh_monitor(struct iwl_trans *trans,
if (!iwl_trans_grab_nic_access(trans, false, &flags))
return 0;
- __iwl_write_prph(trans, MON_DMARB_RD_CTL_ADDR, 0x1);
+ iwl_write_prph_no_grab(trans, MON_DMARB_RD_CTL_ADDR, 0x1);
for (i = 0; i < buf_size_in_dwords; i++)
- buffer[i] = __iwl_read_prph(trans, MON_DMARB_RD_DATA_ADDR);
- __iwl_write_prph(trans, MON_DMARB_RD_CTL_ADDR, 0x0);
+ buffer[i] = iwl_read_prph_no_grab(trans,
+ MON_DMARB_RD_DATA_ADDR);
+ iwl_write_prph_no_grab(trans, MON_DMARB_RD_CTL_ADDR, 0x0);
iwl_trans_release_nic_access(trans, &flags);
@@ -2773,10 +2774,10 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
if (iwl_trans_grab_nic_access(trans, false, &flags)) {
u32 hw_step;
- hw_step = __iwl_read_prph(trans, WFPM_CTRL_REG);
+ hw_step = iwl_read_prph_no_grab(trans, WFPM_CTRL_REG);
hw_step |= ENABLE_WFPM;
- __iwl_write_prph(trans, WFPM_CTRL_REG, hw_step);
- hw_step = __iwl_read_prph(trans, AUX_MISC_REG);
+ iwl_write_prph_no_grab(trans, WFPM_CTRL_REG, hw_step);
+ hw_step = iwl_read_prph_no_grab(trans, AUX_MISC_REG);
hw_step = (hw_step >> HW_STEP_LOCATION_BITS) & 0xF;
if (hw_step == 0x3)
trans->hw_rev = (trans->hw_rev & 0xFFFFFFF3) |
--
2.5.0
next prev parent reply other threads:[~2015-12-01 9:59 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-01 9:56 pull request: iwlwifi-next 2015-12-01 Grumbach, Emmanuel
2015-12-01 9:58 ` [PATCH 01/41] iwlwifi: nvm: fix up phy section when reading it Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 02/41] iwlwifi: add support for 12K Receive Buffers Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 03/41] iwlwifi: dvm: remove Kconfig default Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 04/41] iwlwifi: trans: make various conversion macros inlines Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 05/41] iwlwifi: mvm: Configure fragmented scan for scheduled scan Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 06/41] iwlwifi: dvm: remove stray debug code Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 07/41] iwlwifi: mvm: Enable MPLUT only on supported hw Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 08/41] iwlwifi: mvm: ignore LMAC scan notifications when running UMAC scans Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 09/41] iwlwifi: mvm: check FW's response for nvm access write cmd Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 10/41] iwlwifi: pcie: remove ICT allocation message Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 11/41] iwlwifi: generalize d0i3_entry_timeout module parameter Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 12/41] iwlwifi: mvm: change name of iwl_mvm_d3_update_gtk Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 13/41] iwlwifi: mvm: use build-time assertion for fw trigger ID Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 14/41] iwlwifi: mvm: add trigger for firmware dump upon TDLS events Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 15/41] iwlwifi: mvm: remove redundant d0i3 flag from the config struct Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 16/41] iwlwifi: mvm: add bt settings to debugfs Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 17/41] iwlwifi: mvm: add bt rrc and ttc " Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 18/41] iwlwifi: mvm: remove stray nd_config element Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 19/41] iwlwifi: mvm: drop low_latency_agg_frame_cnt_limit Emmanuel Grumbach
2015-12-01 9:58 ` Emmanuel Grumbach [this message]
2015-12-01 9:58 ` [PATCH 21/41] iwlwifi: dump prph registers in a common place for all transports Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 22/41] iwlwifi: mvm: flush all used TX queues before suspending Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 23/41] iwlwifi: mvm: remove unnecessary check in iwl_mvm_is_d0i3_supported() Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 24/41] iwlwifi: mvm: move fw-dbg code to separate file Emmanuel Grumbach
2015-12-01 18:52 ` Kalle Valo
2015-12-01 19:14 ` Grumbach, Emmanuel
2015-12-01 19:26 ` Emmanuel Grumbach
2015-12-01 19:29 ` Kalle Valo
2015-12-03 15:32 ` Kalle Valo
2015-12-01 9:58 ` [PATCH 25/41] iwlwifi: mvm: Support setting continuous recording debug mode Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 26/41] iwlwifi: clean up transport debugfs handling Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 27/41] iwlwifi: pcie: remove pointer from debug message Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 28/41] iwlwifi: mvm: fix incorrect fallthrough in iwl_mvm_check_running_scans() Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 29/41] iwlwifi: mvm: use firmware station lookup, combine code Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 30/41] iwlwifi: mvm: refactor d3 key update functions Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 31/41] iwlwifi: Add new PCI IDs for 9260 and 5165 series Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 32/41] iwlwifi: Add PCI IDs for the new 3168 series Emmanuel Grumbach
2015-12-01 9:58 ` [PATCH 33/41] iwlwifi: Add PCI IDs for the new series 8165 Emmanuel Grumbach
2015-12-01 9:59 ` [PATCH 34/41] iwlwifi: mvm: Align bt-coex priority with requirements Emmanuel Grumbach
2015-12-01 9:59 ` [PATCH 35/41] iwlwifi: change the Intel Wireless email address Emmanuel Grumbach
2015-12-01 9:59 ` [PATCH 36/41] iwlwifi: print index in api/capa flags parsing message Emmanuel Grumbach
2015-12-01 9:59 ` [PATCH 37/41] iwlwifi: mvm: rs: fix a warning message Emmanuel Grumbach
2015-12-01 9:59 ` [PATCH 38/41] iwlwifi: mvm: report wakeup for wowlan Emmanuel Grumbach
2015-12-01 9:59 ` [PATCH 39/41] iwlwifi: mvm: add 9000-series RX API Emmanuel Grumbach
2015-12-01 9:59 ` [PATCH 40/41] iwlwifi: mvm: ROC: Extend the ROC max delay duration & limit ROC duration Emmanuel Grumbach
2015-12-01 9:59 ` [PATCH 41/41] iwlwifi: remove IWL_DL_LED Emmanuel Grumbach
2015-12-03 15:28 ` pull request: iwlwifi-next 2015-12-01 Kalle Valo
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=1448963947-24302-20-git-send-email-emmanuel.grumbach@intel.com \
--to=emmanuel.grumbach@intel.com \
--cc=golan.ben.ami@intel.com \
--cc=linux-wireless@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).