Browse Source

qcacmn: Initialize agile Spectral capability for legacy targets

TLV targets advertises the agile Spectral capability in the
chain mask table of extended service ready event.
For legacy targets, mac phy capabilities, which holds the
chain mask table is null. This leads to a load time crash
for some legacy platforms. To fix this, initialize
agile Spectral as disabled for the targets which doesn't
support extended service ready message.

CRs-Fixed: 2854348
Change-Id: I09a64259b31e3e5eb0441f35dbb9451dec001780
Edayilliam Jayadev 4 years ago
parent
commit
6ed59fa1e3
1 changed files with 16 additions and 0 deletions
  1. 16 0
      target_if/spectral/target_if_spectral.c

+ 16 - 0
target_if/spectral/target_if_spectral.c

@@ -171,6 +171,7 @@ target_if_spectral_get_agile_mode_cap(
 	uint32_t table_id;
 	struct wlan_psoc_host_service_ext_param *ext_svc_param;
 	struct wlan_psoc_host_chainmask_table *table;
+	struct wmi_unified *wmi_handle;
 
 	if (!pdev) {
 		spectral_err("pdev is null");
@@ -183,6 +184,21 @@ target_if_spectral_get_agile_mode_cap(
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	wmi_handle =  get_wmi_unified_hdl_from_psoc(psoc);
+	if (!wmi_handle) {
+		spectral_err("wmi handle is null");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	/* Agile Spectral is disabled for legacy targets */
+	if (!target_if_spectral_wmi_service_enabled(psoc, wmi_handle,
+						    wmi_service_ext_msg)) {
+		agile_cap->agile_spectral_cap  = false;
+		agile_cap->agile_spectral_cap_160 = false;
+		agile_cap->agile_spectral_cap_80p80 = false;
+		return QDF_STATUS_SUCCESS;
+	}
+
 	tgt_psoc_info = wlan_psoc_get_tgt_if_handle(psoc);
 	if (!tgt_psoc_info) {
 		spectral_err("target_psoc_info is null");