From: Emmanuel Grumbach <egrumbach@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 17/47] iwlwifi: allow to wait for a subset of the queues
Date: Sun, 13 Apr 2014 22:19:32 +0300 [thread overview]
Message-ID: <1397416802-32403-17-git-send-email-egrumbach@gmail.com> (raw)
In-Reply-To: <534AE330.2020805@gmail.com>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
This will be used later to flush / wait for queues that are
related to a specific vif.
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
drivers/net/wireless/iwlwifi/dvm/lib.c | 2 +-
drivers/net/wireless/iwlwifi/dvm/mac80211.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-trans.h | 10 +++++-----
drivers/net/wireless/iwlwifi/pcie/trans.c | 6 +++++-
4 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/dvm/lib.c b/drivers/net/wireless/iwlwifi/dvm/lib.c
index 576f7ee..d169228 100644
--- a/drivers/net/wireless/iwlwifi/dvm/lib.c
+++ b/drivers/net/wireless/iwlwifi/dvm/lib.c
@@ -180,7 +180,7 @@ void iwlagn_dev_txfifo_flush(struct iwl_priv *priv)
goto done;
}
IWL_DEBUG_INFO(priv, "wait transmit/flush all frames\n");
- iwl_trans_wait_tx_queue_empty(priv->trans);
+ iwl_trans_wait_tx_queue_empty(priv->trans, 0xffffffff);
done:
ieee80211_wake_queues(priv->hw);
mutex_unlock(&priv->mutex);
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
index dd55c9c..d3abc15 100644
--- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
@@ -1119,7 +1119,7 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, u32 queues, bool drop)
}
}
IWL_DEBUG_MAC80211(priv, "wait transmit/flush all frames\n");
- iwl_trans_wait_tx_queue_empty(priv->trans);
+ iwl_trans_wait_tx_queue_empty(priv->trans, 0xffffffff);
done:
mutex_unlock(&priv->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n");
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 8cdb0dd..22fd94e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -437,8 +437,7 @@ struct iwl_trans;
* this one. The op_mode must not configure the HCMD queue. May sleep.
* @txq_disable: de-configure a Tx queue to send AMPDUs
* Must be atomic
- * @wait_tx_queue_empty: wait until all tx queues are empty
- * May sleep
+ * @wait_tx_queue_empty: wait until tx queues are empty. May sleep.
* @dbgfs_register: add the dbgfs files under this directory. Files will be
* automatically deleted.
* @write8: write a u8 to a register at offset ofs from the BAR
@@ -490,7 +489,7 @@ struct iwl_trans_ops {
void (*txq_disable)(struct iwl_trans *trans, int queue);
int (*dbgfs_register)(struct iwl_trans *trans, struct dentry* dir);
- int (*wait_tx_queue_empty)(struct iwl_trans *trans);
+ int (*wait_tx_queue_empty)(struct iwl_trans *trans, u32 txq_bm);
void (*write8)(struct iwl_trans *trans, u32 ofs, u8 val);
void (*write32)(struct iwl_trans *trans, u32 ofs, u32 val);
@@ -759,12 +758,13 @@ static inline void iwl_trans_ac_txq_enable(struct iwl_trans *trans, int queue,
IWL_MAX_TID_COUNT, IWL_FRAME_LIMIT, 0);
}
-static inline int iwl_trans_wait_tx_queue_empty(struct iwl_trans *trans)
+static inline int iwl_trans_wait_tx_queue_empty(struct iwl_trans *trans,
+ u32 txq_bm)
{
if (unlikely(trans->state != IWL_TRANS_FW_ALIVE))
IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
- return trans->ops->wait_tx_queue_empty(trans);
+ return trans->ops->wait_tx_queue_empty(trans, txq_bm);
}
static inline int iwl_trans_dbgfs_register(struct iwl_trans *trans,
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index 2548f49..0f20e73 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -1257,7 +1257,7 @@ static int iwl_trans_pcie_write_mem(struct iwl_trans *trans, u32 addr,
#define IWL_FLUSH_WAIT_MS 2000
-static int iwl_trans_pcie_wait_txq_empty(struct iwl_trans *trans)
+static int iwl_trans_pcie_wait_txq_empty(struct iwl_trans *trans, u32 txq_bm)
{
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
struct iwl_txq *txq;
@@ -1272,6 +1272,10 @@ static int iwl_trans_pcie_wait_txq_empty(struct iwl_trans *trans)
for (cnt = 0; cnt < trans->cfg->base_params->num_of_queues; cnt++) {
if (cnt == trans_pcie->cmd_queue)
continue;
+ if (!test_bit(cnt, trans_pcie->queue_used))
+ continue;
+ if (!(BIT(cnt) & txq_bm))
+ continue;
txq = &trans_pcie->txq[cnt];
q = &txq->q;
while (q->read_ptr != q->write_ptr && !time_after(jiffies,
--
1.8.3.2
next prev parent reply other threads:[~2014-04-13 19:20 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-13 19:19 pull request: iwlwifi 2014-04-13 Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 01/47] iwlwifi: mvm: Handle power management constraints for additional use-cases Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 02/47] iwlwifi: mvm: fix the number of channels in family 8000 Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 03/47] iwlwifi: pcie: don't leave the new NICs awake for commands Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 04/47] iwlwifi: mvm: add lq_cmd/tx_resp reduced_tpc field Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 05/47] iwlwifi: mvm: add ATPC implementation Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 06/47] iwlwifi: mvm: add debugfs file for fixed reduced tx power Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 07/47] iwlwifi: pcie: implement GRO without NAPI Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 08/47] iwlwifi: pcie: clarify RX queue need_update handling and locking Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 09/47] iwlwifi: pcie: use bool for TX queue where appropriate Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 10/47] iwlwifi: pcie: fix TX queue locking Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 11/47] iwlwifi: pcie: clarify TX queue need_update handling Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 12/47] iwlwifi: pcie: unify iwl_rx_replenish and iwl_rx_replenish_now Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 13/47] iwlwifi: move CPU1_CPU2_SEPARATOR_SECTION to iwl-fw.h Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 14/47] iwlwifi: mvm: remove redundant empty line Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 15/47] iwlwifi: mvm: propagate the beamforming status from firmware Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 16/47] iwlwifi: mvm: don't set AP STA to EINVAL Emmanuel Grumbach
2014-04-13 19:19 ` Emmanuel Grumbach [this message]
2014-04-13 19:19 ` [PATCH 18/47] iwlwifi: pcie: WARN upon traffic while flushing TX queues Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 19/47] iwlwifi: mvm: dump Rx FIFO when the firmware asserts Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 20/47] iwlwifi: mvm: Fix warning message when exit thermal throttling Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 21/47] iwlwifi: mvm: Fix tx-backoff when NIC " Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 22/47] iwlwifi: mvm: don't enable bcast filtering on P2P client Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 23/47] iwlwifi: mvm: Use RCU_INIT_POINTER(x, NULL) Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 24/47] iwlwifi: mvm: add per rate tx stats Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 25/47] iwlwifi: mvm: replace BUG_ON by WARN_ON in scan.c Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 26/47] iwlwifi: mvm: deprecate -7 firmware Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 27/47] iwlwifi: mvm: Change scan fragmentation condition Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 28/47] iwlwifi: mvm: Fix scan parameters units Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 29/47] iwlwifi: remove IWL_UCODE_TLV_FLAGS_NEWBT_COEX TLV flag Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 30/47] iwlwifi: remove IWL_UCODE_TLV_FLAGS_PM_CMD_SUPPORT flag Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 31/47] iwlwifi: remove IWL_UCODE_TLV_FLAGS_RX_ENERGY_API flag Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 32/47] iwlwifi: remove IWL_UCODE_TLV_FLAGS_TIME_EVENT_API_V2 flag Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 33/47] iwlwifi: remove IWL_UCODE_TLV_FLAGS_BF_UPDATED flag Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 34/47] iwlwifi: remove IWL_UCODE_TLV_FLAGS_D3_CONTINUITY_API flag Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 35/47] iwlwifi: remove IWL_UCODE_TLV_FLAGS_SCHED_SCAN flag Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 36/47] iwlwifi: remove IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT flag Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 37/47] iwlwifi: remove IWL_UCODE_TLV_FLAGS_STA_KEY_CMD flag Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 38/47] iwlwifi: remove IWL_UCODE_TLV_FLAGS_DEVICE_PS_CMD flag Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 39/47] iwlwifi: mvm: BT Coex - don't use comma operator Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 40/47] iwlwifi: mvm: BT Coex - minor API change Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 41/47] iwlwifi: mvm: BT Coex - send priority tables from iwl_send_bt_init_conf Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 42/47] iwlwifi: mvm: Add support for Energy based scan (EBS) Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 43/47] iwlwifi: 7000: bump firmware API version to 9 Emmanuel Grumbach
2014-04-13 19:19 ` [PATCH 44/47] iwlwifi: mvm: don't use d3 fw if d0i3 is used Emmanuel Grumbach
2014-04-13 19:20 ` [PATCH 45/47] iwlwifi: mvm: replace leading spaces by tabs Emmanuel Grumbach
2014-04-13 19:20 ` [PATCH 46/47] iwlwifi: mvm: Re-factor enabling uAPSD logic Emmanuel Grumbach
2014-04-13 19:20 ` [PATCH 47/47] iwlwifi: don't disable SCD chain extension on newer devices Emmanuel Grumbach
2014-04-13 19:25 ` pull request: iwlwifi 2014-04-13 Emmanuel Grumbach
2014-04-22 20:07 ` John W. Linville
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=1397416802-32403-17-git-send-email-egrumbach@gmail.com \
--to=egrumbach@gmail.com \
--cc=emmanuel.grumbach@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).