All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Gong <quic_wgong@quicinc.com>
To: <ath11k@lists.infradead.org>
Cc: <linux-wireless@vger.kernel.org>, <quic_wgong@quicinc.com>
Subject: [PATCH 15/15] ath11k: send TPC power to firmware for 6 GHz station
Date: Tue, 26 Oct 2021 07:19:13 -0400	[thread overview]
Message-ID: <20211026111913.7346-16-quic_wgong@quicinc.com> (raw)
In-Reply-To: <20211026111913.7346-1-quic_wgong@quicinc.com>

When station is connected to a 6 GHz AP, it has 2 way to configure
the power limit to firmware. The first way is to send 2 wmi command
WMI_PDEV_PARAM_TXPOWER_LIMIT2G/WMI_PDEV_PARAM_TXPOWER_LIMIT5G to
firmware, the second way is to send WMI_VDEV_SET_TPC_POWER_CMDID to
firmware which include more parameters for power control.

The first way is disabled in previous patch
"ath11k: discard BSS_CHANGED_TXPOWER when EXT_TPC_REG_SUPPORT for 6 GHz".

Prepare the parameter for wmi command WMI_VDEV_SET_TPC_POWER_CMDID and
send the firmware after vdev start response success from firmware, it
is for the second way of power control.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1

Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/mac.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 301e08a85f47..88c18ffee7a3 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -5312,6 +5312,12 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif,
 		return ret;
 	}
 
+	if (ath11k_mac_station_support_tpc(ar, arvif, chandef)) {
+		ath11k_mac_fill_reg_tpc_info(ar, arvif->vif, &arvif->chanctx);
+		ath11k_wmi_send_vdev_set_tpc_power(ar, arvif->vdev_id,
+						   &arvif->reg_tpc_info);
+	}
+
 	ar->num_started_vdevs++;
 	ath11k_dbg(ab, ATH11K_DBG_MAC,  "vdev %pM started, vdev_id %d\n",
 		   arvif->vif->addr, arvif->vdev_id);
@@ -6098,7 +6104,7 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
 		if (power_type == IEEE80211_REG_UNSET_AP)
 			power_type = IEEE80211_REG_LPI_AP;
 		ath11k_reg_handle_chan_list(ab, reg_info, power_type);
-
+		arvif->chanctx = *ctx;
 		ath11k_mac_parse_tx_pwr_env(ar, vif, ctx);
 	}
 
-- 
2.31.1


WARNING: multiple messages have this Message-ID (diff)
From: Wen Gong <quic_wgong@quicinc.com>
To: <ath11k@lists.infradead.org>
Cc: <linux-wireless@vger.kernel.org>, <quic_wgong@quicinc.com>
Subject: [PATCH 15/15] ath11k: send TPC power to firmware for 6 GHz station
Date: Tue, 26 Oct 2021 07:19:13 -0400	[thread overview]
Message-ID: <20211026111913.7346-16-quic_wgong@quicinc.com> (raw)
In-Reply-To: <20211026111913.7346-1-quic_wgong@quicinc.com>

When station is connected to a 6 GHz AP, it has 2 way to configure
the power limit to firmware. The first way is to send 2 wmi command
WMI_PDEV_PARAM_TXPOWER_LIMIT2G/WMI_PDEV_PARAM_TXPOWER_LIMIT5G to
firmware, the second way is to send WMI_VDEV_SET_TPC_POWER_CMDID to
firmware which include more parameters for power control.

The first way is disabled in previous patch
"ath11k: discard BSS_CHANGED_TXPOWER when EXT_TPC_REG_SUPPORT for 6 GHz".

Prepare the parameter for wmi command WMI_VDEV_SET_TPC_POWER_CMDID and
send the firmware after vdev start response success from firmware, it
is for the second way of power control.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1

Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/mac.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 301e08a85f47..88c18ffee7a3 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -5312,6 +5312,12 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif,
 		return ret;
 	}
 
+	if (ath11k_mac_station_support_tpc(ar, arvif, chandef)) {
+		ath11k_mac_fill_reg_tpc_info(ar, arvif->vif, &arvif->chanctx);
+		ath11k_wmi_send_vdev_set_tpc_power(ar, arvif->vdev_id,
+						   &arvif->reg_tpc_info);
+	}
+
 	ar->num_started_vdevs++;
 	ath11k_dbg(ab, ATH11K_DBG_MAC,  "vdev %pM started, vdev_id %d\n",
 		   arvif->vif->addr, arvif->vdev_id);
