From fb54ab0eac58d30a0ea9ae60628a87e3ea2edf1c Mon Sep 17 00:00:00 2001 From: Anurag Chouhan Date: Thu, 18 Feb 2016 18:00:46 +0530 Subject: qcacld-3.0: Add QDF status Replace CDF status with QDF status Change-Id: I7170c8ae4c5bd97a8f0f383af637bb2ec312f082 CRs-Fixed: 981188 --- core/bmi/src/bmi.c | 106 ++++++++++++++++++------------------ core/bmi/src/bmi_1.c | 60 ++++++++++----------- core/bmi/src/bmi_2.c | 102 +++++++++++++++++------------------ core/bmi/src/i_bmi.h | 40 +++++++------- core/bmi/src/ol_fw.c | 148 +++++++++++++++++++++++++-------------------------- 5 files changed, 228 insertions(+), 228 deletions(-) (limited to 'core/bmi/src') diff --git a/core/bmi/src/bmi.c b/core/bmi/src/bmi.c index 782792fb2c4a..3e72c76af96c 100644 --- a/core/bmi/src/bmi.c +++ b/core/bmi/src/bmi.c @@ -37,7 +37,7 @@ /* Enable BMI_TEST COMMANDs; The Value 0x09 is randomly choosen */ #define BMI_TEST_ENABLE (0x09) -static CDF_STATUS +static QDF_STATUS bmi_command_test(uint32_t command, uint32_t address, uint8_t *data, uint32_t length, struct ol_context *ol_ctx) { @@ -53,10 +53,10 @@ bmi_command_test(uint32_t command, uint32_t address, uint8_t *data, default: break; } - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS bmi_init(struct ol_context *ol_ctx) +QDF_STATUS bmi_init(struct ol_context *ol_ctx) { struct bmi_info *info = GET_BMI_CONTEXT(ol_ctx); struct hif_opaque_softc *scn = ol_ctx->scn; @@ -65,12 +65,12 @@ CDF_STATUS bmi_init(struct ol_context *ol_ctx) if (!scn) { BMI_ERR("Invalid scn Context"); bmi_assert(0); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } if (!cdf_dev->dev) { BMI_ERR("%s: Invalid Device Pointer", __func__); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } info->bmi_done = false; @@ -81,7 +81,7 @@ CDF_STATUS bmi_init(struct ol_context *ol_ctx) &info->bmi_cmd_da, 0); if (!info->bmi_cmd_buff) { BMI_ERR("No Memory for BMI Command"); - return CDF_STATUS_E_NOMEM; + return QDF_STATUS_E_NOMEM; } } @@ -94,12 +94,12 @@ CDF_STATUS bmi_init(struct ol_context *ol_ctx) goto end; } } - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; end: cdf_os_mem_free_consistent(cdf_dev, MAX_BMI_CMDBUF_SZ, info->bmi_cmd_buff, info->bmi_cmd_da, 0); info->bmi_cmd_buff = NULL; - return CDF_STATUS_E_NOMEM; + return QDF_STATUS_E_NOMEM; } void bmi_cleanup(struct ol_context *ol_ctx) @@ -128,22 +128,22 @@ void bmi_cleanup(struct ol_context *ol_ctx) } -CDF_STATUS bmi_done(struct ol_context *ol_ctx) +QDF_STATUS bmi_done(struct ol_context *ol_ctx) { - CDF_STATUS status = CDF_STATUS_SUCCESS; + QDF_STATUS status = QDF_STATUS_SUCCESS; if (NO_BMI) return status; status = bmi_done_local(ol_ctx); - if (status != CDF_STATUS_SUCCESS) + if (status != QDF_STATUS_SUCCESS) BMI_ERR("BMI_DONE Failed status:%d", status); return status; } -CDF_STATUS +QDF_STATUS bmi_get_target_info(struct bmi_target_info *targ_info, struct ol_context *ol_ctx) { @@ -158,12 +158,12 @@ bmi_get_target_info(struct bmi_target_info *targ_info, if (info->bmi_done) { BMI_ERR("BMI Phase is Already Done"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } if (!bmi_cmd_buff || !bmi_rsp_buff) { BMI_ERR("%s:BMI CMD/RSP Buffer is NULL", __func__); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } cid = BMI_GET_TARGET_INFO; @@ -175,11 +175,11 @@ bmi_get_target_info(struct bmi_target_info *targ_info, BMI_EXCHANGE_TIMEOUT_MS); if (status) { BMI_ERR("Failed to target info: status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } cdf_mem_copy(targ_info, bmi_rsp_buff, length); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } #ifdef FEATURE_BMI_2 @@ -194,7 +194,7 @@ static inline uint32_t bmi_get_test_addr(void) } #endif -CDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx) +QDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx) { uint8_t data[10], out[10]; uint32_t address; @@ -202,12 +202,12 @@ CDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx) struct hif_opaque_softc *scn = ol_ctx->scn; if (NO_BMI) - return CDF_STATUS_SUCCESS; /* no BMI for Q6 bring up */ + return QDF_STATUS_SUCCESS; /* no BMI for Q6 bring up */ if (!scn) { BMI_ERR("Invalid scn context"); bmi_assert(0); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } #ifdef CONFIG_CNSS if (BMI_TEST_ENABLE == cnss_get_bmi_setup()) { @@ -215,7 +215,7 @@ CDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx) BMI_DBG("ret:%d writing data:%s\n", ret, data); address = bmi_get_test_addr(); - if (bmi_init(ol_ctx) != CDF_STATUS_SUCCESS) { + if (bmi_init(ol_ctx) != QDF_STATUS_SUCCESS) { BMI_WARN("BMI_INIT Failed; No Memory!"); goto end; } @@ -229,7 +229,7 @@ end: return bmi_firmware_download(ol_ctx); } -CDF_STATUS bmi_read_soc_register(uint32_t address, uint32_t *param, +QDF_STATUS bmi_read_soc_register(uint32_t address, uint32_t *param, struct ol_context *ol_ctx) { struct hif_opaque_softc *scn = ol_ctx->scn; @@ -248,7 +248,7 @@ CDF_STATUS bmi_read_soc_register(uint32_t address, uint32_t *param, if (info->bmi_done) { BMI_DBG("Command disallowed"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } BMI_DBG("BMI Read SOC Register:device: 0x%p, address: 0x%x", @@ -266,15 +266,15 @@ CDF_STATUS bmi_read_soc_register(uint32_t address, uint32_t *param, bmi_rsp_buff, ¶m_len, BMI_EXCHANGE_TIMEOUT_MS); if (status) { BMI_DBG("Unable to read from the device; status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } cdf_mem_copy(param, bmi_rsp_buff, sizeof(*param)); BMI_DBG("BMI Read SOC Register: Exit value: %d", *param); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS bmi_write_soc_register(uint32_t address, uint32_t param, +QDF_STATUS bmi_write_soc_register(uint32_t address, uint32_t param, struct ol_context *ol_ctx) { struct hif_opaque_softc *scn = ol_ctx->scn; @@ -292,7 +292,7 @@ CDF_STATUS bmi_write_soc_register(uint32_t address, uint32_t param, if (info->bmi_done) { BMI_DBG("Command disallowed"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } BMI_DBG("SOC Register Write:device:0x%p, addr:0x%x, param:%d", @@ -311,14 +311,14 @@ CDF_STATUS bmi_write_soc_register(uint32_t address, uint32_t param, NULL, NULL, 0); if (status) { BMI_ERR("Unable to write to the device: status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } BMI_DBG("BMI Read SOC Register: Exit"); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS +QDF_STATUS bmilz_data(uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx) { uint32_t cid; @@ -337,7 +337,7 @@ bmilz_data(uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx) if (info->bmi_done) { BMI_ERR("Command disallowed"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } BMI_DBG("BMI Send LZ Data: device: 0x%p, length: %d", @@ -363,17 +363,17 @@ bmilz_data(uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx) if (status) { BMI_ERR("Failed to write to the device: status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } remaining -= txlen; } BMI_DBG("BMI LZ Data: Exit"); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS bmi_sign_stream_start(uint32_t address, uint8_t *buffer, +QDF_STATUS bmi_sign_stream_start(uint32_t address, uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx) { uint32_t cid; @@ -394,7 +394,7 @@ CDF_STATUS bmi_sign_stream_start(uint32_t address, uint8_t *buffer, if (info->bmi_done) { BMI_ERR("Command disallowed"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } BMI_ERR("Sign Stream start:device:0x%p, addr:0x%x, length:%d", @@ -431,16 +431,16 @@ CDF_STATUS bmi_sign_stream_start(uint32_t address, uint8_t *buffer, if (status) { BMI_ERR("Unable to write to the device: status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } remaining -= txlen; } BMI_DBG("BMI SIGN Stream Start: Exit"); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS +QDF_STATUS bmilz_stream_start(uint32_t address, struct ol_context *ol_ctx) { uint32_t cid; @@ -457,7 +457,7 @@ bmilz_stream_start(uint32_t address, struct ol_context *ol_ctx) if (info->bmi_done) { BMI_DBG("Command disallowed"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } BMI_DBG("BMI LZ Stream Start: (device: 0x%p, address: 0x%x)", scn, address); @@ -473,23 +473,23 @@ bmilz_stream_start(uint32_t address, struct ol_context *ol_ctx) if (status) { BMI_ERR("Unable to Start LZ Stream to the device status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } BMI_DBG("BMI LZ Stream: Exit"); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS +QDF_STATUS bmi_fast_download(uint32_t address, uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx) { - CDF_STATUS status = CDF_STATUS_E_FAILURE; + QDF_STATUS status = QDF_STATUS_E_FAILURE; uint32_t last_word = 0; uint32_t last_word_offset = length & ~0x3; uint32_t unaligned_bytes = length & 0x3; status = bmilz_stream_start(address, ol_ctx); - if (status != CDF_STATUS_SUCCESS) + if (status != QDF_STATUS_SUCCESS) goto end; /* copy the last word into a zero padded buffer */ @@ -499,13 +499,13 @@ bmi_fast_download(uint32_t address, uint8_t *buffer, status = bmilz_data(buffer, last_word_offset, ol_ctx); - if (status != CDF_STATUS_SUCCESS) + if (status != QDF_STATUS_SUCCESS) goto end; if (unaligned_bytes) status = bmilz_data((uint8_t *) &last_word, 4, ol_ctx); - if (status != CDF_STATUS_SUCCESS) + if (status != QDF_STATUS_SUCCESS) /* * Close compressed stream and open a new (fake) one. * This serves mainly to flush Target caches. @@ -517,23 +517,23 @@ end: /** * ol_cds_init() - API to initialize global CDS OL Context - * @cdf_dev: CDF Device + * @cdf_dev: QDF Device * @hif_ctx: HIF Context * * Return: Success/Failure */ -CDF_STATUS ol_cds_init(cdf_device_t cdf_dev, void *hif_ctx) +QDF_STATUS ol_cds_init(cdf_device_t cdf_dev, void *hif_ctx) { struct ol_context *ol_info; - CDF_STATUS status = CDF_STATUS_SUCCESS; + QDF_STATUS status = QDF_STATUS_SUCCESS; if (NO_BMI) - return CDF_STATUS_SUCCESS; /* no BMI for Q6 bring up */ + return QDF_STATUS_SUCCESS; /* no BMI for Q6 bring up */ - status = cds_alloc_context(cds_get_global_context(), CDF_MODULE_ID_BMI, + status = cds_alloc_context(cds_get_global_context(), QDF_MODULE_ID_BMI, (void **)&ol_info, sizeof(*ol_info)); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("%s: CDS Allocation failed for ol_bmi context", __func__); return status; @@ -555,10 +555,10 @@ CDF_STATUS ol_cds_init(cdf_device_t cdf_dev, void *hif_ctx) */ void ol_cds_free(void) { - struct ol_context *ol_info = cds_get_context(CDF_MODULE_ID_BMI); + struct ol_context *ol_info = cds_get_context(QDF_MODULE_ID_BMI); if (NO_BMI) return; - cds_free_context(cds_get_global_context(), CDF_MODULE_ID_BMI, ol_info); + cds_free_context(cds_get_global_context(), QDF_MODULE_ID_BMI, ol_info); } diff --git a/core/bmi/src/bmi_1.c b/core/bmi/src/bmi_1.c index 331d1db27dd9..d95dbe75b1bb 100644 --- a/core/bmi/src/bmi_1.c +++ b/core/bmi/src/bmi_1.c @@ -30,7 +30,7 @@ /* APIs visible to the driver */ -CDF_STATUS +QDF_STATUS bmi_read_memory(uint32_t address, uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx) { @@ -48,12 +48,12 @@ bmi_read_memory(uint32_t address, if (info->bmi_done) { BMI_DBG("command disallowed"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } if (!info->bmi_cmd_buff || !info->bmi_rsp_buff) { BMI_ERR("BMI Initialization hasn't done"); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } bmi_assert(BMI_COMMAND_FITS(BMI_DATASZ_MAX + sizeof(cid) + @@ -88,7 +88,7 @@ bmi_read_memory(uint32_t address, BMI_EXCHANGE_TIMEOUT_MS); if (status) { BMI_ERR("Unable to read from the device"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } if (remaining == rxlen) { cdf_mem_copy(&buffer[length - remaining + align], @@ -103,10 +103,10 @@ bmi_read_memory(uint32_t address, } BMI_DBG("BMI Read Memory: Exit"); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS bmi_write_memory(uint32_t address, uint8_t *buffer, uint32_t length, +QDF_STATUS bmi_write_memory(uint32_t address, uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx) { struct hif_opaque_softc *scn = ol_ctx->scn; @@ -124,12 +124,12 @@ CDF_STATUS bmi_write_memory(uint32_t address, uint8_t *buffer, uint32_t length, if (info->bmi_done) { BMI_ERR("Command disallowed"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } if (!bmi_cmd_buff) { BMI_ERR("BMI initialization hasn't done"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } bmi_assert(BMI_COMMAND_FITS(BMI_DATASZ_MAX + header)); @@ -170,7 +170,7 @@ CDF_STATUS bmi_write_memory(uint32_t address, uint8_t *buffer, uint32_t length, if (status) { BMI_ERR("Unable to write to the device; status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } remaining -= txlen; address += txlen; @@ -178,10 +178,10 @@ CDF_STATUS bmi_write_memory(uint32_t address, uint8_t *buffer, uint32_t length, BMI_DBG("BMI Write Memory: Exit"); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS +QDF_STATUS bmi_execute(uint32_t address, A_UINT32 *param, struct ol_context *ol_ctx) { struct hif_opaque_softc *scn = ol_ctx->scn; @@ -198,12 +198,12 @@ bmi_execute(uint32_t address, A_UINT32 *param, struct ol_context *ol_ctx) if (info->bmi_done) { BMI_ERR("Command disallowed"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } if (!bmi_cmd_buff || !bmi_rsp_buff) { BMI_ERR("%s:BMI CMD/RSP Buffer is NULL", __func__); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } bmi_assert(BMI_COMMAND_FITS(size)); @@ -228,40 +228,40 @@ bmi_execute(uint32_t address, A_UINT32 *param, struct ol_context *ol_ctx) bmi_rsp_buff, ¶m_len, 0); if (status) { BMI_ERR("Unable to read from the device status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } cdf_mem_copy(param, bmi_rsp_buff, sizeof(*param)); BMI_DBG("BMI Execute: Exit (param: %d)", *param); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -inline CDF_STATUS +inline QDF_STATUS bmi_no_command(struct ol_context *ol_ctx) { - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS +QDF_STATUS bmi_firmware_download(struct ol_context *ol_ctx) { struct hif_opaque_softc *scn = ol_ctx->scn; - CDF_STATUS status; + QDF_STATUS status; struct bmi_target_info targ_info; struct hif_target_info *tgt_info = hif_get_target_info_handle(scn); cdf_mem_zero(&targ_info, sizeof(targ_info)); /* Initialize BMI */ status = bmi_init(ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("BMI Initialization Failed err:%d", status); return status; } /* Get target information */ status = bmi_get_target_info(&targ_info, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("BMI Target Info get failed: status:%d", status); return status; } @@ -271,19 +271,19 @@ bmi_firmware_download(struct ol_context *ol_ctx) /* Configure target */ status = ol_configure_target(ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("BMI Configure Target Failed status:%d", status); return status; } status = ol_download_firmware(ol_ctx); - if (status != CDF_STATUS_SUCCESS) + if (status != QDF_STATUS_SUCCESS) BMI_ERR("BMI Download Firmware Failed Status:%d", status); return status; } -CDF_STATUS bmi_done_local(struct ol_context *ol_ctx) +QDF_STATUS bmi_done_local(struct ol_context *ol_ctx) { struct hif_opaque_softc *scn = ol_ctx->scn; int status; @@ -295,18 +295,18 @@ CDF_STATUS bmi_done_local(struct ol_context *ol_ctx) if (!scn) { BMI_ERR("Invalid scn context"); bmi_assert(0); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } if (!cdf_dev->dev) { BMI_ERR("%s: Invalid device pointer", __func__); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } info = GET_BMI_CONTEXT(ol_ctx); if (info->bmi_done) { BMI_DBG("bmi_done_local skipped"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } cmd = info->bmi_cmd_da; @@ -320,7 +320,7 @@ CDF_STATUS bmi_done_local(struct ol_context *ol_ctx) if (!info->bmi_cmd_buff) { BMI_ERR("Invalid scn BMICmdBuff"); bmi_assert(0); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } cdf_mem_copy(info->bmi_cmd_buff, &cid, sizeof(cid)); @@ -329,7 +329,7 @@ CDF_STATUS bmi_done_local(struct ol_context *ol_ctx) sizeof(cid), NULL, NULL, 0); if (status) { BMI_ERR("Failed to write to the device; status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } if (info->bmi_cmd_buff) { @@ -346,5 +346,5 @@ CDF_STATUS bmi_done_local(struct ol_context *ol_ctx) info->bmi_rsp_da = 0; } - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } diff --git a/core/bmi/src/bmi_2.c b/core/bmi/src/bmi_2.c index 79de973756db..ef697ecf6412 100644 --- a/core/bmi/src/bmi_2.c +++ b/core/bmi/src/bmi_2.c @@ -33,7 +33,7 @@ */ #define BMI_LOAD_IMAGE 18 -CDF_STATUS +QDF_STATUS bmi_no_command(struct ol_context *ol_ctx) { struct hif_opaque_softc *scn = ol_ctx->scn; @@ -49,12 +49,12 @@ bmi_no_command(struct ol_context *ol_ctx) if (info->bmi_done) { BMI_ERR("Command disallowed: BMI DONE ALREADY"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } if (!bmi_cmd_buff || !bmi_rsp_buff) { BMI_ERR("No Memory Allocated for BMI CMD/RSP Buffer"); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } cid = BMI_NO_COMMAND; @@ -66,18 +66,18 @@ bmi_no_command(struct ol_context *ol_ctx) if (status) { BMI_ERR("Failed to write bmi no command status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } cdf_mem_copy(&ret, bmi_rsp_buff, length); if (ret != 0) { BMI_ERR("bmi no command response error ret 0x%x", ret); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS +QDF_STATUS bmi_done_local(struct ol_context *ol_ctx) { struct hif_opaque_softc *scn = ol_ctx->scn; @@ -94,17 +94,17 @@ bmi_done_local(struct ol_context *ol_ctx) if (info->bmi_done) { BMI_ERR("Command disallowed"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } if (!bmi_cmd_buff || !bmi_rsp_buff) { BMI_ERR("No Memory Allocated for BMI CMD/RSP Buffer"); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } if (!cdf_dev->dev) { BMI_ERR("%s Invalid Device pointer", __func__); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } cid = BMI_DONE; @@ -117,13 +117,13 @@ bmi_done_local(struct ol_context *ol_ctx) if (status) { BMI_ERR("Failed to close BMI on target status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } cdf_mem_copy(&ret, bmi_rsp_buff, length); if (ret != 0) { BMI_ERR("BMI DONE response failed:%d", ret); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } if (info->bmi_cmd_buff) { @@ -140,10 +140,10 @@ bmi_done_local(struct ol_context *ol_ctx) info->bmi_rsp_da = 0; } - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS bmi_write_memory(uint32_t address, uint8_t *buffer, uint32_t length, +QDF_STATUS bmi_write_memory(uint32_t address, uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx) { uint32_t cid; @@ -164,12 +164,12 @@ CDF_STATUS bmi_write_memory(uint32_t address, uint8_t *buffer, uint32_t length, if (info->bmi_done) { BMI_ERR("Command disallowed"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } if (!bmi_cmd_buff || !bmi_rsp_buff) { BMI_ERR("BMI Initialization is not happened"); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } bmi_assert(BMI_COMMAND_FITS(BMI_DATASZ_MAX + header)); @@ -207,20 +207,20 @@ CDF_STATUS bmi_write_memory(uint32_t address, uint8_t *buffer, uint32_t length, BMI_EXCHANGE_TIMEOUT_MS); if (status) { BMI_ERR("BMI Write Memory Failed status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } cdf_mem_copy(&ret, bmi_rsp_buff, rsp_len); if (ret != 0) { BMI_ERR("BMI Write memory response fail: %x", ret); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } remaining -= txlen; address += txlen; } - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS +QDF_STATUS bmi_read_memory(uint32_t address, uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx) { @@ -240,11 +240,11 @@ bmi_read_memory(uint32_t address, uint8_t *buffer, if (info->bmi_done) { BMI_ERR("Command disallowed"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } if (!bmi_cmd_buff || !bmi_rsp_buff) { BMI_ERR("BMI Initialization is not done"); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } bmi_assert(BMI_COMMAND_FITS(BMI_DATASZ_MAX + size)); @@ -278,14 +278,14 @@ bmi_read_memory(uint32_t address, uint8_t *buffer, if (status) { BMI_ERR("BMI Read memory failed status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } cdf_mem_copy(&ret, bmi_rsp_buff, rsp_len); if (ret != 0) { BMI_ERR("bmi read memory response fail %x", ret); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } cdf_mem_copy(&buffer[length - remaining], @@ -293,10 +293,10 @@ bmi_read_memory(uint32_t address, uint8_t *buffer, remaining -= rxlen; address += rxlen; } - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS +QDF_STATUS bmi_execute(uint32_t address, uint32_t *param, struct ol_context *ol_ctx) { struct hif_opaque_softc *scn = ol_ctx->scn; @@ -312,12 +312,12 @@ bmi_execute(uint32_t address, uint32_t *param, struct ol_context *ol_ctx) if (info->bmi_done) { BMI_ERR("Command disallowed"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } if (!bmi_cmd_buff || !bmi_rsp_buff) { BMI_ERR("No Memory Allocated for bmi buffers"); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } cid = BMI_EXECUTE; @@ -330,24 +330,24 @@ bmi_execute(uint32_t address, uint32_t *param, struct ol_context *ol_ctx) if (status) { BMI_ERR("Failed to do BMI_EXECUTE status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } cdf_mem_copy(&ret, bmi_rsp_buff, length); if (ret != 0) { BMI_ERR("%s: ret 0x%x", __func__, ret); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -static CDF_STATUS +static QDF_STATUS bmi_load_image(dma_addr_t address, uint32_t size, struct ol_context *ol_ctx) { uint32_t cid; - CDF_STATUS status; + QDF_STATUS status; uint32_t offset; uint32_t length; uint8_t ret = 0; @@ -362,12 +362,12 @@ bmi_load_image(dma_addr_t address, if (info->bmi_done) { BMI_ERR("Command disallowed"); - return CDF_STATUS_E_PERM; + return QDF_STATUS_E_PERM; } if (!bmi_cmd_buff || !bmi_rsp_buff) { BMI_ERR("No Memory Allocated for BMI CMD/RSP Buffer"); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } bmi_assert(BMI_COMMAND_FITS(sizeof(cid) + sizeof(address))); @@ -396,41 +396,41 @@ bmi_load_image(dma_addr_t address, if (status) { BMI_ERR("BMI Load Image Failed; status:%d", status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } cdf_mem_copy(&ret, bmi_rsp_buff, length); if (ret != 0) { BMI_ERR("%s: ret 0x%x", __func__, ret); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -static CDF_STATUS bmi_enable(struct ol_context *ol_ctx) +static QDF_STATUS bmi_enable(struct ol_context *ol_ctx) { struct hif_opaque_softc *scn = ol_ctx->scn; struct bmi_target_info targ_info; struct image_desc_info image_desc_info; - CDF_STATUS status; + QDF_STATUS status; struct hif_target_info *tgt_info; struct bmi_info *info = GET_BMI_CONTEXT(ol_ctx); if (!scn) { BMI_ERR("Invalid scn context"); bmi_assert(0); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } tgt_info = hif_get_target_info_handle(scn); if (info->bmi_cmd_buff == NULL || info->bmi_rsp_buff == NULL) { BMI_ERR("bmi_open failed!"); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } status = bmi_get_target_info(&targ_info, ol_ctx); - if (status != CDF_STATUS_SUCCESS) + if (status != QDF_STATUS_SUCCESS) return status; BMI_DBG("%s: target type 0x%x, target ver 0x%x", __func__, @@ -441,13 +441,13 @@ static CDF_STATUS bmi_enable(struct ol_context *ol_ctx) if (cnss_get_fw_image(&image_desc_info) != 0) { BMI_ERR("Failed to get fw image"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } status = bmi_load_image(image_desc_info.bdata_addr, image_desc_info.bdata_size, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Load board data failed! status:%d", status); return status; } @@ -455,27 +455,27 @@ static CDF_STATUS bmi_enable(struct ol_context *ol_ctx) status = bmi_load_image(image_desc_info.fw_addr, image_desc_info.fw_size, ol_ctx); - if (status != CDF_STATUS_SUCCESS) + if (status != QDF_STATUS_SUCCESS) BMI_ERR("Load fw image failed! status:%d", status); return status; } -CDF_STATUS bmi_firmware_download(struct ol_context *ol_ctx) +QDF_STATUS bmi_firmware_download(struct ol_context *ol_ctx) { - CDF_STATUS status; + QDF_STATUS status; if (NO_BMI) - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; status = bmi_init(ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("BMI_INIT Failed status:%d", status); goto end; } status = bmi_enable(ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("BMI_ENABLE failed status:%d\n", status); goto err_bmi_enable; } diff --git a/core/bmi/src/i_bmi.h b/core/bmi/src/i_bmi.h index caef15d1b98a..2638981efcb2 100644 --- a/core/bmi/src/i_bmi.h +++ b/core/bmi/src/i_bmi.h @@ -75,16 +75,16 @@ /* BMI LOGGING WRAPPERS */ -#define BMI_LOG(level, args...) CDF_TRACE(CDF_MODULE_ID_BMI, \ +#define BMI_LOG(level, args...) QDF_TRACE(QDF_MODULE_ID_BMI, \ level, ##args) -#define BMI_ERR(args ...) BMI_LOG(CDF_TRACE_LEVEL_ERROR, args) -#define BMI_DBG(args ...) BMI_LOG(CDF_TRACE_LEVEL_DEBUG, args) -#define BMI_WARN(args ...) BMI_LOG(CDF_TRACE_LEVEL_WARN, args) -#define BMI_INFO(args ...) BMI_LOG(CDF_TRACE_LEVEL_INFO, args) +#define BMI_ERR(args ...) BMI_LOG(QDF_TRACE_LEVEL_ERROR, args) +#define BMI_DBG(args ...) BMI_LOG(QDF_TRACE_LEVEL_DEBUG, args) +#define BMI_WARN(args ...) BMI_LOG(QDF_TRACE_LEVEL_WARN, args) +#define BMI_INFO(args ...) BMI_LOG(QDF_TRACE_LEVEL_INFO, args) /* End of BMI Logging Wrappers */ /* BMI Assert Wrappers */ -#define bmi_assert CDF_BUG +#define bmi_assert QDF_BUG /* * Although we had envisioned BMI to run on top of HTC, this is not how the * final implementation ended up. On the Target side, BMI is a part of the BSP @@ -146,7 +146,7 @@ struct bmi_info { * struct ol_context - Structure to hold OL context * @bmi: BMI info * @cal_in_flash: For Firmware Flash Download - * @cdf_dev: CDF Device + * @cdf_dev: QDF Device * @scn: HIF Context * @ramdump_work: WorkQueue for Ramdump collection * @tgt_def: Target Defnition pointer @@ -167,26 +167,26 @@ struct ol_context { #define GET_BMI_CONTEXT(ol_ctx) ((struct bmi_info *)ol_ctx) -CDF_STATUS bmi_execute(uint32_t address, uint32_t *param, +QDF_STATUS bmi_execute(uint32_t address, uint32_t *param, struct ol_context *ol_ctx); -CDF_STATUS bmi_init(struct ol_context *ol_ctx); -CDF_STATUS bmi_no_command(struct ol_context *ol_ctx); -CDF_STATUS bmi_read_memory(uint32_t address, uint8_t *buffer, uint32_t length, +QDF_STATUS bmi_init(struct ol_context *ol_ctx); +QDF_STATUS bmi_no_command(struct ol_context *ol_ctx); +QDF_STATUS bmi_read_memory(uint32_t address, uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx); -CDF_STATUS bmi_write_memory(uint32_t address, uint8_t *buffer, uint32_t length, +QDF_STATUS bmi_write_memory(uint32_t address, uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx); -CDF_STATUS bmi_fast_download(uint32_t address, uint8_t *buffer, uint32_t length, +QDF_STATUS bmi_fast_download(uint32_t address, uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx); -CDF_STATUS bmi_read_soc_register(uint32_t address, +QDF_STATUS bmi_read_soc_register(uint32_t address, uint32_t *param, struct ol_context *ol_ctx); -CDF_STATUS bmi_write_soc_register(uint32_t address, uint32_t param, +QDF_STATUS bmi_write_soc_register(uint32_t address, uint32_t param, struct ol_context *ol_ctx); -CDF_STATUS bmi_get_target_info(struct bmi_target_info *targ_info, +QDF_STATUS bmi_get_target_info(struct bmi_target_info *targ_info, struct ol_context *ol_ctx); -CDF_STATUS bmi_firmware_download(struct ol_context *ol_ctx); -CDF_STATUS bmi_done_local(struct ol_context *ol_ctx); -CDF_STATUS ol_download_firmware(struct ol_context *ol_ctx); -CDF_STATUS ol_configure_target(struct ol_context *ol_ctx); +QDF_STATUS bmi_firmware_download(struct ol_context *ol_ctx); +QDF_STATUS bmi_done_local(struct ol_context *ol_ctx); +QDF_STATUS ol_download_firmware(struct ol_context *ol_ctx); +QDF_STATUS ol_configure_target(struct ol_context *ol_ctx); void ramdump_work_handler(void *arg); struct ol_config_info *ol_get_ini_handle(struct ol_context *ol_ctx); #endif diff --git a/core/bmi/src/ol_fw.c b/core/bmi/src/ol_fw.c index 0b04d5169dc4..38b5674e1a02 100644 --- a/core/bmi/src/ol_fw.c +++ b/core/bmi/src/ol_fw.c @@ -124,7 +124,7 @@ static int ol_check_fw_hash(const u8 *data, u32 fw_size, ATH_BIN_FILE file) digest, SHA256_DIGEST_SIZE); cdf_trace_hex_dump(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL, hash, SHA256_DIGEST_SIZE); - ret = CDF_STATUS_E_FAILURE; + ret = QDF_STATUS_E_FAILURE; } #endif end: @@ -280,7 +280,7 @@ __ol_transfer_bin_file(struct ol_context *ol_ctx, ATH_BIN_FILE file, if (!fw_entry || !fw_entry->data) { BMI_ERR("Invalid fw_entries"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } fw_entry_size = fw_entry->size; @@ -290,7 +290,7 @@ __ol_transfer_bin_file(struct ol_context *ol_ctx, ATH_BIN_FILE file, if (ol_check_fw_hash(fw_entry->data, fw_entry_size, file)) { BMI_ERR("Hash Check failed for file:%s", filename); - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; goto end; } #endif @@ -303,7 +303,7 @@ __ol_transfer_bin_file(struct ol_context *ol_ctx, ATH_BIN_FILE file, if (!temp_eeprom) { BMI_ERR("%s: Memory allocation failed", __func__); release_firmware(fw_entry); - return CDF_STATUS_E_NOMEM; + return QDF_STATUS_E_NOMEM; } cdf_mem_copy(temp_eeprom, (uint8_t *) fw_entry->data, @@ -363,7 +363,7 @@ __ol_transfer_bin_file(struct ol_context *ol_ctx, ATH_BIN_FILE file, if (fw_entry_size < sizeof(SIGN_HEADER_T)) { BMI_ERR("Invalid binary size %d", fw_entry_size); - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; goto end; } @@ -379,7 +379,7 @@ __ol_transfer_bin_file(struct ol_context *ol_ctx, ATH_BIN_FILE file, sizeof(SIGN_HEADER_T), ol_ctx); if (status != EOK) { BMI_ERR("unable to start sign stream"); - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; goto end; } @@ -449,7 +449,7 @@ end: if (status != EOK) { BMI_ERR("%s, BMI operation failed: %d", __func__, __LINE__); release_firmware(fw_entry); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } release_firmware(fw_entry); @@ -558,7 +558,7 @@ void ramdump_work_handler(void *data) hif_hia_item_address(target_type, offsetof(struct host_interest_s, hi_failure_state)), (uint8_t *)&host_interest_address, - sizeof(uint32_t)) != CDF_STATUS_SUCCESS) { + sizeof(uint32_t)) != QDF_STATUS_SUCCESS) { BMI_ERR("HifDiagReadiMem FW Dump Area Pointer failed!"); ol_copy_ramdump(ramdump_scn); cnss_device_crashed(); @@ -569,7 +569,7 @@ void ramdump_work_handler(void *data) if (hif_diag_read_mem(ramdump_scn, host_interest_address, (uint8_t *) &dram_dump_values[0], - 4 * sizeof(uint32_t)) != CDF_STATUS_SUCCESS) { + 4 * sizeof(uint32_t)) != QDF_STATUS_SUCCESS) { BMI_ERR("HifDiagReadiMem FW Dump Area failed!"); goto out_fail; } @@ -607,7 +607,7 @@ void ol_schedule_fw_indication_work(struct hif_opaque_softc *scn) } #endif -void ol_target_failure(void *instance, CDF_STATUS status) +void ol_target_failure(void *instance, QDF_STATUS status) { struct ol_context *ol_ctx = instance; struct hif_opaque_softc *scn = ol_ctx->scn; @@ -663,7 +663,7 @@ void ol_target_failure(void *instance, CDF_STATUS status) return; } -CDF_STATUS ol_configure_target(struct ol_context *ol_ctx) +QDF_STATUS ol_configure_target(struct ol_context *ol_ctx) { uint32_t param; #ifdef CONFIG_CNSS @@ -680,18 +680,18 @@ CDF_STATUS ol_configure_target(struct ol_context *ol_ctx) if (bmi_write_memory( hif_hia_item_address(target_type, offsetof(struct host_interest_s, hi_app_host_interest)), - (uint8_t *) ¶m, 4, ol_ctx) != CDF_STATUS_SUCCESS) { + (uint8_t *) ¶m, 4, ol_ctx) != QDF_STATUS_SUCCESS) { BMI_ERR("bmi_write_memory for htc version failed"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } /* set the firmware mode to STA/IBSS/AP */ { if (bmi_read_memory(hif_hia_item_address(target_type, offsetof(struct host_interest_s, hi_option_flag)), - (uint8_t *)¶m, 4, ol_ctx) != CDF_STATUS_SUCCESS) { + (uint8_t *)¶m, 4, ol_ctx) != QDF_STATUS_SUCCESS) { BMI_ERR("bmi_read_memory for setting fwmode failed"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } /* TODO following parameters need to be re-visited. */ @@ -711,9 +711,9 @@ CDF_STATUS ol_configure_target(struct ol_context *ol_ctx) if (bmi_write_memory( hif_hia_item_address(target_type, offsetof(struct host_interest_s, hi_option_flag)), - (uint8_t *)¶m, 4, ol_ctx) != CDF_STATUS_SUCCESS) { + (uint8_t *)¶m, 4, ol_ctx) != QDF_STATUS_SUCCESS) { BMI_ERR("BMI WRITE for setting fwmode failed"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } } @@ -722,18 +722,18 @@ CDF_STATUS ol_configure_target(struct ol_context *ol_ctx) /* set the firmware to disable CDC max perf WAR */ if (bmi_read_memory(hif_hia_item_address(target_type, offsetof(struct host_interest_s, hi_option_flag2)), - (uint8_t *) ¶m, 4, ol_ctx) != CDF_STATUS_SUCCESS) { + (uint8_t *) ¶m, 4, ol_ctx) != QDF_STATUS_SUCCESS) { BMI_ERR("BMI READ for setting cdc max perf failed"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } param |= HI_OPTION_DISABLE_CDC_MAX_PERF_WAR; if (bmi_write_memory( hif_hia_item_address(target_type, offsetof(struct host_interest_s, hi_option_flag2)), - (uint8_t *)¶m, 4, ol_ctx) != CDF_STATUS_SUCCESS) { + (uint8_t *)¶m, 4, ol_ctx) != QDF_STATUS_SUCCESS) { BMI_ERR("setting cdc max perf failed"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } } #endif /* CONFIG_CDC_MAX_PERF_WAR */ @@ -747,19 +747,19 @@ CDF_STATUS ol_configure_target(struct ol_context *ol_ctx) if (!ret && cap.cap_flag & CNSS_HAS_EXTERNAL_SWREG) { if (bmi_read_memory(hif_hia_item_address(target_type, offsetof(struct host_interest_s, hi_option_flag2)), - (uint8_t *)¶m, 4, ol_ctx) != CDF_STATUS_SUCCESS) { + (uint8_t *)¶m, 4, ol_ctx) != QDF_STATUS_SUCCESS) { BMI_ERR("bmi_read_memory for setting" "external SWREG failed"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } param |= HI_OPTION_USE_EXT_LDO; if (bmi_write_memory( hif_hia_item_address(target_type, offsetof(struct host_interest_s, hi_option_flag2)), - (uint8_t *)¶m, 4, ol_ctx) != CDF_STATUS_SUCCESS) { + (uint8_t *)¶m, 4, ol_ctx) != QDF_STATUS_SUCCESS) { BMI_ERR("BMI WRITE for setting external SWREG fail"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } } #endif @@ -768,18 +768,18 @@ CDF_STATUS ol_configure_target(struct ol_context *ol_ctx) if (ini_cfg->enable_lpass_support) { if (bmi_read_memory(hif_hia_item_address(target_type, offsetof(struct host_interest_s, hi_option_flag2)), - (uint8_t *) ¶m, 4, ol_ctx) != CDF_STATUS_SUCCESS) { + (uint8_t *) ¶m, 4, ol_ctx) != QDF_STATUS_SUCCESS) { BMI_ERR("BMI READ:Setting LPASS Support failed"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } param |= HI_OPTION_DBUART_SUPPORT; if (bmi_write_memory( hif_hia_item_address(target_type, offsetof(struct host_interest_s, hi_option_flag2)), - (uint8_t *)¶m, 4, ol_ctx) != CDF_STATUS_SUCCESS) { + (uint8_t *)¶m, 4, ol_ctx) != QDF_STATUS_SUCCESS) { BMI_ERR("BMI_READ for setting LPASS Support fail"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } } #endif @@ -794,9 +794,9 @@ CDF_STATUS ol_configure_target(struct ol_context *ol_ctx) if (bmi_write_memory( hif_hia_item_address(target_type, offsetof(struct host_interest_s, hi_be)), - (uint8_t *) ¶m, 4, ol_ctx) != CDF_STATUS_SUCCESS) { + (uint8_t *) ¶m, 4, ol_ctx) != QDF_STATUS_SUCCESS) { BMI_ERR("setting host CPU BE mode failed"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } } @@ -805,12 +805,12 @@ CDF_STATUS ol_configure_target(struct ol_context *ol_ctx) if (bmi_write_memory( hif_hia_item_address(target_type, offsetof(struct host_interest_s, hi_fw_swap)), - (uint8_t *) ¶m, 4, ol_ctx) != CDF_STATUS_SUCCESS) { + (uint8_t *) ¶m, 4, ol_ctx) != QDF_STATUS_SUCCESS) { BMI_ERR("BMI WRITE failed setting FW data/desc swap flags"); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } static int @@ -821,11 +821,11 @@ ol_check_dataset_patch(struct hif_opaque_softc *scn, uint32_t *address) } -CDF_STATUS ol_fw_populate_clk_settings(A_refclk_speed_t refclk, +QDF_STATUS ol_fw_populate_clk_settings(A_refclk_speed_t refclk, struct cmnos_clock_s *clock_s) { if (!clock_s) - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; switch (refclk) { case SOC_REFCLK_48_MHZ: @@ -876,20 +876,20 @@ CDF_STATUS ol_fw_populate_clk_settings(A_refclk_speed_t refclk, clock_s->pll_settling_time = 1024; clock_s->refclk_hz = 0; default: - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } clock_s->refclk_hz = refclk_speed_to_hz[refclk]; clock_s->wlan_pll.refdiv = 0; clock_s->wlan_pll.outdiv = 1; - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } -CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) +QDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) { struct hif_opaque_softc *hif = ol_ctx->scn; - CDF_STATUS status = CDF_STATUS_SUCCESS; + QDF_STATUS status = QDF_STATUS_SUCCESS; uint32_t addr = 0; uint32_t reg_val = 0; uint32_t mem_val = 0; @@ -927,14 +927,14 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) addr = (RTC_SOC_BASE_ADDRESS | EFUSE_OFFSET); status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read EFUSE Addr"); goto end; } status = ol_fw_populate_clk_settings(EFUSE_XTAL_SEL_GET(reg_val), &clock_s); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to set clock settings"); goto end; } @@ -944,7 +944,7 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val = 0; addr = (RTC_SOC_BASE_ADDRESS | BB_PLL_CONFIG_OFFSET); status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read PLL_CONFIG Addr"); goto end; } @@ -954,14 +954,14 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val |= (BB_PLL_CONFIG_FRAC_SET(clock_s.wlan_pll.rnfrac) | BB_PLL_CONFIG_OUTDIV_SET(clock_s.wlan_pll.outdiv)); status = bmi_write_soc_register(addr, reg_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to write PLL_CONFIG Addr"); goto end; } reg_val = 0; status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read back PLL_CONFIG Addr"); goto end; } @@ -971,7 +971,7 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val = 0; addr = (RTC_WMAC_BASE_ADDRESS | WLAN_PLL_SETTLE_OFFSET); status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read PLL_SETTLE Addr"); goto end; } @@ -980,14 +980,14 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val &= ~WLAN_PLL_SETTLE_TIME_MASK; reg_val |= WLAN_PLL_SETTLE_TIME_SET(clock_s.pll_settling_time); status = bmi_write_soc_register(addr, reg_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to write PLL_SETTLE Addr"); goto end; } reg_val = 0; status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read back PLL_SETTLE Addr"); goto end; } @@ -997,7 +997,7 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val = 0; addr = (RTC_SOC_BASE_ADDRESS | SOC_CORE_CLK_CTRL_OFFSET); status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read CLK_CTRL Addr"); goto end; } @@ -1006,14 +1006,14 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val &= ~SOC_CORE_CLK_CTRL_DIV_MASK; reg_val |= SOC_CORE_CLK_CTRL_DIV_SET(1); status = bmi_write_soc_register(addr, reg_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to write CLK_CTRL Addr"); goto end; } reg_val = 0; status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read back CLK_CTRL Addr"); goto end; } @@ -1023,7 +1023,7 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) mem_val = 1; status = bmi_write_memory(cmnos_core_clk_div_addr, (uint8_t *) &mem_val, 4, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to write CLK_DIV Addr"); goto end; } @@ -1032,7 +1032,7 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val = 0; addr = (RTC_WMAC_BASE_ADDRESS | WLAN_PLL_CONTROL_OFFSET); status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read PLL_CTRL Addr"); goto end; } @@ -1044,14 +1044,14 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) WLAN_PLL_CONTROL_DIV_SET(clock_s.wlan_pll.div) | WLAN_PLL_CONTROL_NOPWD_SET(1)); status = bmi_write_soc_register(addr, reg_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to write PLL_CTRL Addr"); goto end; } reg_val = 0; status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read back PLL_CTRL Addr"); goto end; } @@ -1063,7 +1063,7 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val = 0; status = bmi_read_soc_register((RTC_WMAC_BASE_ADDRESS | RTC_SYNC_STATUS_OFFSET), ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read RTC_SYNC_STATUS Addr"); goto end; } @@ -1073,7 +1073,7 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val = 0; addr = (RTC_WMAC_BASE_ADDRESS | WLAN_PLL_CONTROL_OFFSET); status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read PLL_CTRL Addr for CTRL_BYPASS"); goto end; } @@ -1082,14 +1082,14 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val &= ~WLAN_PLL_CONTROL_BYPASS_MASK; reg_val |= WLAN_PLL_CONTROL_BYPASS_SET(0); status = bmi_write_soc_register(addr, reg_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to write PLL_CTRL Addr for CTRL_BYPASS"); goto end; } reg_val = 0; status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read back PLL_CTRL Addr for CTRL_BYPASS"); goto end; } @@ -1100,7 +1100,7 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val = 0; status = bmi_read_soc_register((RTC_WMAC_BASE_ADDRESS | RTC_SYNC_STATUS_OFFSET), ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read SYNC_STATUS Addr"); goto end; } @@ -1110,7 +1110,7 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val = 0; addr = (RTC_SOC_BASE_ADDRESS | SOC_CPU_CLOCK_OFFSET); status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read CPU_CLK Addr"); goto end; } @@ -1119,14 +1119,14 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val &= ~SOC_CPU_CLOCK_STANDARD_MASK; reg_val |= SOC_CPU_CLOCK_STANDARD_SET(1); status = bmi_write_soc_register(addr, reg_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to write CPU_CLK Addr"); goto end; } reg_val = 0; status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read back CPU_CLK Addr"); goto end; } @@ -1136,7 +1136,7 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val = 0; addr = (RTC_WMAC_BASE_ADDRESS | WLAN_PLL_CONTROL_OFFSET); status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read PLL_CTRL Addr for NOPWD"); goto end; } @@ -1144,13 +1144,13 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) reg_val &= ~WLAN_PLL_CONTROL_NOPWD_MASK; status = bmi_write_soc_register(addr, reg_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to write PLL_CTRL Addr for NOPWD"); goto end; } reg_val = 0; status = bmi_read_soc_register(addr, ®_val, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to read back PLL_CTRL Addr for NOPWD"); goto end; } @@ -1160,7 +1160,7 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) mem_val = 1; status = bmi_write_memory(cmnos_cpu_pll_init_done_addr, (uint8_t *) &mem_val, 4, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to write PLL_INIT Addr"); goto end; } @@ -1168,7 +1168,7 @@ CDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) mem_val = TARGET_CPU_FREQ; status = bmi_write_memory(cmnos_cpu_speed_addr, (uint8_t *) &mem_val, 4, ol_ctx); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to write CPU_SPEED Addr"); goto end; } @@ -1184,7 +1184,7 @@ end: void ol_transfer_codeswap_struct(struct ol_context *ol_ctx) { struct codeswap_codeseg_info wlan_codeswap; - CDF_STATUS rv; + QDF_STATUS rv; if (cnss_get_codeswap_struct(&wlan_codeswap)) { BMI_ERR("%s: failed to get codeswap structure", __func__); @@ -1195,7 +1195,7 @@ void ol_transfer_codeswap_struct(struct ol_context *ol_ctx) (uint8_t *) &wlan_codeswap, sizeof(wlan_codeswap), ol_ctx); - if (rv != CDF_STATUS_SUCCESS) { + if (rv != QDF_STATUS_SUCCESS) { BMI_ERR("Failed to Write 0xa0000 to Target"); return; } @@ -1203,12 +1203,12 @@ void ol_transfer_codeswap_struct(struct ol_context *ol_ctx) } #endif -CDF_STATUS ol_download_firmware(struct ol_context *ol_ctx) +QDF_STATUS ol_download_firmware(struct ol_context *ol_ctx) { struct hif_opaque_softc *scn = ol_ctx->scn; uint32_t param, address = 0; int status = !EOK; - CDF_STATUS ret; + QDF_STATUS ret; struct hif_target_info *tgt_info = hif_get_target_info_handle(scn); struct ol_config_info *ini_cfg = ol_get_ini_handle(ol_ctx); uint32_t target_type = tgt_info->target_type; @@ -1220,7 +1220,7 @@ CDF_STATUS ol_download_firmware(struct ol_context *ol_ctx) target_type, target_version)) { BMI_ERR("%s: No FW files from CNSS driver", __func__); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } #endif /* Transfer Board Data from Target EEPROM to Target RAM */ @@ -1237,7 +1237,7 @@ CDF_STATUS ol_download_firmware(struct ol_context *ol_ctx) ret = ol_patch_pll_switch(ol_ctx); - if (ret != CDF_STATUS_SUCCESS) { + if (ret != QDF_STATUS_SUCCESS) { BMI_ERR("pll switch failed. status %d", ret); return ret; } -- cgit v1.2.3