Bladeren bron

qcacmn: Extract enhanced AoA caps to tgt_info

Changes to extract enhanced AoA (multi gain table support)
capabilities from SERVICE_READY_EXT2 event

CRs-Fixed: 3553378
Change-Id: I8db093cfce7b8c8cacedef39f97911eabe062c19
Shwetha G K 1 jaar geleden
bovenliggende
commit
6828824ccd

+ 24 - 0
target_if/core/inc/target_if.h

@@ -210,6 +210,7 @@ struct target_version_info {
  * @sbs_lower_band_end_freq: sbs lower band end frequency
  * @health_mon_param: health monitor params
  * @aux_dev_caps: aux device capability
+ * @aoa_caps: aoa capabilities from target
  */
 struct tgt_info {
 	struct host_fw_ver version;
@@ -250,6 +251,9 @@ struct tgt_info {
 	struct wmi_health_mon_params health_mon_param;
 #endif /* HEALTH_MON_SUPPORT */
 	struct wlan_psoc_host_aux_dev_caps *aux_dev_caps;
+#ifdef WLAN_RCC_ENHANCED_AOA_SUPPORT
+	struct wlan_psoc_host_rcc_enh_aoa_caps_ext2 *aoa_caps;
+#endif /* WLAN_RCC_ENHANCED_AOA_SUPPORT */
 };
 
 /**
@@ -1483,6 +1487,26 @@ static inline uint32_t target_psoc_get_num_dbr_ring_caps
 	return psoc_info->info.service_ext2_param.num_dbr_ring_caps;
 }
 
+/**
+ * target_psoc_get_aoa_caps() - get aoa_caps
+ * @psoc_info:  pointer to structure target_psoc_info
+ *
+ * API to get aoa_caps
+ *
+ * Return: structure pointer to wlan_psoc_host_rcc_enh_aoa_caps_ext2
+ */
+#ifdef WLAN_RCC_ENHANCED_AOA_SUPPORT
+static inline
+struct wlan_psoc_host_rcc_enh_aoa_caps_ext2 *target_psoc_get_aoa_caps
+		(struct target_psoc_info *psoc_info)
+{
+	if (!psoc_info)
+		return NULL;
+
+	return psoc_info->info.aoa_caps;
+}
+#endif /* WLAN_RCC_ENHANCED_AOA_SUPPORT */
+
 /**
  * target_psoc_get_num_scan_radio_caps() - get no of scan_radio_caps
  * @psoc_info:  pointer to structure target_psoc_info

+ 1 - 0
target_if/core/src/target_if_main.c

@@ -794,6 +794,7 @@ QDF_STATUS target_if_psoc_tgt_info_mem_free(
 	init_deinit_scan_radio_cap_free(tgt_psoc_info);
 	init_deinit_msdu_idx_qtype_map_free(tgt_psoc_info);
 	init_deinit_aux_dev_cap_free(tgt_psoc_info);
+	init_deinit_rcc_aoa_cap_ext2_free(tgt_psoc_info);
 
 	return QDF_STATUS_SUCCESS;
 }

+ 30 - 0
target_if/init_deinit/inc/service_ready_param.h

@@ -356,6 +356,36 @@ struct wlan_psoc_host_spectral_scaling_params {
 	uint32_t default_agc_max_gain;
 };
 
+#ifdef WLAN_RCC_ENHANCED_AOA_SUPPORT
+/**
+ * struct wlan_psoc_host_rcc_enh_aoa_caps_ext2 - aoa capabilities
+ * @max_agc_gain_tbls: max number of AGC gain tables supported
+ * @max_agc_gain_per_tbl_2g: max AGC gain value per each table on 2GHz band.
+ *                           Each entry in max_agc_gain_per_table indicates
+ *                           max AGC gain value corresponding AGC gain table
+ *                           index.
+ * @max_agc_gain_per_tbl_5g: max AGC gain value per each table on 5GHz band.
+ *                           Each entry in max_agc_gain_per_table indicates
+ *                           max AGC gain value corresponding AGC gain table
+ *                           index.
+ * @max_agc_gain_per_tbl_6g: max AGC gain value per each table on 5GHz band.
+ *                           Each entry in max_agc_gain_per_table indicates
+ *                           max AGC gain value corresponding AGC gain table
+ *                           index.
+ * @max_bdf_entries_per_tbl: max entries in phase_array and gain_array per
+ *                           each gain table index. Each entry in this array
+ *                           indicates max entries used to store required data
+ *                           for corresponding AGC gain table index.
+ */
+struct wlan_psoc_host_rcc_enh_aoa_caps_ext2 {
+	uint32_t max_agc_gain_tbls;
+	uint16_t max_agc_gain_per_tbl_2g[PSOC_MAX_NUM_AGC_GAIN_TBLS];
+	uint16_t max_agc_gain_per_tbl_5g[PSOC_MAX_NUM_AGC_GAIN_TBLS];
+	uint16_t max_agc_gain_per_tbl_6g[PSOC_MAX_NUM_AGC_GAIN_TBLS];
+	uint8_t max_bdf_entries_per_tbl[PSOC_MAX_NUM_AGC_GAIN_TBLS];
+};
+#endif /* WLAN_RCC_ENHANCED_AOA_SUPPORT */
+
 /**
  * struct wlan_psoc_host_chainmask_capabilities - chain mask capabilities list
  * @supports_chan_width_20: channel width 20 support for this chain mask.

+ 27 - 0
target_if/init_deinit/inc/service_ready_util.h

@@ -312,6 +312,33 @@ int init_deinit_populate_hal_reg_cap_ext2(wmi_unified_t handle, uint8_t *event,
 int init_deinit_populate_mac_phy_cap_ext2(wmi_unified_t handle, uint8_t *event,
 					  struct tgt_info *info);
 
+/**
+ * init_deinit_populate_rcc_aoa_cap_ext2() - populate aoa capabilities from
+ * service ready ext2 event
+ * @psoc: PSOC object
+ * @handle: WMI handle pointer
+ * @event: event buffer received from FW
+ * @info: tgt_info object
+ *
+ * API to populate aoa capability from service ready ext2 event.
+ *
+ * Return: zero on successful population of aoa capability or failure
+ */
+int init_deinit_populate_rcc_aoa_cap_ext2(struct wlan_objmgr_psoc *psoc,
+					  wmi_unified_t handle, uint8_t *event,
+					  struct tgt_info *info);
+
+/**
+ * init_deinit_rcc_aoa_cap_ext2_free() - free aoa capability
+ * @tgt_psoc_info: target psoc info object
+ *
+ * API to free aoa capability
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS init_deinit_rcc_aoa_cap_ext2_free(
+				struct target_psoc_info *tgt_psoc_info);
+
 /**
  * init_deinit_populate_scan_radio_cap_ext2() - populate scan radio capabilities
  * from service ready ext2 event

+ 9 - 0
target_if/init_deinit/src/init_event_handler.c

@@ -595,6 +595,15 @@ static int init_deinit_service_ext2_ready_event_handler(ol_scn_t scn_handle,
 			target_if_debug("failed to populate aux_dev cap ext2");
 	}
 
+	if (wmi_service_enabled(wmi_handle,
+				wmi_service_aoa_for_rcc_supported)) {
+		err_code = init_deinit_populate_rcc_aoa_cap_ext2(psoc,
+								 wmi_handle,
+								 event, info);
+		if (err_code)
+			target_if_debug("failed to populate aoa cap ext2");
+	}
+
 	legacy_callback = target_if_get_psoc_legacy_service_ready_cb();
 	if (legacy_callback)
 		if (legacy_callback(wmi_service_ready_ext2_event_id,

+ 60 - 0
target_if/init_deinit/src/service_ready_util.c

@@ -562,6 +562,66 @@ exit:
 }
 #endif
 
+#ifdef WLAN_RCC_ENHANCED_AOA_SUPPORT
+int init_deinit_populate_rcc_aoa_cap_ext2(struct wlan_objmgr_psoc *psoc,
+					  wmi_unified_t handle,
+					  uint8_t *event,
+					  struct tgt_info *info)
+{
+	QDF_STATUS status = QDF_STATUS_E_FAILURE;
+
+	info->aoa_caps = qdf_mem_malloc(
+		sizeof(struct wlan_psoc_host_rcc_enh_aoa_caps_ext2));
+
+	if (!info->aoa_caps) {
+		target_if_err("Mem alloc for aoa cap failed");
+		return -EINVAL;
+	}
+
+	status = wmi_extract_aoa_caps_service_ready_ext2(
+				handle, event,
+				info->aoa_caps);
+
+	if (QDF_IS_STATUS_ERROR(status)) {
+		target_if_err("Extraction of aoa caps failed");
+		goto free_and_return;
+	}
+
+	return 0;
+
+free_and_return:
+	qdf_mem_free(info->aoa_caps);
+	info->aoa_caps = NULL;
+
+	return qdf_status_to_os_return(status);
+}
+
+QDF_STATUS init_deinit_rcc_aoa_cap_ext2_free(
+		struct target_psoc_info *tgt_psoc_info)
+{
+	qdf_mem_free(tgt_psoc_info->info.aoa_caps);
+	tgt_psoc_info->info.aoa_caps = NULL;
+
+	return QDF_STATUS_SUCCESS;
+}
+#else
+int init_deinit_populate_rcc_aoa_cap_ext2(struct wlan_objmgr_psoc *psoc,
+					  wmi_unified_t handle,
+					  uint8_t *event,
+					  struct tgt_info *info)
+{
+	return 0;
+}
+
+QDF_STATUS init_deinit_rcc_aoa_cap_ext2_free(
+		struct target_psoc_info *tgt_psoc_info)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif /* WLAN_RCC_ENHANCED_AOA_SUPPORT */
+
+qdf_export_symbol(init_deinit_rcc_aoa_cap_ext2_free);
+
 int init_deinit_populate_dbs_or_sbs_cap_ext2(struct wlan_objmgr_psoc *psoc,
 					     wmi_unified_t handle,
 					     uint8_t *event,