wcn36xx: Setup starting bitrate to MCS-5
authorLoic Poulain <loic.poulain@linaro.org>
Tue, 25 Aug 2020 08:49:01 +0000 (10:49 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 27 Aug 2020 10:14:19 +0000 (13:14 +0300)
By default, after associated to an AP, the wcn36xx bitrate adjustment
algorithm starts sending data at 1Mbps, and increases the rate slowly
(1Mbps, 2Mbps, 6Mbps...) over the further TX packets.

Starting at 1Mbps usually causes the initial throughput to be really
low and the maximum possible bitrate to be reached after about hundreed
of TX packets.

That can be improved by setting a different initial bitrate for data
packets via the ENABLE_DYNAMIC_RA_START_RATE configuration value, this
value can be a legacy or MCS rate.

This patch sets the starting bitrate value to MCS-5, which seems to be
a good compromise given it can be quickly adjusted low or up if necessary.
(and based on what I observed in the wild with some mobile devices)

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1598345341-4505-1-git-send-email-loic.poulain@linaro.org
drivers/net/wireless/ath/wcn36xx/hal.h
drivers/net/wireless/ath/wcn36xx/smd.c

index aab5a58..30476f8 100644 (file)
@@ -728,6 +728,14 @@ enum pe_stats_mask {
 #define WCN36XX_HAL_CFG_ENABLE_TDLS_OXYGEN_MODE                104
 #define WCN36XX_HAL_CFG_MAX_PARAMS                     105
 
+/* Specify the starting bitrate, 11B and 11A/G rates can be specified in
+ * multiples of 0.5 So for 5.5 mbps => 11. for MCS 0 - 7 rates, Bit 7 should
+ * set to 1 and Bit 0-6 represent the MCS index. so for MCS2 => 130.
+ * Any invalid non-zero value or unsupported rate will set the start rate
+ * to 6 mbps.
+ */
+#define WCN36XX_HAL_CFG_ENABLE_DYNAMIC_RA_START_RATE   210
+
 /* Message definitons - All the messages below need to be packed */
 
 /* Definition for HAL API Version. */
index 5a565f1..92ae775 100644 (file)
@@ -77,6 +77,7 @@ static struct wcn36xx_cfg_val wcn36xx_cfg_vals[] = {
        WCN36XX_CFG_VAL(BTC_STATIC_LEN_LE_WLAN, 30000),
        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 */
 };
 
 static int put_cfg_tlv_u32(struct wcn36xx *wcn, size_t *len, u32 id, u32 value)