@@ -6098,7 +6104,7 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
 		if (power_type == IEEE80211_REG_UNSET_AP)
 			power_type = IEEE80211_REG_LPI_AP;
 		ath11k_reg_handle_chan_list(ab, reg_info, power_type);
-
+		arvif->chanctx = *ctx;
 		ath11k_mac_parse_tx_pwr_env(ar, vif, ctx);
 	}
 
-- 
2.31.1


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  parent reply	other threads:[~2021-10-26 11:20 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 11:18 [PATCH 00/15] ath11k: add support for 6 GHz station for various modes : LPI, SP and VLP Wen Gong
2021-10-26 11:18 ` Wen Gong
2021-10-26 11:18 ` [PATCH 01/15] ath11k: add support for extended wmi service bit Wen Gong
2021-10-26 11:18   ` Wen Gong
2021-12-09 16:16   ` Kalle Valo
2021-12-09 16:16     ` Kalle Valo
2021-10-26 11:19 ` [PATCH 02/15] ath11k: Add support to parse new wmi event for 6 GHz regulatory Wen Gong
2021-10-26 11:19   ` Wen Gong
2021-12-09 17:21   ` Kalle Valo
2021-12-09 17:21     ` Kalle Valo
2021-10-26 11:19 ` [PATCH 03/15] ath11k: add support to select 6 GHz Regulatory type Wen Gong
2021-10-26 11:19   ` Wen Gong
2021-10-26 11:19 ` [PATCH 04/15] ath11k: allow only one interface up simultaneously for WCN6855 Wen Gong
2021-10-26 11:19   ` Wen Gong
2021-12-09 17:24   ` Kalle Valo
2021-12-09 17:24     ` Kalle Valo
2021-10-26 11:19 ` [PATCH 05/15] ath11k: store cur_regulatory_info for each radio Wen Gong
2021-10-26 11:19   ` Wen Gong
2021-12-09 17:31   ` Kalle Valo
2021-12-09 17:31     ` Kalle Valo
2021-10-26 11:19 ` [PATCH 06/15] ath11k: update regulatory rules when interface added Wen Gong
2021-10-26 11:19   ` Wen Gong
2021-10-26 11:19 ` [PATCH 07/15] ath11k: update regulatory rules when connect to AP on 6 GHz band for station Wen Gong
2021-10-26 11:19   ` Wen Gong
2021-10-26 11:19 ` [PATCH 08/15] ath11k: save power spectral density(psd) of regulatory rule Wen Gong
2021-10-26 11:19   ` Wen Gong
2021-10-26 11:19 ` [PATCH 09/15] ath11k: add parse of transmit power envelope element Wen Gong
2021-10-26 11:19   ` Wen Gong
2021-12-09 17:35   ` Kalle Valo
2021-12-09 17:35     ` Kalle Valo
2021-10-26 11:19 ` [PATCH 10/15] ath11k: save max tx power in vdev start response event from firmware Wen Gong
2021-10-26 11:19   ` Wen Gong
2021-10-26 11:19 ` [PATCH 11/15] ath11k: fill parameters for vdev_set_tpc_power wmi command Wen Gong
2021-10-26 11:19   ` Wen Gong
2021-10-26 11:19 ` [PATCH 12/15] ath11k: add WMI_TLV_SERVICE_EXT_TPC_REG_SUPPORT service bit Wen Gong
2021-10-26 11:19   ` Wen Gong
2021-10-26 11:19 ` [PATCH 13/15] ath11k: discard BSS_CHANGED_TXPOWER when EXT_TPC_REG_SUPPORT for 6 GHz Wen Gong
2021-10-26 11:19   ` Wen Gong
2021-12-09 17:38   ` Kalle Valo
2021-12-09 17:38     ` Kalle Valo
2021-10-26 11:19 ` [PATCH 14/15] ath11k: add handler for WMI_VDEV_SET_TPC_POWER_CMDID Wen Gong
2021-10-26 11:19   ` Wen Gong
2021-12-09 17:40   ` Kalle Valo
2021-12-09 17:40     ` Kalle Valo
2021-10-26 11:19 ` Wen Gong [this message]
2021-10-26 11:19   ` [PATCH 15/15] ath11k: send TPC power to firmware for 6 GHz station Wen Gong
2021-12-09 17:43 ` [PATCH 00/15] ath11k: add support for 6 GHz station for various modes : LPI, SP and VLP Kalle Valo
2021-12-09 17:43   ` 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=20211026111913.7346-16-quic_wgong@quicinc.com \
    --to=quic_wgong@quicinc.com \
    --cc=ath11k@lists.infradead.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.