2021-09-09 14:49:05

by Bryan O'Donoghue

[permalink] [raw]
Subject: [PATCH v2 2/2] wcn36xx: Add ability for wcn36xx_smd_dump_cmd_req to pass two's complement

Qcom documents suggest passing of negative values to the dump command,
however currently we convert from string to u32 not s32, so we cannot pass
a two's complement value to the firmware in this way.

There is in fact only one parameter which takes a two's complement value
<tigger threshold> in the antenna diversity switch command.

Downstream:
iwpriv wlan0 dump 71 3 <schedule period> <trigger threshold> <hysteresis value>

Upstream:
echo "71 3 <schedule period> <trigger threshold> <hysteresis value>" > /sys/kernel/debug/ieee80211/phy0/wcn36xx/dump

Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware")
Signed-off-by: Bryan O'Donoghue <[email protected]>
---
drivers/net/wireless/ath/wcn36xx/debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/debug.c b/drivers/net/wireless/ath/wcn36xx/debug.c
index 389b5e7129a6..6af306ae41ad 100644
--- a/drivers/net/wireless/ath/wcn36xx/debug.c
+++ b/drivers/net/wireless/ath/wcn36xx/debug.c
@@ -120,7 +120,7 @@ static ssize_t write_file_dump(struct file *file,
if (begin == NULL)
break;

- if (kstrtou32(begin, 0, &arg[i]) != 0)
+ if (kstrtos32(begin, 0, &arg[i]) != 0)
break;
}

--
2.33.0


2021-09-09 15:30:07

by Loic Poulain

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] wcn36xx: Add ability for wcn36xx_smd_dump_cmd_req to pass two's complement

On Thu, 9 Sept 2021 at 16:42, Bryan O'Donoghue
<[email protected]> wrote:
>
> Qcom documents suggest passing of negative values to the dump command,
> however currently we convert from string to u32 not s32, so we cannot pass
> a two's complement value to the firmware in this way.
>
> There is in fact only one parameter which takes a two's complement value
> <tigger threshold> in the antenna diversity switch command.
>
> Downstream:
> iwpriv wlan0 dump 71 3 <schedule period> <trigger threshold> <hysteresis value>
>
> Upstream:
> echo "71 3 <schedule period> <trigger threshold> <hysteresis value>" > /sys/kernel/debug/ieee80211/phy0/wcn36xx/dump
>
> Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware")
> Signed-off-by: Bryan O'Donoghue <[email protected]>

Reviewed-by: Loic Poulain <[email protected]>