From cf08b7385eb6891cd4078d766f47ef19ade056f0 Mon Sep 17 00:00:00 2001 From: Nandha Kishore Easwaran Date: Thu, 15 Jun 2017 10:29:29 +0530 Subject: [PATCH] qcacmn: convert target HT cap bitmap to host bitmap HT cap bit map is different for tlv and non-tlv based firmware. Convert target cap to host cap bitmap to abstract out the differences. Change-Id: Ia803efa3a895c7faa159d8051277d2a926b365a5 --- wmi/inc/wmi_unified_param.h | 4 +++- wmi/src/wmi_unified_non_tlv.c | 23 ++++++++++++++++++++++- wmi/src/wmi_unified_tlv.c | 25 ++++++++++++++++++++++++- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 02f8151e9cba..0b59a140230a 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -6198,7 +6198,9 @@ enum wmi_host_sta_powersave_param { #define WMI_HOST_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */ #define WMI_HOST_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8 #define WMI_HOST_HT_CAP_HT40_SGI 0x0800 -#define WMI_HOST_HT_CAP_IBF_BFER 0x1000 +#define WMI_HOST_HT_CAP_RX_LDPC 0x1000 +#define WMI_HOST_HT_CAP_TX_LDPC 0x2000 +#define WMI_HOST_HT_CAP_IBF_BFER 0x4000 /* These macros should be used when we wish to advertise STBC support for * only 1SS or 2SS or 3SS. */ diff --git a/wmi/src/wmi_unified_non_tlv.c b/wmi/src/wmi_unified_non_tlv.c index 224d15dd4b9a..56450131ad7e 100644 --- a/wmi/src/wmi_unified_non_tlv.c +++ b/wmi/src/wmi_unified_non_tlv.c @@ -5406,6 +5406,27 @@ static bool is_service_enabled_non_tlv(wmi_unified_t wmi_handle, service_id); } +static inline void copy_ht_cap_info(uint32_t ev_target_cap, + struct wlan_psoc_target_capability_info *cap) +{ + cap->ht_cap_info |= ev_target_cap & ( + WMI_HT_CAP_ENABLED + | WMI_HT_CAP_HT20_SGI + | WMI_HT_CAP_DYNAMIC_SMPS + | WMI_HT_CAP_TX_STBC + | WMI_HT_CAP_TX_STBC_MASK_SHIFT + | WMI_HT_CAP_RX_STBC + | WMI_HT_CAP_RX_STBC_MASK_SHIFT + | WMI_HT_CAP_LDPC + | WMI_HT_CAP_L_SIG_TXOP_PROT + | WMI_HT_CAP_MPDU_DENSITY + | WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT + | WMI_HT_CAP_HT40_SGI + | WMI_HT_CAP_IBF_BFER); + if (ev_target_cap & WMI_HT_CAP_IBF_BFER) + cap->ht_cap_info |= WMI_HOST_HT_CAP_IBF_BFER; +} + /** * extract_service_ready_non_tlv() - extract service ready event * @wmi_handle: wmi handle @@ -5425,7 +5446,7 @@ static QDF_STATUS extract_service_ready_non_tlv(wmi_unified_t wmi_handle, cap->phy_capability = ev->phy_capability; cap->max_frag_entry = ev->max_frag_entry; cap->num_rf_chains = ev->num_rf_chains; - cap->ht_cap_info = ev->ht_cap_info; + copy_ht_cap_info(ev->ht_cap_info, cap); cap->vht_cap_info = ev->vht_cap_info; cap->vht_supp_mcs = ev->vht_supp_mcs; cap->hw_min_tx_power = ev->hw_min_tx_power; diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index ee98402f63c0..cd5747650675 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -15391,6 +15391,29 @@ static bool is_service_enabled_tlv(wmi_unified_t wmi_handle, } #endif +static inline void copy_ht_cap_info(uint32_t ev_target_cap, + struct wlan_psoc_target_capability_info *cap) +{ + /* except LDPC all flags are common betwen legacy and here + * also IBFEER is not defined for TLV + */ + cap->ht_cap_info |= ev_target_cap & ( + WMI_HT_CAP_ENABLED + | WMI_HT_CAP_HT20_SGI + | WMI_HT_CAP_DYNAMIC_SMPS + | WMI_HT_CAP_TX_STBC + | WMI_HT_CAP_TX_STBC_MASK_SHIFT + | WMI_HT_CAP_RX_STBC + | WMI_HT_CAP_RX_STBC_MASK_SHIFT + | WMI_HT_CAP_LDPC + | WMI_HT_CAP_L_SIG_TXOP_PROT + | WMI_HT_CAP_MPDU_DENSITY + | WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT + | WMI_HT_CAP_HT40_SGI); + if (ev_target_cap & WMI_HT_CAP_LDPC) + cap->ht_cap_info |= WMI_HOST_HT_CAP_RX_LDPC | + WMI_HOST_HT_CAP_TX_LDPC; +} /** * extract_service_ready_tlv() - extract service ready event * @wmi_handle: wmi handle @@ -15417,7 +15440,7 @@ static QDF_STATUS extract_service_ready_tlv(wmi_unified_t wmi_handle, cap->phy_capability = ev->phy_capability; cap->max_frag_entry = ev->max_frag_entry; cap->num_rf_chains = ev->num_rf_chains; - cap->ht_cap_info = ev->ht_cap_info; + copy_ht_cap_info(ev->ht_cap_info, cap); cap->vht_cap_info = ev->vht_cap_info; cap->vht_supp_mcs = ev->vht_supp_mcs; cap->hw_min_tx_power = ev->hw_min_tx_power;