Bladeren bron

qcacmn: Fix radar detection failure for DA and PO

DFS capability was not set properly for Partial-offload(PO) and
Direct-Attach(DA) radio. Thus radar detection failed.

Change-Id: I5493d7195a57f160792a411653c05bbf220d3561
CRs-Fixed: 2160418
Shashikala Prabhu 7 jaren geleden
bovenliggende
commit
8136b58f56
3 gewijzigde bestanden met toevoegingen van 53 en 6 verwijderingen
  1. 2 1
      target_if/core/inc/target_if.h
  2. 39 1
      target_if/dfs/src/target_if_dfs.c
  3. 12 4
      umac/dfs/core/src/filtering/dfs_radar.c

+ 2 - 1
target_if/core/inc/target_if.h

@@ -57,10 +57,11 @@
 #endif
 
 #ifdef CONFIG_MCL
-#define TARGET_TYPE_AR900B    9
+#define TARGET_TYPE_AR900B    9  /* Beeliner */
 #define TARGET_TYPE_QCA9984   15 /* cascade */
 #define TARGET_TYPE_IPQ4019   16 /* dakota */
 #define TARGET_TYPE_QCA9888   17 /* besra */
+#define TARGET_TYPE_AR9888    7  /* Peregrine */
 #endif
 
 typedef struct wlan_objmgr_psoc *(*get_psoc_handle_callback)(

+ 39 - 1
target_if/dfs/src/target_if_dfs.c

@@ -457,17 +457,55 @@ static QDF_STATUS target_if_dfs_set_phyerr_filter_offload(
 static QDF_STATUS target_if_dfs_get_caps(struct wlan_objmgr_pdev *pdev,
 					struct wlan_dfs_caps *dfs_caps)
 {
+	struct wlan_objmgr_psoc *psoc = NULL;
+	struct target_psoc_info *tgt_psoc_info;
+
 	if (!dfs_caps) {
 		target_if_err("null dfs_caps");
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	dfs_caps->wlan_chip_is_bb_tlv = 1;
 	dfs_caps->wlan_dfs_combined_rssi_ok = 0;
 	dfs_caps->wlan_dfs_ext_chan_ok = 0;
 	dfs_caps->wlan_dfs_use_enhancement = 0;
 	dfs_caps->wlan_strong_signal_diversiry = 0;
 	dfs_caps->wlan_fastdiv_val = 0;
+	dfs_caps->wlan_chip_is_bb_tlv = 1;
+	dfs_caps->wlan_chip_is_over_sampled = 0;
+	dfs_caps->wlan_chip_is_ht160 = 0;
+	dfs_caps->wlan_chip_is_false_detect = 0;
+
+	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc) {
+		target_if_err("null psoc");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	tgt_psoc_info = wlan_psoc_get_tgt_if_handle(psoc);
+	if (!tgt_psoc_info) {
+		target_if_err("null tgt_psoc_info");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	switch (tgt_psoc_info->target_type) {
+	case TARGET_TYPE_AR900B:
+		break;
+
+	case TARGET_TYPE_IPQ4019:
+		dfs_caps->wlan_chip_is_false_detect = 0;
+		break;
+
+	case TARGET_TYPE_AR9888:
+		dfs_caps->wlan_chip_is_over_sampled = 1;
+		break;
+
+	case TARGET_TYPE_QCA9984:
+	case TARGET_TYPE_QCA9888:
+		dfs_caps->wlan_chip_is_ht160 = 1;
+		break;
+	default:
+		break;
+	}
 
 	return QDF_STATUS_SUCCESS;
 }

+ 12 - 4
umac/dfs/core/src/filtering/dfs_radar.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
  * Copyright (c) 2011, Atheros Communications Inc.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -457,17 +457,25 @@ void dfs_get_radars(struct wlan_dfs *dfs)
 #define AR9300_DEVID_AR956X_PCIE    0x0036 /* Aphrodite: 1x1 DB + BT - AR9564 */
 #define AR9300_DEVID_EMU_PCIE       0xabcd
 
+	struct wlan_objmgr_psoc *psoc;
+
 	if (!dfs) {
 		dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS,  "dfs is NULL");
 		return;
 	}
 
-	if (lmac_is_mode_offload(dfs->dfs_pdev_obj)) {
-		/* For offload */
+	psoc = wlan_pdev_get_psoc(dfs->dfs_pdev_obj);
+	if (!psoc) {
+		dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS,  "psoc is NULL");
+		return;
+	}
+
+	if (wlan_objmgr_psoc_get_dev_type(psoc) == WLAN_DEV_OL) {
+		/* For offload chip */
 		ol_if_dfs_configure(dfs);
 	} else {
 		uint16_t devid = lmac_get_ah_devid(dfs->dfs_pdev_obj);
-		/* For DA */
+		/* For DA chip*/
 
 		switch (devid) {
 		case AR5212_DEVID_IBM: