qcacld-3.0: Fix check for firmware's chainmask capability

Fix condition checked before programming user's requested chainmask to
firwmare. Get current firmware advertised phy cap for non-dbs phymode
and check if it supports all chains for tx/rx 2g and 5g.

Change-Id: I3fcef315f478403955ce400b3ba6d138a8006a01
CRs-Fixed: 2202544
This commit is contained in:
Naveen Rawat 2018-03-06 10:29:42 -08:00 committed by nshrivas
parent 49c60e3f12
commit 9832247b07
3 changed files with 31 additions and 0 deletions

View File

@ -4238,6 +4238,8 @@ static void hdd_set_fw_log_params(struct hdd_context *hdd_ctx,
static int hdd_configure_chain_mask(struct hdd_adapter *adapter)
{
int ret_val;
QDF_STATUS status;
struct wma_caps_per_phy non_dbs_phy_cap;
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
hdd_debug("enable2x2: %d, lte_coex: %d, ChainMask1x1: tx: %d rx: %d",
@ -4254,6 +4256,22 @@ static int hdd_configure_chain_mask(struct hdd_adapter *adapter)
hdd_debug("enable_bt_chain_separation %d",
hdd_ctx->config->enable_bt_chain_separation);
status = wma_get_caps_for_phyidx_hwmode(&non_dbs_phy_cap,
HW_MODE_DBS_NONE,
CDS_BAND_ALL);
if (QDF_IS_STATUS_ERROR(status)) {
hdd_err("couldn't get phy caps. skip chain mask programming");
return qdf_status_to_os_return(status);
}
if (non_dbs_phy_cap.tx_chain_mask_2G < 3 ||
non_dbs_phy_cap.rx_chain_mask_2G < 3 ||
non_dbs_phy_cap.tx_chain_mask_5G < 3 ||
non_dbs_phy_cap.rx_chain_mask_5G < 3) {
hdd_info("firmware not capable. skip chain mask programming");
return 0;
}
if (hdd_ctx->config->enable2x2 &&
!hdd_ctx->config->enable_bt_chain_separation) {
hdd_info("2x2 enabled. skip chain mask programming");

View File

@ -75,6 +75,10 @@ enum GEN_PARAM {
* @vht_5g: entire VHT cap for 5G band in terms of 32 bit flag
* @he_2g: entire HE cap for 2G band in terms of 32 bit flag
* @he_5g: entire HE cap for 5G band in terms of 32 bit flag
* @tx_chain_mask_2G: tx chain mask for 2g
* @rx_chain_mask_2G: rx chain mask for 2g
* @tx_chain_mask_5G: tx chain mask for 5g
* @rx_chain_mask_5G: rx chain mask for 5g
*/
struct wma_caps_per_phy {
uint32_t ht_2g;
@ -83,6 +87,10 @@ struct wma_caps_per_phy {
uint32_t vht_5g;
uint32_t he_2g;
uint32_t he_5g;
uint32_t tx_chain_mask_2G;
uint32_t rx_chain_mask_2G;
uint32_t tx_chain_mask_5G;
uint32_t rx_chain_mask_5G;
};

View File

@ -5897,6 +5897,11 @@ QDF_STATUS wma_get_caps_for_phyidx_hwmode(struct wma_caps_per_phy *caps_per_phy,
caps_per_phy->he_2g = mac_phy_cap[phyid].he_cap_info_2G;
caps_per_phy->he_5g = mac_phy_cap[phyid].he_cap_info_5G;
caps_per_phy->tx_chain_mask_2G = mac_phy_cap->tx_chain_mask_2G;
caps_per_phy->rx_chain_mask_2G = mac_phy_cap->rx_chain_mask_2G;
caps_per_phy->tx_chain_mask_5G = mac_phy_cap->tx_chain_mask_5G;
caps_per_phy->rx_chain_mask_5G = mac_phy_cap->rx_chain_mask_5G;
return QDF_STATUS_SUCCESS;
}