diff options
| -rw-r--r-- | core/cds/inc/cds_sched.h | 1 | ||||
| -rw-r--r-- | core/cds/src/cds_api.c | 11 | ||||
| -rw-r--r-- | core/utils/epping/inc/epping_internal.h | 4 | ||||
| -rw-r--r-- | core/utils/epping/src/epping_main.c | 44 |
4 files changed, 24 insertions, 36 deletions
diff --git a/core/cds/inc/cds_sched.h b/core/cds/inc/cds_sched.h index 3ccf3cb8c6c3..3d8d367d3d5e 100644 --- a/core/cds/inc/cds_sched.h +++ b/core/cds/inc/cds_sched.h @@ -263,7 +263,6 @@ typedef struct _cds_context_type { void *htc_ctx; - void *epping_ctx; /* * cdf_ctx will be used by cdf * while allocating dma memory diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 5c36ef3944f5..448aee02073d 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1068,10 +1068,6 @@ CDF_STATUS cds_alloc_context(void *p_cds_context, CDF_MODULE_ID moduleID, } case CDF_MODULE_ID_EPPING: - { - pGpModContext = &(gp_cds_context->epping_ctx); - break; - } case CDF_MODULE_ID_SME: case CDF_MODULE_ID_PE: case CDF_MODULE_ID_HDD: @@ -1154,18 +1150,13 @@ CDF_STATUS cds_free_context(void *p_cds_context, CDF_MODULE_ID moduleID, break; } - case CDF_MODULE_ID_EPPING: - { - pGpModContext = &(gp_cds_context->epping_ctx); - break; - } - case CDF_MODULE_ID_TXRX: { pGpModContext = &(gp_cds_context->pdev_txrx_ctx); break; } + case CDF_MODULE_ID_EPPING: case CDF_MODULE_ID_HDD: case CDF_MODULE_ID_SME: case CDF_MODULE_ID_PE: diff --git a/core/utils/epping/inc/epping_internal.h b/core/utils/epping/inc/epping_internal.h index ab68c2b18b49..0ea5d526558c 100644 --- a/core/utils/epping/inc/epping_internal.h +++ b/core/utils/epping/inc/epping_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -104,7 +104,7 @@ typedef struct { } epping_poll_t; #endif -typedef struct epping_context_s { +typedef struct epping_context { int32_t con_mode; char *pwlan_module_name; uint32_t target_type; diff --git a/core/utils/epping/src/epping_main.c b/core/utils/epping/src/epping_main.c index a625c0b109b5..2fa63759009c 100644 --- a/core/utils/epping/src/epping_main.c +++ b/core/utils/epping/src/epping_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -73,6 +73,8 @@ #define WLAN_WAIT_TIME_WLANSTART 2000 #endif +static struct epping_context *g_epping_ctx; + /** * epping_open(): End point ping driver open Function * @@ -83,22 +85,17 @@ */ int epping_open(void) { - epping_context_t *pEpping_ctx; - v_CONTEXT_t cds_context; - CDF_STATUS status = CDF_STATUS_SUCCESS; - EPPING_LOG(CDF_TRACE_LEVEL_INFO_HIGH, "%s: Enter", __func__); - cds_context = cds_get_global_context(); - status = cds_alloc_context(cds_context, CDF_MODULE_ID_EPPING, - (void **)&pEpping_ctx, - sizeof(*pEpping_ctx)); - if (status != CDF_STATUS_SUCCESS) { - EPPING_LOG(CDF_TRACE_LEVEL_ERROR, "%s: cannot alloc epping context", __func__); + g_epping_ctx = cdf_mem_malloc(sizeof(*g_epping_ctx)); + + if (g_epping_ctx == NULL) { + EPPING_LOG(CDF_TRACE_LEVEL_ERROR, + "%s: cannot alloc epping context", __func__); return -ENOMEM; } - pEpping_ctx->con_mode = cds_get_conparam(); + g_epping_ctx->con_mode = cds_get_conparam(); return 0; } @@ -114,7 +111,7 @@ void epping_disable(void) { epping_context_t *pEpping_ctx; - pEpping_ctx = cds_get_context(CDF_MODULE_ID_EPPING); + pEpping_ctx = g_epping_ctx; if (pEpping_ctx == NULL) { EPPING_LOG(CDF_TRACE_LEVEL_FATAL, "%s: error: pEpping_ctx = NULL", __func__); @@ -140,30 +137,31 @@ void epping_disable(void) */ void epping_close(void) { - epping_context_t *pEpping_ctx; + epping_context_t *to_free; - pEpping_ctx = cds_get_context(CDF_MODULE_ID_EPPING); - if (pEpping_ctx == NULL) { + + if (g_epping_ctx == NULL) { EPPING_LOG(CDF_TRACE_LEVEL_FATAL, - "%s: error: pEpping_ctx = NULL", __func__); + "%s: error: g_epping_ctx = NULL", __func__); return; } - cds_free_context(NULL, CDF_MODULE_ID_EPPING, - cds_get_context(CDF_MODULE_ID_EPPING)); + + to_free = g_epping_ctx; + g_epping_ctx = NULL; + cdf_mem_free(to_free); } static void epping_target_suspend_acknowledge(void *context) { - epping_context_t *pEpping_ctx = cds_get_context(CDF_MODULE_ID_EPPING); int wow_nack = *((int *)context); - if (NULL == pEpping_ctx) { + if (NULL == g_epping_ctx) { EPPING_LOG(CDF_TRACE_LEVEL_FATAL, "%s: epping_ctx is NULL", __func__); return; } /* EPPING_TODO: do we need wow_nack? */ - pEpping_ctx->wow_nack = wow_nack; + g_epping_ctx->wow_nack = wow_nack; } /** @@ -195,7 +193,7 @@ int epping_enable(struct device *parent_dev) return ret; } - pEpping_ctx = cds_get_context(CDF_MODULE_ID_EPPING); + pEpping_ctx = g_epping_ctx; if (pEpping_ctx == NULL) { EPPING_LOG(CDF_TRACE_LEVEL_FATAL, "%s: Failed to get pEpping_ctx", __func__); |
