qcacld-3.0: Support link rate for mcs12/13

This is to support he mcs12/13 for 4K QAM.

Change-Id: I07c565498fb99387f7aac3f36103fbc90de67b7f
CRs-Fixed: 2802600
Этот коммит содержится в:
Jingxiang Ge
2020-10-21 16:33:31 +08:00
коммит произвёл snandini
родитель 42ed9ebdf1
Коммит 407de9891a
9 изменённых файлов: 98 добавлений и 16 удалений

Просмотреть файл

@@ -173,11 +173,14 @@ static struct index_vht_data_rate_type supported_vht_mcs_rate_nss2[] = {
};
/*array index points to MCS and array value points respective rssi*/
static int rssi_mcs_tbl[][12] = {
/* MCS 0 1 2 3 4 5 6 7 8 9 10 11*/
{-82, -79, -77, -74, -70, -66, -65, -64, -59, -57, -52, -48}, /* 20 */
{-79, -76, -74, -71, -67, -63, -62, -61, -56, -54, -49, -45}, /* 40 */
{-76, -73, -71, -68, -64, -60, -59, -58, -53, -51, -46, -42} /* 80 */
static int rssi_mcs_tbl[][14] = {
/* MCS 0 1 2 3 4 5 6 7 8 9 10 11 12 13*/
/* 20 */
{-82, -79, -77, -74, -70, -66, -65, -64, -59, -57, -52, -48, -46, -42},
/* 40 */
{-79, -76, -74, -71, -67, -63, -62, -61, -56, -54, -49, -45, -43, -39},
/* 80 */
{-76, -73, -71, -68, -64, -60, -59, -58, -53, -51, -46, -42, -46, -36}
};
static bool get_station_fw_request_needed = true;
@@ -1610,6 +1613,7 @@ static int copy_station_stats_to_adapter(struct hdd_adapter *adapter,
struct wlan_mlme_nss_chains *dynamic_cfg;
uint32_t tx_nss, rx_nss;
struct wlan_objmgr_vdev *vdev;
uint16_t he_mcs_12_13_map;
vdev = hdd_objmgr_get_vdev(adapter);
if (!vdev)
@@ -1688,16 +1692,19 @@ static int copy_station_stats_to_adapter(struct hdd_adapter *adapter,
adapter->hdd_stats.class_a_stat.tx_rate = stats->tx_rate;
adapter->hdd_stats.class_a_stat.rx_rate = stats->rx_rate;
adapter->hdd_stats.class_a_stat.tx_rx_rate_flags = stats->tx_rate_flags;
he_mcs_12_13_map = wlan_vdev_mlme_get_he_mcs_12_13_map(vdev);
adapter->hdd_stats.class_a_stat.tx_mcs_index =
sme_get_mcs_idx(stats->tx_rate, stats->tx_rate_flags,
he_mcs_12_13_map,
&adapter->hdd_stats.class_a_stat.tx_nss,
&adapter->hdd_stats.class_a_stat.tx_dcm,
&adapter->hdd_stats.class_a_stat.tx_gi,
&adapter->hdd_stats.class_a_stat.
tx_mcs_rate_flags);
adapter->hdd_stats.class_a_stat.rx_mcs_index =
sme_get_mcs_idx(stats->rx_rate, stats->tx_rate_flags,
he_mcs_12_13_map,
&adapter->hdd_stats.class_a_stat.rx_nss,
&adapter->hdd_stats.class_a_stat.rx_dcm,
&adapter->hdd_stats.class_a_stat.rx_gi,
@@ -4862,6 +4869,7 @@ bool hdd_report_max_rate(struct hdd_adapter *adapter,
uint16_t max_rate = 0;
uint32_t vht_mcs_map;
bool is_vht20_mcs9 = false;
uint16_t he_mcs_12_13_map = 0;
uint16_t current_rate = 0;
qdf_size_t or_leng = CSR_DOT11_SUPPORTED_RATES_MAX;
uint8_t operational_rates[CSR_DOT11_SUPPORTED_RATES_MAX];
@@ -4951,6 +4959,8 @@ bool hdd_report_max_rate(struct hdd_adapter *adapter,
return false;
}
he_mcs_12_13_map = wlan_vdev_mlme_get_he_mcs_12_13_map(vdev);
hdd_objmgr_put_vdev(vdev);
for (i = 0; i < er_leng; i++) {
@@ -5024,8 +5034,11 @@ bool hdd_report_max_rate(struct hdd_adapter *adapter,
}
if (rate_flags & (TX_RATE_HE20 | TX_RATE_HE40 |
TX_RATE_HE80 | TX_RATE_HE160))
TX_RATE_HE80 | TX_RATE_HE160)) {
max_mcs_idx = 11;
if (he_mcs_12_13_map)
max_mcs_idx = 13;
}
if (rssidx != 0) {
for (i = 0; i <= max_mcs_idx; i++) {

Просмотреть файл

@@ -255,6 +255,23 @@ void lim_update_he_bw_cap_mcs(struct pe_session *session,
HE_MCS_ALL_DISABLED;
}
}
void lim_update_he_mcs_12_13_map(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id, uint16_t he_mcs_12_13_map)
{
struct wlan_objmgr_vdev *vdev;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
WLAN_LEGACY_MAC_ID);
if (!vdev) {
pe_err("vdev not found for id: %d", vdev_id);
return;
}
wlan_vdev_obj_lock(vdev);
wlan_vdev_mlme_set_he_mcs_12_13_map(vdev, he_mcs_12_13_map);
wlan_vdev_obj_unlock(vdev);
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
}
#else
static inline void lim_extract_he_op(struct pe_session *session,
tSirProbeRespBeacon *beacon_struct)
@@ -263,6 +280,11 @@ static void lim_check_is_he_mcs_valid(struct pe_session *session,
tSirProbeRespBeacon *beacon_struct)
{
}
void lim_update_he_mcs_12_13_map(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id, uint16_t he_mcs_12_13_map)
{
}
#endif
void lim_objmgr_update_vdev_nss(struct wlan_objmgr_psoc *psoc,

Просмотреть файл

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2014, 2016, 2018-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2011-2014, 2016, 2018-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
@@ -67,4 +67,14 @@ ePhyChanBondState lim_get_htcb_state(ePhyChanBondState aniCBMode);
void lim_objmgr_update_vdev_nss(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id, uint8_t nss);
/**
* lim_update_he_mcs_12_13_map() - update he_mcs_12_13_map in vdev object
* @psoc: Pointer to Global MAC structure
* @vdev_id: vdev id
* @he_mcs_12_13_map: he mcs 12/13 map
*
* Return: None
*/
void lim_update_he_mcs_12_13_map(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id, uint16_t he_mcs_12_13_map);
#endif /* __LIM_PROP_EXTS_UTILS_H */

Просмотреть файл

@@ -6854,6 +6854,11 @@ void lim_update_stads_he_caps(struct mac_context *mac_ctx,
else
sta_ds->he_mcs_12_13_map &=
mac_ctx->mlme_cfg->he_caps.he_mcs_12_13_supp_5g;
lim_update_he_mcs_12_13_map(mac_ctx->psoc,
session_entry->smeSessionId,
sta_ds->he_mcs_12_13_map);
}
void lim_update_stads_he_6ghz_op(struct pe_session *session,

Просмотреть файл

@@ -3607,6 +3607,7 @@ static inline void sme_reset_he_caps(mac_handle_t mac_handle, uint8_t vdev_id)
* sme_get_mcs_idx() - gets mcs index
* @raw_rate: raw rate from fw
* @rate_flags: rate flags
* @he_mcs_12_13_map: he mcs12/13 map
* @nss: number of nss
* @dcm: dcm will be calculated from rate
* @guard_interval: guard interval info from rate
@@ -3615,6 +3616,7 @@ static inline void sme_reset_he_caps(mac_handle_t mac_handle, uint8_t vdev_id)
* Return: return mcs index
*/
uint8_t sme_get_mcs_idx(uint16_t raw_rate, enum tx_rate_info rate_flags,
uint16_t he_mcs_12_13_map,
uint8_t *nss, uint8_t *dcm,
enum txrate_gi *guard_interval,
enum tx_rate_info *mcs_rate_flags);

Просмотреть файл

@@ -15573,11 +15573,12 @@ void sme_reset_he_caps(mac_handle_t mac_handle, uint8_t vdev_id)
#endif
uint8_t sme_get_mcs_idx(uint16_t raw_rate, enum tx_rate_info rate_flags,
uint16_t he_mcs_12_13_map,
uint8_t *nss, uint8_t *dcm,
enum txrate_gi *guard_interval,
enum tx_rate_info *mcs_rate_flags)
{
return wma_get_mcs_idx(raw_rate, rate_flags,
return wma_get_mcs_idx(raw_rate, rate_flags, he_mcs_12_13_map,
nss, dcm, guard_interval, mcs_rate_flags);
}

Просмотреть файл

@@ -508,6 +508,7 @@ void wma_wmi_stop(void);
* wma_get_mcs_idx() - get mcs index
* @raw_rate: raw rate from fw
* @rate_flags: rate flags
* @he_mcs_12_13_map: he mcs12/13 map
* @nss: nss
* @dcm: dcm
* @guard_interval: guard interval
@@ -516,6 +517,7 @@ void wma_wmi_stop(void);
* Return: mcs index
*/
uint8_t wma_get_mcs_idx(uint16_t raw_rate, enum tx_rate_info rate_flags,
uint16_t he_mcs_12_13_map,
uint8_t *nss, uint8_t *dcm,
enum txrate_gi *guard_interval,
enum tx_rate_info *mcs_rate_flag);

Просмотреть файл

@@ -52,6 +52,7 @@
#define MAX_VHT_MCS_IDX 10
#ifdef WLAN_FEATURE_11AX
#define MAX_HE_MCS_IDX 12
#define MAX_HE_MCS12_13_IDX 14
#endif
#define INVALID_MCS_IDX 255

Просмотреть файл

@@ -66,6 +66,7 @@
#include <../../core/src/vdev_mgr_ops.h>
#include "cdp_txrx_misc.h"
#include <cdp_txrx_host_stats.h>
#include "wlan_mlme_ucfg_api.h"
/* MCS Based rate table */
/* HT MCS parameters with Nss = 1 */
@@ -177,7 +178,15 @@ static struct index_he_data_rate_type he_mcs_nss1[] = {
{11, {{1434, 1354, 1219}, {0} },
{{2868, 2708, 2438}, {0} },
{{6004, 5671, 5104}, {0} },
{{12010, 11342, 10208}, {0} } }
{{12010, 11342, 10208}, {0} } },
{12, {{1549, 1463, 1316}, {0} },
{{3097, 2925, 2633}, {0} },
{{6485, 6125, 5513}, {0} },
{{12971, 12250, 11025}, {0} } },
{13, {{1721, 1625, 1463}, {0} },
{{3441, 3250, 2925}, {0} },
{{7206, 6806, 6125}, {0} },
{{14412, 13611, 12250}, {0} } }
};
/*MCS parameters with Nss = 2*/
@@ -230,7 +239,15 @@ static struct index_he_data_rate_type he_mcs_nss2[] = {
{11, {{2868, 2708, 2438}, {0} },
{{5735, 5417, 4875}, {0} },
{{12010, 11343, 10208}, {0} },
{{24019, 22685, 20416}, {0} } }
{{24019, 22685, 20416}, {0} } },
{12, {{3097, 2925, 2633}, {0} },
{{6194, 5850, 5265}, {0} },
{{12971, 12250, 11025}, {0} },
{{25941, 24500, 22050}, {0} } },
{13, {{3441, 3250, 2925}, {0} },
{{6882, 6500, 5850}, {0} },
{{14412, 13611, 12250}, {0} },
{{28824, 27222, 24500}, {0} } }
};
#endif
@@ -318,6 +335,7 @@ static inline uint16_t wma_mcs_rate_match(uint16_t raw_rate,
* wma_get_mcs_idx() - get mcs index
* @raw_rate: raw rate from fw
* @rate_flags: rate flags
* @he_mcs_12_13_map: he mcs12/13 map
* @nss: nss
* @dcm: dcm
* @guard_interval: guard interval
@@ -328,12 +346,13 @@ static inline uint16_t wma_mcs_rate_match(uint16_t raw_rate,
*/
static uint16_t wma_match_he_rate(uint16_t raw_rate,
enum tx_rate_info rate_flags,
uint16_t he_mcs_12_13_map,
uint8_t *nss, uint8_t *dcm,
enum txrate_gi *guard_interval,
enum tx_rate_info *mcs_rate_flag,
uint8_t *p_index)
{
uint8_t index = 0;
uint8_t index = 0, max_he_mcs_idx;
uint8_t dcm_index_max = 1;
uint8_t dcm_index = 0;
uint16_t match_rate = 0;
@@ -345,7 +364,12 @@ static uint16_t wma_match_he_rate(uint16_t raw_rate,
TX_RATE_HE20)))
return 0;
for (index = 0; index < MAX_HE_MCS_IDX; index++) {
if (he_mcs_12_13_map)
max_he_mcs_idx = MAX_HE_MCS12_13_IDX;
else
max_he_mcs_idx = MAX_HE_MCS_IDX;
for (index = 0; index < max_he_mcs_idx; index++) {
dcm_index_max = IS_MCS_HAS_DCM_RATE(index) ? 2 : 1;
for (dcm_index = 0; dcm_index < dcm_index_max;
@@ -433,6 +457,7 @@ rate_found:
#else
static uint16_t wma_match_he_rate(uint16_t raw_rate,
enum tx_rate_info rate_flags,
uint16_t he_mcs_12_13_map,
uint8_t *nss, uint8_t *dcm,
enum txrate_gi *guard_interval,
enum tx_rate_info *mcs_rate_flag,
@@ -443,6 +468,7 @@ static uint16_t wma_match_he_rate(uint16_t raw_rate,
#endif
uint8_t wma_get_mcs_idx(uint16_t raw_rate, enum tx_rate_info rate_flags,
uint16_t he_mcs_12_13_map,
uint8_t *nss, uint8_t *dcm,
enum txrate_gi *guard_interval,
enum tx_rate_info *mcs_rate_flag)
@@ -452,12 +478,12 @@ uint8_t wma_get_mcs_idx(uint16_t raw_rate, enum tx_rate_info rate_flags,
uint16_t *nss1_rate;
uint16_t *nss2_rate;
wma_debug("Rates from FW: raw_rate:%d rate_flgs: 0x%x, nss: %d",
raw_rate, rate_flags, *nss);
wma_debug("Rates from FW: raw_rate:%d rate_flgs: 0x%x he_mcs_12_13_map: 0x%x nss: %d",
raw_rate, rate_flags, he_mcs_12_13_map, *nss);
*mcs_rate_flag = rate_flags;
match_rate = wma_match_he_rate(raw_rate, rate_flags,
match_rate = wma_match_he_rate(raw_rate, rate_flags, he_mcs_12_13_map,
nss, dcm, guard_interval,
mcs_rate_flag, &index);
if (match_rate)