Ver Fonte

Merge "qcacld-3.0: Return chain_mask for legacy chip" into wlan-cld3.driver.lnx.2.0

CNSS_WLAN Service há 5 anos atrás
pai
commit
5c50330ac4
2 ficheiros alterados com 23 adições e 0 exclusões
  1. 13 0
      core/wma/inc/wma.h
  2. 10 0
      core/wma/src/wma_main.c

+ 13 - 0
core/wma/inc/wma.h

@@ -390,6 +390,19 @@
 	((hw_mode & WMA_HW_MODE_SBS_MODE_MASK) >>               \
 		WMA_HW_MODE_SBS_MODE_BITPOS)
 
+/*
+ * Extract 2G or 5G tx/rx chainmask
+ * format of txrx_chainmask (from wmi_service_ready_event_fixed_param):
+ *    [7:0]   - 2G band tx chain mask
+ *    [15:8]  - 2G band rx chain mask
+ *    [23:16] - 5G band tx chain mask
+ *    [31:24] - 5G band rx chain mask
+ */
+#define EXTRACT_TX_CHAIN_MASK_2G(chainmask) ((chainmask) & 0xFF)
+#define EXTRACT_RX_CHAIN_MASK_2G(chainmask) (((chainmask) >> 8) & 0xFF)
+#define EXTRACT_TX_CHAIN_MASK_5G(chainmask) (((chainmask) >> 16) & 0xFF)
+#define EXTRACT_RX_CHAIN_MASK_5G(chainmask) (((chainmask) >> 24) & 0xFF)
+
 /*
  * PROBE_REQ_TX_DELAY
  * param to specify probe request Tx delay for scans triggered on this VDEV

+ 10 - 0
core/wma/src/wma_main.c

@@ -6349,6 +6349,7 @@ QDF_STATUS wma_get_caps_for_phyidx_hwmode(struct wma_caps_per_phy *caps_per_phy,
 	int ht_cap_info, vht_cap_info;
 	uint8_t phyid, our_hw_mode = hw_mode, num_hw_modes;
 	struct wlan_psoc_host_mac_phy_caps *mac_phy_cap;
+	struct wlan_psoc_target_capability_info *tgt_cap_info;
 
 	if (!wma_handle) {
 		WMA_LOGE("Invalid wma handle");
@@ -6365,6 +6366,7 @@ QDF_STATUS wma_get_caps_for_phyidx_hwmode(struct wma_caps_per_phy *caps_per_phy,
 	vht_cap_info = target_if_get_vht_cap_info(tgt_hdl);
 	num_hw_modes = target_psoc_get_num_hw_modes(tgt_hdl);
 	mac_phy_cap = target_psoc_get_mac_phy_cap(tgt_hdl);
+	tgt_cap_info = target_psoc_get_target_caps(tgt_hdl);
 
 	if (!num_hw_modes) {
 		WMA_LOGD("Invalid number of hw modes, use legacy HT/VHT caps");
@@ -6377,6 +6379,14 @@ QDF_STATUS wma_get_caps_for_phyidx_hwmode(struct wma_caps_per_phy *caps_per_phy,
 		caps_per_phy->he_2g[1] = 0;
 		caps_per_phy->he_5g[0] = 0;
 		caps_per_phy->he_5g[1] = 0;
+		caps_per_phy->tx_chain_mask_2G =
+			EXTRACT_TX_CHAIN_MASK_2G(tgt_cap_info->txrx_chainmask);
+		caps_per_phy->rx_chain_mask_2G =
+			EXTRACT_RX_CHAIN_MASK_2G(tgt_cap_info->txrx_chainmask);
+		caps_per_phy->tx_chain_mask_5G =
+			EXTRACT_TX_CHAIN_MASK_5G(tgt_cap_info->txrx_chainmask);
+		caps_per_phy->rx_chain_mask_5G =
+			EXTRACT_RX_CHAIN_MASK_5G(tgt_cap_info->txrx_chainmask);
 
 		return QDF_STATUS_SUCCESS;
 	}