summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGovind Singh <govinds@codeaurora.org>2017-05-01 10:19:45 +0530
committersnandini <snandini@codeaurora.org>2017-05-11 10:44:15 -0700
commitc8886dcdf7283d3d4eb2fce713e1cdfb19e153fd (patch)
tree320cebecb582102cd6d315e2f7bc142645f7ac52
parenta4cef15587ad518954b9964c2e66c90233fda72b (diff)
qcacmn: Assign host/target ce config dynamically
HOST and TRAGET ce configuration are mapped statically by using compile time macro. Assign host/target ce config dynamically to get rid of compile time flags. Change-Id: Ic6bf85cb68d89dc92fb4963da234edde968aa8c4 CRs-Fixed: 2041887
-rw-r--r--hif/src/ce/ce_assignment.h30
-rw-r--r--hif/src/ce/ce_main.c62
2 files changed, 60 insertions, 32 deletions
diff --git a/hif/src/ce/ce_assignment.h b/hif/src/ce/ce_assignment.h
index 06269f8182d8..8cb9b3c5f972 100644
--- a/hif/src/ce/ce_assignment.h
+++ b/hif/src/ce/ce_assignment.h
@@ -84,8 +84,7 @@ static void hif_target_dump_access_log(void);
#define PIPEDIR_INOUT_H2H 4
#endif
-#ifdef QCA_WIFI_3_0
-static struct CE_attr host_ce_config_wlan[] = {
+static struct CE_attr host_ce_cfg_wcn3990[] = {
/* host->target HTC control and raw streams */
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 2048, 0, NULL,},
/* target->host HTT + HTC control */
@@ -115,7 +114,7 @@ static struct CE_attr host_ce_config_wlan[] = {
{ /* CE11 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
};
-static struct CE_pipe_config target_ce_config_wlan[] = {
+static struct CE_pipe_config target_ce_cfg_wcn3990[] = {
/* host->target HTC control and raw streams */
{ /* CE0 */ 0, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,},
/* target->host HTT */
@@ -146,7 +145,7 @@ static struct CE_pipe_config target_ce_config_wlan[] = {
{ /* CE11 */ 11, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
};
-static struct CE_attr host_ce_config_wlan_epping_poll[] = {
+static struct CE_attr host_ce_cfg_wcn3990_epping_poll[] = {
/* host->target HTC control and raw streams */
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 2048, 0, NULL,},
/* target->host EP-ping */
@@ -165,7 +164,7 @@ static struct CE_attr host_ce_config_wlan_epping_poll[] = {
{ /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
};
-static struct CE_attr host_ce_config_wlan_epping_irq[] = {
+static struct CE_attr host_ce_cfg_wcn3990_epping_irq[] = {
/* host->target HTC control and raw streams */
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 2048, 0, NULL,},
/* target->host EP-ping */
@@ -186,7 +185,7 @@ static struct CE_attr host_ce_config_wlan_epping_irq[] = {
/*
* EP-ping firmware's CE configuration
*/
-static struct CE_pipe_config target_ce_config_wlan_epping[] = {
+static struct CE_pipe_config target_ce_cfg_wcn3990_epping[] = {
/* host->target HTC control and raw streams */
{ /* CE0 */ 0, PIPEDIR_OUT, 16, 2048, CE_ATTR_FLAGS, 0,},
/* target->host EP-ping */
@@ -206,8 +205,8 @@ 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,}
};
-#else
-static struct CE_attr host_ce_config_wlan[] = {
+
+static struct CE_attr host_ce_cfg_ar6320[] = {
/* host->target HTC control and raw streams */
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL,},
/* target->host HTT + HTC control */
@@ -229,7 +228,7 @@ static struct CE_attr host_ce_config_wlan[] = {
0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
};
-static struct CE_pipe_config target_ce_config_wlan[] = {
+static struct CE_pipe_config target_ce_cfg_ar6320[] = {
/* host->target HTC control and raw streams */
{ /* CE0 */ 0, PIPEDIR_OUT, 32, 256, CE_ATTR_FLAGS, 0,},
/* target->host HTT + HTC control */
@@ -251,7 +250,7 @@ static struct CE_pipe_config target_ce_config_wlan[] = {
{ /* CE8 */ 8, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,}
};
-static struct CE_attr host_ce_config_wlan_epping_poll[] = {
+static struct CE_attr host_ce_cfg_ar6320_epping_poll[] = {
/* host->target HTC control and raw streams */
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL,},
/* target->host EP-ping */
@@ -274,7 +273,7 @@ static struct CE_attr host_ce_config_wlan_epping_poll[] = {
{ /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
{ /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
};
-static struct CE_attr host_ce_config_wlan_epping_irq[] = {
+static struct CE_attr host_ce_cfg_ar6320_epping_irq[] = {
/* host->target HTC control and raw streams */
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL,},
/* target->host EP-ping */
@@ -300,7 +299,7 @@ static struct CE_attr host_ce_config_wlan_epping_irq[] = {
/*
* EP-ping firmware's CE configuration
*/
-static struct CE_pipe_config target_ce_config_wlan_epping[] = {
+static struct CE_pipe_config target_ce_cfg_ar6320_epping[] = {
/* host->target HTC control and raw streams */
{ /* CE0 */ 0, PIPEDIR_OUT, 16, 256, CE_ATTR_FLAGS, 0,},
/* target->host EP-ping */
@@ -323,7 +322,6 @@ static struct CE_pipe_config target_ce_config_wlan_epping[] = {
{ /* CE10 */ 10, PIPEDIR_IN, 0, 0, CE_ATTR_FLAGS, 0,},
{ /* CE11 */ 11, PIPEDIR_IN, 0, 0, CE_ATTR_FLAGS, 0,},
};
-#endif
static struct CE_attr host_ce_config_wlan_ar9888[] = {
/* host->target HTC control and raw streams */
@@ -446,7 +444,7 @@ static struct CE_pipe_config target_ce_config_wlan_ar900b[] = {
-static struct CE_attr *host_ce_config = host_ce_config_wlan;
-static struct CE_pipe_config *target_ce_config = target_ce_config_wlan;
-static int target_ce_config_sz = sizeof(target_ce_config_wlan);
+static struct CE_attr *host_ce_config;
+static struct CE_pipe_config *target_ce_config;
+static int target_ce_config_sz;
#endif /* __HIF_PCI_INTERNAL_H__ */
diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c
index 7e3cd91f979c..dcd7a95fabc7 100644
--- a/hif/src/ce/ce_main.c
+++ b/hif/src/ce/ce_main.c
@@ -2115,25 +2115,55 @@ void hif_ce_prepare_config(struct hif_softc *scn)
struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_target_info *tgt_info = hif_get_target_info_handle(hif_hdl);
- /* if epping is enabled we need to use the epping configuration. */
- 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;
- target_ce_config = target_ce_config_wlan_epping;
- target_ce_config_sz = sizeof(target_ce_config_wlan_epping);
- target_service_to_ce_map =
- target_service_to_ce_map_wlan_epping;
- target_service_to_ce_map_sz =
- sizeof(target_service_to_ce_map_wlan_epping);
- target_shadow_reg_cfg = target_shadow_reg_cfg_epping;
- shadow_cfg_sz = sizeof(target_shadow_reg_cfg_epping);
- }
-
switch (tgt_info->target_type) {
default:
break;
+ case TARGET_TYPE_AR6320V1:
+ case TARGET_TYPE_AR6320V2:
+ case TARGET_TYPE_AR6320V3:
+ if (QDF_IS_EPPING_ENABLED(mode)) {
+ if (CE_EPPING_USES_IRQ)
+ host_ce_config = host_ce_cfg_ar6320_epping_irq;
+ else
+ host_ce_config =
+ host_ce_cfg_ar6320_epping_poll;
+ target_ce_config = target_ce_cfg_ar6320_epping;
+ target_ce_config_sz =
+ sizeof(target_ce_cfg_ar6320_epping);
+ target_service_to_ce_map =
+ target_service_to_ce_map_wlan_epping;
+ target_service_to_ce_map_sz =
+ sizeof(target_service_to_ce_map_wlan_epping);
+ target_shadow_reg_cfg = target_shadow_reg_cfg_epping;
+ shadow_cfg_sz = sizeof(target_shadow_reg_cfg_epping);
+ } else {
+ host_ce_config = host_ce_cfg_ar6320;
+ target_ce_config = target_ce_cfg_ar6320;
+ target_ce_config_sz = sizeof(target_ce_cfg_ar6320);
+ }
+ break;
+ case TARGET_TYPE_ADRASTEA:
+ if (QDF_IS_EPPING_ENABLED(mode)) {
+ if (CE_EPPING_USES_IRQ)
+ host_ce_config = host_ce_cfg_wcn3990_epping_irq;
+ else
+ host_ce_config =
+ host_ce_cfg_wcn3990_epping_poll;
+ target_ce_config = target_ce_cfg_wcn3990_epping;
+ target_ce_config_sz =
+ sizeof(target_ce_cfg_wcn3990_epping);
+ target_service_to_ce_map =
+ target_service_to_ce_map_wlan_epping;
+ target_service_to_ce_map_sz =
+ sizeof(target_service_to_ce_map_wlan_epping);
+ target_shadow_reg_cfg = target_shadow_reg_cfg_epping;
+ shadow_cfg_sz = sizeof(target_shadow_reg_cfg_epping);
+ } else {
+ host_ce_config = host_ce_cfg_wcn3990;
+ target_ce_config = target_ce_cfg_wcn3990;
+ target_ce_config_sz = sizeof(target_ce_cfg_wcn3990);
+ }
+ break;
case TARGET_TYPE_AR900B:
case TARGET_TYPE_QCA9984:
case TARGET_TYPE_IPQ4019: