From 8136b58f56ec64b7d12222df76bd40d98f21d4ff Mon Sep 17 00:00:00 2001 From: Shashikala Prabhu Date: Thu, 11 Jan 2018 19:26:56 +0530 Subject: [PATCH] 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 --- target_if/core/inc/target_if.h | 3 +- target_if/dfs/src/target_if_dfs.c | 40 ++++++++++++++++++++++++- umac/dfs/core/src/filtering/dfs_radar.c | 16 +++++++--- 3 files changed, 53 insertions(+), 6 deletions(-) diff --git a/target_if/core/inc/target_if.h b/target_if/core/inc/target_if.h index b6da65b831a5..0f2914368403 100644 --- a/target_if/core/inc/target_if.h +++ b/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)( diff --git a/target_if/dfs/src/target_if_dfs.c b/target_if/dfs/src/target_if_dfs.c index 3dd2051601de..959df8f583b7 100644 --- a/target_if/dfs/src/target_if_dfs.c +++ b/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; } diff --git a/umac/dfs/core/src/filtering/dfs_radar.c b/umac/dfs/core/src/filtering/dfs_radar.c index 3244819000bd..6f5a2ad774c1 100644 --- a/umac/dfs/core/src/filtering/dfs_radar.c +++ b/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: