qcacld-3.0: Add support to configure rate mask to cap phy rate

The ini ratemask_type and ratemask_set can be used to limit
the maximum phy rate. The ratemask_type is used to select
the phy mode and the ratemask_set to select desired NSS and MCS.

It can be used to optimize link performance.

Change-Id: Ia5c9f3a80eb93710bdcf53dabc4a45e554753b01
CRs-Fixed: 2758859
This commit is contained in:
Madhvapathi Sriram
2020-03-13 11:47:46 -07:00
committed by snandini
vanhempi fd6093151e
commit fce3c2b2b4
4 muutettua tiedostoa jossa 220 lisäystä ja 2 poistoa

Näytä tiedosto

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -30,6 +30,7 @@
#define CFG_SUPPORTED_MCS_SET_LEN 16
#define CFG_BASIC_MCS_SET_LEN 16
#define CFG_CURRENT_MCS_SET_LEN 16
#define CFG_MLME_RATE_MASK_LEN 4
/*
* <ini>
@@ -221,6 +222,78 @@
CFG_CURRENT_MCS_SET_DATA, \
"current MCS set")
/*
* <cfg>
* ratemask_type - PHY type for the ratemask.
* @Min: 0 No rate mask set defined - disabled the configuration
* @Max: 4
* @Default: 0
*
* This ini is used to set the PHY type for ratemask in rate selection.
*
* 0 = Disables the configuration
* 1 = The rate mask specified is for CCK/OFDM configuration
* 2 = The rate mask specified is for HT configuration
* 3 = The rate mask specified is for VHT configuration
* 4 = The rate mask specified is for HE/11ax configuration
*
* Related: CFG_RATEMASK_SET
*
* Usage: External
*/
#define CFG_RATEMASK_TYPE CFG_INI_UINT( \
"ratemask_type", \
0, \
4, \
0, \
CFG_VALUE_OR_DEFAULT, \
"Ratemask type")
/*
* <cfg>
* ratemask_set - ratemasks for a PHY type used in rate selection
* @Min: default data length of ratemask in string format
* @Max: default data length of ratemask in string format
* @Default: 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF
*
* This is used to set the rate mask value to be used in rate selection.
* Each of the four words must be configured.
* A bit value of 1 represents rate is enabled
* A bit value of 0 represents rate is disabled
*
* [b31-b0],[b63-b32],[b95-b64],[b127-b96]
* For HE targets, 12 bits correpond to one NSS setting. Ex:
* b0-13 => NSS1, MCS 0-13
* b14-27 => NSS2, MCS 0-13 and so on for other NSS.
* Note that the bit representation is continuous.
*
* For VHT targets, 10 bits correspond to one NSS setting.
* b0-9 => NSS1, MCS 0-9
* b10-19 => NSS2, MCS 0-9 and so on for other NSS.
*
* For HT targets, 8 bits correspond to one NSS setting.
* b0-7 => NSS1, MCS 0-7
* b8-15 => NSS2, MCS 0-7 and so on for other NSS.
*
* For OFDM/CCK targets, 8 bits correspond to one NSS setting.
* Bit position |-b3-|-b2-|-b1-|-b0-|
* Rates in Mbps |-1 -|-2 -|-5.5|-11-| CCK Rates
*
* Bit position |-b11-|-b10-|-b09-|-b08-|-b07-|-b06-|-b05-|-b04-|
* Rates in Mbps |- 9 -|- 18-|-36 -|-54 -|- 6 -|-12 -| -24-|-48- | OFDM Rates
*
* Related: CFG_RATEMASK_TYPE
*
* Usage: External
*/
#define CFG_RATEMASK_DATA "0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF"
#define CFG_RATEMASK_SET CFG_INI_STRING( \
"ratemask_set", \
0, \
sizeof(CFG_RATEMASK_DATA) - 1, \
CFG_RATEMASK_DATA, \
"Ratemasks for rate selection")
#define CFG_RATES_ALL \
CFG(CFG_MAX_HT_MCS_FOR_TX_DATA) \
CFG(CFG_DISABLE_ABG_RATE_FOR_TX_DATA) \
@@ -232,6 +305,8 @@
CFG(CFG_SUPPORTED_RATES_11A) \
CFG(CFG_SUPPORTED_MCS_SET) \
CFG(CFG_BASIC_MCS_SET) \
CFG(CFG_CURRENT_MCS_SET)
CFG(CFG_CURRENT_MCS_SET) \
CFG(CFG_RATEMASK_TYPE) \
CFG(CFG_RATEMASK_SET)
#endif /* __CFG_MLME_RATES_H */

Näytä tiedosto

@@ -1131,6 +1131,42 @@ struct wlan_mlme_chainmask {
bool enable_bt_chain_separation;
};
/**
* enum wlan_mlme_ratemask_type: Type of PHY for ratemask
* @WLAN_MLME_RATEMASK_TYPE_NO_MASK: no ratemask set
* @WLAN_MLME_RATEMASK_TYPE_CCK: CCK/OFDM rate
* @WLAN_MLEM_RATEMASK_TYPE_HT: HT rate
* @WLAN_MLME_RATEMASK_TYPE_VHT: VHT rate
* @WLAN_MLME_RATEMASK_TYPE_HE: HE rate
*
* This is used for 'type' values in wlan_mlme_ratemask
*/
enum wlan_mlme_ratemask_type {
WLAN_MLME_RATEMASK_TYPE_NO_MASK = 0,
WLAN_MLME_RATEMASK_TYPE_CCK = 1,
WLAN_MLME_RATEMASK_TYPE_HT = 2,
WLAN_MLME_RATEMASK_TYPE_VHT = 3,
WLAN_MLME_RATEMASK_TYPE_HE = 4,
/* keep this last */
WLAN_MLME_RATEMASK_TYPE_MAX,
};
/**
* struct wlan_mlme_ratemask - ratemask config parameters
* @type: Type of PHY the mask to be applied
* @lower32: Lower 32 bits in the 1st 64-bit value
* @higher32: Higher 32 bits in the 1st 64-bit value
* @lower32_2: Lower 32 bits in the 2nd 64-bit value
* @higher32_2: Higher 32 bits in the 2nd 64-bit value
*/
struct wlan_mlme_ratemask {
enum wlan_mlme_ratemask_type type;
uint32_t lower32;
uint32_t higher32;
uint32_t lower32_2;
uint32_t higher32_2;
};
/* struct wlan_mlme_generic - Generic CFG config items
*
* @band_capability: HW Band Capability - Both or 2.4G only or 5G only
@@ -2333,6 +2369,7 @@ struct wlan_mlme_cfg {
struct wlan_mlme_reg reg;
struct roam_trigger_score_delta trig_score_delta[NUM_OF_ROAM_TRIGGERS];
struct roam_trigger_min_rssi trig_min_rssi[NUM_OF_ROAM_TRIGGERS];
struct wlan_mlme_ratemask ratemask_cfg;
};
enum pkt_origin {