All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath10k:  Fix setting txpower to zero.
@ 2019-12-12 17:14 ` greearb
  0 siblings, 0 replies; 4+ messages in thread
From: greearb @ 2019-12-12 17:14 UTC (permalink / raw)
  To: linux-wireless, kvalo, ath10k; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

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

This should fix regression in:

commit 88407beb1b1462f706a1950a355fd086e1c450b6
Author: Ryan Hsu <ryanhsu@qca.qualcomm.com>
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.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 289d03da14b2..1c5e1b5570f8 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -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)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ath10k:  Fix setting txpower to zero.
@ 2019-12-12 17:14 ` greearb
  0 siblings, 0 replies; 4+ messages in thread
From: greearb @ 2019-12-12 17:14 UTC (permalink / raw)
  To: linux-wireless, kvalo, ath10k; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

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

This should fix regression in:

commit 88407beb1b1462f706a1950a355fd086e1c450b6
Author: Ryan Hsu <ryanhsu@qca.qualcomm.com>
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.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 289d03da14b2..1c5e1b5570f8 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -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)
-- 
2.20.1


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath10k: Fix setting txpower to zero.
  2019-12-12 17:14 ` greearb
@ 2019-12-13 21:55   ` Ben Greear
  -1 siblings, 0 replies; 4+ messages in thread
From: Ben Greear @ 2019-12-13 21:55 UTC (permalink / raw)
  To: linux-wireless, kvalo, ath10k

On 12/12/19 9:14 AM, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> 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

> 
> This should fix regression in:
> 
> commit 88407beb1b1462f706a1950a355fd086e1c450b6
> Author: Ryan Hsu <ryanhsu@qca.qualcomm.com>
> 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.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
>   drivers/net/wireless/ath/ath10k/mac.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
> index 289d03da14b2..1c5e1b5570f8 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -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)
> 


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath10k: Fix setting txpower to zero.
@ 2019-12-13 21:55   ` Ben Greear
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Greear @ 2019-12-13 21:55 UTC (permalink / raw)
  To: linux-wireless, kvalo, ath10k

On 12/12/19 9:14 AM, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> 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

> 
> This should fix regression in:
> 
> commit 88407beb1b1462f706a1950a355fd086e1c450b6
> Author: Ryan Hsu <ryanhsu@qca.qualcomm.com>
> 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.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
>   drivers/net/wireless/ath/ath10k/mac.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
> index 289d03da14b2..1c5e1b5570f8 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -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)
> 


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-13 21:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-12 17:14 [PATCH] ath10k: Fix setting txpower to zero greearb
2019-12-12 17:14 ` greearb
2019-12-13 21:55 ` Ben Greear
2019-12-13 21:55   ` Ben Greear

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.