From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: sara.sharon@intel.com, linux-wireless@vger.kernel.org,
Liad Kaufman <liad.kaufman@intel.com>,
Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH v2 7/9] iwlwifi: mvm: add missing lq_color
Date: Wed, 18 Oct 2017 09:31:12 +0300 [thread overview]
Message-ID: <20171018063112.934-1-luca@coelho.fi> (raw)
In-Reply-To: <20171013132502.10473-8-luca@coelho.fi>
From: Liad Kaufman <liad.kaufman@intel.com>
In the compressed BA notif, the driver didn't parse out
the LQ color, so statistics for the rates tried were
always thrown out. Add it so it gets correctly used.
While at it, fix the name of the relevant field in the
struct.
Fixes: c46e7724bfe9 ("iwlwifi: mvm: support new BA notification response")
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
In v2: a fix by Sari to properly initialize the tid_data lq_color
field to avoid a double usage of the rate scaling macro.
drivers/net/wireless/intel/iwlwifi/fw/api/tx.h | 4 ++--
drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 10 ++++++++++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h b/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h
index 14ad9fb895f9..f5d5ba7e37ec 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h
@@ -710,7 +710,7 @@ enum iwl_mvm_ba_resp_flags {
* @reduced_txp: power reduced according to TPC. This is the actual value and
* not a copy from the LQ command. Thus, if not the first rate was used
* for Tx-ing then this value will be set to 0 by FW.
- * @initial_rate: TLC rate info, initial rate index, TLC table color
+ * @tlc_rate_info: TLC rate info, initial rate index, TLC table color
* @retry_cnt: retry count
* @query_byte_cnt: SCD query byte count
* @query_frame_cnt: SCD query frame count
@@ -730,7 +730,7 @@ struct iwl_mvm_compressed_ba_notif {
__le32 flags;
u8 sta_id;
u8 reduced_txp;
- u8 initial_rate;
+ u8 tlc_rate_info;
u8 retry_cnt;
__le32 query_byte_cnt;
__le16 query_frame_cnt;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index 172b5e63d3fb..35f455ede173 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -1746,6 +1746,7 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
if (iwl_mvm_has_new_tx_api(mvm)) {
struct iwl_mvm_compressed_ba_notif *ba_res =
(void *)pkt->data;
+ u8 lq_color = TX_RES_RATE_TABLE_COL_GET(ba_res->tlc_rate_info);
int i;
sta_id = ba_res->sta_id;
@@ -1759,11 +1760,18 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
if (!le16_to_cpu(ba_res->tfd_cnt))
goto out;
+ rcu_read_lock();
+
+ mvmsta = iwl_mvm_sta_from_staid_rcu(mvm, sta_id);
+ if (!mvmsta)
+ goto out_unlock;
+
/* Free per TID */
for (i = 0; i < le16_to_cpu(ba_res->tfd_cnt); i++) {
struct iwl_mvm_compressed_ba_tfd *ba_tfd =
&ba_res->tfd[i];
+ mvmsta->tid_data[i].lq_color = lq_color;
iwl_mvm_tx_reclaim(mvm, sta_id, ba_tfd->tid,
(int)(le16_to_cpu(ba_tfd->q_num)),
le16_to_cpu(ba_tfd->tfd_index),
@@ -1771,6 +1779,8 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
le32_to_cpu(ba_res->tx_rate));
}
+out_unlock:
+ rcu_read_unlock();
out:
IWL_DEBUG_TX_REPLY(mvm,
"BA_NOTIFICATION Received from sta_id = %d, flags %x, sent:%d, acked:%d\n",
--
2.14.2
next prev parent reply other threads:[~2017-10-18 6:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 13:24 [PATCH 0/9] ] iwlwifi: updates intended for v4.15 2017-10-13 Luca Coelho
2017-10-13 13:24 ` [PATCH 1/9] iwlwifi: mvm: allocate reorder buffer according to need Luca Coelho
2017-10-13 13:24 ` [PATCH 2/9] iwlwifi: mvm: remove duplicated fields in mvm reorder buffer Luca Coelho
2017-10-13 13:24 ` [PATCH 3/9] iwlwifi: mvm: pass baid_data to iwl_mvm_release_frames() Luca Coelho
2017-10-13 13:24 ` [PATCH 4/9] iwlwifi: mvm: allow reading UMAC error data from SMEM in A000 devices Luca Coelho
2017-10-13 13:24 ` [PATCH 5/9] iwlwifi: mvm: move umac_error_event_table validity check to where it's set Luca Coelho
2017-10-13 13:24 ` [PATCH 6/9] iwlwifi: define minimum valid address for umac_error_event_table in cfg Luca Coelho
2017-10-13 13:25 ` [PATCH 7/9] iwlwifi: mvm: add missing lq_color Luca Coelho
2017-10-18 6:31 ` Luca Coelho [this message]
2017-10-13 13:25 ` [PATCH 8/9] iwlwifi: pcie: sort IDs for the 9000 series for easier comparisons Luca Coelho
2017-10-13 13:25 ` [PATCH 9/9] iwlwifi: pcie: remove set but not used variable tcph 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=20171018063112.934-1-luca@coelho.fi \
--to=luca@coelho.fi \
--cc=kvalo@codeaurora.org \
--cc=liad.kaufman@intel.com \
--cc=linux-wireless@vger.kernel.org \
--cc=luciano.coelho@intel.com \
--cc=sara.sharon@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