linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: ath9k: fix LNA selection in ath_ant_try_scan()
@ 2023-12-11 17:24 Dmitry Antipov
  2023-12-15 11:24 ` Toke Høiland-Jørgensen
  2023-12-18 18:46 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Antipov @ 2023-12-11 17:24 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen 
  Cc: Kalle Valo, lvc-project, linux-wireless, Dmitry Antipov

In 'ath_ant_try_scan()', (most likely) the 2nd LNA's signal
strength should be used in comparison against RSSI when
selecting first LNA as the main one. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
 drivers/net/wireless/ath/ath9k/antenna.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
index 988222cea9df..acc84e6711b0 100644
--- a/drivers/net/wireless/ath/ath9k/antenna.c
+++ b/drivers/net/wireless/ath/ath9k/antenna.c
@@ -643,7 +643,7 @@ static void ath_ant_try_scan(struct ath_ant_comb *antcomb,
 				conf->main_lna_conf = ATH_ANT_DIV_COMB_LNA1;
 				conf->alt_lna_conf = ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2;
 			} else if (antcomb->rssi_sub >
-				   antcomb->rssi_lna1) {
+				   antcomb->rssi_lna2) {
 				/* set to A-B */
 				conf->main_lna_conf = ATH_ANT_DIV_COMB_LNA1;
 				conf->alt_lna_conf = ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2;
-- 
2.43.0


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

* Re: [PATCH] wifi: ath9k: fix LNA selection in ath_ant_try_scan()
  2023-12-11 17:24 [PATCH] wifi: ath9k: fix LNA selection in ath_ant_try_scan() Dmitry Antipov
@ 2023-12-15 11:24 ` Toke Høiland-Jørgensen
  2023-12-18 18:46 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Toke Høiland-Jørgensen @ 2023-12-15 11:24 UTC (permalink / raw)
  To: Dmitry Antipov; +Cc: Kalle Valo, lvc-project, linux-wireless, Dmitry Antipov

Dmitry Antipov <dmantipov@yandex.ru> writes:

> In 'ath_ant_try_scan()', (most likely) the 2nd LNA's signal
> strength should be used in comparison against RSSI when
> selecting first LNA as the main one. Compile tested only.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>

Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>

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

* Re: [PATCH] wifi: ath9k: fix LNA selection in ath_ant_try_scan()
  2023-12-11 17:24 [PATCH] wifi: ath9k: fix LNA selection in ath_ant_try_scan() Dmitry Antipov
  2023-12-15 11:24 ` Toke Høiland-Jørgensen
@ 2023-12-18 18:46 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2023-12-18 18:46 UTC (permalink / raw)
  To: Dmitry Antipov
  Cc: Toke Høiland-Jørgensen , lvc-project, linux-wireless,
	Dmitry Antipov

Dmitry Antipov <dmantipov@yandex.ru> wrote:

> In 'ath_ant_try_scan()', (most likely) the 2nd LNA's signal
> strength should be used in comparison against RSSI when
> selecting first LNA as the main one. Compile tested only.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

d6b27eb997ef wifi: ath9k: fix LNA selection in ath_ant_try_scan()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20231211172502.25202-1-dmantipov@yandex.ru/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2023-12-18 18:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-11 17:24 [PATCH] wifi: ath9k: fix LNA selection in ath_ant_try_scan() Dmitry Antipov
2023-12-15 11:24 ` Toke Høiland-Jørgensen
2023-12-18 18:46 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).