Bladeren bron

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
Nandha Kishore Easwaran 7 jaren geleden
bovenliggende
commit
cf08b7385e
3 gewijzigde bestanden met toevoegingen van 49 en 3 verwijderingen
  1. 3 1
      wmi/inc/wmi_unified_param.h
  2. 22 1
      wmi/src/wmi_unified_non_tlv.c
  3. 24 1
      wmi/src/wmi_unified_tlv.c

+ 3 - 1
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. */

+ 22 - 1
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;

+ 24 - 1
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;