Skip to contentSkip to conversation

ath10k: Fix setting txpower to zero.

PATCH In review [email protected] 1 participant 2 messages Dec 12, 2019 – Dec 13, 2019 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: Fix setting txpower to zero.

From: Ben Greear <[email protected]>

Do not ignore 0 txpower setting unless the vif is of type p2p.

This should fix regression in:

commit 88407beb1b1462f706a1950a355fd086e1c450b6

Author: Ryan Hsu <[email protected]>
Date:   Tue Dec 13 14:55:19 2016 -0800

ath10k: fix incorrect txpower set by P2P_DEVICE interface

Tested (without p2p in use) on 9984 with ath10k-ct firmware, but I don't think this is firmware specific.

---
 drivers/net/wireless/ath/ath10k/mac.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/mac.c +8 -1
index 289d03da14b2..1c5e1b5570f8 100644
@@ -5902,11 +5902,18 @@ static int ath10k_mac_txpower_recalc(struct ath10k *ar)
 {
 	struct ath10k_vif *arvif;
 	int ret, txpower = -1;
+	int p2p_st;
+
+	p2p_st = ath10k_wmi_get_vdev_subtype(ar, WMI_VDEV_SUBTYPE_P2P_DEVICE);
 
 	lockdep_assert_held(&ar->conf_mutex);
 
 	list_for_each_entry(arvif, &ar->arvifs, list) {
-		if (arvif->txpower <= 0)
+		/* p2p may not initialize txpower, and we should ignore it
+		 * in that case.
+		 */
+		if ((arvif->txpower < 0) ||
+		    ((arvif->txpower == 0) && (arvif->vdev_subtype == p2p_st)))
 			continue;
 
 		if (txpower == -1)
Signature · 1 line
2.20.1
author
#1 lore raw
Quoted 3 lines · On 12/12/19 9:14 AM, [email protected] wrote:

From: Ben Greear <[email protected]>

Do not ignore 0 txpower setting unless the vif is of type p2p.

My patch has problems I think: secondary stations also have un-init txpower when they are first built and start scanning.

So, I'm going to try setting txpower to -1 in mac80211 and use that to mean 'unset'.

Thanks,
Ben

Quoted 42 lines

This should fix regression in:

commit 88407beb1b1462f706a1950a355fd086e1c450b6

Author: Ryan Hsu <[email protected]>
Date:   Tue Dec 13 14:55:19 2016 -0800

ath10k: fix incorrect txpower set by P2P_DEVICE interface

Tested (without p2p in use) on 9984 with ath10k-ct firmware, but I don't think this is firmware specific.

---
  drivers/net/wireless/ath/ath10k/mac.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/mac.c +8 -1
index 289d03da14b2..1c5e1b5570f8 100644
@@ -5902,11 +5902,18 @@ static int ath10k_mac_txpower_recalc(struct ath10k *ar)
  {
  	struct ath10k_vif *arvif;
  	int ret, txpower = -1;
+	int p2p_st;
+
+	p2p_st = ath10k_wmi_get_vdev_subtype(ar, WMI_VDEV_SUBTYPE_P2P_DEVICE);
 
  	lockdep_assert_held(&ar->conf_mutex);
 
  	list_for_each_entry(arvif, &ar->arvifs, list) {
-		if (arvif->txpower <= 0)
+		/* p2p may not initialize txpower, and we should ignore it
+		 * in that case.
+		 */
+		if ((arvif->txpower < 0) ||
+		    ((arvif->txpower == 0) && (arvif->vdev_subtype == p2p_st)))
  			continue;
 
  		if (txpower == -1)
Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com