From 75ef5a55f28545b5ec6ddbc7533cc039a6f13ce6 Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Thu, 14 Apr 2016 17:15:49 -0700 Subject: [PATCH] qcacmn: Use qdf macro for epping mode Use QDF macro to check if we are in epping mode. Hardcode the ce engine to use interrupts in epping mode. Change-Id: Ie58c2efffdced03f24905469319eabc0af4ed228 CRs-Fixed: 1003792 --- hif/src/ce/ce_bmi.c | 1 - hif/src/ce/ce_diag.c | 1 - hif/src/ce/ce_main.c | 13 +++++++------ hif/src/ce/ce_service.c | 7 +++---- hif/src/dispatcher/multibus_pci.c | 3 +-- hif/src/hif_main.c | 5 ++--- hif/src/pcie/if_pci.c | 5 ++--- qdf/inc/qdf_types.h | 2 ++ 8 files changed, 17 insertions(+), 20 deletions(-) diff --git a/hif/src/ce/ce_bmi.c b/hif/src/ce/ce_bmi.c index b4b1b968ae67..881e2558dba4 100644 --- a/hif/src/ce/ce_bmi.c +++ b/hif/src/ce/ce_bmi.c @@ -43,7 +43,6 @@ #ifdef CONFIG_CNSS #include #endif -#include "epping_main.h" #include "hif_debug.h" /* Track a BMI transaction that is in progress */ diff --git a/hif/src/ce/ce_diag.c b/hif/src/ce/ce_diag.c index 14d89107038f..72d67316748f 100644 --- a/hif/src/ce/ce_diag.c +++ b/hif/src/ce/ce_diag.c @@ -44,7 +44,6 @@ #include #endif #include "hif_debug.h" -#include "epping_main.h" void hif_dump_target_memory(struct hif_opaque_softc *hif_ctx, void *ramdump_base, diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 141738c1eec7..f1befafc1e4d 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -42,7 +42,6 @@ #ifdef CONFIG_CNSS #include #endif -#include "epping_main.h" #include "hif_debug.h" #include "ce_internal.h" #include "ce_reg.h" @@ -358,7 +357,7 @@ bool ce_mark_datapath(struct CE_state *ce_state) bool rc = false; if (ce_state != NULL) { - if (WLAN_IS_EPPING_ENABLED(hif_get_conparam(ce_state->scn))) { + if (QDF_IS_EPPING_ENABLED(hif_get_conparam(ce_state->scn))) { svc_map = target_service_to_ce_map_wlan_epping; map_sz = sizeof(target_service_to_ce_map_wlan_epping) / sizeof(struct service_to_pipe); @@ -1737,7 +1736,7 @@ int hif_wlan_enable(struct hif_softc *scn) if (QDF_GLOBAL_FTM_MODE == con_mode) mode = ICNSS_FTM; - else if (WLAN_IS_EPPING_ENABLED(con_mode)) + else if (QDF_IS_EPPING_ENABLED(con_mode)) mode = ICNSS_EPPING; else mode = ICNSS_MISSION; @@ -1748,6 +1747,8 @@ int hif_wlan_enable(struct hif_softc *scn) return icnss_wlan_enable(&cfg, mode, QWLAN_VERSIONSTR); } +#define CE_EPPING_USES_IRQ true + /** * hif_ce_prepare_config() - load the correct static tables. * @scn: hif context @@ -1758,8 +1759,8 @@ void hif_ce_prepare_config(struct hif_softc *scn) { uint32_t mode = hif_get_conparam(scn); /* if epping is enabled we need to use the epping configuration. */ - if (WLAN_IS_EPPING_ENABLED(mode)) { - if (WLAN_IS_EPPING_IRQ(mode)) + if (QDF_IS_EPPING_ENABLED(mode)) { + if (CE_EPPING_USES_IRQ) host_ce_config = host_ce_config_wlan_epping_irq; else host_ce_config = host_ce_config_wlan_epping_poll; @@ -2241,7 +2242,7 @@ int hif_map_service_to_pipe(struct hif_opaque_softc *hif_hdl, uint16_t svc_id, struct hif_softc *scn = HIF_GET_SOFTC(hif_hdl); uint32_t mode = hif_get_conparam(scn); - if (WLAN_IS_EPPING_ENABLED(mode)) { + if (QDF_IS_EPPING_ENABLED(mode)) { tgt_svc_map_to_use = target_service_to_ce_map_wlan_epping; sz_tgt_svc_map_to_use = sizeof(target_service_to_ce_map_wlan_epping); diff --git a/hif/src/ce/ce_service.c b/hif/src/ce/ce_service.c index 031e60b19b93..74950bd530f4 100644 --- a/hif/src/ce/ce_service.c +++ b/hif/src/ce/ce_service.c @@ -33,7 +33,6 @@ #include "ce_reg.h" #include "qdf_lock.h" #include "regtable.h" -#include "epping_main.h" #include "hif_main.h" #include "hif_debug.h" @@ -1612,7 +1611,7 @@ more_completions: &toeplitz_hash_result) == QDF_STATUS_SUCCESS) { if (CE_id != CE_HTT_H2T_MSG || - WLAN_IS_EPPING_ENABLED(mode)) { + QDF_IS_EPPING_ENABLED(mode)) { qdf_spin_unlock(&CE_state->ce_index_lock); CE_state->send_cb((struct CE_handle *)CE_state, CE_context, transfer_context, @@ -1684,7 +1683,7 @@ more_watermarks: * we find no more events to process. */ if (CE_state->recv_cb && ce_recv_entries_done_nolock(scn, CE_state)) { - if (WLAN_IS_EPPING_ENABLED(mode) || + if (QDF_IS_EPPING_ENABLED(mode) || more_comp_cnt++ < CE_TXRX_COMP_CHECK_THRESHOLD) { goto more_completions; } else { @@ -1698,7 +1697,7 @@ more_watermarks: } if (CE_state->send_cb && ce_send_entries_done_nolock(scn, CE_state)) { - if (WLAN_IS_EPPING_ENABLED(mode) || + if (QDF_IS_EPPING_ENABLED(mode) || more_snd_comp_cnt++ < CE_TXRX_COMP_CHECK_THRESHOLD) { goto more_completions; } else { diff --git a/hif/src/dispatcher/multibus_pci.c b/hif/src/dispatcher/multibus_pci.c index 7bb21b13d7e4..d06765a1fdf8 100644 --- a/hif/src/dispatcher/multibus_pci.c +++ b/hif/src/dispatcher/multibus_pci.c @@ -26,7 +26,6 @@ */ #include "hif.h" -#include "epping_main.h" #include "hif_main.h" #include "multibus.h" #include "pci_api.h" @@ -52,7 +51,7 @@ QDF_STATUS hif_initialize_pci_ops(struct hif_softc *hif_sc) /* do not put the target to sleep for epping or maxperf mode */ if (CONFIG_ATH_PCIE_MAX_PERF == 0 && - !WLAN_IS_EPPING_ENABLED(hif_get_conparam(hif_sc))) + !QDF_IS_EPPING_ENABLED(hif_get_conparam(hif_sc))) bus_ops->hif_target_sleep_state_adjust = &hif_pci_target_sleep_state_adjust; else diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c index d6021ac8d85b..acdd0f145b80 100644 --- a/hif/src/hif_main.c +++ b/hif/src/hif_main.c @@ -47,7 +47,6 @@ #ifdef CONFIG_CNSS #include #endif -#include "epping_main.h" #include "hif_debug.h" #include "mp_dev.h" #include "platform_icnss.h" @@ -310,7 +309,7 @@ uint32_t hif_hia_item_address(uint32_t target_type, uint32_t item_offset) */ bool hif_max_num_receives_reached(struct hif_softc *scn, unsigned int count) { - if (WLAN_IS_EPPING_ENABLED(hif_get_conparam(scn))) + if (QDF_IS_EPPING_ENABLED(hif_get_conparam(scn))) return count > 120; else return count > MAX_NUM_OF_RECEIVES; @@ -535,7 +534,7 @@ void hif_wlan_disable(struct hif_softc *scn) if (QDF_GLOBAL_FTM_MODE == con_mode) mode = ICNSS_FTM; - else if (WLAN_IS_EPPING_ENABLED(con_mode)) + else if (QDF_IS_EPPING_ENABLED(con_mode)) mode = ICNSS_EPPING; else mode = ICNSS_MISSION; diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index 0d78d85d5878..efae5c02ac57 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -52,7 +52,6 @@ #else #include "cnss_stub.h" #endif -#include "epping_main.h" #include "mp_dev.h" #include "hif_debug.h" @@ -1113,7 +1112,7 @@ static void hif_pm_runtime_start(struct hif_pci_softc *sc) return; } - if (mode == QDF_GLOBAL_FTM_MODE || WLAN_IS_EPPING_ENABLED(mode)) { + if (mode == QDF_GLOBAL_FTM_MODE || QDF_IS_EPPING_ENABLED(mode)) { HIF_INFO("%s: RUNTIME PM is disabled for FTM/EPPING mode\n", __func__); return; @@ -1145,7 +1144,7 @@ static void hif_pm_runtime_stop(struct hif_pci_softc *sc) if (!ol_sc->hif_config.enable_runtime_pm) return; - if (mode == QDF_GLOBAL_FTM_MODE || WLAN_IS_EPPING_ENABLED(mode)) + if (mode == QDF_GLOBAL_FTM_MODE || QDF_IS_EPPING_ENABLED(mode)) return; cnss_runtime_exit(sc->dev); diff --git a/qdf/inc/qdf_types.h b/qdf/inc/qdf_types.h index b0e312677ca0..837e849c3f44 100644 --- a/qdf/inc/qdf_types.h +++ b/qdf/inc/qdf_types.h @@ -322,6 +322,8 @@ enum tQDF_GLOBAL_CON_MODE { QDF_GLOBAL_MAX_MODE }; +#define QDF_IS_EPPING_ENABLED(mode) (mode == QDF_GLOBAL_EPPING_MODE) + #define qdf_print(args...) \ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, ## args)