Commit 41fd2fec authored by Liad Kaufman's avatar Liad Kaufman Committed by Luca Coelho

iwlwifi: mvm: add missing lq_color

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: c46e7724 ("iwlwifi: mvm: support new BA notification response")
Signed-off-by: default avatarLiad Kaufman <liad.kaufman@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 3485e76e
...@@ -710,7 +710,7 @@ enum iwl_mvm_ba_resp_flags { ...@@ -710,7 +710,7 @@ enum iwl_mvm_ba_resp_flags {
* @reduced_txp: power reduced according to TPC. This is the actual value and * @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 * 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. * 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 * @retry_cnt: retry count
* @query_byte_cnt: SCD query byte count * @query_byte_cnt: SCD query byte count
* @query_frame_cnt: SCD query frame count * @query_frame_cnt: SCD query frame count
...@@ -730,7 +730,7 @@ struct iwl_mvm_compressed_ba_notif { ...@@ -730,7 +730,7 @@ struct iwl_mvm_compressed_ba_notif {
__le32 flags; __le32 flags;
u8 sta_id; u8 sta_id;
u8 reduced_txp; u8 reduced_txp;
u8 initial_rate; u8 tlc_rate_info;
u8 retry_cnt; u8 retry_cnt;
__le32 query_byte_cnt; __le32 query_byte_cnt;
__le16 query_frame_cnt; __le16 query_frame_cnt;
......
...@@ -1746,6 +1746,7 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) ...@@ -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)) { if (iwl_mvm_has_new_tx_api(mvm)) {
struct iwl_mvm_compressed_ba_notif *ba_res = struct iwl_mvm_compressed_ba_notif *ba_res =
(void *)pkt->data; (void *)pkt->data;
u8 lq_color = TX_RES_RATE_TABLE_COL_GET(ba_res->tlc_rate_info);
int i; int i;
sta_id = ba_res->sta_id; 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) ...@@ -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)) if (!le16_to_cpu(ba_res->tfd_cnt))
goto out; goto out;
rcu_read_lock();
mvmsta = iwl_mvm_sta_from_staid_rcu(mvm, sta_id);
if (!mvmsta)
goto out_unlock;
/* Free per TID */ /* Free per TID */
for (i = 0; i < le16_to_cpu(ba_res->tfd_cnt); i++) { for (i = 0; i < le16_to_cpu(ba_res->tfd_cnt); i++) {
struct iwl_mvm_compressed_ba_tfd *ba_tfd = struct iwl_mvm_compressed_ba_tfd *ba_tfd =
&ba_res->tfd[i]; &ba_res->tfd[i];
mvmsta->tid_data[i].lq_color = lq_color;
iwl_mvm_tx_reclaim(mvm, sta_id, ba_tfd->tid, iwl_mvm_tx_reclaim(mvm, sta_id, ba_tfd->tid,
(int)(le16_to_cpu(ba_tfd->q_num)), (int)(le16_to_cpu(ba_tfd->q_num)),
le16_to_cpu(ba_tfd->tfd_index), 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) ...@@ -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)); le32_to_cpu(ba_res->tx_rate));
} }
out_unlock:
rcu_read_unlock();
out: out:
IWL_DEBUG_TX_REPLY(mvm, IWL_DEBUG_TX_REPLY(mvm,
"BA_NOTIFICATION Received from sta_id = %d, flags %x, sent:%d, acked:%d\n", "BA_NOTIFICATION Received from sta_id = %d, flags %x, sent:%d, acked:%d\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment