qcacld-3.0: Add API to get max mcs index

Add a new field max_mcs_index in mlme_legacy_priv to save max mcs
index of current vdev.
Add a new field max_real_mcs_idx in hdd_station_info to save max
mcs index of the connected station.

Change-Id: I28908515cbe5c18c79f14f8645defd5c82e3a6f0
CRs-Fixed: 3065838
This commit is contained in:
Bing Sun
2022-04-06 19:13:21 +08:00
committed by Madan Koyyalamudi
parent b5ba99c5aa
commit 6df47a0d95
24 changed files with 388 additions and 97 deletions

View File

@@ -3520,4 +3520,46 @@ wlan_mlme_get_user_mcc_duty_cycle_percentage(struct wlan_objmgr_psoc *psoc)
return 0;
}
#endif /* WLAN_FEATURE_MCC_QUOTA */
/**
* mlme_get_max_he_mcs_idx() - get max mcs index from he cap information
* @mcs_ch_width: channel width
* @hecap_rxmcsnssmap: rx mcs map from he cap
* @hecap_txmcsnssmap: tx mcs map from he cap
*
* Return: the maximum MCS supported
*/
uint8_t mlme_get_max_he_mcs_idx(enum phy_ch_width mcs_ch_width,
u_int16_t *hecap_rxmcsnssmap,
u_int16_t *hecap_txmcsnssmap);
/**
* mlme_get_max_vht_mcs_idx() - get max mcs index from vht cap information
* @rx_vht_mcs_map: rx mcs map from vht cap
* @tx_vht_mcs_map: tx mcs map from vht cap
*
* Return: the maximum MCS supported
*/
uint8_t mlme_get_max_vht_mcs_idx(u_int16_t rx_vht_mcs_map,
u_int16_t tx_vht_mcs_map);
#ifdef WLAN_FEATURE_SON
/**
* mlme_set_vdev_max_mcs_idx() - Save max mcs index of vdev
* @vdev: pointer to vdev object
* @max_mcs_idx: max_mcs_idx to save
*
* Return: QDF Status
*/
QDF_STATUS mlme_save_vdev_max_mcs_idx(struct wlan_objmgr_vdev *vdev,
uint8_t max_mcs_idx);
/**
* mlme_get_vdev_max_mcs_idx() - Get max mcs index of vdev
* @vdev: pointer to vdev object
*
* Return max mcs index of vdev
*/
uint8_t mlme_get_vdev_max_mcs_idx(struct wlan_objmgr_vdev *vdev);
#endif /* WLAN_FEATURE_SON */
#endif /* _WLAN_MLME_API_H_ */

View File

