Commit 3a84b69e authored by Eliad Peller's avatar Eliad Peller Committed by Emmanuel Grumbach

iwlwifi: mvm: add lq_cmd/tx_resp reduced_tpc field

The fw recently added an option to set tx power reduction
per station (in the lq_cmd command), and get the tx power
reduction used (in the tx_resp struct).

Use them and propogate this value up to mac80211's tx
response (in order to use it later in the rate-scaling
algorithm).
Signed-off-by: default avatarEliad Peller <eliadx.peller@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent e7f76340
...@@ -334,7 +334,7 @@ enum { ...@@ -334,7 +334,7 @@ enum {
*/ */
struct iwl_lq_cmd { struct iwl_lq_cmd {
u8 sta_id; u8 sta_id;
u8 reserved1; u8 reduced_tpc;
u16 control; u16 control;
/* LINK_QUAL_GENERAL_PARAMS_API_S_VER_1 */ /* LINK_QUAL_GENERAL_PARAMS_API_S_VER_1 */
u8 flags; u8 flags;
......
...@@ -482,7 +482,8 @@ struct iwl_mvm_tx_resp { ...@@ -482,7 +482,8 @@ struct iwl_mvm_tx_resp {
u8 pa_integ_res_b[3]; u8 pa_integ_res_b[3];
u8 pa_integ_res_c[3]; u8 pa_integ_res_c[3];
__le16 measurement_req_id; __le16 measurement_req_id;
__le16 reserved; u8 reduced_tpc;
u8 reserved;
__le32 tfd_info; __le32 tfd_info;
__le16 seq_ctl; __le16 seq_ctl;
......
...@@ -253,6 +253,8 @@ enum iwl_mvm_agg_state { ...@@ -253,6 +253,8 @@ enum iwl_mvm_agg_state {
* This is basically (last acked packet++). * This is basically (last acked packet++).
* @rate_n_flags: Rate at which Tx was attempted. Holds the data between the * @rate_n_flags: Rate at which Tx was attempted. Holds the data between the
* Tx response (TX_CMD), and the block ack notification (COMPRESSED_BA). * Tx response (TX_CMD), and the block ack notification (COMPRESSED_BA).
* @reduced_tpc: Reduced tx power. Holds the data between the
* Tx response (TX_CMD), and the block ack notification (COMPRESSED_BA).
* @state: state of the BA agreement establishment / tear down. * @state: state of the BA agreement establishment / tear down.
* @txq_id: Tx queue used by the BA session * @txq_id: Tx queue used by the BA session
* @ssn: the first packet to be sent in AGG HW queue in Tx AGG start flow, or * @ssn: the first packet to be sent in AGG HW queue in Tx AGG start flow, or
...@@ -265,6 +267,7 @@ struct iwl_mvm_tid_data { ...@@ -265,6 +267,7 @@ struct iwl_mvm_tid_data {
u16 next_reclaimed; u16 next_reclaimed;
/* The rest is Tx AGG related */ /* The rest is Tx AGG related */
u32 rate_n_flags; u32 rate_n_flags;
u8 reduced_tpc;
enum iwl_mvm_agg_state state; enum iwl_mvm_agg_state state;
u16 txq_id; u16 txq_id;
u16 ssn; u16 ssn;
......
...@@ -636,6 +636,10 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm, ...@@ -636,6 +636,10 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm,
seq_ctl = le16_to_cpu(hdr->seq_ctrl); seq_ctl = le16_to_cpu(hdr->seq_ctrl);
} }
BUILD_BUG_ON(ARRAY_SIZE(info->status.status_driver_data) < 1);
info->status.status_driver_data[0] =
(void *)(uintptr_t)tx_resp->reduced_tpc;
ieee80211_tx_status_ni(mvm->hw, skb); ieee80211_tx_status_ni(mvm->hw, skb);
} }
...@@ -815,6 +819,7 @@ static void iwl_mvm_rx_tx_cmd_agg(struct iwl_mvm *mvm, ...@@ -815,6 +819,7 @@ static void iwl_mvm_rx_tx_cmd_agg(struct iwl_mvm *mvm,
struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
mvmsta->tid_data[tid].rate_n_flags = mvmsta->tid_data[tid].rate_n_flags =
le32_to_cpu(tx_resp->initial_rate); le32_to_cpu(tx_resp->initial_rate);
mvmsta->tid_data[tid].reduced_tpc = tx_resp->reduced_tpc;
} }
rcu_read_unlock(); rcu_read_unlock();
...@@ -928,6 +933,8 @@ int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb, ...@@ -928,6 +933,8 @@ int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
info->status.ampdu_len = ba_notif->txed; info->status.ampdu_len = ba_notif->txed;
iwl_mvm_hwrate_to_tx_status(tid_data->rate_n_flags, iwl_mvm_hwrate_to_tx_status(tid_data->rate_n_flags,
info); info);
info->status.status_driver_data[0] =
(void *)(uintptr_t)tid_data->reduced_tpc;
} }
} }
......
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