diff --git a/hif/src/ce/ce_assignment.h b/hif/src/ce/ce_assignment.h index 0fbf17d5ea..f12867f187 100644 --- a/hif/src/ce/ce_assignment.h +++ b/hif/src/ce/ce_assignment.h @@ -147,6 +147,7 @@ static struct CE_pipe_config target_ce_config_wlan[] = { { /* CE11 */ 11, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,}, }; +#ifdef WLAN_FEATURE_EPPING static struct CE_attr host_ce_config_wlan_epping_poll[] = { /* host->target HTC control and raw streams */ { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 2048, 0, NULL,}, @@ -207,6 +208,7 @@ static struct CE_pipe_config target_ce_config_wlan_epping[] = { /* CE8 used only by IPA */ { /* CE8 */ 8, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,} }; +#endif #else static struct CE_attr host_ce_config_wlan[] = { /* host->target HTC control and raw streams */ @@ -252,6 +254,7 @@ static struct CE_pipe_config target_ce_config_wlan[] = { { /* CE8 */ 8, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,} }; +#ifdef WLAN_FEATURE_EPPING static struct CE_attr host_ce_config_wlan_epping_poll[] = { /* host->target HTC control and raw streams */ { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL,}, @@ -325,6 +328,7 @@ static struct CE_pipe_config target_ce_config_wlan_epping[] = { { /* CE11 */ 11, PIPEDIR_IN, 0, 0, CE_ATTR_FLAGS, 0,}, }; #endif +#endif static struct CE_attr host_ce_config_wlan_ar9888[] = { /* host->target HTC control and raw streams */ diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 01e69554b4..53c4ee0f0b 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -189,6 +189,7 @@ static struct shadow_reg_cfg target_shadow_reg_cfg_map[] = { #endif }; +#ifdef WLAN_FEATURE_EPPING static struct shadow_reg_cfg target_shadow_reg_cfg_epping[] = { { 0, ADRASTEA_SRC_WR_INDEX_OFFSET}, { 3, ADRASTEA_SRC_WR_INDEX_OFFSET}, @@ -200,6 +201,7 @@ static struct shadow_reg_cfg target_shadow_reg_cfg_epping[] = { { 7, ADRASTEA_DST_WR_INDEX_OFFSET}, { 8, ADRASTEA_DST_WR_INDEX_OFFSET}, }; +#endif /* CE_PCI TABLE */ /* @@ -551,10 +553,10 @@ static struct service_to_pipe target_service_to_ce_map_ar900b[] = { }, }; - static struct shadow_reg_cfg *target_shadow_reg_cfg = target_shadow_reg_cfg_map; static int shadow_cfg_sz = sizeof(target_shadow_reg_cfg_map); +#ifdef WLAN_FEATURE_EPPING static struct service_to_pipe target_service_to_ce_map_wlan_epping[] = { {WMI_DATA_VO_SVC, PIPEDIR_OUT, 3,}, /* out = UL = host -> target */ {WMI_DATA_VO_SVC, PIPEDIR_IN, 2,}, /* in = DL = target -> host */ @@ -575,6 +577,16 @@ static struct service_to_pipe target_service_to_ce_map_wlan_epping[] = { {0, 0, 0,}, /* Must be last */ }; +void hif_select_epping_service_to_pipe_map(struct service_to_pipe + **tgt_svc_map_to_use, + uint32_t *sz_tgt_svc_map_to_use) +{ + *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); +} +#endif + static void hif_select_service_to_pipe_map(struct hif_softc *scn, struct service_to_pipe **tgt_svc_map_to_use, uint32_t *sz_tgt_svc_map_to_use) @@ -583,9 +595,8 @@ static void hif_select_service_to_pipe_map(struct hif_softc *scn, struct hif_target_info *tgt_info = &scn->target_info; 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); + hif_select_epping_service_to_pipe_map(tgt_svc_map_to_use, + sz_tgt_svc_map_to_use); } else { switch (tgt_info->target_type) { default: @@ -2448,8 +2459,23 @@ int hif_wlan_enable(struct hif_softc *scn) mode, QWLAN_VERSIONSTR); } +#ifdef WLAN_FEATURE_EPPING + #define CE_EPPING_USES_IRQ true +void hif_ce_prepare_epping_config(struct HIF_CE_state *hif_state) +{ + if (CE_EPPING_USES_IRQ) + hif_state->host_ce_config = host_ce_config_wlan_epping_irq; + else + hif_state->host_ce_config = host_ce_config_wlan_epping_poll; + hif_state->target_ce_config = target_ce_config_wlan_epping; + hif_state->target_ce_config_sz = sizeof(target_ce_config_wlan_epping); + target_shadow_reg_cfg = target_shadow_reg_cfg_epping; + shadow_cfg_sz = sizeof(target_shadow_reg_cfg_epping); +} +#endif + /** * hif_ce_prepare_config() - load the correct static tables. * @scn: hif context @@ -2468,14 +2494,7 @@ void hif_ce_prepare_config(struct hif_softc *scn) scn->ce_count = HOST_CE_COUNT; /* if epping is enabled we need to use the epping configuration. */ if (QDF_IS_EPPING_ENABLED(mode)) { - if (CE_EPPING_USES_IRQ) - hif_state->host_ce_config = host_ce_config_wlan_epping_irq; - else - hif_state->host_ce_config = host_ce_config_wlan_epping_poll; - hif_state->target_ce_config = target_ce_config_wlan_epping; - hif_state->target_ce_config_sz = sizeof(target_ce_config_wlan_epping); - target_shadow_reg_cfg = target_shadow_reg_cfg_epping; - shadow_cfg_sz = sizeof(target_shadow_reg_cfg_epping); + hif_ce_prepare_epping_config(hif_state); } switch (tgt_info->target_type) { diff --git a/hif/src/ce/ce_main.h b/hif/src/ce/ce_main.h index 61fabeafeb..bfc76650a0 100644 --- a/hif/src/ce/ce_main.h +++ b/hif/src/ce/ce_main.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -218,4 +218,21 @@ void hif_get_target_ce_config(struct hif_softc *scn, struct shadow_reg_cfg **target_shadow_reg_cfg_v1_ret, uint32_t *shadow_cfg_v1_sz_ret); +#ifdef WLAN_FEATURE_EPPING +void hif_ce_prepare_epping_config(struct HIF_CE_state *hif_state); +void hif_select_epping_service_to_pipe_map(struct service_to_pipe + **tgt_svc_map_to_use, + uint32_t *sz_tgt_svc_map_to_use); + +#else +static inline +void hif_ce_prepare_epping_config(struct HIF_CE_state *hif_state) +{ } +static inline +void hif_select_epping_service_to_pipe_map(struct service_to_pipe + **tgt_svc_map_to_use, + uint32_t *sz_tgt_svc_map_to_use) +{ } +#endif + #endif /* __CE_H__ */ diff --git a/utils/epping/inc/epping_main.h b/utils/epping/inc/epping_main.h index 47b1632d85..f2e5075f67 100644 --- a/utils/epping/inc/epping_main.h +++ b/utils/epping/inc/epping_main.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,8 +42,23 @@ #include /* epping_main signatures */ +#ifdef WLAN_FEATURE_EPPING int epping_open(void); void epping_close(void); void epping_disable(void); int epping_enable(struct device *parent_dev); +#else +static inline int epping_open(void) +{ + return QDF_STATUS_E_INVAL; +} + +static inline int epping_enable(struct device *parent_dev) +{ + return QDF_STATUS_E_INVAL; +} + +static inline void epping_close(void) {} +static inline void epping_disable(void) {} +#endif #endif /* end #ifndef EPPING_MAIN_H */ diff --git a/utils/epping/src/epping_main.c b/utils/epping/src/epping_main.c index 3e91a6236a..f93037c43c 100644 --- a/utils/epping/src/epping_main.c +++ b/utils/epping/src/epping_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -73,6 +73,7 @@ #define WLAN_WAIT_TIME_WLANSTART 2000 #endif +#ifdef WLAN_FEATURE_EPPING static struct epping_context *g_epping_ctx; /** @@ -352,3 +353,4 @@ error_end: bmi_cleanup(ol_ctx); return A_ERROR; } +#endif