@@ -104,6 +104,11 @@
/* Default beacon interval of 100 ms */
#define CUSTOM_CONC_GO_BI 100
#define HECAP_TXRX_MCS_NSS_IDX_80 (0)
#define HECAP_TXRX_MCS_NSS_IDX_160 (1)
#define HECAP_TXRX_MCS_NSS_IDX_80_80 (2)
#define INVALID_MCS_NSS_INDEX 0xff
enum diagwlan_status_eventsubtype {
DIAG_WLAN_STATUS_CONNECT = 0,
DIAG_WLAN_STATUS_DISCONNECT

View File

@@ -4530,4 +4530,18 @@ ucfg_mlme_get_wds_mode(struct wlan_objmgr_psoc *psoc)
{
return wlan_mlme_get_wds_mode(psoc);
}
#ifdef WLAN_FEATURE_SON
/**
* ucfg_mlme_get_vdev_max_mcs_idx() - Get max mcs idx of given vdev
* @vdev: pointer to vdev object
*
* Return: max mcs idx of given vdev
*/
static inline uint8_t
ucfg_mlme_get_vdev_max_mcs_idx(struct wlan_objmgr_vdev *vdev)
{
return mlme_get_vdev_max_mcs_idx(vdev);
}
#endif /* WLAN_FEATURE_SON */
#endif /* _WLAN_MLME_UCFG_API_H_ */

View File

@@ -5607,3 +5607,101 @@ wlan_mlme_get_user_mcc_duty_cycle_percentage(struct wlan_objmgr_psoc *psoc)
return quota_value;
}
#endif /* WLAN_FEATURE_MCC_QUOTA */
uint8_t mlme_get_max_he_mcs_idx(enum phy_ch_width mcs_ch_width,
u_int16_t *hecap_rxmcsnssmap,
u_int16_t *hecap_txmcsnssmap)
{
uint8_t rx_max_mcs, tx_max_mcs, max_mcs = INVALID_MCS_NSS_INDEX;
switch (mcs_ch_width) {
case CH_WIDTH_80P80MHZ:
if (hecap_rxmcsnssmap[HECAP_TXRX_MCS_NSS_IDX_80_80] &&
hecap_txmcsnssmap[HECAP_TXRX_MCS_NSS_IDX_80_80]) {
rx_max_mcs = hecap_rxmcsnssmap[HECAP_TXRX_MCS_NSS_IDX_80_80] & 0x03;
tx_max_mcs = hecap_txmcsnssmap[HECAP_TXRX_MCS_NSS_IDX_80_80] & 0x03;
max_mcs = rx_max_mcs < tx_max_mcs ? rx_max_mcs : tx_max_mcs;
if (max_mcs < 0x03)
max_mcs = 7 + 2 * max_mcs;
}
/* fallthrough */
case CH_WIDTH_160MHZ:
if (hecap_rxmcsnssmap[HECAP_TXRX_MCS_NSS_IDX_160] &&
hecap_txmcsnssmap[HECAP_TXRX_MCS_NSS_IDX_160]) {
rx_max_mcs = hecap_rxmcsnssmap[HECAP_TXRX_MCS_NSS_IDX_160] & 0x03;
tx_max_mcs = hecap_txmcsnssmap[HECAP_TXRX_MCS_NSS_IDX_160] & 0x03;
max_mcs = rx_max_mcs < tx_max_mcs ? rx_max_mcs : tx_max_mcs;
if (max_mcs < 0x03)
max_mcs = 7 + 2 * max_mcs;
}
/* fallthrough */
default:
if (hecap_rxmcsnssmap[HECAP_TXRX_MCS_NSS_IDX_80] &&
hecap_txmcsnssmap[HECAP_TXRX_MCS_NSS_IDX_80]) {
rx_max_mcs = hecap_rxmcsnssmap[HECAP_TXRX_MCS_NSS_IDX_80] & 0x03;
tx_max_mcs = hecap_txmcsnssmap[HECAP_TXRX_MCS_NSS_IDX_80] & 0x03;
max_mcs = rx_max_mcs < tx_max_mcs ? rx_max_mcs : tx_max_mcs;
if (max_mcs < 0x03)
max_mcs = 7 + 2 * max_mcs;
}
}
return max_mcs;
}
uint8_t mlme_get_max_vht_mcs_idx(u_int16_t rx_vht_mcs_map,
u_int16_t tx_vht_mcs_map)
{
uint8_t rx_max_mcs, tx_max_mcs, max_mcs = INVALID_MCS_NSS_INDEX;
if (rx_vht_mcs_map && tx_vht_mcs_map) {
rx_max_mcs = rx_vht_mcs_map & 0x03;
tx_max_mcs = tx_vht_mcs_map & 0x03;
max_mcs = rx_max_mcs < tx_max_mcs ? rx_max_mcs : tx_max_mcs;
if (max_mcs < 0x03)
return 7 + max_mcs;
}
return max_mcs;
}
#ifdef WLAN_FEATURE_SON
QDF_STATUS mlme_save_vdev_max_mcs_idx(struct wlan_objmgr_vdev *vdev,
uint8_t max_mcs_idx)
{
struct mlme_legacy_priv *mlme_priv;
if (!vdev) {
mlme_legacy_err("invalid vdev");
return QDF_STATUS_E_INVAL;
}
mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
if (!mlme_priv) {
mlme_legacy_err("vdev legacy private object is NULL");
return QDF_STATUS_E_FAILURE;
}
mlme_priv->max_mcs_index = max_mcs_idx;
return QDF_STATUS_SUCCESS;
}
uint8_t mlme_get_vdev_max_mcs_idx(struct wlan_objmgr_vdev *vdev)
{
struct mlme_legacy_priv *mlme_priv;
if (!vdev) {
mlme_legacy_err("invalid vdev");
return INVALID_MCS_NSS_INDEX;
}
mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
if (!mlme_priv) {
mlme_legacy_err("vdev legacy private object is NULL");
return INVALID_MCS_NSS_INDEX;
}
return mlme_priv->max_mcs_index;
}
#endif /* WLAN_FEATURE_SON */