From e3ac7503d19640a063e52a63dfcf32bedc32a6c3 Mon Sep 17 00:00:00 2001 From: Wu Gao Date: Sat, 7 Mar 2020 13:26:23 +0800 Subject: [PATCH] qcacmn: Enable CFR for QCA6490 in target interface This change adds interface to interface to subscibe wdi ppdu desc event, adds pdev init/deinit in target interface. Change-Id: Id6b3dbd500f2f99ab62beeb99b58eb2c22d68857 CRs-Fixed: 2637137 --- target_if/cfr/src/target_if_cfr.c | 56 ++++++++++++++++++- umac/cfr/dispatcher/inc/wlan_cfr_tgt_api.h | 13 ++++- umac/cfr/dispatcher/inc/wlan_cfr_ucfg_api.h | 11 ++++ umac/cfr/dispatcher/src/wlan_cfr_tgt_api.c | 22 +++++++- umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c | 6 ++ .../lmac_if/inc/wlan_lmac_if_def.h | 2 + 6 files changed, 107 insertions(+), 3 deletions(-) diff --git a/target_if/cfr/src/target_if_cfr.c b/target_if/cfr/src/target_if_cfr.c index 410f1ba8fb90..9c95256e6b5d 100644 --- a/target_if/cfr/src/target_if_cfr.c +++ b/target_if/cfr/src/target_if_cfr.c @@ -26,8 +26,12 @@ #include #include #include -#include #include +#ifdef CFR_USE_FIXED_FOLDER +#include "target_if_cfr_6490.h" +#else +#include +#endif int target_if_cfr_stop_capture(struct wlan_objmgr_pdev *pdev, struct wlan_objmgr_peer *peer) @@ -166,6 +170,43 @@ int target_if_cfr_get_target_type(struct wlan_objmgr_psoc *psoc) return target_type; } +#ifdef CFR_USE_FIXED_FOLDER +int target_if_cfr_init_pdev(struct wlan_objmgr_psoc *psoc, + struct wlan_objmgr_pdev *pdev) +{ + uint32_t target_type; + QDF_STATUS status; + + target_type = target_if_cfr_get_target_type(psoc); + + if (target_type == TARGET_TYPE_QCA6490) { + status = cfr_6490_init_pdev(psoc, pdev); + } else { + cfr_info("unsupport chip"); + status = QDF_STATUS_SUCCESS; + } + + return qdf_status_to_os_return(status); +} + +int target_if_cfr_deinit_pdev(struct wlan_objmgr_psoc *psoc, + struct wlan_objmgr_pdev *pdev) +{ + uint32_t target_type; + QDF_STATUS status; + + target_type = target_if_cfr_get_target_type(psoc); + + if (target_type == TARGET_TYPE_QCA6490) { + status = cfr_6490_deinit_pdev(psoc, pdev); + } else { + cfr_info("unsupport chip"); + status = QDF_STATUS_SUCCESS; + } + + return qdf_status_to_os_return(status); +} +#else int target_if_cfr_init_pdev(struct wlan_objmgr_psoc *psoc, struct wlan_objmgr_pdev *pdev) { @@ -225,6 +266,7 @@ int target_if_cfr_deinit_pdev(struct wlan_objmgr_psoc *psoc, } else return QDF_STATUS_E_NOSUPPORT; } +#endif #ifdef WLAN_ENH_CFR_ENABLE QDF_STATUS target_if_cfr_config_rcc(struct wlan_objmgr_pdev *pdev, @@ -301,6 +343,17 @@ void target_if_cfr_default_ta_ra_config(struct cfr_rcc_param *rcc_info, #endif #ifdef WLAN_ENH_CFR_ENABLE +#ifdef CFR_USE_FIXED_FOLDER +static void target_if_enh_cfr_add_ops(struct wlan_lmac_if_tx_ops *tx_ops) +{ + tx_ops->cfr_tx_ops.cfr_subscribe_ppdu_desc = + target_if_cfr_subscribe_ppdu_desc; +} +#else +static void target_if_enh_cfr_add_ops(struct wlan_lmac_if_tx_ops *tx_ops) +{ +} +#endif /* CFR_USE_FIXED_FOLDER */ static void target_if_enh_cfr_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) { tx_ops->cfr_tx_ops.cfr_config_rcc = @@ -317,6 +370,7 @@ static void target_if_enh_cfr_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) target_if_cfr_rx_tlv_process; tx_ops->cfr_tx_ops.cfr_update_global_cfg = target_if_cfr_update_global_cfg; + target_if_enh_cfr_add_ops(tx_ops); } #else static void target_if_enh_cfr_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) diff --git a/umac/cfr/dispatcher/inc/wlan_cfr_tgt_api.h b/umac/cfr/dispatcher/inc/wlan_cfr_tgt_api.h index b9d3b283956c..907524ba49b7 100644 --- a/umac/cfr/dispatcher/inc/wlan_cfr_tgt_api.h +++ b/umac/cfr/dispatcher/inc/wlan_cfr_tgt_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -165,5 +165,16 @@ void tgt_cfr_rx_tlv_process(struct wlan_objmgr_pdev *pdev, void *nbuf); * @pdev: pointer to pdev_object */ void tgt_cfr_update_global_cfg(struct wlan_objmgr_pdev *pdev); + +/** + * tgt_cfr_subscribe_ppdu_desc() - Target interface to + * subscribe/unsubscribe WDI PPDU desc event + * @pdev: pointer to pdev_object + * @is_subscribe: subscribe or unsubscribei + * + * return QDF status + */ +QDF_STATUS tgt_cfr_subscribe_ppdu_desc(struct wlan_objmgr_pdev *pdev, + bool is_subscribe); #endif #endif diff --git a/umac/cfr/dispatcher/inc/wlan_cfr_ucfg_api.h b/umac/cfr/dispatcher/inc/wlan_cfr_ucfg_api.h index 2e9b11124f70..16f969da63fb 100644 --- a/umac/cfr/dispatcher/inc/wlan_cfr_ucfg_api.h +++ b/umac/cfr/dispatcher/inc/wlan_cfr_ucfg_api.h @@ -263,5 +263,16 @@ QDF_STATUS ucfg_cfr_rcc_clr_dbg_counters(struct wlan_objmgr_vdev *vdev); * Return: status */ QDF_STATUS ucfg_cfr_rcc_dump_lut(struct wlan_objmgr_vdev *vdev); + +/** + * ucfg_cfr_subscribe_ppdu_desc() - User space interface to + * subscribe/unsubscribe WDI PPDU desc event + * @pdev: pointer to pdev_object + * @is_subscribe: subscribe or unsubscribei + * + * return QDF status + */ +QDF_STATUS ucfg_cfr_subscribe_ppdu_desc(struct wlan_objmgr_pdev *pdev, + bool is_subscribe); #endif #endif diff --git a/umac/cfr/dispatcher/src/wlan_cfr_tgt_api.c b/umac/cfr/dispatcher/src/wlan_cfr_tgt_api.c index 93b6075188c4..3504ee5abd95 100644 --- a/umac/cfr/dispatcher/src/wlan_cfr_tgt_api.c +++ b/umac/cfr/dispatcher/src/wlan_cfr_tgt_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -284,4 +284,24 @@ void tgt_cfr_update_global_cfg(struct wlan_objmgr_pdev *pdev) if (cfr_tx_ops->cfr_update_global_cfg) cfr_tx_ops->cfr_update_global_cfg(pdev); } + +QDF_STATUS tgt_cfr_subscribe_ppdu_desc(struct wlan_objmgr_pdev *pdev, + bool is_subscribe) +{ + struct wlan_lmac_if_cfr_tx_ops *cfr_tx_ops = NULL; + struct wlan_objmgr_psoc *psoc = wlan_pdev_get_psoc(pdev); + + if (!psoc) { + cfr_err("Invalid psoc\n"); + return QDF_STATUS_E_INVAL; + } + + cfr_tx_ops = wlan_psoc_get_cfr_txops(psoc); + + if (cfr_tx_ops->cfr_subscribe_ppdu_desc) + return cfr_tx_ops->cfr_subscribe_ppdu_desc(pdev, + is_subscribe); + + return QDF_STATUS_SUCCESS; +} #endif diff --git a/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c b/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c index 73402ce73b33..00e5b50b0d9e 100644 --- a/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c +++ b/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c @@ -1141,4 +1141,10 @@ bool ucfg_cfr_get_rcc_enabled(struct wlan_objmgr_vdev *vdev) return rcc_enabled; } + +QDF_STATUS ucfg_cfr_subscribe_ppdu_desc(struct wlan_objmgr_pdev *pdev, + bool is_subscribe) +{ + return tgt_cfr_subscribe_ppdu_desc(pdev, is_subscribe); +} #endif diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index 7615df4226a2..b0f5a014b8fa 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -553,6 +553,8 @@ struct wlan_lmac_if_cfr_tx_ops { void (*cfr_dump_lut_enh)(struct wlan_objmgr_pdev *pdev); void (*cfr_rx_tlv_process)(struct wlan_objmgr_pdev *pdev, void *nbuf); void (*cfr_update_global_cfg)(struct wlan_objmgr_pdev *pdev); + QDF_STATUS (*cfr_subscribe_ppdu_desc)(struct wlan_objmgr_pdev *pdev, + bool is_subscribe); #endif }; #endif /* WLAN_CFR_ENABLE */