diff options
| author | Chouhan, Anurag <achouhan@codeaurora.org> | 2016-03-03 19:05:05 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-03-16 12:18:31 -0700 |
| commit | fc06aa94302bf143e998d4e89abd0132d8e6d423 (patch) | |
| tree | 67c8609aa46f10c32d5e6be91cfa6d995ce54c17 /hif/src | |
| parent | 5776318d1934b14c3b4eb4eb98c74830d64d00a7 (diff) | |
qcacmn: Fix compilation issues HTC/HIF
Resolve compilation issues for references to cdf after rebase
Change-Id: I332566deb690fa7de68d89bf51b42f94f7a270a6
CRs-Fixed: 981187
Diffstat (limited to 'hif/src')
| -rw-r--r-- | hif/src/ath_procfs.c | 12 | ||||
| -rw-r--r-- | hif/src/ce/ce_api.h | 30 | ||||
| -rw-r--r-- | hif/src/ce/ce_bmi.c | 74 | ||||
| -rw-r--r-- | hif/src/ce/ce_bmi.h | 8 | ||||
| -rw-r--r-- | hif/src/ce/ce_diag.c | 129 | ||||
| -rw-r--r-- | hif/src/ce/ce_internal.h | 12 | ||||
| -rw-r--r-- | hif/src/ce/ce_main.c | 330 | ||||
| -rw-r--r-- | hif/src/ce/ce_main.h | 14 | ||||
| -rw-r--r-- | hif/src/ce/ce_service.c | 226 | ||||
| -rw-r--r-- | hif/src/ce/ce_tasklet.c | 32 | ||||
| -rw-r--r-- | hif/src/ce/ce_tasklet.h | 4 | ||||
| -rw-r--r-- | hif/src/hif_debug.h | 18 | ||||
| -rw-r--r-- | hif/src/hif_main.c | 77 | ||||
| -rw-r--r-- | hif/src/hif_main.h | 20 | ||||
| -rw-r--r-- | hif/src/hif_napi.c | 4 | ||||
| -rw-r--r-- | hif/src/icnss_stub/icnss_stub.c | 4 | ||||
| -rw-r--r-- | hif/src/mp_dev.c | 52 | ||||
| -rw-r--r-- | hif/src/pcie/hif_io32_pci.h | 8 | ||||
| -rw-r--r-- | hif/src/pcie/if_pci.c | 172 | ||||
| -rw-r--r-- | hif/src/pcie/if_pci.h | 6 | ||||
| -rw-r--r-- | hif/src/snoc/hif_io32_snoc.h | 2 | ||||
| -rw-r--r-- | hif/src/snoc/if_snoc.c | 16 |
22 files changed, 628 insertions, 622 deletions
diff --git a/hif/src/ath_procfs.c b/hif/src/ath_procfs.c index 3837af6c8479..af31864c3a0f 100644 --- a/hif/src/ath_procfs.c +++ b/hif/src/ath_procfs.c @@ -66,7 +66,7 @@ static ssize_t ath_procfs_diag_read(struct file *file, char __user *buf, int rv; uint8_t *read_buffer = NULL; - read_buffer = cdf_mem_malloc(count); + read_buffer = qdf_mem_malloc(count); if (NULL == read_buffer) { HIF_ERROR("%s: cdf_mem_alloc failed", __func__); return -ENOMEM; @@ -86,12 +86,12 @@ static ssize_t ath_procfs_diag_read(struct file *file, char __user *buf, } if (copy_to_user(buf, read_buffer, count)) { - cdf_mem_free(read_buffer); + qdf_mem_free(read_buffer); HIF_ERROR("%s: copy_to_user error in /proc/%s", __func__, PROCFS_NAME); return -EFAULT; } else - cdf_mem_free(read_buffer); + qdf_mem_free(read_buffer); if (rv == 0) { return count; @@ -108,13 +108,13 @@ static ssize_t ath_procfs_diag_write(struct file *file, int rv; uint8_t *write_buffer = NULL; - write_buffer = cdf_mem_malloc(count); + write_buffer = qdf_mem_malloc(count); if (NULL == write_buffer) { HIF_ERROR("%s: cdf_mem_alloc failed", __func__); return -ENOMEM; } if (copy_from_user(write_buffer, buf, count)) { - cdf_mem_free(write_buffer); + qdf_mem_free(write_buffer); HIF_ERROR("%s: copy_to_user error in /proc/%s", __func__, PROCFS_NAME); return -EFAULT; @@ -134,7 +134,7 @@ static ssize_t ath_procfs_diag_write(struct file *file, (uint8_t *)write_buffer, count); } - cdf_mem_free(write_buffer); + qdf_mem_free(write_buffer); if (rv == 0) { return count; } else { diff --git a/hif/src/ce/ce_api.h b/hif/src/ce/ce_api.h index 501828359cad..2dd2de0cc604 100644 --- a/hif/src/ce/ce_api.h +++ b/hif/src/ce/ce_api.h @@ -73,7 +73,7 @@ struct CE_handle; typedef void (*ce_send_cb)(struct CE_handle *copyeng, void *per_ce_send_context, void *per_transfer_send_context, - cdf_dma_addr_t buffer, + qdf_dma_addr_t buffer, unsigned int nbytes, unsigned int transfer_id, unsigned int sw_index, @@ -88,7 +88,7 @@ typedef void (*ce_send_cb)(struct CE_handle *copyeng, typedef void (*CE_recv_cb)(struct CE_handle *copyeng, void *per_CE_recv_context, void *per_transfer_recv_context, - cdf_dma_addr_t buffer, + qdf_dma_addr_t buffer, unsigned int nbytes, unsigned int transfer_id, unsigned int flags); @@ -142,7 +142,7 @@ struct CE_attr; */ int ce_send(struct CE_handle *copyeng, void *per_transfer_send_context, - cdf_dma_addr_t buffer, + qdf_dma_addr_t buffer, unsigned int nbytes, unsigned int transfer_id, unsigned int flags, @@ -177,7 +177,7 @@ void ce_sendlist_init(struct ce_sendlist *sendlist); /* Append a simple buffer (address/length) to a sendlist. */ int ce_sendlist_buf_add(struct ce_sendlist *sendlist, - cdf_dma_addr_t buffer, + qdf_dma_addr_t buffer, unsigned int nbytes, uint32_t flags, /* OR-ed with internal flags */ uint32_t user_flags); @@ -211,7 +211,7 @@ int ce_sendlist_send(struct CE_handle *copyeng, */ int ce_recv_buf_enqueue(struct CE_handle *copyeng, void *per_transfer_recv_context, - cdf_dma_addr_t buffer); + qdf_dma_addr_t buffer); /* * Register a Receive Callback function. @@ -314,7 +314,7 @@ void ce_enable_msi(struct hif_softc *scn, int ce_completed_recv_next(struct CE_handle *copyeng, void **per_CE_contextp, void **per_transfer_contextp, - cdf_dma_addr_t *bufferp, + qdf_dma_addr_t *bufferp, unsigned int *nbytesp, unsigned int *transfer_idp, unsigned int *flagsp); @@ -331,7 +331,7 @@ int ce_completed_recv_next(struct CE_handle *copyeng, int ce_completed_send_next(struct CE_handle *copyeng, void **per_CE_contextp, void **per_transfer_contextp, - cdf_dma_addr_t *bufferp, + qdf_dma_addr_t *bufferp, unsigned int *nbytesp, unsigned int *transfer_idp, unsigned int *sw_idx, @@ -350,22 +350,22 @@ struct CE_handle *ce_init(struct hif_softc *scn, * receive buffers. Target DMA must be stopped before using * this API. */ -CDF_STATUS +QDF_STATUS ce_revoke_recv_next(struct CE_handle *copyeng, void **per_CE_contextp, void **per_transfer_contextp, - cdf_dma_addr_t *bufferp); + qdf_dma_addr_t *bufferp); /* * Support clean shutdown by allowing the caller to cancel * pending sends. Target DMA must be stopped before using * this API. */ -CDF_STATUS +QDF_STATUS ce_cancel_send_next(struct CE_handle *copyeng, void **per_CE_contextp, void **per_transfer_contextp, - cdf_dma_addr_t *bufferp, + qdf_dma_addr_t *bufferp, unsigned int *nbytesp, unsigned int *transfer_idp, uint32_t *toeplitz_hash_result); @@ -433,9 +433,9 @@ struct ce_sendlist { #ifdef IPA_OFFLOAD void ce_ipa_get_resource(struct CE_handle *ce, - cdf_dma_addr_t *ce_sr_base_paddr, + qdf_dma_addr_t *ce_sr_base_paddr, uint32_t *ce_sr_ring_size, - cdf_dma_addr_t *ce_reg_paddr); + qdf_dma_addr_t *ce_reg_paddr); #else /** * ce_ipa_get_resource() - get uc resource on copyengine @@ -453,9 +453,9 @@ void ce_ipa_get_resource(struct CE_handle *ce, * Return: None */ static inline void ce_ipa_get_resource(struct CE_handle *ce, - cdf_dma_addr_t *ce_sr_base_paddr, + qdf_dma_addr_t *ce_sr_base_paddr, uint32_t *ce_sr_ring_size, - cdf_dma_addr_t *ce_reg_paddr) + qdf_dma_addr_t *ce_reg_paddr) { return; } diff --git a/hif/src/ce/ce_bmi.c b/hif/src/ce/ce_bmi.c index a1146877df39..fb3d43b0eee9 100644 --- a/hif/src/ce/ce_bmi.c +++ b/hif/src/ce/ce_bmi.c @@ -30,9 +30,10 @@ #include "athdefs.h" #include "osapi_linux.h" #include "targcfg.h" -#include "cdf_lock.h" -#include "cdf_status.h" -#include <cdf_atomic.h> /* cdf_atomic_read */ +#include "qdf_lock.h" +#include "qdf_status.h" +#include "qdf_status.h" +#include <qdf_atomic.h> /* qdf_atomic_read */ #include <targaddrs.h> #include <bmi_msg.h> #include "hif_io32.h" @@ -42,7 +43,7 @@ #include <a_debug.h> #include "hif_main.h" #include "ce_api.h" -#include "cdf_trace.h" +#include "qdf_trace.h" #ifdef CONFIG_CNSS #include <net/cnss.h> #else @@ -63,12 +64,12 @@ enum { struct BMI_transaction { struct HIF_CE_state *hif_state; - cdf_semaphore_t bmi_transaction_sem; + qdf_semaphore_t bmi_transaction_sem; uint8_t *bmi_request_host; /* Req BMI msg in Host addr space */ - cdf_dma_addr_t bmi_request_CE; /* Req BMI msg in CE addr space */ + qdf_dma_addr_t bmi_request_CE; /* Req BMI msg in CE addr space */ uint32_t bmi_request_length; /* Length of BMI request */ uint8_t *bmi_response_host; /* Rsp BMI msg in Host addr space */ - cdf_dma_addr_t bmi_response_CE; /* Rsp BMI msg in CE addr space */ + qdf_dma_addr_t bmi_response_CE; /* Rsp BMI msg in CE addr space */ unsigned int bmi_response_length; /* Length of received response */ unsigned int bmi_timeout_ms; uint32_t bmi_transaction_flags; /* flags for the transcation */ @@ -80,22 +81,20 @@ struct BMI_transaction { * straight buffer, not an sk_buff. */ void hif_bmi_send_done(struct CE_handle *copyeng, void *ce_context, - void *transfer_context, cdf_dma_addr_t data, + void *transfer_context, qdf_dma_addr_t data, unsigned int nbytes, unsigned int transfer_id, unsigned int sw_index, unsigned int hw_index, uint32_t toeplitz_hash_result) { struct BMI_transaction *transaction = (struct BMI_transaction *)transfer_context; - struct hif_softc *scn = HIF_GET_SOFTC(transaction->hif_state); #ifdef BMI_RSP_POLLING /* * Fix EV118783, Release a semaphore after sending * no matter whether a response is been expecting now. */ - cdf_semaphore_release(scn->cdf_dev, - &transaction->bmi_transaction_sem); + qdf_semaphore_release(&transaction->bmi_transaction_sem); #else /* * If a response is anticipated, we'll complete the @@ -109,36 +108,33 @@ void hif_bmi_send_done(struct CE_handle *copyeng, void *ce_context, * never assume resp comes later then this */ if (!transaction->bmi_response_CE || (transaction->bmi_transaction_flags & BMI_RESP_RECV_DONE)) { - cdf_semaphore_release(scn->cdf_dev, - &transaction->bmi_transaction_sem); + qdf_semaphore_release(&transaction->bmi_transaction_sem); } #endif } #ifndef BMI_RSP_POLLING void hif_bmi_recv_data(struct CE_handle *copyeng, void *ce_context, - void *transfer_context, cdf_dma_addr_t data, + void *transfer_context, qdf_dma_addr_t data, unsigned int nbytes, unsigned int transfer_id, unsigned int flags) { struct BMI_transaction *transaction = (struct BMI_transaction *)transfer_context; - struct hif_softc *scn = HIF_GET_SOFTC(transaction->hif_state); transaction->bmi_response_length = nbytes; transaction->bmi_transaction_flags |= BMI_RESP_RECV_DONE; /* when both send/recv are done, the sem can be released */ if (transaction->bmi_transaction_flags & BMI_REQ_SEND_DONE) { - cdf_semaphore_release(scn->cdf_dev, - &transaction->bmi_transaction_sem); + qdf_semaphore_release(&transaction->bmi_transaction_sem); } } #endif -CDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx, - cdf_dma_addr_t bmi_cmd_da, - cdf_dma_addr_t bmi_rsp_da, +QDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx, + qdf_dma_addr_t bmi_cmd_da, + qdf_dma_addr_t bmi_rsp_da, uint8_t *bmi_request, uint32_t request_length, uint8_t *bmi_response, @@ -150,9 +146,9 @@ CDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx, struct HIF_CE_pipe_info *send_pipe_info = &(hif_state->pipe_info[BMI_CE_NUM_TO_TARG]); struct CE_handle *ce_send_hdl = send_pipe_info->ce_hdl; - cdf_dma_addr_t CE_request, CE_response = 0; + qdf_dma_addr_t CE_request, CE_response = 0; struct BMI_transaction *transaction = NULL; - int status = CDF_STATUS_SUCCESS; + int status = QDF_STATUS_SUCCESS; struct HIF_CE_pipe_info *recv_pipe_info = &(hif_state->pipe_info[BMI_CE_NUM_TO_HOST]); struct CE_handle *ce_recv = recv_pipe_info->ce_hdl; @@ -160,16 +156,16 @@ CDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx, unsigned int transaction_id = 0xffff; unsigned int user_flags = 0; #ifdef BMI_RSP_POLLING - cdf_dma_addr_t buf; + qdf_dma_addr_t buf; unsigned int completed_nbytes, id, flags; int i; #endif transaction = - (struct BMI_transaction *)cdf_mem_malloc(sizeof(*transaction)); + (struct BMI_transaction *)qdf_mem_malloc(sizeof(*transaction)); if (unlikely(!transaction)) { HIF_ERROR("%s: no memory", __func__); - return CDF_STATUS_E_NOMEM; + return QDF_STATUS_E_NOMEM; } transaction_id = (mux_id & MUX_ID_MASK) | (transaction_id & TRANSACTION_ID_MASK); @@ -179,8 +175,8 @@ CDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx, A_TARGET_ACCESS_LIKELY(scn); /* Initialize bmi_transaction_sem to block */ - cdf_semaphore_init(&transaction->bmi_transaction_sem); - cdf_semaphore_acquire(scn->cdf_dev, &transaction->bmi_transaction_sem); + qdf_semaphore_init(&transaction->bmi_transaction_sem); + qdf_semaphore_acquire(&transaction->bmi_transaction_sem); transaction->hif_state = hif_state; transaction->bmi_request_host = bmi_request; @@ -207,7 +203,7 @@ CDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx, transaction->bmi_response_CE = CE_response; /* dma_cache_sync(dev, bmi_response, BMI_DATASZ_MAX, DMA_FROM_DEVICE); */ - cdf_os_mem_dma_sync_single_for_device(scn->cdf_dev, + qdf_mem_dma_sync_single_for_device(scn->qdf_dev, CE_response, BMI_DATASZ_MAX, DMA_FROM_DEVICE); @@ -220,14 +216,14 @@ CDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx, } /* dma_cache_sync(dev, bmi_request, request_length, DMA_TO_DEVICE); */ - cdf_os_mem_dma_sync_single_for_device(scn->cdf_dev, CE_request, + qdf_mem_dma_sync_single_for_device(scn->qdf_dev, CE_request, request_length, DMA_TO_DEVICE); status = ce_send(ce_send_hdl, transaction, CE_request, request_length, transaction_id, 0, user_flags); - ASSERT(status == CDF_STATUS_SUCCESS); + ASSERT(status == QDF_STATUS_SUCCESS); /* NB: see hif_bmi_send_done */ /* TBDXXX: handle timeout */ @@ -235,8 +231,8 @@ CDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx, /* Wait for BMI request/response transaction to complete */ /* Always just wait for BMI request here if * BMI_RSP_POLLING is defined */ - while (cdf_semaphore_acquire - (scn->cdf_dev, &transaction->bmi_transaction_sem)) { + while (qdf_semaphore_acquire + (&transaction->bmi_transaction_sem)) { /*need some break out condition(time out?) */ } @@ -250,20 +246,20 @@ CDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx, while (ce_completed_recv_next( ce_recv, NULL, NULL, &buf, &completed_nbytes, &id, - &flags) != CDF_STATUS_SUCCESS) { + &flags) != QDF_STATUS_SUCCESS) { if (i++ > BMI_RSP_TO_MILLISEC) { HIF_ERROR("%s:error, can't get bmi response\n", __func__); - status = CDF_STATUS_E_BUSY; + status = QDF_STATUS_E_BUSY; break; } OS_DELAY(1000); } - if ((status == CDF_STATUS_SUCCESS) && bmi_response_lengthp) + if ((status == QDF_STATUS_SUCCESS) && bmi_response_lengthp) *bmi_response_lengthp = completed_nbytes; #else - if ((status == CDF_STATUS_SUCCESS) && bmi_response_lengthp) { + if ((status == QDF_STATUS_SUCCESS) && bmi_response_lengthp) { *bmi_response_lengthp = transaction->bmi_response_length; } @@ -277,8 +273,8 @@ CDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx, transaction->bmi_request_CE, request_length, BUS_DMA_TODEVICE); */ - if (status != CDF_STATUS_SUCCESS) { - cdf_dma_addr_t unused_buffer; + if (status != QDF_STATUS_SUCCESS) { + qdf_dma_addr_t unused_buffer; unsigned int unused_nbytes; unsigned int unused_id; unsigned int toeplitz_hash_result; @@ -290,6 +286,6 @@ CDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx, } A_TARGET_ACCESS_UNLIKELY(scn); - cdf_mem_free(transaction); + qdf_mem_free(transaction); return status; } diff --git a/hif/src/ce/ce_bmi.h b/hif/src/ce/ce_bmi.h index c09b211b6e3e..1fb7c83a97df 100644 --- a/hif/src/ce/ce_bmi.h +++ b/hif/src/ce/ce_bmi.h @@ -28,17 +28,17 @@ #ifndef __CE_BMI_H__ #define __CE_BMI_H__ -#include <cdf_atomic.h> /* cdf_atomic_read */ -#include "cdf_lock.h" +#include <qdf_atomic.h> /* qdf_atomic_read */ +#include "qdf_lock.h" #include "ce_api.h" #include "cepci.h" void hif_bmi_recv_data(struct CE_handle *copyeng, void *ce_context, - void *transfer_context, cdf_dma_addr_t data, + void *transfer_context, qdf_dma_addr_t data, unsigned int nbytes, unsigned int transfer_id, unsigned int flags); void hif_bmi_send_done(struct CE_handle *copyeng, void *ce_context, - void *transfer_context, cdf_dma_addr_t data, + void *transfer_context, qdf_dma_addr_t data, unsigned int nbytes, unsigned int transfer_id, unsigned int sw_index, unsigned int hw_index, uint32_t toeplitz_hash_result); diff --git a/hif/src/ce/ce_diag.c b/hif/src/ce/ce_diag.c index 67d85545ff06..05ee4134e2d9 100644 --- a/hif/src/ce/ce_diag.c +++ b/hif/src/ce/ce_diag.c @@ -30,9 +30,10 @@ #include "athdefs.h" #include "osapi_linux.h" #include "targcfg.h" -#include "cdf_lock.h" -#include "cdf_status.h" -#include <cdf_atomic.h> /* cdf_atomic_read */ +#include "qdf_lock.h" +#include "qdf_status.h" +#include "qdf_status.h" +#include <qdf_atomic.h> /* qdf_atomic_read */ #include <targaddrs.h> #include <bmi_msg.h> #include "hif_io32.h" @@ -42,7 +43,7 @@ #include <a_debug.h> #include "hif_main.h" #include "ce_api.h" -#include "cdf_trace.h" +#include "qdf_trace.h" #ifdef CONFIG_CNSS #include <net/cnss.h> #endif @@ -62,7 +63,7 @@ hif_dump_target_memory(struct hif_opaque_softc *hif_ctx, void *ramdump_base, A_TARGET_ACCESS_BEGIN(scn); while (j < size) { val = hif_read32_mb(scn->mem + loc + j); - cdf_mem_copy(temp, &val, 4); + qdf_mem_copy(temp, &val, 4); j += 4; temp += 4; } @@ -94,25 +95,25 @@ hif_dump_target_memory(struct hif_opaque_softc *hif_ctx, void *ramdump_base, * at any moment. */ -CDF_STATUS +QDF_STATUS hif_diag_read_mem(struct hif_opaque_softc *hif_ctx, uint32_t address, uint8_t *data, int nbytes) { struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); - CDF_STATUS status = CDF_STATUS_SUCCESS; - cdf_dma_addr_t buf; + QDF_STATUS status = QDF_STATUS_SUCCESS; + qdf_dma_addr_t buf; unsigned int completed_nbytes, orig_nbytes, remaining_bytes; unsigned int id; unsigned int flags; struct CE_handle *ce_diag; - cdf_dma_addr_t CE_data; /* Host buffer address in CE space */ - cdf_dma_addr_t CE_data_base = 0; + qdf_dma_addr_t CE_data; /* Host buffer address in CE space */ + qdf_dma_addr_t CE_data_base = 0; void *data_buf = NULL; int i; unsigned int mux_id = 0; unsigned int transaction_id = 0xffff; - cdf_dma_addr_t ce_phy_addr = address; + qdf_dma_addr_t ce_phy_addr = address; unsigned int toeplitz_hash_result; unsigned int user_flags = 0; @@ -129,10 +130,10 @@ hif_diag_read_mem(struct hif_opaque_softc *hif_ctx, uint32_t address, if (address < DRAM_BASE_ADDRESS) { if ((address & 0x3) || ((uintptr_t) data & 0x3)) - return CDF_STATUS_E_INVAL; + return QDF_STATUS_E_INVAL; while ((nbytes >= 4) && - (CDF_STATUS_SUCCESS == (status = + (QDF_STATUS_SUCCESS == (status = hif_diag_read_access(hif_ctx, address, (uint32_t *)data)))) { @@ -155,14 +156,14 @@ hif_diag_read_mem(struct hif_opaque_softc *hif_ctx, uint32_t address, * 2) Buffer in DMA-able space */ orig_nbytes = nbytes; - data_buf = cdf_os_mem_alloc_consistent(scn->cdf_dev, - orig_nbytes, &CE_data_base, 0); + data_buf = qdf_mem_alloc_consistent(scn->qdf_dev, scn->qdf_dev->dev, + orig_nbytes, &CE_data_base); if (!data_buf) { - status = CDF_STATUS_E_NOMEM; + status = QDF_STATUS_E_NOMEM; goto done; } - cdf_mem_set(data_buf, orig_nbytes, 0); - cdf_os_mem_dma_sync_single_for_device(scn->cdf_dev, CE_data_base, + qdf_mem_set(data_buf, orig_nbytes, 0); + qdf_mem_dma_sync_single_for_device(scn->qdf_dev, CE_data_base, orig_nbytes, DMA_FROM_DEVICE); remaining_bytes = orig_nbytes; @@ -171,7 +172,7 @@ hif_diag_read_mem(struct hif_opaque_softc *hif_ctx, uint32_t address, nbytes = min(remaining_bytes, DIAG_TRANSFER_LIMIT); { status = ce_recv_buf_enqueue(ce_diag, NULL, CE_data); - if (status != CDF_STATUS_SUCCESS) + if (status != QDF_STATUS_SUCCESS) goto done; } @@ -195,26 +196,26 @@ hif_diag_read_mem(struct hif_opaque_softc *hif_ctx, uint32_t address, status = ce_send(ce_diag, NULL, ce_phy_addr, nbytes, transaction_id, 0, user_flags); - if (status != CDF_STATUS_SUCCESS) + if (status != QDF_STATUS_SUCCESS) goto done; } i = 0; while (ce_completed_send_next(ce_diag, NULL, NULL, &buf, &completed_nbytes, &id, NULL, NULL, - &toeplitz_hash_result) != CDF_STATUS_SUCCESS) { - cdf_mdelay(1); + &toeplitz_hash_result) != QDF_STATUS_SUCCESS) { + qdf_mdelay(1); if (i++ > DIAG_ACCESS_CE_TIMEOUT_MS) { - status = CDF_STATUS_E_BUSY; + status = QDF_STATUS_E_BUSY; goto done; } } if (nbytes != completed_nbytes) { - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; goto done; } if (buf != ce_phy_addr) { - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; goto done; } @@ -222,19 +223,19 @@ hif_diag_read_mem(struct hif_opaque_softc *hif_ctx, uint32_t address, while (ce_completed_recv_next (ce_diag, NULL, NULL, &buf, &completed_nbytes, &id, - &flags) != CDF_STATUS_SUCCESS) { - cdf_mdelay(1); + &flags) != QDF_STATUS_SUCCESS) { + qdf_mdelay(1); if (i++ > DIAG_ACCESS_CE_TIMEOUT_MS) { - status = CDF_STATUS_E_BUSY; + status = QDF_STATUS_E_BUSY; goto done; } } if (nbytes != completed_nbytes) { - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; goto done; } if (buf != CE_data) { - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; goto done; } @@ -246,20 +247,20 @@ hif_diag_read_mem(struct hif_opaque_softc *hif_ctx, uint32_t address, done: A_TARGET_ACCESS_UNLIKELY(scn); - if (status == CDF_STATUS_SUCCESS) - cdf_mem_copy(data, data_buf, orig_nbytes); + if (status == QDF_STATUS_SUCCESS) + qdf_mem_copy(data, data_buf, orig_nbytes); else HIF_ERROR("%s failure (0x%x)", __func__, address); if (data_buf) - cdf_os_mem_free_consistent(scn->cdf_dev, orig_nbytes, - data_buf, CE_data_base, 0); + qdf_mem_free_consistent(scn->qdf_dev, scn->qdf_dev->dev, + orig_nbytes, data_buf, CE_data_base, 0); return status; } /* Read 4-byte aligned data from Target memory or register */ -CDF_STATUS hif_diag_read_access(struct hif_opaque_softc *hif_ctx, +QDF_STATUS hif_diag_read_access(struct hif_opaque_softc *hif_ctx, uint32_t address, uint32_t *data) { struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); @@ -273,28 +274,28 @@ CDF_STATUS hif_diag_read_access(struct hif_opaque_softc *hif_ctx, *data = A_TARGET_READ(scn, address); A_TARGET_ACCESS_END_RET(scn); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } } -CDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *hif_ctx, +QDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *hif_ctx, uint32_t address, uint8_t *data, int nbytes) { struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_ctx); - CDF_STATUS status = CDF_STATUS_SUCCESS; - cdf_dma_addr_t buf; + QDF_STATUS status = QDF_STATUS_SUCCESS; + qdf_dma_addr_t buf; unsigned int completed_nbytes, orig_nbytes, remaining_bytes; unsigned int id; unsigned int flags; struct CE_handle *ce_diag; void *data_buf = NULL; - cdf_dma_addr_t CE_data; /* Host buffer address in CE space */ - cdf_dma_addr_t CE_data_base = 0; + qdf_dma_addr_t CE_data; /* Host buffer address in CE space */ + qdf_dma_addr_t CE_data_base = 0; int i; unsigned int mux_id = 0; unsigned int transaction_id = 0xffff; - cdf_dma_addr_t ce_phy_addr = address; + qdf_dma_addr_t ce_phy_addr = address; unsigned int toeplitz_hash_result; unsigned int user_flags = 0; @@ -314,16 +315,16 @@ CDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *hif_ctx, * 2) Buffer in DMA-able space */ orig_nbytes = nbytes; - data_buf = cdf_os_mem_alloc_consistent(scn->cdf_dev, - orig_nbytes, &CE_data_base, 0); + data_buf = qdf_mem_alloc_consistent(scn->qdf_dev, scn->qdf_dev->dev, + orig_nbytes, &CE_data_base); if (!data_buf) { status = A_NO_MEMORY; goto done; } /* Copy caller's data to allocated DMA buf */ - cdf_mem_copy(data_buf, data, orig_nbytes); - cdf_os_mem_dma_sync_single_for_device(scn->cdf_dev, CE_data_base, + qdf_mem_copy(data_buf, data, orig_nbytes); + qdf_mem_dma_sync_single_for_device(scn->qdf_dev, CE_data_base, orig_nbytes, DMA_TO_DEVICE); /* @@ -348,7 +349,7 @@ CDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *hif_ctx, { /* Set up to receive directly into Target(!) address */ status = ce_recv_buf_enqueue(ce_diag, NULL, ce_phy_addr); - if (status != CDF_STATUS_SUCCESS) + if (status != QDF_STATUS_SUCCESS) goto done; } @@ -359,9 +360,9 @@ CDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *hif_ctx, */ status = ce_send(ce_diag, NULL, - (cdf_dma_addr_t) CE_data, nbytes, + (qdf_dma_addr_t) CE_data, nbytes, transaction_id, 0, user_flags); - if (status != CDF_STATUS_SUCCESS) + if (status != QDF_STATUS_SUCCESS) goto done; } @@ -369,21 +370,21 @@ CDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *hif_ctx, while (ce_completed_send_next(ce_diag, NULL, NULL, &buf, &completed_nbytes, &id, NULL, NULL, &toeplitz_hash_result) != - CDF_STATUS_SUCCESS) { - cdf_mdelay(1); + QDF_STATUS_SUCCESS) { + qdf_mdelay(1); if (i++ > DIAG_ACCESS_CE_TIMEOUT_MS) { - status = CDF_STATUS_E_BUSY; + status = QDF_STATUS_E_BUSY; goto done; } } if (nbytes != completed_nbytes) { - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; goto done; } if (buf != CE_data) { - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; goto done; } @@ -391,21 +392,21 @@ CDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *hif_ctx, while (ce_completed_recv_next (ce_diag, NULL, NULL, &buf, &completed_nbytes, &id, - &flags) != CDF_STATUS_SUCCESS) { - cdf_mdelay(1); + &flags) != QDF_STATUS_SUCCESS) { + qdf_mdelay(1); if (i++ > DIAG_ACCESS_CE_TIMEOUT_MS) { - status = CDF_STATUS_E_BUSY; + status = QDF_STATUS_E_BUSY; goto done; } } if (nbytes != completed_nbytes) { - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; goto done; } if (buf != ce_phy_addr) { - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; goto done; } @@ -418,11 +419,11 @@ done: A_TARGET_ACCESS_UNLIKELY(scn); if (data_buf) { - cdf_os_mem_free_consistent(scn->cdf_dev, orig_nbytes, - data_buf, CE_data_base, 0); + qdf_mem_free_consistent(scn->qdf_dev, scn->qdf_dev->dev, + orig_nbytes, data_buf, CE_data_base, 0); } - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { HIF_ERROR("%s failure (0x%llu)", __func__, (uint64_t)ce_phy_addr); } @@ -431,7 +432,7 @@ done: } /* Write 4B data to Target memory or register */ -CDF_STATUS hif_diag_write_access(struct hif_opaque_softc *hif_ctx, +QDF_STATUS hif_diag_write_access(struct hif_opaque_softc *hif_ctx, uint32_t address, uint32_t data) { struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); @@ -448,6 +449,6 @@ CDF_STATUS hif_diag_write_access(struct hif_opaque_softc *hif_ctx, A_TARGET_WRITE(scn, address, data); A_TARGET_ACCESS_END_RET(scn); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } } diff --git a/hif/src/ce/ce_internal.h b/hif/src/ce/ce_internal.h index dabb7d37fb39..60f483a04dbd 100644 --- a/hif/src/ce/ce_internal.h +++ b/hif/src/ce/ce_internal.h @@ -76,7 +76,7 @@ struct CE_ring_state { /* Start of DMA-coherent area reserved for descriptors */ void *base_addr_owner_space_unaligned; /* Host address space */ - cdf_dma_addr_t base_addr_CE_space_unaligned; /* CE address space */ + qdf_dma_addr_t base_addr_CE_space_unaligned; /* CE address space */ /* * Actual start of descriptors. @@ -84,7 +84,7 @@ struct CE_ring_state { * Points into reserved DMA-coherent area, above. */ void *base_addr_owner_space; /* Host address space */ - cdf_dma_addr_t base_addr_CE_space; /* CE address space */ + qdf_dma_addr_t base_addr_CE_space; /* CE address space */ /* * Start of shadow copy of descriptors, within regular memory. * Aligned to descriptor-size boundary. @@ -130,7 +130,7 @@ struct CE_state { struct CE_ring_state *dest_ring; atomic_t rx_pending; - cdf_spinlock_t ce_index_lock; + qdf_spinlock_t ce_index_lock; bool force_break; /* Flag to indicate whether to * break out the DPC context */ @@ -139,7 +139,7 @@ struct CE_state { * DPC routine */ /* epping */ bool timer_inited; - cdf_softirq_timer_t poll_timer; + qdf_timer_t poll_timer; void (*lro_flush_cb)(void *); void *lro_data; }; @@ -149,11 +149,11 @@ struct CE_state { #ifdef QCA_WIFI_3_0 #define HIF_CE_DESC_ADDR_TO_DMA(desc) \ - (cdf_dma_addr_t)(((uint64_t)(desc)->buffer_addr + \ + (qdf_dma_addr_t)(((uint64_t)(desc)->buffer_addr + \ ((uint64_t)((desc)->buffer_addr_hi & 0x1F) << 32))) #else #define HIF_CE_DESC_ADDR_TO_DMA(desc) \ - (cdf_dma_addr_t)((desc)->buffer_addr) + (qdf_dma_addr_t)((desc)->buffer_addr) #endif #ifdef QCA_WIFI_3_0 diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 58f87d593881..3320d8c47565 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -29,9 +29,10 @@ #include "athdefs.h" #include "osapi_linux.h" #include "targcfg.h" -#include "cdf_lock.h" -#include "cdf_status.h" -#include <cdf_atomic.h> /* cdf_atomic_read */ +#include "qdf_lock.h" +#include "qdf_status.h" +#include "qdf_status.h" +#include <qdf_atomic.h> /* qdf_atomic_read */ #include <targaddrs.h> #include <bmi_msg.h> #include "hif_io32.h" @@ -44,7 +45,7 @@ #include "ce_bmi.h" #endif #include "ce_api.h" -#include "cdf_trace.h" +#include "qdf_trace.h" #ifdef CONFIG_CNSS #include <net/cnss.h> #endif @@ -82,7 +83,7 @@ static void ce_poll_timeout(void *arg) struct CE_state *CE_state = (struct CE_state *)arg; if (CE_state->timer_inited) { ce_per_engine_service(CE_state->scn, CE_state->id); - cdf_softirq_timer_mod(&CE_state->poll_timer, CE_POLL_TIMEOUT); + qdf_timer_mod(&CE_state->poll_timer, CE_POLL_TIMEOUT); } } @@ -101,7 +102,7 @@ static unsigned int roundup_pwr2(unsigned int n) test_pwr2 = test_pwr2 << 1; } - CDF_ASSERT(0); /* n too large */ + QDF_ASSERT(0); /* n too large */ return 0; } @@ -121,25 +122,25 @@ struct CE_handle *ce_init(struct hif_softc *scn, struct CE_state *CE_state; uint32_t ctrl_addr; unsigned int nentries; - cdf_dma_addr_t base_addr; + qdf_dma_addr_t base_addr; bool malloc_CE_state = false; bool malloc_src_ring = false; - CDF_ASSERT(CE_id < scn->ce_count); + QDF_ASSERT(CE_id < scn->ce_count); ctrl_addr = CE_BASE_ADDRESS(CE_id); CE_state = scn->ce_id_to_state[CE_id]; if (!CE_state) { CE_state = - (struct CE_state *)cdf_mem_malloc(sizeof(*CE_state)); + (struct CE_state *)qdf_mem_malloc(sizeof(*CE_state)); if (!CE_state) { HIF_ERROR("%s: CE_state has no mem", __func__); return NULL; } malloc_CE_state = true; - cdf_mem_zero(CE_state, sizeof(*CE_state)); + qdf_mem_zero(CE_state, sizeof(*CE_state)); scn->ce_id_to_state[CE_id] = CE_state; - cdf_spinlock_init(&CE_state->ce_index_lock); + qdf_spinlock_create(&CE_state->ce_index_lock); CE_state->id = CE_id; CE_state->ctrl_addr = ctrl_addr; @@ -148,7 +149,7 @@ struct CE_handle *ce_init(struct hif_softc *scn, } CE_state->scn = scn; - cdf_atomic_init(&CE_state->rx_pending); + qdf_atomic_init(&CE_state->rx_pending); if (attr == NULL) { /* Already initialized; caller wants the handle */ return (struct CE_handle *)CE_state; @@ -160,7 +161,7 @@ struct CE_handle *ce_init(struct hif_softc *scn, #endif if (CE_state->src_sz_max) - CDF_ASSERT(CE_state->src_sz_max == attr->src_sz_max); + QDF_ASSERT(CE_state->src_sz_max == attr->src_sz_max); else CE_state->src_sz_max = attr->src_sz_max; @@ -176,11 +177,11 @@ struct CE_handle *ce_init(struct hif_softc *scn, uint64_t dma_addr; nentries = roundup_pwr2(nentries); if (CE_state->src_ring) { - CDF_ASSERT(CE_state->src_ring->nentries == nentries); + QDF_ASSERT(CE_state->src_ring->nentries == nentries); } else { CE_nbytes = sizeof(struct CE_ring_state) + (nentries * sizeof(void *)); - ptr = cdf_mem_malloc(CE_nbytes); + ptr = qdf_mem_malloc(CE_nbytes); if (!ptr) { /* cannot allocate src ring. If the * CE_state is allocated locally free @@ -190,7 +191,7 @@ struct CE_handle *ce_init(struct hif_softc *scn, if (malloc_CE_state) { /* allocated CE_state locally */ scn->ce_id_to_state[CE_id] = NULL; - cdf_mem_free(CE_state); + qdf_mem_free(CE_state); malloc_CE_state = false; } return NULL; @@ -201,7 +202,7 @@ struct CE_handle *ce_init(struct hif_softc *scn, */ malloc_src_ring = true; } - cdf_mem_zero(ptr, CE_nbytes); + qdf_mem_zero(ptr, CE_nbytes); src_ring = CE_state->src_ring = (struct CE_ring_state *)ptr; @@ -223,11 +224,12 @@ struct CE_handle *ce_init(struct hif_softc *scn, * coherent DMA are unsupported */ src_ring->base_addr_owner_space_unaligned = - cdf_os_mem_alloc_consistent(scn->cdf_dev, + qdf_mem_alloc_consistent(scn->qdf_dev, + scn->qdf_dev->dev, (nentries * sizeof(struct CE_src_desc) + CE_DESC_RING_ALIGN), - &base_addr, 0); + &base_addr); if (src_ring->base_addr_owner_space_unaligned == NULL) { HIF_ERROR("%s: src ring has no DMA mem", @@ -262,7 +264,7 @@ struct CE_handle *ce_init(struct hif_softc *scn, * regular mem to use for faster access. */ src_ring->shadow_base_unaligned = - cdf_mem_malloc(nentries * + qdf_mem_malloc(nentries * sizeof(struct CE_src_desc) + CE_DESC_RING_ALIGN); if (src_ring->shadow_base_unaligned == NULL) { @@ -312,11 +314,11 @@ struct CE_handle *ce_init(struct hif_softc *scn, nentries = roundup_pwr2(nentries); if (CE_state->dest_ring) { - CDF_ASSERT(CE_state->dest_ring->nentries == nentries); + QDF_ASSERT(CE_state->dest_ring->nentries == nentries); } else { CE_nbytes = sizeof(struct CE_ring_state) + (nentries * sizeof(void *)); - ptr = cdf_mem_malloc(CE_nbytes); + ptr = qdf_mem_malloc(CE_nbytes); if (!ptr) { /* cannot allocate dst ring. If the CE_state * or src ring is allocated locally free @@ -325,19 +327,19 @@ struct CE_handle *ce_init(struct hif_softc *scn, HIF_ERROR("%s: dest ring has no mem", __func__); if (malloc_src_ring) { - cdf_mem_free(CE_state->src_ring); + qdf_mem_free(CE_state->src_ring); CE_state->src_ring = NULL; malloc_src_ring = false; } if (malloc_CE_state) { /* allocated CE_state locally */ scn->ce_id_to_state[CE_id] = NULL; - cdf_mem_free(CE_state); + qdf_mem_free(CE_state); malloc_CE_state = false; } return NULL; } - cdf_mem_zero(ptr, CE_nbytes); + qdf_mem_zero(ptr, CE_nbytes); dest_ring = CE_state->dest_ring = (struct CE_ring_state *)ptr; @@ -357,11 +359,12 @@ struct CE_handle *ce_init(struct hif_softc *scn, /* Legacy platforms that do not support cache * coherent DMA are unsupported */ dest_ring->base_addr_owner_space_unaligned = - cdf_os_mem_alloc_consistent(scn->cdf_dev, + qdf_mem_alloc_consistent(scn->qdf_dev, + scn->qdf_dev->dev, (nentries * sizeof(struct CE_dest_desc) + CE_DESC_RING_ALIGN), - &base_addr, 0); + &base_addr); if (dest_ring->base_addr_owner_space_unaligned == NULL) { HIF_ERROR("%s: dest ring has no DMA mem", @@ -374,7 +377,7 @@ struct CE_handle *ce_init(struct hif_softc *scn, * prevent garbage data crashing system * when download firmware */ - cdf_mem_zero(dest_ring->base_addr_owner_space_unaligned, + qdf_mem_zero(dest_ring->base_addr_owner_space_unaligned, nentries * sizeof(struct CE_dest_desc) + CE_DESC_RING_ALIGN); @@ -429,13 +432,13 @@ struct CE_handle *ce_init(struct hif_softc *scn, /* epping */ /* poll timer */ if ((CE_state->attr_flags & CE_ATTR_ENABLE_POLL)) { - cdf_softirq_timer_init(scn->cdf_dev, + qdf_timer_init(scn->qdf_dev, &CE_state->poll_timer, ce_poll_timeout, CE_state, - CDF_TIMER_TYPE_SW); + QDF_TIMER_TYPE_SW); CE_state->timer_inited = true; - cdf_softirq_timer_mod(&CE_state->poll_timer, + qdf_timer_mod(&CE_state->poll_timer, CE_POLL_TIMEOUT); } } @@ -482,7 +485,7 @@ ce_h2t_tx_ce_cleanup(struct CE_handle *ce_hdl) write_index = src_ring->sw_index; /* At this point Tx CE should be clean */ - cdf_assert_always(sw_index == write_index); + qdf_assert_always(sw_index == write_index); } } #else @@ -504,9 +507,10 @@ void ce_fini(struct CE_handle *copyeng) ce_h2t_tx_ce_cleanup(copyeng); if (CE_state->src_ring->shadow_base_unaligned) - cdf_mem_free(CE_state->src_ring->shadow_base_unaligned); + qdf_mem_free(CE_state->src_ring->shadow_base_unaligned); if (CE_state->src_ring->base_addr_owner_space_unaligned) - cdf_os_mem_free_consistent(scn->cdf_dev, + qdf_mem_free_consistent(scn->qdf_dev, + scn->qdf_dev->dev, (CE_state->src_ring->nentries * sizeof(struct CE_src_desc) + CE_DESC_RING_ALIGN), @@ -514,11 +518,12 @@ void ce_fini(struct CE_handle *copyeng) base_addr_owner_space_unaligned, CE_state->src_ring-> base_addr_CE_space, 0); - cdf_mem_free(CE_state->src_ring); + qdf_mem_free(CE_state->src_ring); } if (CE_state->dest_ring) { if (CE_state->dest_ring->base_addr_owner_space_unaligned) - cdf_os_mem_free_consistent(scn->cdf_dev, + qdf_mem_free_consistent(scn->qdf_dev, + scn->qdf_dev->dev, (CE_state->dest_ring->nentries * sizeof(struct CE_dest_desc) + CE_DESC_RING_ALIGN), @@ -526,29 +531,29 @@ void ce_fini(struct CE_handle *copyeng) base_addr_owner_space_unaligned, CE_state->dest_ring-> base_addr_CE_space, 0); - cdf_mem_free(CE_state->dest_ring); + qdf_mem_free(CE_state->dest_ring); /* epping */ if (CE_state->timer_inited) { CE_state->timer_inited = false; - cdf_softirq_timer_free(&CE_state->poll_timer); + qdf_timer_free(&CE_state->poll_timer); } } - cdf_mem_free(CE_state); + qdf_mem_free(CE_state); } void hif_detach_htc(struct hif_opaque_softc *hif_ctx) { struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_ctx); - cdf_mem_zero(&hif_state->msg_callbacks_pending, + qdf_mem_zero(&hif_state->msg_callbacks_pending, sizeof(hif_state->msg_callbacks_pending)); - cdf_mem_zero(&hif_state->msg_callbacks_current, + qdf_mem_zero(&hif_state->msg_callbacks_current, sizeof(hif_state->msg_callbacks_current)); } /* Send the first nbytes bytes of the buffer */ -CDF_STATUS +QDF_STATUS hif_send_head(struct hif_opaque_softc *hif_ctx, uint8_t pipe, unsigned int transfer_id, unsigned int nbytes, cdf_nbuf_t nbuf, unsigned int data_attr) @@ -562,7 +567,7 @@ hif_send_head(struct hif_opaque_softc *hif_ctx, int status, i = 0; unsigned int mux_id = 0; - CDF_ASSERT(nbytes <= cdf_nbuf_len(nbuf)); + QDF_ASSERT(nbytes <= cdf_nbuf_len(nbuf)); transfer_id = (mux_id & MUX_ID_MASK) | @@ -578,7 +583,7 @@ hif_send_head(struct hif_opaque_softc *hif_ctx, */ ce_sendlist_init(&sendlist); do { - cdf_dma_addr_t frag_paddr; + qdf_dma_addr_t frag_paddr; int frag_bytes; frag_paddr = cdf_nbuf_get_frag_paddr(nbuf, nfrags); @@ -587,7 +592,7 @@ hif_send_head(struct hif_opaque_softc *hif_ctx, * Clear the packet offset for all but the first CE desc. */ if (i++ > 0) - data_attr &= ~CDF_CE_TX_PKT_OFFSET_BIT_M; + data_attr &= ~QDF_CE_TX_PKT_OFFSET_BIT_M; status = ce_sendlist_buf_add(&sendlist, frag_paddr, frag_bytes > @@ -597,7 +602,7 @@ hif_send_head(struct hif_opaque_softc *hif_ctx, nfrags) ? 0 : CE_SEND_FLAG_SWAP_DISABLE, data_attr); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: error, frag_num %d larger than limit", __func__, nfrags); return status; @@ -607,26 +612,26 @@ hif_send_head(struct hif_opaque_softc *hif_ctx, } while (bytes > 0); /* Make sure we have resources to handle this request */ - cdf_spin_lock_bh(&pipe_info->completion_freeq_lock); + qdf_spin_lock_bh(&pipe_info->completion_freeq_lock); if (pipe_info->num_sends_allowed < nfrags) { - cdf_spin_unlock_bh(&pipe_info->completion_freeq_lock); + qdf_spin_unlock_bh(&pipe_info->completion_freeq_lock); ce_pkt_error_count_incr(hif_state, HIF_PIPE_NO_RESOURCE); - return CDF_STATUS_E_RESOURCES; + return QDF_STATUS_E_RESOURCES; } pipe_info->num_sends_allowed -= nfrags; - cdf_spin_unlock_bh(&pipe_info->completion_freeq_lock); + qdf_spin_unlock_bh(&pipe_info->completion_freeq_lock); - if (cdf_unlikely(ce_hdl == NULL)) { + if (qdf_unlikely(ce_hdl == NULL)) { HIF_ERROR("%s: error CE handle is null", __func__); return A_ERROR; } NBUF_UPDATE_TX_PKT_COUNT(nbuf, NBUF_TX_PKT_HIF); - DPTRACE(cdf_dp_trace(nbuf, CDF_DP_TRACE_HIF_PACKET_PTR_RECORD, + DPTRACE(qdf_dp_trace(nbuf, QDF_DP_TRACE_HIF_PACKET_PTR_RECORD, (uint8_t *)(cdf_nbuf_data(nbuf)), sizeof(cdf_nbuf_data(nbuf)))); status = ce_sendlist_send(ce_hdl, nbuf, &sendlist, transfer_id); - CDF_ASSERT(status == CDF_STATUS_SUCCESS); + QDF_ASSERT(status == QDF_STATUS_SUCCESS); return status; } @@ -668,16 +673,16 @@ hif_get_free_queue_number(struct hif_opaque_softc *hif_ctx, uint8_t pipe) struct HIF_CE_pipe_info *pipe_info = &(hif_state->pipe_info[pipe]); uint16_t rv; - cdf_spin_lock_bh(&pipe_info->completion_freeq_lock); + qdf_spin_lock_bh(&pipe_info->completion_freeq_lock); rv = pipe_info->num_sends_allowed; - cdf_spin_unlock_bh(&pipe_info->completion_freeq_lock); + qdf_spin_unlock_bh(&pipe_info->completion_freeq_lock); return rv; } /* Called by lower (CE) layer when a send to Target completes. */ void hif_pci_ce_send_done(struct CE_handle *copyeng, void *ce_context, - void *transfer_context, cdf_dma_addr_t CE_data, + void *transfer_context, qdf_dma_addr_t CE_data, unsigned int nbytes, unsigned int transfer_id, unsigned int sw_index, unsigned int hw_index, unsigned int toeplitz_hash_result) @@ -706,14 +711,14 @@ hif_pci_ce_send_done(struct CE_handle *copyeng, void *ce_context, toeplitz_hash_result); } - cdf_spin_lock(&pipe_info->completion_freeq_lock); + qdf_spin_lock(&pipe_info->completion_freeq_lock); pipe_info->num_sends_allowed++; - cdf_spin_unlock(&pipe_info->completion_freeq_lock); + qdf_spin_unlock(&pipe_info->completion_freeq_lock); } while (ce_completed_send_next(copyeng, &ce_context, &transfer_context, &CE_data, &nbytes, &transfer_id, &sw_idx, &hw_idx, - &toeplitz_hash_result) == CDF_STATUS_SUCCESS); + &toeplitz_hash_result) == QDF_STATUS_SUCCESS); } /** @@ -746,7 +751,7 @@ static inline void hif_ce_do_recv(struct hif_msg_callbacks *msg_callbacks, /* Called by lower (CE) layer when data is received from the Target. */ void hif_pci_ce_recv_data(struct CE_handle *copyeng, void *ce_context, - void *transfer_context, cdf_dma_addr_t CE_data, + void *transfer_context, qdf_dma_addr_t CE_data, unsigned int nbytes, unsigned int transfer_id, unsigned int flags) { @@ -762,9 +767,9 @@ hif_pci_ce_recv_data(struct CE_handle *copyeng, void *ce_context, do { hif_pm_runtime_mark_last_busy(hif_sc->dev); - cdf_nbuf_unmap_single(scn->cdf_dev, + cdf_nbuf_unmap_single(scn->qdf_dev, (cdf_nbuf_t) transfer_context, - CDF_DMA_FROM_DEVICE); + QDF_DMA_FROM_DEVICE); atomic_inc(&pipe_info->recv_bufs_needed); hif_post_recv_buffers_for_pipe(pipe_info); @@ -778,13 +783,13 @@ hif_pci_ce_recv_data(struct CE_handle *copyeng, void *ce_context, * MAX_NUM_OF_RECEIVES */ ce_state->receive_count++; count = ce_state->receive_count; - if (cdf_unlikely(hif_max_num_receives_reached(scn, count))) { + if (qdf_unlikely(hif_max_num_receives_reached(scn, count))) { ce_state->force_break = 1; break; } } while (ce_completed_recv_next(copyeng, &ce_context, &transfer_context, &CE_data, &nbytes, &transfer_id, - &flags) == CDF_STATUS_SUCCESS); + &flags) == QDF_STATUS_SUCCESS); } @@ -800,7 +805,7 @@ hif_post_init(struct hif_opaque_softc *hif_ctx, void *unused, spin_lock_init(&pcie_access_log_lock); #endif /* Save callbacks for later installation */ - cdf_mem_copy(&hif_state->msg_callbacks_pending, callbacks, + qdf_mem_copy(&hif_state->msg_callbacks_pending, callbacks, sizeof(hif_state->msg_callbacks_pending)); } @@ -854,7 +859,7 @@ int hif_completion_thread_startup(struct HIF_CE_state *hif_state) } if (attr.src_nentries) - cdf_spinlock_init(&pipe_info->completion_freeq_lock); + qdf_spinlock_create(&pipe_info->completion_freeq_lock); } A_TARGET_ACCESS_UNLIKELY(scn); @@ -873,7 +878,7 @@ static void hif_msg_callbacks_install(struct hif_softc *scn) { struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); - cdf_mem_copy(&hif_state->msg_callbacks_current, + qdf_mem_copy(&hif_state->msg_callbacks_current, &hif_state->msg_callbacks_pending, sizeof(hif_state->msg_callbacks_pending)); } @@ -925,9 +930,9 @@ void hif_dump_pipe_debug_count(struct hif_softc *scn) static int hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info) { struct CE_handle *ce_hdl; - cdf_size_t buf_sz; + qdf_size_t buf_sz; struct hif_softc *scn = HIF_GET_SOFTC(pipe_info->HIF_CE_state); - CDF_STATUS ret; + QDF_STATUS ret; uint32_t bufs_posted = 0; buf_sz = pipe_info->buf_sz; @@ -938,20 +943,20 @@ static int hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info) ce_hdl = pipe_info->ce_hdl; - cdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock); + qdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock); while (atomic_read(&pipe_info->recv_bufs_needed) > 0) { - cdf_dma_addr_t CE_data; /* CE space buffer address */ + qdf_dma_addr_t CE_data; /* CE space buffer address */ cdf_nbuf_t nbuf; int status; atomic_dec(&pipe_info->recv_bufs_needed); - cdf_spin_unlock_bh(&pipe_info->recv_bufs_needed_lock); + qdf_spin_unlock_bh(&pipe_info->recv_bufs_needed_lock); - nbuf = cdf_nbuf_alloc(scn->cdf_dev, buf_sz, 0, 4, false); + nbuf = cdf_nbuf_alloc(scn->qdf_dev, buf_sz, 0, 4, false); if (!nbuf) { - cdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock); + qdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock); pipe_info->nbuf_alloc_err_count++; - cdf_spin_unlock_bh( + qdf_spin_unlock_bh( &pipe_info->recv_bufs_needed_lock); HIF_ERROR( "%s buf alloc error [%d] needed %d, nbuf_alloc_err_count = %u", @@ -968,13 +973,13 @@ static int hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info) * DMA_FROM_DEVICE); */ ret = - cdf_nbuf_map_single(scn->cdf_dev, nbuf, - CDF_DMA_FROM_DEVICE); + cdf_nbuf_map_single(scn->qdf_dev, nbuf, + QDF_DMA_FROM_DEVICE); - if (unlikely(ret != CDF_STATUS_SUCCESS)) { - cdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock); + if (unlikely(ret != QDF_STATUS_SUCCESS)) { + qdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock); pipe_info->nbuf_dma_err_count++; - cdf_spin_unlock_bh(&pipe_info->recv_bufs_needed_lock); + qdf_spin_unlock_bh(&pipe_info->recv_bufs_needed_lock); HIF_ERROR( "%s buf alloc error [%d] needed %d, nbuf_dma_err_count = %u", __func__, pipe_info->pipe_num, @@ -987,14 +992,14 @@ static int hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info) CE_data = cdf_nbuf_get_frag_paddr(nbuf, 0); - cdf_os_mem_dma_sync_single_for_device(scn->cdf_dev, CE_data, + qdf_mem_dma_sync_single_for_device(scn->qdf_dev, CE_data, buf_sz, DMA_FROM_DEVICE); status = ce_recv_buf_enqueue(ce_hdl, (void *)nbuf, CE_data); - CDF_ASSERT(status == CDF_STATUS_SUCCESS); + QDF_ASSERT(status == QDF_STATUS_SUCCESS); if (status != EOK) { - cdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock); + qdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock); pipe_info->nbuf_ce_enqueue_err_count++; - cdf_spin_unlock_bh(&pipe_info->recv_bufs_needed_lock); + qdf_spin_unlock_bh(&pipe_info->recv_bufs_needed_lock); HIF_ERROR( "%s buf alloc error [%d] needed %d, nbuf_alloc_err_count = %u", __func__, pipe_info->pipe_num, @@ -1005,7 +1010,7 @@ static int hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info) return 1; } - cdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock); + qdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock); bufs_posted++; } pipe_info->nbuf_alloc_err_count = @@ -1018,7 +1023,7 @@ static int hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info) (pipe_info->nbuf_ce_enqueue_err_count > bufs_posted) ? pipe_info->nbuf_ce_enqueue_err_count - bufs_posted : 0; - cdf_spin_unlock_bh(&pipe_info->recv_bufs_needed_lock); + qdf_spin_unlock_bh(&pipe_info->recv_bufs_needed_lock); return 0; } @@ -1051,7 +1056,7 @@ done: return rv; } -CDF_STATUS hif_start(struct hif_opaque_softc *hif_ctx) +QDF_STATUS hif_start(struct hif_opaque_softc *hif_ctx) { struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); @@ -1059,14 +1064,14 @@ CDF_STATUS hif_start(struct hif_opaque_softc *hif_ctx) hif_msg_callbacks_install(scn); if (hif_completion_thread_startup(hif_state)) - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; /* Post buffers once to start things off. */ (void)hif_post_recv_buffers(scn); hif_state->started = true; - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } #ifdef WLAN_FEATURE_FASTPATH @@ -1125,7 +1130,7 @@ void hif_recv_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info) uint32_t buf_sz; struct HIF_CE_state *hif_state; cdf_nbuf_t netbuf; - cdf_dma_addr_t CE_data; + qdf_dma_addr_t CE_data; void *per_CE_context; buf_sz = pipe_info->buf_sz; @@ -1142,14 +1147,14 @@ void hif_recv_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info) scn = HIF_GET_SOFTC(hif_state); ce_hdl = pipe_info->ce_hdl; - if (scn->cdf_dev == NULL) { + if (scn->qdf_dev == NULL) { return; } while (ce_revoke_recv_next (ce_hdl, &per_CE_context, (void **)&netbuf, - &CE_data) == CDF_STATUS_SUCCESS) { - cdf_nbuf_unmap_single(scn->cdf_dev, netbuf, - CDF_DMA_FROM_DEVICE); + &CE_data) == QDF_STATUS_SUCCESS) { + cdf_nbuf_unmap_single(scn->qdf_dev, netbuf, + QDF_DMA_FROM_DEVICE); cdf_nbuf_free(netbuf); } } @@ -1161,7 +1166,7 @@ void hif_send_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info) struct hif_softc *scn; cdf_nbuf_t netbuf; void *per_CE_context; - cdf_dma_addr_t CE_data; + qdf_dma_addr_t CE_data; unsigned int nbytes; unsigned int id; uint32_t buf_sz; @@ -1185,7 +1190,7 @@ void hif_send_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info) while (ce_cancel_send_next (ce_hdl, &per_CE_context, (void **)&netbuf, &CE_data, &nbytes, - &id, &toeplitz_hash_result) == CDF_STATUS_SUCCESS) { + &id, &toeplitz_hash_result) == QDF_STATUS_SUCCESS) { if (netbuf != CE_SENDLIST_ITEM_CTXT) { /* * Packets enqueued by htt_h2t_ver_req_msg() and @@ -1271,8 +1276,8 @@ void hif_stop(struct hif_opaque_softc *hif_ctx) } if (hif_state->sleep_timer_init) { - cdf_softirq_timer_cancel(&hif_state->sleep_timer); - cdf_softirq_timer_free(&hif_state->sleep_timer); + qdf_timer_stop(&hif_state->sleep_timer); + qdf_timer_free(&hif_state->sleep_timer); hif_state->sleep_timer_init = false; } @@ -1497,21 +1502,21 @@ static struct service_to_pipe target_service_to_ce_map_wlan_epping[] = { */ void hif_wake_target_cpu(struct hif_softc *scn) { - CDF_STATUS rv; + QDF_STATUS rv; uint32_t core_ctrl; struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); rv = hif_diag_read_access(hif_hdl, SOC_CORE_BASE_ADDRESS | CORE_CTRL_ADDRESS, &core_ctrl); - CDF_ASSERT(rv == CDF_STATUS_SUCCESS); + QDF_ASSERT(rv == QDF_STATUS_SUCCESS); /* A_INUM_FIRMWARE interrupt to Target CPU */ core_ctrl |= CORE_CTRL_CPU_INTR_MASK; rv = hif_diag_write_access(hif_hdl, SOC_CORE_BASE_ADDRESS | CORE_CTRL_ADDRESS, core_ctrl); - CDF_ASSERT(rv == CDF_STATUS_SUCCESS); + QDF_ASSERT(rv == QDF_STATUS_SUCCESS); } #endif @@ -1527,26 +1532,26 @@ static void hif_sleep_entry(void *arg) if (hif_is_driver_unloading(scn)) return; - cdf_spin_lock_irqsave(&hif_state->keep_awake_lock); + qdf_spin_lock_irqsave(&hif_state->keep_awake_lock); if (hif_state->verified_awake == false) { - idle_ms = cdf_system_ticks_to_msecs(cdf_system_ticks() + idle_ms = qdf_system_ticks_to_msecs(qdf_system_ticks() - hif_state->sleep_ticks); if (idle_ms >= HIF_MIN_SLEEP_INACTIVITY_TIME_MS) { - if (!cdf_atomic_read(&scn->link_suspended)) { + if (!qdf_atomic_read(&scn->link_suspended)) { soc_wake_reset(scn); hif_state->fake_sleep = false; } } else { - cdf_softirq_timer_cancel(&hif_state->sleep_timer); - cdf_softirq_timer_start(&hif_state->sleep_timer, + qdf_timer_stop(&hif_state->sleep_timer); + qdf_timer_start(&hif_state->sleep_timer, HIF_SLEEP_INACTIVITY_TIMER_PERIOD_MS); } } else { - cdf_softirq_timer_cancel(&hif_state->sleep_timer); - cdf_softirq_timer_start(&hif_state->sleep_timer, + qdf_timer_stop(&hif_state->sleep_timer); + qdf_timer_start(&hif_state->sleep_timer, HIF_SLEEP_INACTIVITY_TIMER_PERIOD_MS); } - cdf_spin_unlock_irqrestore(&hif_state->keep_awake_lock); + qdf_spin_unlock_irqrestore(&hif_state->keep_awake_lock); } #define HIF_HIA_MAX_POLL_LOOP 1000000 #define HIF_HIA_POLLING_DELAY_MS 10 @@ -1559,7 +1564,7 @@ int hif_set_hia(struct hif_softc *scn) #else int hif_set_hia(struct hif_softc *scn) { - CDF_STATUS rv; + QDF_STATUS rv; uint32_t interconnect_targ_addr = 0; uint32_t pcie_state_targ_addr = 0; uint32_t pipe_cfg_targ_addr = 0; @@ -1584,7 +1589,7 @@ int hif_set_hia(struct hif_softc *scn) HIF_TRACE("%s: E", __func__); if (ADRASTEA_BU) - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; #ifdef QCA_WIFI_3_0 i = 0; @@ -1592,7 +1597,7 @@ int hif_set_hia(struct hif_softc *scn) host_interest_area = hif_read32_mb(scn->mem + A_SOC_CORE_SCRATCH_0_ADDRESS); if ((host_interest_area & 0x01) == 0) { - cdf_mdelay(HIF_HIA_POLLING_DELAY_MS); + qdf_mdelay(HIF_HIA_POLLING_DELAY_MS); host_interest_area = 0; i++; if (i > HIF_HIA_MAX_POLL_LOOP && (i % 1000 == 0)) { @@ -1633,13 +1638,13 @@ int hif_set_hia(struct hif_softc *scn) /* Supply Target-side CE configuration */ rv = hif_diag_read_access(hif_hdl, interconnect_targ_addr, &pcie_state_targ_addr); - if (rv != CDF_STATUS_SUCCESS) { + if (rv != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: interconnect_targ_addr = 0x%0x, ret = %d", __func__, interconnect_targ_addr, rv); goto done; } if (pcie_state_targ_addr == 0) { - rv = CDF_STATUS_E_FAILURE; + rv = QDF_STATUS_E_FAILURE; HIF_ERROR("%s: pcie state addr is 0", __func__); goto done; } @@ -1649,13 +1654,13 @@ int hif_set_hia(struct hif_softc *scn) rv = hif_diag_read_access(hif_hdl, pipe_cfg_addr, &pipe_cfg_targ_addr); - if (rv != CDF_STATUS_SUCCESS) { + if (rv != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: pipe_cfg_addr = 0x%0x, ret = %d", __func__, pipe_cfg_addr, rv); goto done; } if (pipe_cfg_targ_addr == 0) { - rv = CDF_STATUS_E_FAILURE; + rv = QDF_STATUS_E_FAILURE; HIF_ERROR("%s: pipe cfg addr is 0", __func__); goto done; } @@ -1664,7 +1669,7 @@ int hif_set_hia(struct hif_softc *scn) (uint8_t *) target_ce_config, target_ce_config_sz); - if (rv != CDF_STATUS_SUCCESS) { + if (rv != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: write pipe cfg (%d)", __func__, rv); goto done; } @@ -1674,12 +1679,12 @@ int hif_set_hia(struct hif_softc *scn) offsetof(struct pcie_state_s, svc_to_pipe_map), &svc_to_pipe_map); - if (rv != CDF_STATUS_SUCCESS) { + if (rv != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: get svc/pipe map (%d)", __func__, rv); goto done; } if (svc_to_pipe_map == 0) { - rv = CDF_STATUS_E_FAILURE; + rv = QDF_STATUS_E_FAILURE; HIF_ERROR("%s: svc_to_pipe map is 0", __func__); goto done; } @@ -1688,7 +1693,7 @@ int hif_set_hia(struct hif_softc *scn) svc_to_pipe_map, (uint8_t *) target_service_to_ce_map, target_service_to_ce_map_sz); - if (rv != CDF_STATUS_SUCCESS) { + if (rv != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: write svc/pipe map (%d)", __func__, rv); goto done; } @@ -1698,7 +1703,7 @@ int hif_set_hia(struct hif_softc *scn) offsetof(struct pcie_state_s, config_flags), &pcie_config_flags); - if (rv != CDF_STATUS_SUCCESS) { + if (rv != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: get pcie config_flags (%d)", __func__, rv); goto done; } @@ -1717,7 +1722,7 @@ int hif_set_hia(struct hif_softc *scn) config_flags), (uint8_t *) &pcie_config_flags, sizeof(pcie_config_flags)); - if (rv != CDF_STATUS_SUCCESS) { + if (rv != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: write pcie config_flags (%d)", __func__, rv); goto done; } @@ -1731,7 +1736,7 @@ int hif_set_hia(struct hif_softc *scn) rv = hif_diag_read_access(hif_hdl, ealloc_targ_addr, &ealloc_value); - if (rv != CDF_STATUS_SUCCESS) { + if (rv != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: get early alloc val (%d)", __func__, rv); goto done; } @@ -1744,7 +1749,7 @@ int hif_set_hia(struct hif_softc *scn) rv = hif_diag_read_access(hif_hdl, CHIP_ID_ADDRESS | RTC_SOC_BASE_ADDRESS, &chip_id); - if (rv != CDF_STATUS_SUCCESS) { + if (rv != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: get chip id val (%d)", __func__, rv); goto done; } @@ -1780,7 +1785,7 @@ int hif_set_hia(struct hif_softc *scn) rv = hif_diag_write_access(hif_hdl, ealloc_targ_addr, ealloc_value); - if (rv != CDF_STATUS_SUCCESS) { + if (rv != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: set early alloc val (%d)", __func__, rv); goto done; } @@ -1794,7 +1799,7 @@ int hif_set_hia(struct hif_softc *scn) rv = hif_diag_read_access(hif_hdl, flag2_targ_addr, &flag2_value); - if (rv != CDF_STATUS_SUCCESS) { + if (rv != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: get option val (%d)", __func__, rv); goto done; } @@ -1802,7 +1807,7 @@ int hif_set_hia(struct hif_softc *scn) flag2_value |= HI_OPTION_EARLY_CFG_DONE; rv = hif_diag_write_access(hif_hdl, flag2_targ_addr, flag2_value); - if (rv != CDF_STATUS_SUCCESS) { + if (rv != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: set option val (%d)", __func__, rv); goto done; } @@ -1840,7 +1845,7 @@ static int hif_wlan_enable(struct hif_softc *scn) cfg.shadow_reg_cfg = (struct icnss_shadow_reg_cfg *) target_shadow_reg_cfg; - if (CDF_GLOBAL_FTM_MODE == con_mode) + if (QDF_GLOBAL_FTM_MODE == con_mode) mode = ICNSS_FTM; else if (WLAN_IS_EPPING_ENABLED(con_mode)) mode = ICNSS_EPPING; @@ -1863,7 +1868,7 @@ int hif_config_ce(struct hif_softc *scn) #ifdef ADRASTEA_SHADOW_REGISTERS int i; #endif - CDF_STATUS rv = CDF_STATUS_SUCCESS; + QDF_STATUS rv = QDF_STATUS_SUCCESS; int ret; struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); @@ -1888,31 +1893,31 @@ int hif_config_ce(struct hif_softc *scn) if (ret) { HIF_ERROR("%s: hif_wlan_enable error = %d", __func__, ret); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } scn->notice_send = true; - cdf_mem_zero(&soc_info, sizeof(soc_info)); + qdf_mem_zero(&soc_info, sizeof(soc_info)); ret = icnss_get_soc_info(scn, &soc_info); if (ret < 0) { HIF_ERROR("%s: icnss_get_soc_info error = %d", __func__, ret); - return CDF_STATUS_NOT_INITIALIZED; + return QDF_STATUS_NOT_INITIALIZED; } scn->mem = soc_info.v_addr; scn->mem_pa = soc_info.p_addr; tgt_info->soc_version = soc_info.version; - cdf_spinlock_init(&hif_state->keep_awake_lock); + qdf_spinlock_create(&hif_state->keep_awake_lock); hif_state->keep_awake_count = 0; hif_state->fake_sleep = false; hif_state->sleep_ticks = 0; - cdf_softirq_timer_init(NULL, &hif_state->sleep_timer, + qdf_timer_init(NULL, &hif_state->sleep_timer, hif_sleep_entry, (void *)hif_state, - CDF_TIMER_TYPE_WAKE_APPS); + QDF_TIMER_TYPE_WAKE_APPS); hif_state->sleep_timer_init = true; hif_state->fw_indicator_address = FW_INDICATOR_ADDRESS; #ifdef HIF_PCI @@ -1936,9 +1941,9 @@ int hif_config_ce(struct hif_softc *scn) pipe_info->HIF_CE_state = hif_state; attr = &host_ce_config[pipe_num]; pipe_info->ce_hdl = ce_init(scn, pipe_num, attr); - CDF_ASSERT(pipe_info->ce_hdl != NULL); + QDF_ASSERT(pipe_info->ce_hdl != NULL); if (pipe_info->ce_hdl == NULL) { - rv = CDF_STATUS_E_FAILURE; + rv = QDF_STATUS_E_FAILURE; A_TARGET_ACCESS_UNLIKELY(scn); goto err; } @@ -1951,8 +1956,8 @@ int hif_config_ce(struct hif_softc *scn) continue; } - pipe_info->buf_sz = (cdf_size_t) (attr->src_sz_max); - cdf_spinlock_init(&pipe_info->recv_bufs_needed_lock); + pipe_info->buf_sz = (qdf_size_t) (attr->src_sz_max); + qdf_spinlock_create(&pipe_info->recv_bufs_needed_lock); if (attr->dest_nentries > 0) { atomic_set(&pipe_info->recv_bufs_needed, init_buffer_count(attr->dest_nentries - 1)); @@ -1992,7 +1997,7 @@ int hif_config_ce(struct hif_softc *scn) A_TARGET_ACCESS_UNLIKELY(scn); - if (rv != CDF_STATUS_SUCCESS) + if (rv != QDF_STATUS_SUCCESS) goto err; else init_tasklet_workers(hif_hdl); @@ -2009,7 +2014,7 @@ int hif_config_ce(struct hif_softc *scn) #endif - return rv != CDF_STATUS_SUCCESS; + return rv != QDF_STATUS_SUCCESS; err: /* Failure, so clean up */ @@ -2024,15 +2029,15 @@ err: } } if (hif_state->sleep_timer_init) { - cdf_softirq_timer_cancel(&hif_state->sleep_timer); - cdf_softirq_timer_free(&hif_state->sleep_timer); + qdf_timer_stop(&hif_state->sleep_timer); + qdf_timer_free(&hif_state->sleep_timer); hif_state->sleep_timer_init = false; } athdiag_procfs_remove(); scn->athdiag_procfs_inited = false; HIF_TRACE("%s: X, ret = %d\n", __func__, rv); - return CDF_STATUS_SUCCESS != CDF_STATUS_E_FAILURE; + return QDF_STATUS_SUCCESS != QDF_STATUS_E_FAILURE; } @@ -2055,9 +2060,9 @@ err: * Return: None */ void hif_ipa_get_ce_resource(struct hif_opaque_softc *hif_ctx, - cdf_dma_addr_t *ce_sr_base_paddr, + qdf_dma_addr_t *ce_sr_base_paddr, uint32_t *ce_sr_ring_size, - cdf_dma_addr_t *ce_reg_paddr) + qdf_dma_addr_t *ce_reg_paddr) { struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); @@ -2164,7 +2169,7 @@ u32 shadow_sr_wr_ind_addr(struct hif_softc *scn, u32 ctrl_addr) break; default: HIF_ERROR("invalid CE ctrl_addr\n"); - CDF_ASSERT(0); + QDF_ASSERT(0); } return addr; @@ -2190,7 +2195,7 @@ u32 shadow_dst_wr_ind_addr(struct hif_softc *scn, u32 ctrl_addr) break; default: HIF_ERROR("invalid CE ctrl_addr\n"); - CDF_ASSERT(0); + QDF_ASSERT(0); } return addr; @@ -2217,9 +2222,9 @@ void ce_lro_flush_cb_register(struct hif_opaque_softc *hif_hdl, int ul_polled, dl_polled; struct hif_softc *scn = HIF_GET_SOFTC(hif_hdl); - CDF_ASSERT(scn != NULL); + QDF_ASSERT(scn != NULL); - if (CDF_STATUS_SUCCESS != + if (QDF_STATUS_SUCCESS != hif_map_service_to_pipe(hif_hdl, HTT_DATA_MSG_SVC, &ul, &dl, &ul_polled, &dl_polled)) { printk("%s cannot map service to pipe\n", __FUNCTION__); @@ -2247,9 +2252,9 @@ void ce_lro_flush_cb_deregister(struct hif_opaque_softc *hif_hdl) int ul_polled, dl_polled; struct hif_softc *scn = HIF_GET_SOFTC(hif_hdl); - CDF_ASSERT(scn != NULL); + QDF_ASSERT(scn != NULL); - if (CDF_STATUS_SUCCESS != + if (QDF_STATUS_SUCCESS != hif_map_service_to_pipe(hif_hdl, HTT_DATA_MSG_SVC, &ul, &dl, &ul_polled, &dl_polled)) { printk("%s cannot map service to pipe\n", __FUNCTION__); @@ -2284,7 +2289,7 @@ int hif_map_service_to_pipe(struct hif_opaque_softc *hif_hdl, uint16_t svc_id, uint8_t *ul_pipe, uint8_t *dl_pipe, int *ul_is_polled, int *dl_is_polled) { - int status = CDF_STATUS_SUCCESS; + int status = QDF_STATUS_SUCCESS; unsigned int i; struct service_to_pipe element; struct service_to_pipe *tgt_svc_map_to_use; @@ -2336,7 +2341,7 @@ inline uint32_t DEBUG_CE_SRC_RING_READ_IDX_GET(struct hif_softc *scn, HIF_ERROR("error: read from ddr = %d actual read from register = %d, CE_MISC_INT_STATUS_GET = 0x%x\n", srri_from_ddr, read_from_hw, CE_MISC_INT_STATUS_GET(scn, CE_ctrl_addr)); - CDF_ASSERT(0); + QDF_ASSERT(0); } return srri_from_ddr; } @@ -2355,7 +2360,7 @@ inline uint32_t DEBUG_CE_DEST_RING_READ_IDX_GET(struct hif_softc *scn, HIF_ERROR("error: read from ddr = %d actual read from register = %d, CE_MISC_INT_STATUS_GET = 0x%x\n", drri_from_ddr, read_from_hw, CE_MISC_INT_STATUS_GET(scn, CE_ctrl_addr)); - CDF_ASSERT(0); + QDF_ASSERT(0); } return drri_from_ddr; } @@ -2426,11 +2431,12 @@ inline unsigned int hif_get_dst_ring_read_index(struct hif_softc *scn, static inline void hif_config_rri_on_ddr(struct hif_softc *scn) { unsigned int i; - cdf_dma_addr_t paddr_rri_on_ddr; + qdf_dma_addr_t paddr_rri_on_ddr; uint32_t high_paddr, low_paddr; scn->vaddr_rri_on_ddr = - (uint32_t *)cdf_os_mem_alloc_consistent(scn->cdf_dev, - (CE_COUNT*sizeof(uint32_t)), &paddr_rri_on_ddr, 0); + (uint32_t *)qdf_mem_alloc_consistent(scn->qdf_dev, + scn->qdf_dev->dev, (CE_COUNT*sizeof(uint32_t)), + &paddr_rri_on_ddr); low_paddr = BITS0_TO_31(paddr_rri_on_ddr); high_paddr = BITS32_TO_35(paddr_rri_on_ddr); @@ -2443,7 +2449,7 @@ static inline void hif_config_rri_on_ddr(struct hif_softc *scn) for (i = 0; i < CE_COUNT; i++) CE_IDX_UPD_EN_SET(scn, CE_BASE_ADDRESS(i)); - cdf_mem_zero(scn->vaddr_rri_on_ddr, CE_COUNT*sizeof(uint32_t)); + qdf_mem_zero(scn->vaddr_rri_on_ddr, CE_COUNT*sizeof(uint32_t)); return; } @@ -2480,19 +2486,19 @@ int hif_dump_ce_registers(struct hif_softc *scn) uint32_t ce_reg_values[CE_COUNT_MAX][CE_USEFUL_SIZE >> 2]; uint32_t ce_reg_word_size = CE_USEFUL_SIZE >> 2; uint16_t i; - CDF_STATUS status; + QDF_STATUS status; for (i = 0; i < CE_COUNT_MAX; i++, ce_reg_address += CE_OFFSET) { status = hif_diag_read_mem(hif_hdl, ce_reg_address, (uint8_t *) &ce_reg_values[i][0], ce_reg_word_size * sizeof(uint32_t)); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { HIF_ERROR("Dumping CE register failed!"); return -EACCES; } HIF_ERROR("CE%d Registers:", i); - cdf_trace_hex_dump(CDF_MODULE_ID_HIF, CDF_TRACE_LEVEL_DEBUG, + qdf_trace_hex_dump(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_DEBUG, (uint8_t *) &ce_reg_values[i][0], ce_reg_word_size * sizeof(uint32_t)); } diff --git a/hif/src/ce/ce_main.h b/hif/src/ce/ce_main.h index a51e82c55712..c0af85045dbe 100644 --- a/hif/src/ce/ce_main.h +++ b/hif/src/ce/ce_main.h @@ -28,8 +28,8 @@ #ifndef __CE_H__ #define __CE_H__ -#include "cdf_atomic.h" -#include "cdf_lock.h" +#include "qdf_atomic.h" +#include "qdf_lock.h" #include "hif_main.h" #define CE_HTT_T2H_MSG 1 @@ -78,10 +78,10 @@ struct HIF_CE_pipe_info { /* Instantaneous number of receive buffers that should be posted */ atomic_t recv_bufs_needed; - cdf_size_t buf_sz; - cdf_spinlock_t recv_bufs_needed_lock; + qdf_size_t buf_sz; + qdf_spinlock_t recv_bufs_needed_lock; - cdf_spinlock_t completion_freeq_lock; + qdf_spinlock_t completion_freeq_lock; /* Limit the number of outstanding send requests. */ int num_sends_allowed; @@ -111,11 +111,11 @@ struct HIF_CE_state { struct hif_softc ol_sc; bool started; struct ce_tasklet_entry tasklets[CE_COUNT_MAX]; - cdf_spinlock_t keep_awake_lock; + qdf_spinlock_t keep_awake_lock; unsigned int keep_awake_count; bool verified_awake; bool fake_sleep; - cdf_softirq_timer_t sleep_timer; + qdf_timer_t sleep_timer; bool sleep_timer_init; unsigned long sleep_ticks; diff --git a/hif/src/ce/ce_service.c b/hif/src/ce/ce_service.c index 9f90d5b8235e..3c3457591b39 100644 --- a/hif/src/ce/ce_service.c +++ b/hif/src/ce/ce_service.c @@ -35,7 +35,7 @@ #include "ce_main.h" #include "ce_internal.h" #include "ce_reg.h" -#include "cdf_lock.h" +#include "qdf_lock.h" #include "regtable.h" #include "epping_main.h" #include "hif_main.h" @@ -97,7 +97,7 @@ struct hif_ce_desc_event { /* max history to record per copy engine */ #define HIF_CE_HISTORY_MAX 512 -cdf_atomic_t hif_ce_desc_history_index[CE_COUNT_MAX]; +qdf_atomic_t hif_ce_desc_history_index[CE_COUNT_MAX]; struct hif_ce_desc_event hif_ce_desc_history[CE_COUNT_MAX][HIF_CE_HISTORY_MAX]; @@ -113,11 +113,11 @@ struct hif_ce_desc_event hif_ce_desc_history[CE_COUNT_MAX][HIF_CE_HISTORY_MAX]; * trying to access the array, full locking of the recording process would * be needed to have sane logging. */ -static int get_next_record_index(cdf_atomic_t *table_index, int array_size) +static int get_next_record_index(qdf_atomic_t *table_index, int array_size) { - int record_index = cdf_atomic_inc_return(table_index); + int record_index = qdf_atomic_inc_return(table_index); if (record_index == array_size) - cdf_atomic_sub(array_size, table_index); + qdf_atomic_sub(array_size, table_index); while (record_index >= array_size) record_index -= array_size; @@ -149,8 +149,8 @@ void hif_record_ce_desc_event(struct hif_softc *scn, int ce_id, if (cbk && cbk->get_monotonic_boottime) event->time = cbk->get_monotonic_boottime(); else - event->time = ((uint64_t)cdf_system_ticks_to_msecs( - cdf_system_ticks()) * 1000); + event->time = ((uint64_t)qdf_system_ticks_to_msecs( + qdf_system_ticks()) * 1000); if (descriptor != NULL) event->descriptor = *descriptor; @@ -169,7 +169,7 @@ void hif_record_ce_desc_event(struct hif_softc *scn, int ce_id, */ void ce_init_ce_desc_event_log(int ce_id, int size) { - cdf_atomic_init(&hif_ce_desc_history_index[ce_id]); + qdf_atomic_init(&hif_ce_desc_history_index[ce_id]); } #else void hif_record_ce_desc_event(struct hif_softc *scn, @@ -232,7 +232,7 @@ int ce_completed_send_next_nolock(struct CE_state *CE_state, void **per_CE_contextp, void **per_transfer_contextp, - cdf_dma_addr_t *bufferp, + qdf_dma_addr_t *bufferp, unsigned int *nbytesp, unsigned int *transfer_idp, unsigned int *sw_idx, unsigned int *hw_idx, @@ -275,7 +275,7 @@ void war_ce_src_ring_write_idx_set(struct hif_softc *scn, int ce_send_nolock(struct CE_handle *copyeng, void *per_transfer_context, - cdf_dma_addr_t buffer, + qdf_dma_addr_t buffer, uint32_t nbytes, uint32_t transfer_id, uint32_t flags, @@ -295,7 +295,7 @@ ce_send_nolock(struct CE_handle *copyeng, if (unlikely(CE_RING_DELTA(nentries_mask, write_index, sw_index - 1) <= 0)) { OL_ATH_CE_PKT_ERROR_COUNT_INCR(scn, CE_RING_DELTA_FAIL); - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; A_TARGET_ACCESS_END_RET(scn); return status; } @@ -357,7 +357,7 @@ ce_send_nolock(struct CE_handle *copyeng, src_ring->write_index); src_ring->write_index = write_index; - status = CDF_STATUS_SUCCESS; + status = QDF_STATUS_SUCCESS; } A_TARGET_ACCESS_END_RET(scn); @@ -367,7 +367,7 @@ ce_send_nolock(struct CE_handle *copyeng, int ce_send(struct CE_handle *copyeng, void *per_transfer_context, - cdf_dma_addr_t buffer, + qdf_dma_addr_t buffer, uint32_t nbytes, uint32_t transfer_id, uint32_t flags, @@ -376,10 +376,10 @@ ce_send(struct CE_handle *copyeng, struct CE_state *CE_state = (struct CE_state *)copyeng; int status; - cdf_spin_lock_bh(&CE_state->ce_index_lock); + qdf_spin_lock_bh(&CE_state->ce_index_lock); status = ce_send_nolock(copyeng, per_transfer_context, buffer, nbytes, transfer_id, flags, user_flag); - cdf_spin_unlock_bh(&CE_state->ce_index_lock); + qdf_spin_unlock_bh(&CE_state->ce_index_lock); return status; } @@ -397,7 +397,7 @@ void ce_sendlist_init(struct ce_sendlist *sendlist) int ce_sendlist_buf_add(struct ce_sendlist *sendlist, - cdf_dma_addr_t buffer, + qdf_dma_addr_t buffer, uint32_t nbytes, uint32_t flags, uint32_t user_flags) @@ -407,8 +407,8 @@ ce_sendlist_buf_add(struct ce_sendlist *sendlist, struct ce_sendlist_item *item; if (num_items >= CE_SENDLIST_ITEMS_MAX) { - CDF_ASSERT(num_items < CE_SENDLIST_ITEMS_MAX); - return CDF_STATUS_E_RESOURCES; + QDF_ASSERT(num_items < CE_SENDLIST_ITEMS_MAX); + return QDF_STATUS_E_RESOURCES; } item = &sl->item[num_items]; @@ -418,7 +418,7 @@ ce_sendlist_buf_add(struct ce_sendlist *sendlist, item->flags = flags; item->user_flags = user_flags; sl->num_items = num_items + 1; - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } int @@ -435,9 +435,9 @@ ce_sendlist_send(struct CE_handle *copyeng, unsigned int sw_index; unsigned int write_index; - CDF_ASSERT((num_items > 0) && (num_items < src_ring->nentries)); + QDF_ASSERT((num_items > 0) && (num_items < src_ring->nentries)); - cdf_spin_lock_bh(&CE_state->ce_index_lock); + qdf_spin_lock_bh(&CE_state->ce_index_lock); sw_index = src_ring->sw_index; write_index = src_ring->write_index; @@ -450,28 +450,28 @@ ce_sendlist_send(struct CE_handle *copyeng, for (i = 0; i < num_items - 1; i++) { item = &sl->item[i]; /* TBDXXX: Support extensible sendlist_types? */ - CDF_ASSERT(item->send_type == CE_SIMPLE_BUFFER_TYPE); + QDF_ASSERT(item->send_type == CE_SIMPLE_BUFFER_TYPE); status = ce_send_nolock(copyeng, CE_SENDLIST_ITEM_CTXT, - (cdf_dma_addr_t) item->data, + (qdf_dma_addr_t) item->data, item->u.nbytes, transfer_id, item->flags | CE_SEND_FLAG_GATHER, item->user_flags); - CDF_ASSERT(status == CDF_STATUS_SUCCESS); + QDF_ASSERT(status == QDF_STATUS_SUCCESS); } /* provide valid context pointer for final item */ item = &sl->item[i]; /* TBDXXX: Support extensible sendlist_types? */ - CDF_ASSERT(item->send_type == CE_SIMPLE_BUFFER_TYPE); + QDF_ASSERT(item->send_type == CE_SIMPLE_BUFFER_TYPE); status = ce_send_nolock(copyeng, per_transfer_context, - (cdf_dma_addr_t) item->data, + (qdf_dma_addr_t) item->data, item->u.nbytes, transfer_id, item->flags, item->user_flags); - CDF_ASSERT(status == CDF_STATUS_SUCCESS); + QDF_ASSERT(status == QDF_STATUS_SUCCESS); NBUF_UPDATE_TX_PKT_COUNT((cdf_nbuf_t)per_transfer_context, NBUF_TX_PKT_CE); - DPTRACE(cdf_dp_trace((cdf_nbuf_t)per_transfer_context, - CDF_DP_TRACE_CE_PACKET_PTR_RECORD, + DPTRACE(qdf_dp_trace((cdf_nbuf_t)per_transfer_context, + QDF_DP_TRACE_CE_PACKET_PTR_RECORD, (uint8_t *)(((cdf_nbuf_t)per_transfer_context)->data), sizeof(((cdf_nbuf_t)per_transfer_context)->data))); } else { @@ -482,7 +482,7 @@ ce_sendlist_send(struct CE_handle *copyeng, * the entire request at once, punt it back to the caller. */ } - cdf_spin_unlock_bh(&CE_state->ce_index_lock); + qdf_spin_unlock_bh(&CE_state->ce_index_lock); return status; } @@ -543,7 +543,7 @@ int ce_send_fast(struct CE_handle *copyeng, cdf_nbuf_t *msdus, uint64_t dma_addr; uint32_t user_flags = 0; - cdf_spin_lock_bh(&ce_state->ce_index_lock); + qdf_spin_lock_bh(&ce_state->ce_index_lock); sw_index = src_ring->sw_index; write_index = src_ring->write_index; @@ -606,7 +606,7 @@ int ce_send_fast(struct CE_handle *copyeng, cdf_nbuf_t *msdus, /* * Clear packet offset for all but the first CE desc. */ - user_flags &= ~CDF_CE_TX_PKT_OFFSET_BIT_M; + user_flags &= ~QDF_CE_TX_PKT_OFFSET_BIT_M; ce_buffer_addr_hi_set(shadow_src_desc, dma_addr, user_flags); shadow_src_desc->meta_data = transfer_id; @@ -641,7 +641,7 @@ int ce_send_fast(struct CE_handle *copyeng, cdf_nbuf_t *msdus, } } - cdf_spin_unlock_bh(&ce_state->ce_index_lock); + qdf_spin_unlock_bh(&ce_state->ce_index_lock); /* * If all packets in the array are transmitted, @@ -655,7 +655,7 @@ int ce_send_fast(struct CE_handle *copyeng, cdf_nbuf_t *msdus, int ce_recv_buf_enqueue(struct CE_handle *copyeng, - void *per_recv_context, cdf_dma_addr_t buffer) + void *per_recv_context, qdf_dma_addr_t buffer) { int status; struct CE_state *CE_state = (struct CE_state *)copyeng; @@ -668,13 +668,13 @@ ce_recv_buf_enqueue(struct CE_handle *copyeng, uint64_t dma_addr = buffer; struct hif_softc *scn = CE_state->scn; - cdf_spin_lock_bh(&CE_state->ce_index_lock); + qdf_spin_lock_bh(&CE_state->ce_index_lock); write_index = dest_ring->write_index; sw_index = dest_ring->sw_index; A_TARGET_ACCESS_BEGIN_RET_EXT(scn, val); if (val == -1) { - cdf_spin_unlock_bh(&CE_state->ce_index_lock); + qdf_spin_unlock_bh(&CE_state->ce_index_lock); return val; } @@ -704,17 +704,17 @@ ce_recv_buf_enqueue(struct CE_handle *copyeng, write_index = CE_RING_IDX_INCR(nentries_mask, write_index); CE_DEST_RING_WRITE_IDX_SET(scn, ctrl_addr, write_index); dest_ring->write_index = write_index; - status = CDF_STATUS_SUCCESS; + status = QDF_STATUS_SUCCESS; } else { - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; } A_TARGET_ACCESS_END_RET_EXT(scn, val); if (val == -1) { - cdf_spin_unlock_bh(&CE_state->ce_index_lock); + qdf_spin_unlock_bh(&CE_state->ce_index_lock); return val; } - cdf_spin_unlock_bh(&CE_state->ce_index_lock); + qdf_spin_unlock_bh(&CE_state->ce_index_lock); return status; } @@ -755,10 +755,10 @@ unsigned int ce_send_entries_avail(struct CE_handle *copyeng) unsigned int sw_index; unsigned int write_index; - cdf_spin_lock(&CE_state->ce_index_lock); + qdf_spin_lock(&CE_state->ce_index_lock); sw_index = src_ring->sw_index; write_index = src_ring->write_index; - cdf_spin_unlock(&CE_state->ce_index_lock); + qdf_spin_unlock(&CE_state->ce_index_lock); return CE_RING_DELTA(nentries_mask, write_index, sw_index - 1); } @@ -771,10 +771,10 @@ unsigned int ce_recv_entries_avail(struct CE_handle *copyeng) unsigned int sw_index; unsigned int write_index; - cdf_spin_lock(&CE_state->ce_index_lock); + qdf_spin_lock(&CE_state->ce_index_lock); sw_index = dest_ring->sw_index; write_index = dest_ring->write_index; - cdf_spin_unlock(&CE_state->ce_index_lock); + qdf_spin_unlock(&CE_state->ce_index_lock); return CE_RING_DELTA(nentries_mask, write_index, sw_index - 1); } @@ -804,9 +804,9 @@ unsigned int ce_send_entries_done(struct CE_handle *copyeng) struct CE_state *CE_state = (struct CE_state *)copyeng; unsigned int nentries; - cdf_spin_lock(&CE_state->ce_index_lock); + qdf_spin_lock(&CE_state->ce_index_lock); nentries = ce_send_entries_done_nolock(CE_state->scn, CE_state); - cdf_spin_unlock(&CE_state->ce_index_lock); + qdf_spin_unlock(&CE_state->ce_index_lock); return nentries; } @@ -836,9 +836,9 @@ unsigned int ce_recv_entries_done(struct CE_handle *copyeng) struct CE_state *CE_state = (struct CE_state *)copyeng; unsigned int nentries; - cdf_spin_lock(&CE_state->ce_index_lock); + qdf_spin_lock(&CE_state->ce_index_lock); nentries = ce_recv_entries_done_nolock(CE_state->scn, CE_state); - cdf_spin_unlock(&CE_state->ce_index_lock); + qdf_spin_unlock(&CE_state->ce_index_lock); return nentries; } @@ -857,7 +857,7 @@ int ce_completed_recv_next_nolock(struct CE_state *CE_state, void **per_CE_contextp, void **per_transfer_contextp, - cdf_dma_addr_t *bufferp, + qdf_dma_addr_t *bufferp, unsigned int *nbytesp, unsigned int *transfer_idp, unsigned int *flagsp) @@ -886,7 +886,7 @@ ce_completed_recv_next_nolock(struct CE_state *CE_state, * corresponding descriptor has completed. We treat this * as a descriptor that is not yet done. */ - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; goto done; } @@ -916,7 +916,7 @@ ce_completed_recv_next_nolock(struct CE_state *CE_state, /* Update sw_index */ sw_index = CE_RING_IDX_INCR(nentries_mask, sw_index); dest_ring->sw_index = sw_index; - status = CDF_STATUS_SUCCESS; + status = QDF_STATUS_SUCCESS; done: return status; @@ -926,45 +926,45 @@ int ce_completed_recv_next(struct CE_handle *copyeng, void **per_CE_contextp, void **per_transfer_contextp, - cdf_dma_addr_t *bufferp, + qdf_dma_addr_t *bufferp, unsigned int *nbytesp, unsigned int *transfer_idp, unsigned int *flagsp) { struct CE_state *CE_state = (struct CE_state *)copyeng; int status; - cdf_spin_lock_bh(&CE_state->ce_index_lock); + qdf_spin_lock_bh(&CE_state->ce_index_lock); status = ce_completed_recv_next_nolock(CE_state, per_CE_contextp, per_transfer_contextp, bufferp, nbytesp, transfer_idp, flagsp); - cdf_spin_unlock_bh(&CE_state->ce_index_lock); + qdf_spin_unlock_bh(&CE_state->ce_index_lock); return status; } /* NB: Modeled after ce_completed_recv_next_nolock */ -CDF_STATUS +QDF_STATUS ce_revoke_recv_next(struct CE_handle *copyeng, void **per_CE_contextp, - void **per_transfer_contextp, cdf_dma_addr_t *bufferp) + void **per_transfer_contextp, qdf_dma_addr_t *bufferp) { struct CE_state *CE_state; struct CE_ring_state *dest_ring; unsigned int nentries_mask; unsigned int sw_index; unsigned int write_index; - CDF_STATUS status; + QDF_STATUS status; struct hif_softc *scn; CE_state = (struct CE_state *)copyeng; dest_ring = CE_state->dest_ring; if (!dest_ring) { - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } scn = CE_state->scn; - cdf_spin_lock(&CE_state->ce_index_lock); + qdf_spin_lock(&CE_state->ce_index_lock); nentries_mask = dest_ring->nentries_mask; sw_index = dest_ring->sw_index; write_index = dest_ring->write_index; @@ -992,11 +992,11 @@ ce_revoke_recv_next(struct CE_handle *copyeng, /* Update sw_index */ sw_index = CE_RING_IDX_INCR(nentries_mask, sw_index); dest_ring->sw_index = sw_index; - status = CDF_STATUS_SUCCESS; + status = QDF_STATUS_SUCCESS; } else { - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; } - cdf_spin_unlock(&CE_state->ce_index_lock); + qdf_spin_unlock(&CE_state->ce_index_lock); return status; } @@ -1009,14 +1009,14 @@ int ce_completed_send_next_nolock(struct CE_state *CE_state, void **per_CE_contextp, void **per_transfer_contextp, - cdf_dma_addr_t *bufferp, + qdf_dma_addr_t *bufferp, unsigned int *nbytesp, unsigned int *transfer_idp, unsigned int *sw_idx, unsigned int *hw_idx, uint32_t *toeplitz_hash_result) { - int status = CDF_STATUS_E_FAILURE; + int status = QDF_STATUS_E_FAILURE; struct CE_ring_state *src_ring = CE_state->src_ring; uint32_t ctrl_addr = CE_state->ctrl_addr; unsigned int nentries_mask = src_ring->nentries_mask; @@ -1085,18 +1085,18 @@ ce_completed_send_next_nolock(struct CE_state *CE_state, /* Update sw_index */ sw_index = CE_RING_IDX_INCR(nentries_mask, sw_index); src_ring->sw_index = sw_index; - status = CDF_STATUS_SUCCESS; + status = QDF_STATUS_SUCCESS; } return status; } /* NB: Modeled after ce_completed_send_next */ -CDF_STATUS +QDF_STATUS ce_cancel_send_next(struct CE_handle *copyeng, void **per_CE_contextp, void **per_transfer_contextp, - cdf_dma_addr_t *bufferp, + qdf_dma_addr_t *bufferp, unsigned int *nbytesp, unsigned int *transfer_idp, uint32_t *toeplitz_hash_result) @@ -1106,17 +1106,17 @@ ce_cancel_send_next(struct CE_handle *copyeng, unsigned int nentries_mask; unsigned int sw_index; unsigned int write_index; - CDF_STATUS status; + QDF_STATUS status; struct hif_softc *scn; CE_state = (struct CE_state *)copyeng; src_ring = CE_state->src_ring; if (!src_ring) { - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } scn = CE_state->scn; - cdf_spin_lock(&CE_state->ce_index_lock); + qdf_spin_lock(&CE_state->ce_index_lock); nentries_mask = src_ring->nentries_mask; sw_index = src_ring->sw_index; write_index = src_ring->write_index; @@ -1151,11 +1151,11 @@ ce_cancel_send_next(struct CE_handle *copyeng, /* Update sw_index */ sw_index = CE_RING_IDX_INCR(nentries_mask, sw_index); src_ring->sw_index = sw_index; - status = CDF_STATUS_SUCCESS; + status = QDF_STATUS_SUCCESS; } else { - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; } - cdf_spin_unlock(&CE_state->ce_index_lock); + qdf_spin_unlock(&CE_state->ce_index_lock); return status; } @@ -1167,7 +1167,7 @@ int ce_completed_send_next(struct CE_handle *copyeng, void **per_CE_contextp, void **per_transfer_contextp, - cdf_dma_addr_t *bufferp, + qdf_dma_addr_t *bufferp, unsigned int *nbytesp, unsigned int *transfer_idp, unsigned int *sw_idx, @@ -1177,13 +1177,13 @@ ce_completed_send_next(struct CE_handle *copyeng, struct CE_state *CE_state = (struct CE_state *)copyeng; int status; - cdf_spin_lock_bh(&CE_state->ce_index_lock); + qdf_spin_lock_bh(&CE_state->ce_index_lock); status = ce_completed_send_next_nolock(CE_state, per_CE_contextp, per_transfer_contextp, bufferp, nbytesp, transfer_idp, sw_idx, hw_idx, toeplitz_hash_result); - cdf_spin_unlock_bh(&CE_state->ce_index_lock); + qdf_spin_unlock_bh(&CE_state->ce_index_lock); return status; } @@ -1202,7 +1202,7 @@ void ce_per_engine_servicereap(struct hif_softc *scn, unsigned int ce_id) { void *CE_context; void *transfer_context; - cdf_dma_addr_t buf; + qdf_dma_addr_t buf; unsigned int nbytes; unsigned int id; unsigned int sw_idx, hw_idx; @@ -1226,7 +1226,7 @@ void ce_per_engine_servicereap(struct hif_softc *scn, unsigned int ce_id) * addressed by change spin_lock to spin_lock_bh also. */ - cdf_spin_lock_bh(&CE_state->ce_index_lock); + qdf_spin_lock_bh(&CE_state->ce_index_lock); if (CE_state->send_cb) { { @@ -1238,9 +1238,9 @@ void ce_per_engine_servicereap(struct hif_softc *scn, unsigned int ce_id) &transfer_context, &buf, &nbytes, &id, &sw_idx, &hw_idx, &toeplitz_hash_result) == - CDF_STATUS_SUCCESS) { + QDF_STATUS_SUCCESS) { if (ce_id != CE_HTT_H2T_MSG) { - cdf_spin_unlock_bh( + qdf_spin_unlock_bh( &CE_state->ce_index_lock); CE_state->send_cb( (struct CE_handle *) @@ -1248,24 +1248,24 @@ void ce_per_engine_servicereap(struct hif_softc *scn, unsigned int ce_id) transfer_context, buf, nbytes, id, sw_idx, hw_idx, toeplitz_hash_result); - cdf_spin_lock_bh( + qdf_spin_lock_bh( &CE_state->ce_index_lock); } else { struct HIF_CE_pipe_info *pipe_info = (struct HIF_CE_pipe_info *) CE_context; - cdf_spin_lock_bh(&pipe_info-> + qdf_spin_lock_bh(&pipe_info-> completion_freeq_lock); pipe_info->num_sends_allowed++; - cdf_spin_unlock_bh(&pipe_info-> + qdf_spin_unlock_bh(&pipe_info-> completion_freeq_lock); } } } } - cdf_spin_unlock_bh(&CE_state->ce_index_lock); + qdf_spin_unlock_bh(&CE_state->ce_index_lock); hif_record_ce_desc_event(scn, ce_id, HIF_CE_REAP_EXIT, NULL, NULL, 0); @@ -1299,7 +1299,7 @@ int ce_per_engine_service(struct hif_softc *scn, unsigned int CE_id) uint32_t ctrl_addr = CE_state->ctrl_addr; void *CE_context; void *transfer_context; - cdf_dma_addr_t buf; + qdf_dma_addr_t buf; unsigned int nbytes; unsigned int id; unsigned int flags; @@ -1315,7 +1315,7 @@ int ce_per_engine_service(struct hif_softc *scn, unsigned int CE_id) return 0; /* no work done */ } - cdf_spin_lock(&CE_state->ce_index_lock); + qdf_spin_lock(&CE_state->ce_index_lock); /* Clear force_break flag and re-initialize receive_count to 0 */ @@ -1331,8 +1331,8 @@ more_completions: while (ce_completed_recv_next_nolock (CE_state, &CE_context, &transfer_context, &buf, &nbytes, &id, &flags) == - CDF_STATUS_SUCCESS) { - cdf_spin_unlock(&CE_state->ce_index_lock); + QDF_STATUS_SUCCESS) { + qdf_spin_unlock(&CE_state->ce_index_lock); CE_state->recv_cb((struct CE_handle *)CE_state, CE_context, transfer_context, buf, nbytes, id, flags); @@ -1354,8 +1354,8 @@ more_completions: /* Break the receive processes by * force if force_break set up */ - if (cdf_unlikely(CE_state->force_break)) { - cdf_atomic_set(&CE_state->rx_pending, 1); + if (qdf_unlikely(CE_state->force_break)) { + qdf_atomic_set(&CE_state->rx_pending, 1); CE_ENGINE_INT_STATUS_CLEAR(scn, ctrl_addr, HOST_IS_COPY_COMPLETE_MASK); if (Q_TARGET_ACCESS_END(scn) < 0) @@ -1363,7 +1363,7 @@ more_completions: CE_state->receive_count); return CE_state->receive_count; } - cdf_spin_lock(&CE_state->ce_index_lock); + qdf_spin_lock(&CE_state->ce_index_lock); } } @@ -1383,24 +1383,24 @@ more_completions: (CE_state, &CE_context, &transfer_context, &buf, &nbytes, &id, &sw_idx, &hw_idx, - &toeplitz_hash_result) == CDF_STATUS_SUCCESS) { + &toeplitz_hash_result) == QDF_STATUS_SUCCESS) { if (CE_id != CE_HTT_H2T_MSG || WLAN_IS_EPPING_ENABLED(mode)) { - cdf_spin_unlock(&CE_state->ce_index_lock); + qdf_spin_unlock(&CE_state->ce_index_lock); CE_state->send_cb((struct CE_handle *)CE_state, CE_context, transfer_context, buf, nbytes, id, sw_idx, hw_idx, toeplitz_hash_result); - cdf_spin_lock(&CE_state->ce_index_lock); + qdf_spin_lock(&CE_state->ce_index_lock); } else { struct HIF_CE_pipe_info *pipe_info = (struct HIF_CE_pipe_info *)CE_context; - cdf_spin_lock(&pipe_info-> + qdf_spin_lock(&pipe_info-> completion_freeq_lock); pipe_info->num_sends_allowed++; - cdf_spin_unlock(&pipe_info-> + qdf_spin_unlock(&pipe_info-> completion_freeq_lock); } } @@ -1409,13 +1409,13 @@ more_completions: (CE_state, &CE_context, &transfer_context, &buf, &nbytes, &id, &sw_idx, &hw_idx, - &toeplitz_hash_result) == CDF_STATUS_SUCCESS) { - cdf_spin_unlock(&CE_state->ce_index_lock); + &toeplitz_hash_result) == QDF_STATUS_SUCCESS) { + qdf_spin_unlock(&CE_state->ce_index_lock); CE_state->send_cb((struct CE_handle *)CE_state, CE_context, transfer_context, buf, nbytes, id, sw_idx, hw_idx, toeplitz_hash_result); - cdf_spin_lock(&CE_state->ce_index_lock); + qdf_spin_lock(&CE_state->ce_index_lock); } #endif /*ATH_11AC_TXCOMPACT */ } @@ -1425,7 +1425,7 @@ more_watermarks: CE_int_status = CE_ENGINE_INT_STATUS_GET(scn, ctrl_addr); if (CE_int_status & CE_WATERMARK_MASK) { if (CE_state->watermark_cb) { - cdf_spin_unlock(&CE_state->ce_index_lock); + qdf_spin_unlock(&CE_state->ce_index_lock); /* Convert HW IS bits to software flags */ flags = (CE_int_status & CE_WATERMARK_MASK) >> @@ -1434,7 +1434,7 @@ more_watermarks: CE_state-> watermark_cb((struct CE_handle *)CE_state, CE_state->wm_context, flags); - cdf_spin_lock(&CE_state->ce_index_lock); + qdf_spin_lock(&CE_state->ce_index_lock); } } } @@ -1494,8 +1494,8 @@ more_watermarks: } } - cdf_spin_unlock(&CE_state->ce_index_lock); - cdf_atomic_set(&CE_state->rx_pending, 0); + qdf_spin_unlock(&CE_state->ce_index_lock); + qdf_atomic_set(&CE_state->rx_pending, 0); if (Q_TARGET_ACCESS_END(scn) < 0) HIF_ERROR("<--[premature rc=%d]\n", CE_state->receive_count); @@ -1514,11 +1514,11 @@ void ce_per_engine_service_any(int irq, struct hif_softc *scn) uint32_t intr_summary; A_TARGET_ACCESS_BEGIN(scn); - if (!cdf_atomic_read(&scn->tasklet_from_intr)) { + if (!qdf_atomic_read(&scn->tasklet_from_intr)) { for (CE_id = 0; CE_id < scn->ce_count; CE_id++) { struct CE_state *CE_state = scn->ce_id_to_state[CE_id]; - if (cdf_atomic_read(&CE_state->rx_pending)) { - cdf_atomic_set(&CE_state->rx_pending, 0); + if (qdf_atomic_read(&CE_state->rx_pending)) { + qdf_atomic_set(&CE_state->rx_pending, 0); ce_per_engine_service(scn, CE_id); } } @@ -1718,11 +1718,11 @@ void ce_pkt_dl_len_set(void *hif_sc, u_int32_t pkt_download_len) struct hif_softc *sc = (struct hif_softc *)(hif_sc); struct CE_state *ce_state = sc->ce_id_to_state[CE_HTT_H2T_MSG]; - cdf_assert_always(ce_state); + qdf_assert_always(ce_state); ce_state->download_len = pkt_download_len; - cdf_print("%s CE %d Pkt download length %d", __func__, + qdf_print("%s CE %d Pkt download length %d", __func__, ce_state->id, ce_state->download_len); } #else @@ -1737,7 +1737,7 @@ bool ce_get_rx_pending(struct hif_softc *scn) for (CE_id = 0; CE_id < scn->ce_count; CE_id++) { struct CE_state *CE_state = scn->ce_id_to_state[CE_id]; - if (cdf_atomic_read(&CE_state->rx_pending)) + if (qdf_atomic_read(&CE_state->rx_pending)) return true; } @@ -1754,7 +1754,7 @@ bool ce_get_rx_pending(struct hif_softc *scn) bool ce_check_rx_pending(struct hif_softc *scn, int ce_id) { struct CE_state *CE_state = scn->ce_id_to_state[ce_id]; - if (cdf_atomic_read(&CE_state->rx_pending)) + if (qdf_atomic_read(&CE_state->rx_pending)) return true; else return false; @@ -1813,14 +1813,14 @@ void ce_enable_msi(struct hif_softc *scn, unsigned int CE_id, * Return: None */ void ce_ipa_get_resource(struct CE_handle *ce, - cdf_dma_addr_t *ce_sr_base_paddr, + qdf_dma_addr_t *ce_sr_base_paddr, uint32_t *ce_sr_ring_size, - cdf_dma_addr_t *ce_reg_paddr) + qdf_dma_addr_t *ce_reg_paddr) { struct CE_state *CE_state = (struct CE_state *)ce; uint32_t ring_loop; struct CE_src_desc *ce_desc; - cdf_dma_addr_t phy_mem_base; + qdf_dma_addr_t phy_mem_base; struct hif_softc *scn = CE_state->scn; if (CE_RUNNING != CE_state->state) { diff --git a/hif/src/ce/ce_tasklet.c b/hif/src/ce/ce_tasklet.c index 460d0bb57ac7..7ba68ba2b46e 100644 --- a/hif/src/ce/ce_tasklet.c +++ b/hif/src/ce/ce_tasklet.c @@ -32,9 +32,9 @@ #include <linux/if_arp.h> #include "a_types.h" #include "athdefs.h" -#include "cdf_lock.h" -#include "cdf_types.h" -#include "cdf_status.h" +#include "qdf_lock.h" +#include "qdf_types.h" +#include "qdf_status.h" #include "regtable.h" #include "hif.h" #include "hif_io32.h" @@ -199,10 +199,10 @@ static void ce_tasklet(unsigned long data) hif_record_ce_desc_event(scn, tasklet_entry->ce_id, HIF_CE_TASKLET_ENTRY, NULL, NULL, 0); - if (cdf_atomic_read(&scn->link_suspended)) { + if (qdf_atomic_read(&scn->link_suspended)) { HIF_ERROR("%s: ce %d tasklet fired after link suspend.", __func__, tasklet_entry->ce_id); - CDF_BUG(0); + QDF_BUG(0); } ce_per_engine_service(scn, tasklet_entry->ce_id); @@ -229,7 +229,7 @@ static void ce_tasklet(unsigned long data) hif_record_ce_desc_event(scn, tasklet_entry->ce_id, HIF_CE_TASKLET_EXIT, NULL, NULL, 0); - cdf_atomic_dec(&scn->active_tasklet_cnt); + qdf_atomic_dec(&scn->active_tasklet_cnt); } /** @@ -270,7 +270,7 @@ void ce_tasklet_kill(struct hif_softc *scn) tasklet_kill(&hif_ce_state->tasklets[i].intr_tq); hif_ce_state->tasklets[i].inited = false; } - cdf_atomic_set(&scn->active_tasklet_cnt, 0); + qdf_atomic_set(&scn->active_tasklet_cnt, 0); } /** * ce_irq_handler() - ce_irq_handler @@ -303,7 +303,7 @@ static irqreturn_t ce_irq_handler(int irq, void *context) #endif ce_irq_disable(scn, ce_id); ce_irq_status(scn, ce_id, &host_status); - cdf_atomic_inc(&scn->active_tasklet_cnt); + qdf_atomic_inc(&scn->active_tasklet_cnt); hif_record_ce_desc_event(scn, ce_id, HIF_IRQ_EVENT, NULL, NULL, 0); if (hif_napi_enabled(hif_hdl, ce_id)) hif_napi_schedule(hif_hdl, ce_id); @@ -340,16 +340,16 @@ const char *ce_name[ICNSS_MAX_IRQ_REGISTRATIONS] = { * Unregisters copy engine irqs matching mask. If a 1 is set at bit x, * unregister for copy engine x. * - * Return: CDF_STATUS + * Return: QDF_STATUS */ -CDF_STATUS ce_unregister_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask) +QDF_STATUS ce_unregister_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask) { int id; int ret; if (hif_ce_state == NULL) { HIF_WARN("%s: hif_ce_state = NULL", __func__); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } for (id = 0; id < CE_COUNT_MAX; id++) { if ((mask & (1 << id)) && hif_ce_state->tasklets[id].inited) { @@ -361,7 +361,7 @@ CDF_STATUS ce_unregister_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask) __func__, id, ret); } } - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } /** * ce_register_irq() - ce_register_irq @@ -371,9 +371,9 @@ CDF_STATUS ce_unregister_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask) * Registers copy engine irqs matching mask. If a 1 is set at bit x, * Register for copy engine x. * - * Return: CDF_STATUS + * Return: QDF_STATUS */ -CDF_STATUS ce_register_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask) +QDF_STATUS ce_register_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask) { int id; int ret; @@ -390,7 +390,7 @@ CDF_STATUS ce_register_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask) "%s: cannot register CE %d irq handler, ret = %d", __func__, id, ret); ce_unregister_irq(hif_ce_state, done_mask); - return CDF_STATUS_E_FAULT; + return QDF_STATUS_E_FAULT; } else { done_mask |= 1 << id; } @@ -402,5 +402,5 @@ CDF_STATUS ce_register_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask) ce_enable_irq_in_group_reg(HIF_GET_SOFTC(hif_ce_state), done_mask); #endif - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } diff --git a/hif/src/ce/ce_tasklet.h b/hif/src/ce/ce_tasklet.h index 5187f68a0cf6..d20402e348eb 100644 --- a/hif/src/ce/ce_tasklet.h +++ b/hif/src/ce/ce_tasklet.h @@ -31,6 +31,6 @@ void init_tasklet_workers(struct hif_opaque_softc *scn); void ce_tasklet_init(struct HIF_CE_state *hif_ce_state, uint32_t mask); void ce_tasklet_kill(struct hif_softc *scn); -CDF_STATUS ce_register_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask); -CDF_STATUS ce_unregister_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask); +QDF_STATUS ce_register_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask); +QDF_STATUS ce_unregister_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask); #endif /* __CE_TASKLET_H__ */ diff --git a/hif/src/hif_debug.h b/hif/src/hif_debug.h index 4ab7d1f8e05f..0b0a7b6d62b5 100644 --- a/hif/src/hif_debug.h +++ b/hif/src/hif_debug.h @@ -21,22 +21,22 @@ #ifndef __HIF_DEBUG_H__ #define __HIF_DEBUG_H__ -#include "cdf_trace.h" +#include "qdf_trace.h" #define HIF_ERROR(args ...) \ - CDF_TRACE(CDF_MODULE_ID_HIF, CDF_TRACE_LEVEL_ERROR, ## args) + QDF_TRACE(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_ERROR, ## args) #define HIF_WARN(args ...) \ - CDF_TRACE(CDF_MODULE_ID_HIF, CDF_TRACE_LEVEL_WARN, ## args) + QDF_TRACE(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_WARN, ## args) #define HIF_INFO(args ...) \ - CDF_TRACE(CDF_MODULE_ID_HIF, CDF_TRACE_LEVEL_INFO, ## args) + QDF_TRACE(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_INFO, ## args) #define HIF_INFO_HI(args ...) \ - CDF_TRACE(CDF_MODULE_ID_HIF, CDF_TRACE_LEVEL_INFO_HIGH, ## args) + QDF_TRACE(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_INFO_HIGH, ## args) #define HIF_INFO_MED(args ...) \ - CDF_TRACE(CDF_MODULE_ID_HIF, CDF_TRACE_LEVEL_INFO_MED, ## args) + QDF_TRACE(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_INFO_MED, ## args) #define HIF_INFO_LO(args ...) \ - CDF_TRACE(CDF_MODULE_ID_HIF, CDF_TRACE_LEVEL_INFO_LOW, ## args) + QDF_TRACE(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_INFO_LOW, ## args) #define HIF_TRACE(args ...) \ - CDF_TRACE(CDF_MODULE_ID_HIF, CDF_TRACE_LEVEL_ERROR, ## args) + QDF_TRACE(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_ERROR, ## args) #define HIF_DBG(args ...) \ - CDF_TRACE(CDF_MODULE_ID_HIF, CDF_TRACE_LEVEL_DEBUG, ## args) + QDF_TRACE(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_DEBUG, ## args) #endif /* __HIF_DEBUG_H__ */ diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c index 0c69dbfe73af..db8b6ad36ac7 100644 --- a/hif/src/hif_main.c +++ b/hif/src/hif_main.c @@ -30,9 +30,10 @@ #include "athdefs.h" #include "osapi_linux.h" #include "targcfg.h" -#include "cdf_lock.h" -#include "cdf_status.h" -#include <cdf_atomic.h> /* cdf_atomic_read */ +#include "qdf_lock.h" +#include "qdf_status.h" +#include "qdf_status.h" +#include <qdf_atomic.h> /* qdf_atomic_read */ #include <targaddrs.h> #include <bmi_msg.h> #include "hif_io32.h" @@ -45,8 +46,8 @@ #include "hif_hw_version.h" #include "ce_api.h" #include "ce_tasklet.h" -#include "cdf_trace.h" -#include "cdf_status.h" +#include "qdf_trace.h" +#include "qdf_status.h" #ifdef CONFIG_CNSS #include <net/cnss.h> #endif @@ -193,7 +194,7 @@ static inline void hif_fw_event_handler(struct HIF_CE_state *hif_state) return; msg_callbacks->fwEventHandler(msg_callbacks->Context, - CDF_STATUS_E_FAILURE); + QDF_STATUS_E_FAILURE); } /** @@ -279,7 +280,7 @@ void *hif_get_targetdef(struct hif_opaque_softc *hif_ctx) void hif_vote_link_down(struct hif_opaque_softc *hif_ctx) { struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); - CDF_BUG(scn); + QDF_BUG(scn); scn->linkstate_vote--; if (scn->linkstate_vote == 0) @@ -300,7 +301,7 @@ void hif_vote_link_down(struct hif_opaque_softc *hif_ctx) void hif_vote_link_up(struct hif_opaque_softc *hif_ctx) { struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); - CDF_BUG(scn); + QDF_BUG(scn); scn->linkstate_vote++; if (scn->linkstate_vote == 1) @@ -322,7 +323,7 @@ void hif_vote_link_up(struct hif_opaque_softc *hif_ctx) bool hif_can_suspend_link(struct hif_opaque_softc *hif_ctx) { struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); - CDF_BUG(scn); + QDF_BUG(scn); return scn->linkstate_vote == 0; } @@ -381,14 +382,14 @@ bool hif_max_num_receives_reached(struct hif_softc *scn, unsigned int count) /** * init_buffer_count() - initial buffer count - * @maxSize: cdf_size_t + * @maxSize: qdf_size_t * * routine to modify the initial buffer count to be allocated on an os * platform basis. Platform owner will need to modify this as needed * - * Return: cdf_size_t + * Return: qdf_size_t */ -cdf_size_t init_buffer_count(cdf_size_t maxSize) +qdf_size_t init_buffer_count(qdf_size_t maxSize) { return maxSize; } @@ -453,7 +454,7 @@ void hif_get_hw_info(struct hif_opaque_softc *scn, u32 *version, u32 *revision, /** * hif_open(): hif_open - * @cdf_ctx: CDF Context + * @qdf_ctx: QDF Context * @mode: Driver Mode * @bus_type: Bus Type * @cbk: CDS Callbacks @@ -462,35 +463,35 @@ void hif_get_hw_info(struct hif_opaque_softc *scn, u32 *version, u32 *revision, * * Return: HIF Opaque Pointer */ -struct hif_opaque_softc *hif_open(cdf_device_t cdf_ctx, uint32_t mode, - enum ath_hal_bus_type bus_type, +struct hif_opaque_softc *hif_open(qdf_device_t qdf_ctx, uint32_t mode, + enum qdf_bus_type bus_type, struct hif_callbacks *cbk) { struct hif_softc *scn; - CDF_STATUS status = CDF_STATUS_SUCCESS; + QDF_STATUS status = QDF_STATUS_SUCCESS; int bus_context_size = hif_bus_get_context_size(); - scn = (struct hif_softc *)cdf_mem_malloc(bus_context_size); + scn = (struct hif_softc *)qdf_mem_malloc(bus_context_size); if (!scn) { HIF_ERROR("%s: cannot alloc memory for HIF context of size:%d", __func__, bus_context_size); return GET_HIF_OPAQUE_HDL(scn); } - cdf_mem_zero(scn, bus_context_size); + qdf_mem_zero(scn, bus_context_size); - scn->cdf_dev = cdf_ctx; + scn->qdf_dev = qdf_ctx; scn->hif_con_param = mode; - cdf_atomic_init(&scn->active_tasklet_cnt); - cdf_atomic_init(&scn->link_suspended); - cdf_atomic_init(&scn->tasklet_from_intr); - cdf_mem_copy(&scn->callbacks, cbk, sizeof(struct hif_callbacks)); + qdf_atomic_init(&scn->active_tasklet_cnt); + qdf_atomic_init(&scn->link_suspended); + qdf_atomic_init(&scn->tasklet_from_intr); + qdf_mem_copy(&scn->callbacks, cbk, sizeof(struct hif_callbacks)); status = hif_bus_open(scn, bus_type); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: hif_bus_open error = %d, bus_type = %d", __func__, status, bus_type); - cdf_mem_free(scn); + qdf_mem_free(scn); scn = NULL; } @@ -518,7 +519,7 @@ void hif_close(struct hif_opaque_softc *hif_ctx) } hif_bus_close(scn); - cdf_mem_free(scn); + qdf_mem_free(scn); } /** @@ -530,23 +531,23 @@ void hif_close(struct hif_opaque_softc *hif_ctx) * @bus_type: bus type * @type: enable type * - * Return: CDF_STATUS + * Return: QDF_STATUS */ -CDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev, +QDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev, void *bdev, const hif_bus_id *bid, - enum ath_hal_bus_type bus_type, + enum qdf_bus_type bus_type, enum hif_enable_type type) { - CDF_STATUS status; + QDF_STATUS status; struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); if (scn == NULL) { HIF_ERROR("%s: hif_ctx = NULL", __func__); - return CDF_STATUS_E_NULL_VALUE; + return QDF_STATUS_E_NULL_VALUE; } status = hif_enable_bus(scn, dev, bdev, bid, type); - if (status != CDF_STATUS_SUCCESS) { + if (status != QDF_STATUS_SUCCESS) { HIF_ERROR("%s: hif_enable_bus error = %d", __func__, status); return status; @@ -558,7 +559,7 @@ CDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev, if (hif_config_ce(scn)) { HIF_ERROR("%s: Target probe failed.", __func__); hif_disable_bus(scn); - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; return status; } /* @@ -574,7 +575,7 @@ CDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev, if (status < 0) { HIF_ERROR("%s: ERROR - configure_IRQ_and_CE failed, status = %d", __func__, status); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } #endif @@ -582,7 +583,7 @@ CDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev, HIF_TRACE("%s: X OK", __func__); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } /** @@ -599,7 +600,7 @@ void hif_wlan_disable(struct hif_softc *scn) enum icnss_driver_mode mode; uint32_t con_mode = hif_get_conparam(scn); - if (CDF_GLOBAL_FTM_MODE == con_mode) + if (QDF_GLOBAL_FTM_MODE == con_mode) mode = ICNSS_FTM; else if (WLAN_IS_EPPING_ENABLED(con_mode)) mode = ICNSS_EPPING; @@ -725,7 +726,7 @@ int hif_check_fw_reg(struct hif_opaque_softc *scn) * * Return: n/a */ -void hif_read_phy_mem_base(struct hif_softc *scn, cdf_dma_addr_t *phy_mem_base) +void hif_read_phy_mem_base(struct hif_softc *scn, qdf_dma_addr_t *phy_mem_base) { *phy_mem_base = scn->mem_pa; } @@ -901,7 +902,7 @@ void hif_init_ini_config(struct hif_opaque_softc *hif_ctx, { struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); - cdf_mem_copy(&scn->hif_config, cfg, sizeof(struct hif_config_info)); + qdf_mem_copy(&scn->hif_config, cfg, sizeof(struct hif_config_info)); } /** diff --git a/hif/src/hif_main.h b/hif/src/hif_main.h index 54384ab85f5b..be51e3533e4c 100644 --- a/hif/src/hif_main.h +++ b/hif/src/hif_main.h @@ -42,8 +42,8 @@ #ifndef __HIF_MAIN_H__ #define __HIF_MAIN_H__ -#include <cdf_atomic.h> /* cdf_atomic_read */ -#include "cdf_lock.h" +#include <qdf_atomic.h> /* qdf_atomic_read */ +#include "qdf_lock.h" #include "cepci.h" #include "hif.h" @@ -113,9 +113,9 @@ struct hif_softc { struct hif_config_info hif_config; struct hif_target_info target_info; void __iomem *mem; - enum ath_hal_bus_type bus_type; + enum qdf_bus_type bus_type; void *ce_id_to_state[CE_COUNT_MAX]; - cdf_device_t cdf_dev; + qdf_device_t qdf_dev; bool hif_init_done; bool request_irq_done; /* Packet statistics */ @@ -139,7 +139,7 @@ struct hif_softc { int fastpath_mode_on; atomic_t tasklet_from_intr; int htc_endpoint; - cdf_dma_addr_t mem_pa; + qdf_dma_addr_t mem_pa; bool athdiag_procfs_inited; #ifdef FEATURE_NAPI struct qca_napi_data napi_data; @@ -159,7 +159,7 @@ void athdiag_procfs_remove(void); /* routine to modify the initial buffer count to be allocated on an os * platform basis. Platform owner will need to modify this as needed */ -cdf_size_t init_buffer_count(cdf_size_t maxSize); +qdf_size_t init_buffer_count(qdf_size_t maxSize); irqreturn_t hif_fw_interrupt_handler(int irq, void *arg); int hif_get_target_type(struct hif_softc *ol_sc, struct device *dev, @@ -172,14 +172,14 @@ int hif_get_device_type(uint32_t device_id, bool hif_targ_is_awake(struct hif_softc *scn, void *__iomem *mem); void hif_nointrs(struct hif_softc *scn); void hif_bus_close(struct hif_softc *ol_sc); -CDF_STATUS hif_bus_open(struct hif_softc *ol_sc, - enum ath_hal_bus_type bus_type); -CDF_STATUS hif_enable_bus(struct hif_softc *ol_sc, struct device *dev, +QDF_STATUS hif_bus_open(struct hif_softc *ol_sc, + enum qdf_bus_type bus_type); +QDF_STATUS hif_enable_bus(struct hif_softc *ol_sc, struct device *dev, void *bdev, const hif_bus_id *bid, enum hif_enable_type type); void hif_disable_bus(struct hif_softc *scn); void hif_bus_prevent_linkdown(struct hif_softc *scn, bool flag); int hif_bus_get_context_size(void); -void hif_read_phy_mem_base(struct hif_softc *scn, cdf_dma_addr_t *bar_value); +void hif_read_phy_mem_base(struct hif_softc *scn, qdf_dma_addr_t *bar_value); uint32_t hif_get_conparam(struct hif_softc *scn); struct hif_callbacks *hif_get_callbacks_handle(struct hif_softc *scn); bool hif_is_driver_unloading(struct hif_softc *scn); diff --git a/hif/src/hif_napi.c b/hif/src/hif_napi.c index 64a05e61d87a..58635cba9a87 100644 --- a/hif/src/hif_napi.c +++ b/hif/src/hif_napi.c @@ -424,7 +424,7 @@ int hif_napi_poll(struct hif_opaque_softc *hif_ctx, struct napi_struct *napi, napi_info->stats[cpu].napi_polls++; if (unlikely(NULL == hif)) - CDF_ASSERT(hif != NULL); /* emit a warning if hif NULL */ + QDF_ASSERT(hif != NULL); /* emit a warning if hif NULL */ else { rc = ce_per_engine_service(hif, NAPI_ID2PIPE(napi_info->id)); HIF_INFO_HI("%s: ce_per_engine_service processed %d msgs", @@ -461,7 +461,7 @@ int hif_napi_poll(struct hif_opaque_softc *hif_ctx, struct napi_struct *napi, hif_napi_enable_irq(hif_ctx, napi_info->id); /* support suspend/resume */ - cdf_atomic_dec(&(hif->active_tasklet_cnt)); + qdf_atomic_dec(&(hif->active_tasklet_cnt)); } NAPI_DEBUG("%s:%d: napi_complete + enabling the interrupts", diff --git a/hif/src/icnss_stub/icnss_stub.c b/hif/src/icnss_stub/icnss_stub.c index 85c2320f5ea1..90540c5df13f 100644 --- a/hif/src/icnss_stub/icnss_stub.c +++ b/hif/src/icnss_stub/icnss_stub.c @@ -32,7 +32,7 @@ #include <hif.h> #include "regtable.h" #include "hif_debug.h" -#include "cdf_status.h" +#include "qdf_status.h" #include "qwlan_version.h" #include <net/cnss.h> @@ -294,7 +294,7 @@ void icnss_dispatch_ce_irq(struct hif_softc *scn) if (intr_summary == 0) { if ((scn->target_status != OL_TRGET_STATUS_RESET) && - (!cdf_atomic_read(&scn->link_suspended))) { + (!qdf_atomic_read(&scn->link_suspended))) { hif_write32_mb(scn->mem + (SOC_CORE_BASE_ADDRESS | diff --git a/hif/src/mp_dev.c b/hif/src/mp_dev.c index f1611dbda910..b3b0f3124084 100644 --- a/hif/src/mp_dev.c +++ b/hif/src/mp_dev.c @@ -77,7 +77,7 @@ struct priv_ctrl_ctx { static struct priv_ctrl_ctx g_priv_dump_ctx; -static INLINE void set_target_reg_bits(void __iomem *mem, uint32_t reg, +static inline void set_target_reg_bits(void __iomem *mem, uint32_t reg, uint32_t bitmask, uint32_t val) { uint32_t value = hif_read32_mb(mem + (reg)); @@ -90,7 +90,7 @@ static INLINE void set_target_reg_bits(void __iomem *mem, uint32_t reg, hif_write32_mb(mem + (reg), value); } -static INLINE uint32_t get_target_reg_bits(void __iomem *mem, +static inline uint32_t get_target_reg_bits(void __iomem *mem, uint32_t reg, uint32_t bitmask) { uint32_t value = hif_read32_mb(mem + (reg)); @@ -177,9 +177,9 @@ void priv_dump_chaninfo(struct hif_softc *scn) hif_read32_mb(scn->mem + BB_chn_tables_intf_data) & 0x0000ffff; - cdf_print("0x%x\t", val); + qdf_print("0x%x\t", val); if (i % 4 == 0) - cdf_print("\n"); + qdf_print("\n"); } } else { len = (bw == 2) ? 59 : 60; @@ -187,10 +187,10 @@ void priv_dump_chaninfo(struct hif_softc *scn) tmp = hif_read32_mb(scn->mem + BB_chn_tables_intf_data); - cdf_print("0x%x\t", ((tmp >> 16) & 0x0000ffff)); - cdf_print("0x%x\t", (tmp & 0x0000ffff)); + qdf_print("0x%x\t", ((tmp >> 16) & 0x0000ffff)); + qdf_print("0x%x\t", (tmp & 0x0000ffff)); if (i % 2 == 0) - cdf_print("\n"); + qdf_print("\n"); } if (bw > 2) { /* bw == 3 for vht80 */ @@ -202,11 +202,11 @@ void priv_dump_chaninfo(struct hif_softc *scn) tmp = hif_read32_mb(scn->mem + BB_chn_tables_intf_data); - cdf_print("0x%x\t", + qdf_print("0x%x\t", ((tmp >> 16) & 0x0000ffff)); - cdf_print("0x%x\t", (tmp & 0x0000ffff)); + qdf_print("0x%x\t", (tmp & 0x0000ffff)); if (i % 2 == 0) - cdf_print("\n"); + qdf_print("\n"); } } } @@ -219,9 +219,9 @@ void priv_dump_chaninfo(struct hif_softc *scn) hif_read32_mb(scn->mem + BB_chn1_tables_intf_data) & 0x0000ffff; - cdf_print("0x%x\t", val); + qdf_print("0x%x\t", val); if (i % 4 == 0) - cdf_print("\n"); + qdf_print("\n"); } } else { len = (bw == 2) ? 59 : 60; @@ -229,10 +229,10 @@ void priv_dump_chaninfo(struct hif_softc *scn) tmp = hif_read32_mb(scn->mem + BB_chn1_tables_intf_data); - cdf_print("0x%x\n", (tmp >> 16) & 0x0000ffff); - cdf_print("0x%x\n", tmp & 0x0000ffff); + qdf_print("0x%x\n", (tmp >> 16) & 0x0000ffff); + qdf_print("0x%x\n", tmp & 0x0000ffff); if (i % 2 == 0) - cdf_print("\n"); + qdf_print("\n"); } if (bw > 2) { /* bw == 3 for vht80 */ @@ -244,11 +244,11 @@ void priv_dump_chaninfo(struct hif_softc *scn) tmp = hif_read32_mb(scn->mem + BB_chn1_tables_intf_data); - cdf_print("0x%x\t", + qdf_print("0x%x\t", ((tmp >> 16) & 0x0000ffff)); - cdf_print("0x%x\t", (tmp & 0x0000ffff)); + qdf_print("0x%x\t", (tmp & 0x0000ffff)); if (i % 2 == 0) - cdf_print("\n"); + qdf_print("\n"); } } } @@ -283,9 +283,9 @@ void priv_dump_agc(struct hif_softc *scn) BB_chaninfo_tab_b0 + i * 4); val = hif_read32_mb(scn->mem + PHY_BB_CHN_TABLES_INTF_DATA); - cdf_print("0x%x\t", val); + qdf_print("0x%x\t", val); if (i % 4 == 0) - cdf_print("\n"); + qdf_print("\n"); } } if (chain1) { @@ -295,9 +295,9 @@ void priv_dump_agc(struct hif_softc *scn) BB_chaninfo_tab_b0 + i * 4); val = hif_read32_mb(scn->mem + PHY_BB_CHN1_TABLES_INTF_DATA); - cdf_print("0x%x\t", val); + qdf_print("0x%x\t", val); if (i % 4 == 0) - cdf_print("\n"); + qdf_print("\n"); } } HIF_TRACE("%s: AGC history buffer dump X", __func__); @@ -316,12 +316,12 @@ void priv_dump_bbwatchdog(struct hif_softc *scn) HIF_TRACE("%s: BB watchdog dump E", __func__); val = hif_read32_mb(scn->mem + BB_watchdog_status); - cdf_print("0x%x\t", val); + qdf_print("0x%x\t", val); val = hif_read32_mb(scn->mem + BB_watchdog_ctrl_1); - cdf_print("0x%x\t", val); + qdf_print("0x%x\t", val); val = hif_read32_mb(scn->mem + BB_watchdog_ctrl_2); - cdf_print("0x%x\t", val); + qdf_print("0x%x\t", val); val = hif_read32_mb(scn->mem + BB_watchdog_status_B); - cdf_print("0x%x", val); + qdf_print("0x%x", val); HIF_TRACE("%s: BB watchdog dump X", __func__); } diff --git a/hif/src/pcie/hif_io32_pci.h b/hif/src/pcie/hif_io32_pci.h index 269d8541f8a3..10fc06fadf04 100644 --- a/hif/src/pcie/hif_io32_pci.h +++ b/hif/src/pcie/hif_io32_pci.h @@ -33,7 +33,7 @@ #include "hif_main.h" #include "regtable.h" #include "ce_reg.h" -#include "cdf_atomic.h" +#include "qdf_atomic.h" #include "if_pci.h" /* * For maximum performance and no power management, set this to 1. @@ -258,13 +258,13 @@ static inline void ce_irq_enable(struct hif_softc *scn, int ce_id) uint32_t tmp = 1 << ce_id; struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); - cdf_spin_lock_irqsave(&sc->irq_lock); + qdf_spin_lock_irqsave(&sc->irq_lock); scn->ce_irq_summary &= ~tmp; if (scn->ce_irq_summary == 0) { /* Enable Legacy PCI line interrupts */ if (LEGACY_INTERRUPTS(sc) && (scn->target_status != OL_TRGET_STATUS_RESET) && - (!cdf_atomic_read(&scn->link_suspended))) { + (!qdf_atomic_read(&scn->link_suspended))) { hif_write32_mb(scn->mem + (SOC_CORE_BASE_ADDRESS | @@ -278,7 +278,7 @@ static inline void ce_irq_enable(struct hif_softc *scn, int ce_id) } if (scn->hif_init_done == true) A_TARGET_ACCESS_END(scn); - cdf_spin_unlock_irqrestore(&sc->irq_lock); + qdf_spin_unlock_irqrestore(&sc->irq_lock); /* check for missed firmware crash */ hif_fw_interrupt_handler(0, scn); diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index 55d56a37acdc..687bb1187076 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -46,9 +46,9 @@ #include <linux/debugfs.h> #include <linux/seq_file.h> #include <osapi_linux.h> -#include "cdf_status.h" +#include "qdf_status.h" #include "wma_api.h" -#include "cdf_atomic.h" +#include "qdf_atomic.h" #include "wlan_hdd_power.h" #include "wlan_hdd_main.h" #ifdef CONFIG_CNSS @@ -239,7 +239,7 @@ static irqreturn_t hif_pci_interrupt_handler(int irq, void *arg) __func__, hif_read32_mb(sc->mem + 0x80018), hif_read32_mb(sc->mem + 0x8001c)); - CDF_BUG(0); + QDF_BUG(0); } PCI_CLR_CAUSE0_REGISTER(sc); @@ -260,9 +260,9 @@ static irqreturn_t hif_pci_interrupt_handler(int irq, void *arg) if (ssr_irq) { sc->irq_event = irq; - cdf_atomic_set(&scn->tasklet_from_intr, 1); + qdf_atomic_set(&scn->tasklet_from_intr, 1); - cdf_atomic_inc(&scn->active_tasklet_cnt); + qdf_atomic_inc(&scn->active_tasklet_cnt); tasklet_schedule(&sc->intr_tq); } else { icnss_dispatch_ce_irq(scn); @@ -302,13 +302,13 @@ void hif_pci_cancel_deferred_target_sleep(struct hif_softc *scn) struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); A_target_id_t pci_addr = scn->mem; - cdf_spin_lock_irqsave(&hif_state->keep_awake_lock); + qdf_spin_lock_irqsave(&hif_state->keep_awake_lock); /* * If the deferred sleep timer is running cancel it * and put the soc into sleep. */ if (hif_state->fake_sleep == true) { - cdf_softirq_timer_cancel(&hif_state->sleep_timer); + qdf_timer_stop(&hif_state->sleep_timer); if (hif_state->verified_awake == false) { hif_write32_mb(pci_addr + PCIE_LOCAL_BASE_ADDRESS + PCIE_SOC_WAKE_ADDRESS, @@ -316,7 +316,7 @@ void hif_pci_cancel_deferred_target_sleep(struct hif_softc *scn) } hif_state->fake_sleep = false; } - cdf_spin_unlock_irqrestore(&hif_state->keep_awake_lock); + qdf_spin_unlock_irqrestore(&hif_state->keep_awake_lock); } #else inline void hif_pci_cancel_deferred_target_sleep(struct hif_softc *scn) @@ -367,7 +367,7 @@ static void hif_pci_device_reset(struct hif_pci_softc *sc) if (hif_targ_is_awake(scn, mem)) break; - cdf_mdelay(1); + qdf_mdelay(1); } /* Put Target, including PCIe, into RESET. */ @@ -379,7 +379,7 @@ static void hif_pci_device_reset(struct hif_pci_softc *sc) RTC_STATE_COLD_RESET_MASK) break; - cdf_mdelay(1); + qdf_mdelay(1); } /* Pull Target, including PCIe, out of RESET. */ @@ -391,7 +391,7 @@ static void hif_pci_device_reset(struct hif_pci_softc *sc) RTC_STATE_COLD_RESET_MASK)) break; - cdf_mdelay(1); + qdf_mdelay(1); } A_PCIE_LOCAL_REG_WRITE(mem, PCIE_SOC_WAKE_ADDRESS, PCIE_SOC_WAKE_RESET); @@ -432,7 +432,7 @@ void hif_pci_device_warm_reset(struct hif_pci_softc *sc) for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) { if (hif_targ_is_awake(scn, mem)) break; - cdf_mdelay(1); + qdf_mdelay(1); } /* @@ -457,7 +457,7 @@ void hif_pci_device_warm_reset(struct hif_pci_softc *sc) hif_write32_mb((mem + (SOC_CORE_BASE_ADDRESS + PCIE_INTR_CLR_ADDRESS)), HOST_GROUP0_MASK); - cdf_mdelay(100); + qdf_mdelay(100); /* Clear FW_INDICATOR_ADDRESS */ if (HAS_FW_INDICATOR) { @@ -490,7 +490,7 @@ void hif_pci_device_warm_reset(struct hif_pci_softc *sc) hif_read32_mb(mem + (RTC_SOC_BASE_ADDRESS | SOC_RESET_CONTROL_ADDRESS)); - cdf_mdelay(10); + qdf_mdelay(10); /* CE unreset */ val &= ~SOC_RESET_CONTROL_CE_RST_MASK; @@ -500,7 +500,7 @@ void hif_pci_device_warm_reset(struct hif_pci_softc *sc) hif_read32_mb(mem + (RTC_SOC_BASE_ADDRESS | SOC_RESET_CONTROL_ADDRESS)); - cdf_mdelay(10); + qdf_mdelay(10); /* Read Target CPU Intr Cause */ val = hif_read32_mb(mem + (SOC_CORE_BASE_ADDRESS | CPU_INTR_ADDRESS)); @@ -522,7 +522,7 @@ void hif_pci_device_warm_reset(struct hif_pci_softc *sc) HIF_INFO_MED("%s: RESET_CONTROL after cpu warm reset 0x%x", __func__, val); - cdf_mdelay(100); + qdf_mdelay(100); HIF_INFO_MED("%s: Target Warm reset complete", __func__); } @@ -593,7 +593,7 @@ int hif_check_soc_status(struct hif_opaque_softc *hif_ctx) hif_write32_mb(sc->mem + PCIE_LOCAL_BASE_ADDRESS + PCIE_SOC_WAKE_ADDRESS, PCIE_SOC_WAKE_V_MASK); - cdf_mdelay(100); + qdf_mdelay(100); timeout_count += 100; } @@ -816,8 +816,8 @@ static void reschedule_tasklet_work_handler(void *arg) */ static void hif_init_reschedule_tasklet_work(struct hif_pci_softc *sc) { - cdf_create_work(&sc->reschedule_tasklet_work, - reschedule_tasklet_work_handler, sc); + qdf_create_work(0, &sc->reschedule_tasklet_work, + reschedule_tasklet_work_handler, NULL); } #else static void hif_init_reschedule_tasklet_work(struct hif_pci_softc *sc) { } @@ -831,7 +831,7 @@ static void wlan_tasklet(unsigned long data) if (scn->hif_init_done == false) goto end; - if (cdf_atomic_read(&scn->link_suspended)) + if (qdf_atomic_read(&scn->link_suspended)) goto end; if (!ADRASTEA_BU) { @@ -841,8 +841,8 @@ static void wlan_tasklet(unsigned long data) } end: - cdf_atomic_set(&scn->tasklet_from_intr, 0); - cdf_atomic_dec(&scn->active_tasklet_cnt); + qdf_atomic_set(&scn->tasklet_from_intr, 0); + qdf_atomic_dec(&scn->active_tasklet_cnt); } #ifdef FEATURE_RUNTIME_PM @@ -1049,7 +1049,7 @@ static void hif_pm_runtime_start(struct hif_pci_softc *sc) return; } - if (mode == CDF_FTM_MODE || WLAN_IS_EPPING_ENABLED(mode)) { + if (mode == QDF_FTM_MODE || WLAN_IS_EPPING_ENABLED(mode)) { HIF_INFO("%s: RUNTIME PM is disabled for FTM/EPPING mode\n", __func__); return; @@ -1062,7 +1062,7 @@ static void hif_pm_runtime_start(struct hif_pci_softc *sc) ol_sc->runtime_pm_delay); cnss_runtime_init(sc->dev, ol_sc->runtime_pm_delay); - cdf_atomic_set(&sc->pm_state, HIF_PM_RUNTIME_STATE_ON); + qdf_atomic_set(&sc->pm_state, HIF_PM_RUNTIME_STATE_ON); hif_runtime_pm_debugfs_create(sc); } @@ -1081,13 +1081,13 @@ static void hif_pm_runtime_stop(struct hif_pci_softc *sc) if (!ol_sc->enable_runtime_pm) return; - if (mode == CDF_FTM_MODE || WLAN_IS_EPPING_ENABLED(mode)) + if (mode == QDF_FTM_MODE || WLAN_IS_EPPING_ENABLED(mode)) return; cnss_runtime_exit(sc->dev); cnss_pm_runtime_request(sc->dev, CNSS_PM_RUNTIME_RESUME); - cdf_atomic_set(&sc->pm_state, HIF_PM_RUNTIME_STATE_NONE); + qdf_atomic_set(&sc->pm_state, HIF_PM_RUNTIME_STATE_NONE); hif_runtime_pm_debugfs_remove(sc); del_timer_sync(&sc->runtime_timer); @@ -1104,10 +1104,10 @@ static void hif_pm_runtime_open(struct hif_pci_softc *sc) { spin_lock_init(&sc->runtime_lock); - cdf_atomic_init(&sc->pm_state); + qdf_atomic_init(&sc->pm_state); sc->prevent_linkdown_lock = hif_runtime_lock_init("linkdown suspend disabled"); - cdf_atomic_set(&sc->pm_state, HIF_PM_RUNTIME_STATE_NONE); + qdf_atomic_set(&sc->pm_state, HIF_PM_RUNTIME_STATE_NONE); INIT_LIST_HEAD(&sc->prevent_suspend_list); } @@ -1119,7 +1119,7 @@ static void hif_pm_runtime_open(struct hif_pci_softc *sc) */ static void hif_pm_runtime_close(struct hif_pci_softc *sc) { - if (cdf_atomic_read(&sc->pm_state) == HIF_PM_RUNTIME_STATE_NONE) + if (qdf_atomic_read(&sc->pm_state) == HIF_PM_RUNTIME_STATE_NONE) return; else hif_pm_runtime_stop(sc); @@ -1193,16 +1193,16 @@ int hif_bus_get_context_size(void) * * Return: n/a */ -CDF_STATUS hif_bus_open(struct hif_softc *ol_sc, enum ath_hal_bus_type bus_type) +QDF_STATUS hif_bus_open(struct hif_softc *ol_sc, enum qdf_bus_type bus_type) { struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(ol_sc); ol_sc->bus_type = bus_type; hif_pm_runtime_open(sc); - cdf_spinlock_init(&sc->irq_lock); + qdf_spinlock_create(&sc->irq_lock); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } /** @@ -1228,8 +1228,8 @@ int hif_enable_pci(struct hif_pci_softc *sc, uint16_t device_id; struct hif_softc *ol_sc = HIF_GET_SOFTC(sc); - pci_read_config_word(pdev,PCI_DEVICE_ID,&device_id); - if(device_id != id->device) { + pci_read_config_word(pdev, PCI_DEVICE_ID, &device_id); + if (device_id != id->device) { HIF_ERROR( "%s: dev id mismatch, config id = 0x%x, probing id = 0x%x", __func__, device_id, id->device); @@ -1361,7 +1361,7 @@ int hif_pci_probe_tgt_wakeup(struct hif_pci_softc *sc) ret = -EAGAIN; goto end; } - cdf_mdelay(1); + qdf_mdelay(1); targ_awake_limit--; } @@ -1374,7 +1374,7 @@ int hif_pci_probe_tgt_wakeup(struct hif_pci_softc *sc) PCIE_LOCAL_BASE_ADDRESS + PCIE_SOC_RDY_STATUS_ADDRESS) \ & PCIE_SOC_RDY_STATUS_BAR_MASK)) { - cdf_mdelay(10); + qdf_mdelay(10); } if (wait_limit < 0) { /* AR6320v1 doesn't support checking of BAR0 configuration, @@ -1411,10 +1411,10 @@ static void wlan_tasklet_msi(unsigned long data) if (scn->hif_init_done == false) goto irq_handled; - if (cdf_atomic_read(&scn->link_suspended)) + if (qdf_atomic_read(&scn->link_suspended)) goto irq_handled; - cdf_atomic_inc(&scn->active_tasklet_cnt); + qdf_atomic_inc(&scn->active_tasklet_cnt); if (entry->id == HIF_MAX_TASKLET_NUM) { /* the last tasklet is for fw IRQ */ @@ -1430,7 +1430,7 @@ static void wlan_tasklet_msi(unsigned long data) return; irq_handled: - cdf_atomic_dec(&scn->active_tasklet_cnt); + qdf_atomic_dec(&scn->active_tasklet_cnt); } @@ -1464,17 +1464,17 @@ int hif_configure_msi(struct hif_pci_softc *sc) int i; sc->num_msi_intrs = HIF_MAX_TASKLET_NUM; - sc->tasklet_entries[HIF_MAX_TASKLET_NUM -1].hif_handler = + sc->tasklet_entries[HIF_MAX_TASKLET_NUM-1].hif_handler = (void *)sc; - sc->tasklet_entries[HIF_MAX_TASKLET_NUM -1].id = + sc->tasklet_entries[HIF_MAX_TASKLET_NUM-1].id = HIF_MAX_TASKLET_NUM; tasklet_init(&sc->intr_tq, wlan_tasklet_msi, (unsigned long)&sc->tasklet_entries[ - HIF_MAX_TASKLET_NUM -1]); + HIF_MAX_TASKLET_NUM-1]); ret = request_irq(sc->pdev->irq + MSI_ASSIGN_FW, hif_pci_msi_fw_handler, IRQF_SHARED, "wlan_pci", sc); - if(ret) { + if (ret) { HIF_ERROR("%s: request_irq failed", __func__); goto err_intr; } @@ -1487,7 +1487,7 @@ int hif_configure_msi(struct hif_pci_softc *sc) i + MSI_ASSIGN_CE_INITIAL), ce_per_engine_handler, IRQF_SHARED, "wlan_pci", sc); - if(ret) { + if (ret) { HIF_ERROR("%s: request_irq failed", __func__); goto err_intr; } @@ -1495,7 +1495,8 @@ int hif_configure_msi(struct hif_pci_softc *sc) } else if (rv > 0) { HIF_TRACE("%s: use single msi", __func__); - if ((ret = pci_enable_msi(sc->pdev)) < 0) { + ret = pci_enable_msi(sc->pdev); + if (ret < 0) { HIF_ERROR("%s: single MSI allocation failed", __func__); /* Try for legacy PCI line interrupts */ @@ -1507,7 +1508,7 @@ int hif_configure_msi(struct hif_pci_softc *sc) ret = request_irq(sc->pdev->irq, hif_pci_interrupt_handler, IRQF_SHARED, "wlan_pci", sc); - if(ret) { + if (ret) { HIF_ERROR("%s: request_irq failed", __func__); goto err_intr; } @@ -1517,7 +1518,8 @@ int hif_configure_msi(struct hif_pci_softc *sc) ret = -EIO; HIF_ERROR("%s: do not support MSI, rv = %d", __func__, rv); } - if ((ret = pci_enable_msi(sc->pdev)) < 0) { + ret = pci_enable_msi(sc->pdev); + if (ret < 0) { HIF_ERROR("%s: single MSI interrupt allocation failed", __func__); /* Try for legacy PCI line interrupts */ @@ -1528,7 +1530,7 @@ int hif_configure_msi(struct hif_pci_softc *sc) ret = request_irq(sc->pdev->irq, hif_pci_interrupt_handler, IRQF_SHARED, "wlan_pci", sc); - if(ret) { + if (ret) { HIF_ERROR("%s: request_irq failed", __func__); goto err_intr; } @@ -1564,7 +1566,7 @@ static int hif_pci_configure_legacy_irq(struct hif_pci_softc *sc) ret = request_irq(sc->pdev->irq, hif_pci_interrupt_handler, IRQF_SHARED, "wlan_pci", sc); - if(ret) { + if (ret) { HIF_ERROR("%s: request_irq failed, ret = %d", __func__, ret); goto end; } @@ -1576,7 +1578,7 @@ static int hif_pci_configure_legacy_irq(struct hif_pci_softc *sc) PCIE_SOC_WAKE_ADDRESS, PCIE_SOC_WAKE_RESET); end: - CDF_TRACE(CDF_MODULE_ID_HIF, CDF_TRACE_LEVEL_ERROR, + QDF_TRACE(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_ERROR, "%s: X, ret = %d", __func__, ret); return ret; } @@ -1724,7 +1726,7 @@ static inline int hif_drain_tasklets(struct hif_softc *scn) { uint32_t ce_drain_wait_cnt = 0; - while (cdf_atomic_read(&scn->active_tasklet_cnt)) { + while (qdf_atomic_read(&scn->active_tasklet_cnt)) { if (++ce_drain_wait_cnt > HIF_CE_DRAIN_WAIT_CNT) { HIF_ERROR("%s: CE still not done with access", __func__); @@ -1827,7 +1829,7 @@ static int hif_bus_suspend_link_down(struct hif_softc *scn) /* Stop the HIF Sleep Timer */ hif_cancel_deferred_target_sleep(hif_hdl); - cdf_atomic_set(&scn->link_suspended, 1); + qdf_atomic_set(&scn->link_suspended, 1); return 0; } @@ -1854,7 +1856,7 @@ static int hif_bus_resume_link_down(struct hif_softc *scn) return -EFAULT; } - cdf_atomic_set(&scn->link_suspended, 0); + qdf_atomic_set(&scn->link_suspended, 0); enable_irq(pdev->irq); @@ -1914,7 +1916,7 @@ static void __hif_runtime_pm_set_state(struct hif_softc *scn, } sc = scn->hif_sc; - cdf_atomic_set(&sc->pm_state, state); + qdf_atomic_set(&sc->pm_state, state); } @@ -2117,12 +2119,12 @@ static void hif_fastpath_resume(struct hif_opaque_softc *hif_ctx) if (scn->fastpath_mode_on) { if (Q_TARGET_ACCESS_BEGIN(scn)) { ce_state = scn->ce_id_to_state[CE_HTT_H2T_MSG]; - cdf_spin_lock_bh(&ce_state->ce_index_lock); + qdf_spin_lock_bh(&ce_state->ce_index_lock); /*war_ce_src_ring_write_idx_set */ CE_SRC_RING_WRITE_IDX_SET(scn, ce_state->ctrl_addr, ce_state->src_ring->write_index); - cdf_spin_unlock_bh(&ce_state->ce_index_lock); + qdf_spin_unlock_bh(&ce_state->ce_index_lock); Q_TARGET_ACCESS_END(scn); } } @@ -2151,7 +2153,7 @@ static void hif_free_msi_ctx(struct hif_softc *scn) { struct hif_pci_softc *sc = scn->hif_sc; struct hif_msi_info *info = &sc->msi_info; - struct device *dev = scn->cdf_dev->dev; + struct device *dev = scn->qdf_dev->dev; OS_FREE_CONSISTENT(dev, 4, info->magic, info->magic_dma, OS_GET_DMA_MEM_CONTEXT(scn, dmacontext)); @@ -2174,7 +2176,7 @@ void hif_disable_isr(struct hif_opaque_softc *ol_sc) /* Cancel the pending tasklet */ ce_tasklet_kill(scn); tasklet_kill(&sc->intr_tq); - cdf_atomic_set(&scn->active_tasklet_cnt, 0); + qdf_atomic_set(&scn->active_tasklet_cnt, 0); } /* Function to reset SoC */ @@ -2299,7 +2301,7 @@ static int hif_log_soc_wakeup_timeout(struct hif_pci_softc *sc) hif_msm_pcie_debug_info(sc); if (!cfg->enable_self_recovery) - CDF_BUG(0); + QDF_BUG(0); scn->recovery = true; @@ -2360,10 +2362,10 @@ hif_target_sleep_state_adjust(struct hif_softc *scn, if (scn->recovery) return -EACCES; - if (cdf_atomic_read(&scn->link_suspended)) { + if (qdf_atomic_read(&scn->link_suspended)) { HIF_ERROR("%s:invalid access, PCIe link is down", __func__); debug = true; - CDF_ASSERT(0); + QDF_ASSERT(0); return -EACCES; } @@ -2371,29 +2373,29 @@ hif_target_sleep_state_adjust(struct hif_softc *scn, wait_for_it = true; HIF_ERROR("%s: doing debug for invalid access, PCIe link is suspended", __func__); - CDF_ASSERT(0); + QDF_ASSERT(0); } if (sleep_ok) { - cdf_spin_lock_irqsave(&hif_state->keep_awake_lock); + qdf_spin_lock_irqsave(&hif_state->keep_awake_lock); hif_state->keep_awake_count--; if (hif_state->keep_awake_count == 0) { /* Allow sleep */ hif_state->verified_awake = false; - hif_state->sleep_ticks = cdf_system_ticks(); + hif_state->sleep_ticks = qdf_system_ticks(); } if (hif_state->fake_sleep == false) { /* Set the Fake Sleep */ hif_state->fake_sleep = true; /* Start the Sleep Timer */ - cdf_softirq_timer_cancel(&hif_state->sleep_timer); - cdf_softirq_timer_start(&hif_state->sleep_timer, + qdf_timer_stop(&hif_state->sleep_timer); + qdf_timer_start(&hif_state->sleep_timer, HIF_SLEEP_INACTIVITY_TIMER_PERIOD_MS); } - cdf_spin_unlock_irqrestore(&hif_state->keep_awake_lock); + qdf_spin_unlock_irqrestore(&hif_state->keep_awake_lock); } else { - cdf_spin_lock_irqsave(&hif_state->keep_awake_lock); + qdf_spin_lock_irqsave(&hif_state->keep_awake_lock); if (hif_state->fake_sleep) { hif_state->verified_awake = true; @@ -2407,7 +2409,7 @@ hif_target_sleep_state_adjust(struct hif_softc *scn, } } hif_state->keep_awake_count++; - cdf_spin_unlock_irqrestore(&hif_state->keep_awake_lock); + qdf_spin_unlock_irqrestore(&hif_state->keep_awake_lock); if (wait_for_it && !hif_state->verified_awake) { #define PCIE_SLEEP_ADJUST_TIMEOUT 8000 /* 8Ms */ @@ -2673,7 +2675,7 @@ void hif_target_sync(struct hif_softc *scn) PCIE_INTR_ENABLE_ADDRESS), PCIE_INTR_FIRMWARE_MASK); - cdf_mdelay(10); + qdf_mdelay(10); } if (wait_limit < 0) HIF_TRACE("%s: FW signal timed out", @@ -2696,9 +2698,9 @@ void hif_target_sync(struct hif_softc *scn) * @bdev: bus dev pointer * bid: bus id pointer * type: enum hif_enable_type such as HIF_ENABLE_TYPE_PROBE - * Return: CDF_STATUS + * Return: QDF_STATUS */ -CDF_STATUS hif_enable_bus(struct hif_softc *ol_sc, +QDF_STATUS hif_enable_bus(struct hif_softc *ol_sc, struct device *dev, void *bdev, const hif_bus_id *bid, enum hif_enable_type type) @@ -2716,7 +2718,7 @@ CDF_STATUS hif_enable_bus(struct hif_softc *ol_sc, if (!ol_sc) { HIF_ERROR("%s: hif_ctx is NULL", __func__); - return CDF_STATUS_E_NOMEM; + return QDF_STATUS_E_NOMEM; } HIF_TRACE("%s: con_mode = 0x%x, device_id = 0x%x", @@ -2787,7 +2789,7 @@ err_tgtstate: hif_disable_pci(sc); sc->pci_enabled = false; HIF_ERROR("%s: error, hif_disable_pci done", __func__); - return CDF_STATUS_E_ABORTED; + return QDF_STATUS_E_ABORTED; err_enable_pci: if (probe_again && (probe_again <= ATH_PCI_PROBE_RETRY_MAX)) { @@ -2796,7 +2798,7 @@ err_enable_pci: HIF_INFO("%s: pci reprobe", __func__); /* 10, 40, 90, 100, 100, ... */ delay_time = max(100, 10 * (probe_again * probe_again)); - cdf_mdelay(delay_time); + qdf_mdelay(delay_time); goto again; } return ret; @@ -2869,7 +2871,7 @@ int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx) return -EFAULT; } - pm_state = cdf_atomic_read(&sc->pm_state); + pm_state = qdf_atomic_read(&sc->pm_state); if (pm_state == HIF_PM_RUNTIME_STATE_ON || pm_state == HIF_PM_RUNTIME_STATE_NONE) { @@ -2888,7 +2890,7 @@ int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx) if (ret && ret != -EINPROGRESS) { sc->pm_stats.runtime_get_err++; HIF_ERROR("%s: Runtime Get PM Error in pm_state:%d ret: %d", - __func__, cdf_atomic_read(&sc->pm_state), ret); + __func__, qdf_atomic_read(&sc->pm_state), ret); } return ret; @@ -2910,7 +2912,7 @@ int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx) * This api will return a failure if runtime pm is stopped * This api will return failure if it would decrement the usage count below 0. * - * return: CDF_STATUS_SUCCESS if the put is performed + * return: QDF_STATUS_SUCCESS if the put is performed */ int hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx) { @@ -2928,7 +2930,7 @@ int hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx) usage_count = atomic_read(&sc->dev->power.usage_count); if (usage_count == 1) { - pm_state = cdf_atomic_read(&sc->pm_state); + pm_state = qdf_atomic_read(&sc->pm_state); if (pm_state == HIF_PM_RUNTIME_STATE_NONE) error = "Ignoring unexpected put when runtime pm is disabled"; @@ -3002,7 +3004,7 @@ static int __hif_pm_runtime_prevent_suspend(struct hif_pci_softc hif_sc->pm_stats.prevent_suspend++; HIF_ERROR("%s: in pm_state:%d ret: %d", __func__, - cdf_atomic_read(&hif_sc->pm_state), ret); + qdf_atomic_read(&hif_sc->pm_state), ret); return ret; } @@ -3029,7 +3031,7 @@ static int __hif_pm_runtime_allow_suspend(struct hif_pci_softc *hif_sc, * context->active should be active for allow suspend to happen * Handling this case here to prevent any failures. */ - if ((cdf_atomic_read(&hif_sc->pm_state) == HIF_PM_RUNTIME_STATE_NONE + if ((qdf_atomic_read(&hif_sc->pm_state) == HIF_PM_RUNTIME_STATE_NONE && usage_count == 1) || usage_count == 0) { hif_pci_runtime_pm_warn(hif_sc, "Allow without a prevent suspend"); @@ -3047,7 +3049,7 @@ static int __hif_pm_runtime_allow_suspend(struct hif_pci_softc *hif_sc, ret = hif_pm_runtime_put_auto(hif_sc->dev); HIF_ERROR("%s: in pm_state:%d ret: %d", __func__, - cdf_atomic_read(&hif_sc->pm_state), ret); + qdf_atomic_read(&hif_sc->pm_state), ret); hif_sc->pm_stats.allow_suspend++; return ret; @@ -3232,7 +3234,7 @@ int hif_pm_runtime_prevent_suspend_timeout(struct hif_opaque_softc *ol_sc, spin_unlock_irqrestore(&hif_sc->runtime_lock, flags); HIF_ERROR("%s: pm_state: %d delay: %dms ret: %d\n", __func__, - cdf_atomic_read(&hif_sc->pm_state), delay, ret); + qdf_atomic_read(&hif_sc->pm_state), delay, ret); return ret; } @@ -3250,7 +3252,7 @@ struct hif_pm_runtime_lock *hif_runtime_lock_init(const char *name) { struct hif_pm_runtime_lock *context; - context = cdf_mem_malloc(sizeof(*context)); + context = qdf_mem_malloc(sizeof(*context)); if (!context) { HIF_ERROR("%s: No memory for Runtime PM wakelock context\n", __func__); @@ -3294,7 +3296,7 @@ void hif_runtime_lock_deinit(struct hif_opaque_softc *hif_ctx, __hif_pm_runtime_allow_suspend(sc, context); spin_unlock_irqrestore(&sc->runtime_lock, flags); - cdf_mem_free(context); + qdf_mem_free(context); } #endif /* FEATURE_RUNTIME_PM */ diff --git a/hif/src/pcie/if_pci.h b/hif/src/pcie/if_pci.h index b9ec34a1f94c..5f573b28476c 100644 --- a/hif/src/pcie/if_pci.h +++ b/hif/src/pcie/if_pci.h @@ -126,11 +126,11 @@ struct hif_pci_softc { int irq_event; int cacheline_sz; u16 devid; - cdf_dma_addr_t soc_pcie_bar0; + qdf_dma_addr_t soc_pcie_bar0; struct hif_tasklet_entry tasklet_entries[HIF_MAX_TASKLET_NUM]; bool pci_enabled; - cdf_spinlock_t irq_lock; - cdf_work_t reschedule_tasklet_work; + qdf_spinlock_t irq_lock; + qdf_work_t reschedule_tasklet_work; uint32_t lcr_val; #ifdef FEATURE_RUNTIME_PM atomic_t pm_state; diff --git a/hif/src/snoc/hif_io32_snoc.h b/hif/src/snoc/hif_io32_snoc.h index 6b8107c24d9d..bc968dda4e5f 100644 --- a/hif/src/snoc/hif_io32_snoc.h +++ b/hif/src/snoc/hif_io32_snoc.h @@ -41,7 +41,7 @@ #include "hif.h" #include "regtable.h" #include "ce_reg.h" -#include "cdf_atomic.h" +#include "qdf_atomic.h" #include <soc/qcom/icnss.h> #include "hif_main.h" #include "hif_debug.h" diff --git a/hif/src/snoc/if_snoc.c b/hif/src/snoc/if_snoc.c index e5c04cd7cad0..fdb4463d2f70 100644 --- a/hif/src/snoc/if_snoc.c +++ b/hif/src/snoc/if_snoc.c @@ -97,7 +97,7 @@ void hif_disable_isr(struct hif_opaque_softc *hif_ctx) hif_nointrs(scn); ce_tasklet_kill(scn); - cdf_atomic_set(&scn->active_tasklet_cnt, 0); + qdf_atomic_set(&scn->active_tasklet_cnt, 0); } /** @@ -204,9 +204,9 @@ int hif_bus_get_context_size(void) * * Return: n/a */ -CDF_STATUS hif_bus_open(struct hif_softc *scn, enum ath_hal_bus_type bus_type) +QDF_STATUS hif_bus_open(struct hif_softc *scn, enum qdf_bus_type bus_type) { - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } /** @@ -245,9 +245,9 @@ int hif_get_target_type(struct hif_softc *ol_sc, struct device *dev, * @bid: bus id * @type: bus type * - * Return: CDF_STATUS + * Return: QDF_STATUS */ -CDF_STATUS hif_enable_bus(struct hif_softc *ol_sc, +QDF_STATUS hif_enable_bus(struct hif_softc *ol_sc, struct device *dev, void *bdev, const hif_bus_id *bid, enum hif_enable_type type) @@ -264,14 +264,14 @@ CDF_STATUS hif_enable_bus(struct hif_softc *ol_sc, if (!ol_sc) { HIF_ERROR("%s: hif_ctx is NULL", __func__); - return CDF_STATUS_E_NOMEM; + return QDF_STATUS_E_NOMEM; } ret = hif_get_target_type(ol_sc, dev, bdev, bid, &hif_type, &target_type); if (ret < 0) { HIF_ERROR("%s: invalid device id/revision_id", __func__); - return CDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } hif_register_tbl_attach(ol_sc, hif_type); @@ -280,7 +280,7 @@ CDF_STATUS hif_enable_bus(struct hif_softc *ol_sc, HIF_TRACE("%s: X - hif_type = 0x%x, target_type = 0x%x", __func__, hif_type, target_type); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } /** |
