diff mbox series

[v2,1/3] wcn36xx: Set LINK_FAIL_TX_CNT to 1000 on all wcn36xx

Message ID 20201103121735.291324-2-bryan.odonoghue@linaro.org (mailing list archive)
State Accepted
Commit e24eedc09f14a533439f7f2b92273238b9ac5096
Delegated to: Kalle Valo
Headers show
Series wcn36xx: Firmware link monitor/keepalive offload | expand

Commit Message

Bryan O'Donoghue Nov. 3, 2020, 12:17 p.m. UTC
The firmware parameter LINK_FAIL_TX_CNT maps to the prima configuration
file parameter gLinkFailTxCnt and is described as:

quote: " If within gLinkFailTimeout period(values is mentioned in msec) if
         FW doesn't receive acks for gLinkFailTxCnt number of packets, then
         link will be disconnected."

The downstream description sets a minimum value of 1000 a maximum value of
60000 and a default value of 6000, however it appears that unless we
actually set this value deliberately firmware defaults it to 0.

Setting this value to non-zero results in the firmware doing link
monitoring. The working example from downstream paradoxically sets the
value to 200, here we opt to set the value to the minimum stipulated in the
configuration file 1000.

In conjunction with ieee80211_hw_set(wcn->hw, CONNECTION_MONITOR); this
change effects offload of link monitoring to the firmware.

Tested with:
'CNSS-PR-2-0-1-2-c1-74-130449-3' wcn3620
'CNSS-PR-2-0-1-2-c1-00083'       wcn3680

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Kalle Valo Nov. 7, 2020, 8:09 a.m. UTC | #1
Bryan O'Donoghue <bryan.odonoghue@linaro.org> wrote:

> The firmware parameter LINK_FAIL_TX_CNT maps to the prima configuration
> file parameter gLinkFailTxCnt and is described as:
> 
> quote: " If within gLinkFailTimeout period(values is mentioned in msec) if
>          FW doesn't receive acks for gLinkFailTxCnt number of packets, then
>          link will be disconnected."
> 
> The downstream description sets a minimum value of 1000 a maximum value of
> 60000 and a default value of 6000, however it appears that unless we
> actually set this value deliberately firmware defaults it to 0.
> 
> Setting this value to non-zero results in the firmware doing link
> monitoring. The working example from downstream paradoxically sets the
> value to 200, here we opt to set the value to the minimum stipulated in the
> configuration file 1000.
> 
> In conjunction with ieee80211_hw_set(wcn->hw, CONNECTION_MONITOR); this
> change effects offload of link monitoring to the firmware.
> 
> Tested with:
> 'CNSS-PR-2-0-1-2-c1-74-130449-3' wcn3620
> 'CNSS-PR-2-0-1-2-c1-00083'       wcn3680
> 
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

3 patches applied to ath-next branch of ath.git, thanks.

e24eedc09f14 wcn36xx: Set LINK_FAIL_TX_CNT to 1000 on all wcn36xx
8def9ec46a5f wcn36xx: Enable firmware link monitoring
5336fad96e8f wcn36xx: Enable firmware offloaded keepalive
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 766400f7b61c..8ff1eda8f942 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -78,6 +78,7 @@  static struct wcn36xx_cfg_val wcn36xx_cfg_vals[] = {
 	WCN36XX_CFG_VAL(MAX_ASSOC_LIMIT, 10),
 	WCN36XX_CFG_VAL(ENABLE_MCC_ADAPTIVE_SCHEDULER, 0),
 	WCN36XX_CFG_VAL(ENABLE_DYNAMIC_RA_START_RATE, 133), /* MCS 5 */
+	WCN36XX_CFG_VAL(LINK_FAIL_TX_CNT, 1000),
 };
 
 static struct wcn36xx_cfg_val wcn3680_cfg_vals[] = {
@@ -162,7 +163,7 @@  static struct wcn36xx_cfg_val wcn3680_cfg_vals[] = {
 	WCN36XX_CFG_VAL(ENABLE_RTSCTS_HTVHT, 0),
 	WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN, 30000),
 	WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_IDLE_BT_LEN, 120000),
-	WCN36XX_CFG_VAL(LINK_FAIL_TX_CNT, 200),
+	WCN36XX_CFG_VAL(LINK_FAIL_TX_CNT, 1000),
 	WCN36XX_CFG_VAL(TOGGLE_ARP_BDRATES, 0),
 	WCN36XX_CFG_VAL(OPTIMIZE_CA_EVENT, 0),
 	WCN36XX_CFG_VAL(EXT_SCAN_CONC_MODE, 0),