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 /htc | |
| 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 'htc')
| -rw-r--r-- | htc/htc.c | 68 | ||||
| -rw-r--r-- | htc/htc_api.h | 247 | ||||
| -rw-r--r-- | htc/htc_debug.h | 10 | ||||
| -rw-r--r-- | htc/htc_internal.h | 72 | ||||
| -rw-r--r-- | htc/htc_packet.h | 78 | ||||
| -rw-r--r-- | htc/htc_recv.c | 36 | ||||
| -rw-r--r-- | htc/htc_send.c | 92 | ||||
| -rw-r--r-- | htc/htc_services.c | 10 |
8 files changed, 314 insertions, 299 deletions
diff --git a/htc/htc.c b/htc/htc.c index cd7dbf3b9d00..46b0aa420f4c 100644 --- a/htc/htc.c +++ b/htc/htc.c @@ -29,7 +29,7 @@ #include "htc_debug.h" #include "htc_internal.h" #include <cdf_nbuf.h> /* cdf_nbuf_t */ -#include <cdf_types.h> /* cdf_print */ +#include <qdf_types.h> /* qdf_print */ #include <hif.h> #include "epping_main.h" #include "hif_io32.h" @@ -69,16 +69,16 @@ static void destroy_htc_tx_ctrl_packet(HTC_PACKET *pPacket) cdf_nbuf_free(netbuf); } - cdf_mem_free(pPacket); + qdf_mem_free(pPacket); } -static HTC_PACKET *build_htc_tx_ctrl_packet(cdf_device_t osdev) +static HTC_PACKET *build_htc_tx_ctrl_packet(qdf_device_t osdev) { HTC_PACKET *pPacket = NULL; cdf_nbuf_t netbuf; do { - pPacket = (HTC_PACKET *) cdf_mem_malloc(sizeof(HTC_PACKET)); + pPacket = (HTC_PACKET *) qdf_mem_malloc(sizeof(HTC_PACKET)); if (NULL == pPacket) { break; } @@ -86,9 +86,9 @@ static HTC_PACKET *build_htc_tx_ctrl_packet(cdf_device_t osdev) netbuf = cdf_nbuf_alloc(osdev, HTC_CONTROL_BUFFER_SIZE, 20, 4, true); if (NULL == netbuf) { - cdf_mem_free(pPacket); + qdf_mem_free(pPacket); pPacket = NULL; - cdf_print("%s: nbuf alloc failed\n", __func__); + qdf_print("%s: nbuf alloc failed\n", __func__); break; } AR_DEBUG_PRINTF(ATH_DEBUG_TRC, @@ -158,13 +158,13 @@ static void htc_cleanup(HTC_TARGET *target) if (NULL == pPacket) { break; } - cdf_mem_free(pPacket); + qdf_mem_free(pPacket); } pPacket = target->pBundleFreeList; while (pPacket) { HTC_PACKET *pPacketTmp = (HTC_PACKET *) pPacket->ListLink.pNext; - cdf_mem_free(pPacket); + qdf_mem_free(pPacket); pPacket = pPacketTmp; } #ifdef TODO_FIXME @@ -178,21 +178,21 @@ static void htc_cleanup(HTC_TARGET *target) cdf_nbuf_free(netbuf); } - cdf_mem_free(pPacket); + qdf_mem_free(pPacket); } #endif - cdf_spinlock_destroy(&target->HTCLock); - cdf_spinlock_destroy(&target->HTCRxLock); - cdf_spinlock_destroy(&target->HTCTxLock); - cdf_spinlock_destroy(&target->HTCCreditLock); + qdf_spinlock_destroy(&target->HTCLock); + qdf_spinlock_destroy(&target->HTCRxLock); + qdf_spinlock_destroy(&target->HTCTxLock); + qdf_spinlock_destroy(&target->HTCCreditLock); /* free our instance */ - cdf_mem_free(target); + qdf_mem_free(target); } /* registered target arrival callback from the HIF layer */ -HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, cdf_device_t osdev) +HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, qdf_device_t osdev) { struct hif_msg_callbacks htcCallbacks; HTC_ENDPOINT *pEndpoint = NULL; @@ -207,7 +207,7 @@ HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, cdf_device_t osdev) A_REGISTER_MODULE_DEBUG_INFO(htc); - target = (HTC_TARGET *) cdf_mem_malloc(sizeof(HTC_TARGET)); + target = (HTC_TARGET *) qdf_mem_malloc(sizeof(HTC_TARGET)); if (target == NULL) { HTC_ERROR("%s: Unable to allocate memory", __func__); return NULL; @@ -216,10 +216,10 @@ HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, cdf_device_t osdev) A_MEMZERO(target, sizeof(HTC_TARGET)); htc_runtime_pm_init(target); - cdf_spinlock_init(&target->HTCLock); - cdf_spinlock_init(&target->HTCRxLock); - cdf_spinlock_init(&target->HTCTxLock); - cdf_spinlock_init(&target->HTCCreditLock); + qdf_spinlock_create(&target->HTCLock); + qdf_spinlock_create(&target->HTCRxLock); + qdf_spinlock_create(&target->HTCTxLock); + qdf_spinlock_create(&target->HTCCreditLock); do { A_MEMCPY(&target->HTCInitInfo, pInfo, sizeof(HTC_INIT_INFO)); @@ -232,7 +232,7 @@ HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, cdf_device_t osdev) for (i = 0; i < HTC_PACKET_CONTAINER_ALLOCATION; i++) { HTC_PACKET *pPacket = - (HTC_PACKET *) cdf_mem_malloc(sizeof(HTC_PACKET)); + (HTC_PACKET *) qdf_mem_malloc(sizeof(HTC_PACKET)); if (pPacket != NULL) { A_MEMZERO(pPacket, sizeof(HTC_PACKET)); free_htc_packet_container(target, pPacket); @@ -250,7 +250,7 @@ HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, cdf_device_t osdev) #endif /* setup HIF layer callbacks */ - cdf_mem_zero(&htcCallbacks, sizeof(struct hif_msg_callbacks)); + qdf_mem_zero(&htcCallbacks, sizeof(struct hif_msg_callbacks)); htcCallbacks.Context = target; htcCallbacks.rxCompletionHandler = htc_rx_completion_handler; htcCallbacks.txCompletionHandler = htc_tx_completion_handler; @@ -348,7 +348,7 @@ A_STATUS htc_setup_target_buffer_assignments(HTC_TARGET *target) * There is no WMI mesage exchanges between host and target * in endpoint ping case. * In host side, the endpoint ping driver is a Ethernet driver - * and it directly sits on HTC. Only HIF, HTC, CDF, ADF are + * and it directly sits on HTC. Only HIF, HTC, QDF, ADF are * used by the endpoint ping driver. There is no wifi stack * at all in host side also. For tx perf use case, * the user space mboxping app sends the raw packets to endpoint @@ -529,7 +529,7 @@ static void reset_endpoint_states(HTC_TARGET *target) pEndpoint->target = target; /* pEndpoint->TxCreditFlowEnabled = (A_BOOL)htc_credit_flow; */ pEndpoint->TxCreditFlowEnabled = (A_BOOL) 1; - cdf_atomic_init(&pEndpoint->TxProcessCount); + qdf_atomic_init(&pEndpoint->TxProcessCount); } } @@ -551,7 +551,7 @@ A_STATUS htc_start(HTC_HANDLE HTCHandle) pSendPacket = htc_alloc_control_tx_packet(target); if (NULL == pSendPacket) { AR_DEBUG_ASSERT(false); - cdf_print("%s: allocControlTxPacket failed\n", + qdf_print("%s: allocControlTxPacket failed\n", __func__); status = A_NO_MEMORY; break; @@ -658,8 +658,8 @@ void htc_stop(HTC_HANDLE HTCHandle) htc_flush_rx_hold_queue(target, pEndpoint); htc_flush_endpoint_tx(target, pEndpoint, HTC_TX_PACKET_TAG_ALL); if (pEndpoint->ul_is_polled) { - cdf_softirq_timer_cancel(&pEndpoint->ul_poll_timer); - cdf_softirq_timer_free(&pEndpoint->ul_poll_timer); + qdf_timer_stop(&pEndpoint->ul_poll_timer); + qdf_timer_free(&pEndpoint->ul_poll_timer); } } @@ -693,7 +693,7 @@ void htc_stop(HTC_HANDLE HTCHandle) */ void htc_runtime_pm_init(HTC_TARGET *target) { - cdf_create_work(&target->queue_kicker, htc_kick_queues, target); + qdf_create_work(0, &target->queue_kicker, htc_kick_queues, target); } /** @@ -706,11 +706,11 @@ void htc_runtime_pm_init(HTC_TARGET *target) */ int htc_runtime_suspend(void) { - ol_txrx_pdev_handle txrx_pdev = cds_get_context(CDF_MODULE_ID_TXRX); + ol_txrx_pdev_handle txrx_pdev = cds_get_context(QDF_MODULE_ID_TXRX); if (txrx_pdev == NULL) { HTC_ERROR("%s: txrx context null", __func__); - return CDF_STATUS_E_FAULT; + return QDF_STATUS_E_FAULT; } if (ol_txrx_get_tx_pending(txrx_pdev)) @@ -729,13 +729,13 @@ int htc_runtime_suspend(void) */ int htc_runtime_resume(void) { - HTC_HANDLE htc_ctx = cds_get_context(CDF_MODULE_ID_HTC); + HTC_HANDLE htc_ctx = cds_get_context(QDF_MODULE_ID_HTC); HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_ctx); if (target == NULL) return 0; - cdf_schedule_work(&target->queue_kicker); + qdf_sched_work(0, &target->queue_kicker); return 0; } @@ -866,9 +866,9 @@ void htc_cancel_deferred_target_sleep(void *context) * Return: None */ void htc_ipa_get_ce_resource(HTC_HANDLE htc_handle, - 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) { HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle); diff --git a/htc/htc_api.h b/htc/htc_api.h index f26f3d63368f..446aec328be9 100644 --- a/htc/htc_api.h +++ b/htc/htc_api.h @@ -33,7 +33,7 @@ #include "htc_packet.h" #include <htc.h> #include <htc_services.h> -#include <cdf_types.h> /* cdf_device_t */ +#include <qdf_types.h> /* qdf_device_t */ #ifdef __cplusplus extern "C" { @@ -51,11 +51,11 @@ typedef void *HTC_HANDLE; typedef A_UINT16 HTC_SERVICE_ID; -typedef void (*HTC_TARGET_FAILURE)(void *Instance, CDF_STATUS Status); +typedef void (*HTC_TARGET_FAILURE)(void *Instance, QDF_STATUS Status); typedef struct _HTC_INIT_INFO { void *pContext; /* context for target notifications */ - void (*TargetFailure)(void *Instance, CDF_STATUS Status); + void (*TargetFailure)(void *Instance, QDF_STATUS Status); void (*TargetSendSuspendComplete)(void *ctx); } HTC_INIT_INFO; @@ -151,18 +151,18 @@ typedef struct _HTC_EP_CALLBACKS { HTC_EP_RECV_ALLOC EpRecvAlloc; /* OPTIONAL recv allocation callback */ HTC_EP_RECV_ALLOC EpRecvAllocThresh; /* OPTIONAL recv allocation callback based on a threshold */ HTC_EP_SEND_PKT_COMP_MULTIPLE EpTxCompleteMultiple; /* OPTIONAL completion handler for multiple complete - indications (EpTxComplete must be NULL) */ + indications (EpTxComplete must be NULL) */ HTC_EP_RECV_PKT_MULTIPLE EpRecvPktMultiple; /* OPTIONAL completion handler for multiple - recv packet indications (EpRecv must be NULL) */ + recv packet indications (EpRecv must be NULL) */ HTC_EP_RESUME_TX_QUEUE ep_resume_tx_queue; int RecvAllocThreshold; /* if EpRecvAllocThresh is non-NULL, HTC will compare the - threshold value to the current recv packet length and invoke - the EpRecvAllocThresh callback to acquire a packet buffer */ + threshold value to the current recv packet length and invoke + the EpRecvAllocThresh callback to acquire a packet buffer */ int RecvRefillWaterMark; /* if a EpRecvRefill handler is provided, this value - can be used to set a trigger refill callback - when the recv queue drops below this value - if set to 0, the refill is only called when packets - are empty */ + can be used to set a trigger refill callback + when the recv queue drops below this value + if set to 0, the refill is only called when packets + are empty */ } HTC_EP_CALLBACKS; /* service connection information */ @@ -196,32 +196,32 @@ typedef struct _HTC_ENDPOINT_CREDIT_DIST { HTC_SERVICE_ID service_id; /* Service ID (set by HTC) */ HTC_ENDPOINT_ID Endpoint; /* endpoint for this distribution struct (set by HTC) */ A_UINT32 DistFlags; /* distribution flags, distribution function can - set default activity using SET_EP_ACTIVE() macro */ + set default activity using SET_EP_ACTIVE() macro */ int TxCreditsNorm; /* credits for normal operation, anything above this - indicates the endpoint is over-subscribed, this field - is only relevant to the credit distribution function */ + indicates the endpoint is over-subscribed, this field + is only relevant to the credit distribution function */ int TxCreditsMin; /* floor for credit distribution, this field is - only relevant to the credit distribution function */ + only relevant to the credit distribution function */ int TxCreditsAssigned; /* number of credits assigned to this EP, this field - is only relevant to the credit dist function */ + is only relevant to the credit dist function */ int TxCredits; /* current credits available, this field is used by - HTC to determine whether a message can be sent or - must be queued */ + HTC to determine whether a message can be sent or + must be queued */ int TxCreditsToDist; /* pending credits to distribute on this endpoint, this - is set by HTC when credit reports arrive. - The credit distribution functions sets this to zero - when it distributes the credits */ + is set by HTC when credit reports arrive. + The credit distribution functions sets this to zero + when it distributes the credits */ int TxCreditsSeek; /* this is the number of credits that the current pending TX - packet needs to transmit. This is set by HTC when - and endpoint needs credits in order to transmit */ + packet needs to transmit. This is set by HTC when + and endpoint needs credits in order to transmit */ int TxCreditSize; /* size in bytes of each credit (set by HTC) */ int TxCreditsPerMaxMsg; /* credits required for a maximum sized messages (set by HTC) */ void *pHTCReserved; /* reserved for HTC use */ int TxQueueDepth; /* current depth of TX queue , i.e. messages waiting for credits - This field is valid only when HTC_CREDIT_DIST_ACTIVITY_CHANGE - or HTC_CREDIT_DIST_SEND_COMPLETE is indicated on an endpoint - that has non-zero credits to recover - */ + This field is valid only when HTC_CREDIT_DIST_ACTIVITY_CHANGE + or HTC_CREDIT_DIST_SEND_COMPLETE is indicated on an endpoint + that has non-zero credits to recover + */ } HTC_ENDPOINT_CREDIT_DIST; #define HTC_EP_ACTIVE ((A_UINT32) (1u << 31)) @@ -235,11 +235,11 @@ typedef struct _HTC_ENDPOINT_CREDIT_DIST { * there are mandatory and optional codes that must be handled */ typedef enum _HTC_CREDIT_DIST_REASON { HTC_CREDIT_DIST_SEND_COMPLETE = 0, /* credits available as a result of completed - send operations (MANDATORY) resulting in credit reports */ + send operations (MANDATORY) resulting in credit reports */ HTC_CREDIT_DIST_ACTIVITY_CHANGE = 1, /* a change in endpoint activity occured (OPTIONAL) */ HTC_CREDIT_DIST_SEEK_CREDITS, /* an endpoint needs to "seek" credits (OPTIONAL) */ HTC_DUMP_CREDIT_STATE /* for debugging, dump any state information that is kept by - the distribution function */ + the distribution function */ } HTC_CREDIT_DIST_REASON; typedef void (*HTC_CREDIT_DIST_CALLBACK)(void *Context, @@ -263,7 +263,7 @@ typedef enum _HTC_ENDPOINT_STAT_ACTION { typedef struct _HTC_ENDPOINT_STATS { A_UINT32 TxPosted; /* number of TX packets posted to the endpoint */ A_UINT32 TxCreditLowIndications; /* number of times the host set the credit-low flag in a send message on - this endpoint */ + this endpoint */ A_UINT32 TxIssued; /* running count of total TX packets issued */ A_UINT32 TxPacketsBundled; /* running count of TX packets that were issued in bundles */ A_UINT32 TxBundles; /* running count of TX bundles that were issued */ @@ -279,7 +279,7 @@ typedef struct _HTC_ENDPOINT_STATS { A_UINT32 TxCreditsReturned; /* count of credits returned */ A_UINT32 RxReceived; /* count of RX packets received */ A_UINT32 RxLookAheads; /* count of lookahead records - found in messages received on this endpoint */ + found in messages received on this endpoint */ A_UINT32 RxPacketsBundled; /* count of recv packets received in a bundle */ A_UINT32 RxBundleLookAheads; /* count of number of bundled lookaheads */ A_UINT32 RxBundleIndFromHdr; /* count of the number of bundle indications from the HTC header */ @@ -292,7 +292,7 @@ typedef struct _HTC_ENDPOINT_STATS { @desc: Create an instance of HTC over the underlying HIF device @function name: htc_create @input: HifDevice - hif device handle, - pInfo - initialization information + pInfo - initialization information @output: @return: HTC_HANDLE on success, NULL on failure @notes: @@ -300,7 +300,7 @@ typedef struct _HTC_ENDPOINT_STATS { @see also: htc_destroy +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ HTC_HANDLE htc_create(void *HifDevice, - HTC_INIT_INFO *pInfo, cdf_device_t osdev); + HTC_INIT_INFO *pInfo, qdf_device_t osdev); /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @desc: Get the underlying HIF device handle @function name: htc_get_hif_device @@ -316,18 +316,19 @@ void *htc_get_hif_device(HTC_HANDLE HTCHandle); @desc: Set credit distribution parameters @function name: htc_set_credit_distribution @input: HTCHandle - HTC handle - pCreditDistCont - caller supplied context to pass into distribution functions - CreditDistFunc - Distribution function callback - CreditDistInit - Credit Distribution initialization callback - ServicePriorityOrder - Array containing list of service IDs, lowest index is highest - priority - ListLength - number of elements in ServicePriorityOrder + pCreditDistCont - caller supplied context to pass into distribution functions + CreditDistFunc - Distribution function callback + CreditDistInit - Credit Distribution initialization callback + ServicePriorityOrder - Array containing list of service IDs, lowest index + is highestpriority + ListLength - number of elements in ServicePriorityOrder @output: @return: - @notes: The user can set a custom credit distribution function to handle special requirements - for each endpoint. A default credit distribution routine can be used by setting - CreditInitFunc to NULL. The default credit distribution is only provided for simple - "fair" credit distribution without regard to any prioritization. + @notes : The user can set a custom credit distribution function to handle + special requirementsfor each endpoint. A default credit distribution + routine can be used by setting CreditInitFunc to NULL. The default + credit distribution is only provided for simple "fair" credit distribution + without regard to any prioritization. @example: @see also: @@ -345,8 +346,8 @@ void htc_set_credit_distribution(HTC_HANDLE HTCHandle, @output: @return: @notes: This API blocks until the target responds with an HTC ready message. - The caller should not connect services until the target has indicated it is - ready. + The caller should not connect services until the target has indicated it is + ready. @example: @see also: htc_connect_service +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -357,11 +358,12 @@ A_STATUS htc_wait_target(HTC_HANDLE HTCHandle); @input: HTCHandle - HTC handle @output: @return: - @notes: This API indicates to the target that the service connection phase is complete - and the target can freely start all connected services. This API should only be - called AFTER all service connections have been made. TCStart will issue a - SETUP_COMPLETE message to the target to indicate that all service connections - have been made and the target can start communicating over the endpoints. + @notes: This API indicates to the target that the service connection phase + is completeand the target can freely start all connected services. This + API should only be called AFTER all service connections have been made. + TCStart will issue a SETUP_COMPLETE message to the target to indicate that + all service connections have been made and the target can start + communicating over the endpoints. @example: @see also: htc_connect_service +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -370,12 +372,12 @@ A_STATUS htc_start(HTC_HANDLE HTCHandle); @desc: Add receive packet to HTC @function name: htc_add_receive_pkt @input: HTCHandle - HTC handle - pPacket - HTC receive packet to add + pPacket - HTC receive packet to add @output: @return: A_OK on success - @notes: user must supply HTC packets for capturing incomming HTC frames. The caller - must initialize each HTC packet using the SET_HTC_PACKET_INFO_RX_REFILL() - macro. + @notes: user must supply HTC packets for capturing incomming HTC frames. + The caller must initialize each HTC packet using the + SET_HTC_PACKET_INFO_RX_REFILL() macro. @example: @see also: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -384,11 +386,11 @@ A_STATUS htc_add_receive_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket); @desc: Connect to an HTC service @function name: htc_connect_service @input: HTCHandle - HTC handle - pReq - connection details + pReq - connection details @output: pResp - connection response @return: - @notes: Service connections must be performed before htc_start. User provides callback handlers - for various endpoint events. + @notes: Service connections must be performed before htc_start. + User provides callback handlersfor various endpoint events. @example: @see also: htc_start +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -399,8 +401,8 @@ A_STATUS htc_connect_service(HTC_HANDLE HTCHandle, @desc: HTC register log dump @function name: htc_dump @input: HTCHandle - HTC handle - CmdId - Log command - start - start/print logs + CmdId - Log command + start - start/print logs @output: @return: @notes: Register logs will be started/printed. @@ -414,12 +416,12 @@ void htc_dump(HTC_HANDLE HTCHandle, uint8_t CmdId, bool start); @desc: Send an HTC packet @function name: htc_send_pkt @input: HTCHandle - HTC handle - pPacket - packet to send + pPacket - packet to send @output: @return: A_OK @notes: Caller must initialize packet using SET_HTC_PACKET_INFO_TX() macro. - This interface is fully asynchronous. On error, HTC SendPkt will - call the registered Endpoint callback to cleanup the packet. + This interface is fully asynchronous. On error, HTC SendPkt will + call the registered Endpoint callback to cleanup the packet. @example: @see also: htc_flush_endpoint +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -428,15 +430,15 @@ A_STATUS htc_send_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket); @desc: Send an HTC packet containing a tx descriptor and data @function name: htc_send_data_pkt @input: HTCHandle - HTC handle - pPacket - packet to send + pPacket - packet to send @output: @return: A_OK @notes: Caller must initialize packet using SET_HTC_PACKET_INFO_TX() macro. - Caller must provide headroom in an initial fragment added to the - network buffer to store a HTC_FRAME_HDR. - This interface is fully asynchronous. On error, htc_send_data_pkt will - call the registered Endpoint EpDataTxComplete callback to cleanup - the packet. + Caller must provide headroom in an initial fragment added to the + network buffer to store a HTC_FRAME_HDR. + This interface is fully asynchronous. On error, htc_send_data_pkt will + call the registered Endpoint EpDataTxComplete callback to cleanup + the packet. @example: @see also: htc_send_pkt +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -454,7 +456,7 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket, @output: @return: @notes: All receive and pending TX packets will - be flushed. + be flushed. @example: @see also: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -466,7 +468,7 @@ void htc_flush_surprise_remove(HTC_HANDLE HTCHandle); @output: @return: @notes: HTC communications is halted. All receive and pending TX packets will - be flushed. + be flushed. @example: @see also: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -486,12 +488,12 @@ void htc_destroy(HTC_HANDLE HTCHandle); @desc: Flush pending TX packets @function name: htc_flush_endpoint @input: HTCHandle - HTC handle - Endpoint - Endpoint to flush - Tag - flush tag + Endpoint - Endpoint to flush + Tag - flush tag @output: @return: @notes: The Tag parameter is used to selectively flush packets with matching tags. - The value of 0 forces all packets to be flush regardless of tag. + The value of 0 forces all packets to be flush regardless of tag. @example: @see also: htc_send_pkt +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -512,12 +514,12 @@ void htc_dump_credit_states(HTC_HANDLE HTCHandle); @desc: Indicate a traffic activity change on an endpoint @function name: htc_indicate_activity_change @input: HTCHandle - HTC handle - Endpoint - endpoint in which activity has changed - Active - true if active, false if it has become inactive + Endpoint - endpoint in which activity has changed + Active - true if active, false if it has become inactive @output: @return: @notes: This triggers the registered credit distribution function to - re-adjust credits for active/inactive endpoints. + re-adjust credits for active/inactive endpoints. @example: @see also: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -528,24 +530,26 @@ void htc_indicate_activity_change(HTC_HANDLE HTCHandle, @desc: Get endpoint statistics @function name: htc_get_endpoint_statistics @input: HTCHandle - HTC handle - Endpoint - Endpoint identifier - Action - action to take with statistics + Endpoint - Endpoint identifier + Action - action to take with statistics @output: - pStats - statistics that were sampled (can be NULL if Action is HTC_EP_STAT_CLEAR) + pStats - statistics that were sampled (can be NULL if Action is HTC_EP_STAT_CLEAR) @return: true if statistics profiling is enabled, otherwise false. - @notes: Statistics is a compile-time option and this function may return false - if HTC is not compiled with profiling. + @notes : Statistics is a compile-time option and this function may return + false if HTC is not compiled with profiling. + + The caller can specify the statistic "action" to take when sampling + the statistics. This includes : - The caller can specify the statistic "action" to take when sampling - the statistics. This includes: + HTC_EP_STAT_SAMPLE : The pStats structure is filled with the current + values. + HTC_EP_STAT_SAMPLE_AND_CLEAR : The structure is filled and the current + statisticsare cleared. - HTC_EP_STAT_SAMPLE: The pStats structure is filled with the current values. - HTC_EP_STAT_SAMPLE_AND_CLEAR: The structure is filled and the current statistics - are cleared. - HTC_EP_STAT_CLEA : the statistics are cleared, the called can pass a NULL value for - pStats + HTC_EP_STAT_CLEA : the statistics are cleared, the called can pass a NULL + value forpStats @example: @see also: @@ -562,12 +566,13 @@ A_BOOL htc_get_endpoint_statistics(HTC_HANDLE HTCHandle, @output: @return: @notes: - HTC will block the receiver if the EpRecvAlloc callback fails to provide a packet. - The caller can use this API to indicate to HTC when resources (buffers) are available - such that the receiver can be unblocked and HTC may re-attempt fetching the pending message. + HTC will block the receiver if the EpRecvAlloc callback fails to provide a + packet. The caller can use this API to indicate to HTC when resources + (buffers) are available such that the receiver can be unblocked and HTC + may re-attempt fetching the pending message. - This API is not required if the user uses the EpRecvRefill callback or uses the HTCAddReceivePacket() - API to recycle or provide receive packets to HTC. + This API is not required if the user uses the EpRecvRefill callback or uses + the HTCAddReceivePacket()API to recycle or provide receive packets to HTC. @example: @see also: @@ -578,17 +583,17 @@ void htc_unblock_recv(HTC_HANDLE HTCHandle); @desc: send a series of HTC packets @function name: htc_send_pkts_multiple @input: HTCHandle - HTC handle - pPktQueue - local queue holding packets to send + pPktQueue - local queue holding packets to send @output: @return: A_OK @notes: Caller must initialize each packet using SET_HTC_PACKET_INFO_TX() macro. - The queue must only contain packets directed at the same endpoint. - Caller supplies a pointer to an HTC_PACKET_QUEUE structure holding the TX packets in FIFO order. - This API will remove the packets from the pkt queue and place them into the HTC Tx Queue - and bundle messages where possible. - The caller may allocate the pkt queue on the stack to hold the packets. - This interface is fully asynchronous. On error, htc_send_pkts will - call the registered Endpoint callback to cleanup the packet. + The queue must only contain packets directed at the same endpoint. + Caller supplies a pointer to an HTC_PACKET_QUEUE structure holding the TX packets in FIFO order. + This API will remove the packets from the pkt queue and place them into the HTC Tx Queue + and bundle messages where possible. + The caller may allocate the pkt queue on the stack to hold the packets. + This interface is fully asynchronous. On error, htc_send_pkts will + call the registered Endpoint callback to cleanup the packet. @example: @see also: htc_flush_endpoint +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -599,16 +604,16 @@ A_STATUS htc_send_pkts_multiple(HTC_HANDLE HTCHandle, @desc: Add multiple receive packets to HTC @function name: htc_add_receive_pkt_multiple @input: HTCHandle - HTC handle - pPktQueue - HTC receive packet queue holding packets to add + pPktQueue - HTC receive packet queue holding packets to add @output: @return: A_OK on success @notes: user must supply HTC packets for capturing incomming HTC frames. The caller - must initialize each HTC packet using the SET_HTC_PACKET_INFO_RX_REFILL() - macro. The queue must only contain recv packets for the same endpoint. - Caller supplies a pointer to an HTC_PACKET_QUEUE structure holding the recv packet. - This API will remove the packets from the pkt queue and place them into internal - recv packet list. - The caller may allocate the pkt queue on the stack to hold the packets. + must initialize each HTC packet using the SET_HTC_PACKET_INFO_RX_REFILL() + macro. The queue must only contain recv packets for the same endpoint. + Caller supplies a pointer to an HTC_PACKET_QUEUE structure holding the recv packet. + This API will remove the packets from the pkt queue and place them into internal + recv packet list. + The caller may allocate the pkt queue on the stack to hold the packets. @example: @see also: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -619,7 +624,7 @@ A_STATUS htc_add_receive_pkt_multiple(HTC_HANDLE HTCHandle, @desc: Check if an endpoint is marked active @function name: htc_is_endpoint_active @input: HTCHandle - HTC handle - Endpoint - endpoint to check for active state + Endpoint - endpoint to check for active state @output: @return: returns true if Endpoint is Active @notes: @@ -633,7 +638,7 @@ A_BOOL htc_is_endpoint_active(HTC_HANDLE HTCHandle, @desc: Get the number of recv buffers currently queued into an HTC endpoint @function name: htc_get_num_recv_buffers @input: HTCHandle - HTC handle - Endpoint - endpoint to check + Endpoint - endpoint to check @output: @return: returns number of buffers in queue @notes: @@ -647,7 +652,7 @@ int htc_get_num_recv_buffers(HTC_HANDLE HTCHandle, @desc: Set the target failure handling callback in HTC layer @function name: htc_set_target_failure_callback @input: HTCHandle - HTC handle - Callback - target failure handling callback + Callback - target failure handling callback @output: @return: @notes: @@ -668,14 +673,16 @@ A_STATUS HTCWaitForPendingRecv(HTC_HANDLE HTCHandle, struct ol_ath_htc_stats *ieee80211_ioctl_get_htc_stats(HTC_HANDLE HTCHandle); -#ifdef HIF_USB -#define HTCReturnReceivePkt(target,p,osbuf) \ - A_NETBUF_FREE(osbuf); \ - if(p->Status == A_CLONE) { \ - cdf_mem_free(p); \ - } +#ifdef HIF_USB +#define HTCReturnReceivePkt(target, p, osbuf) \ + do { \ + A_NETBUF_FREE(osbuf); \ + if (p->Status == A_CLONE) { \ + qdf_mem_free(p); \ + } \ + } while (0) #else -#define HTCReturnReceivePkt(target,p,osbuf) htc_add_receive_pkt(target,p) +#define HTCReturnReceivePkt(target, p, osbuf) htc_add_receive_pkt(target, p) #endif #ifdef WLAN_FEATURE_FASTPATH @@ -708,9 +715,9 @@ void htc_vote_link_down(HTC_HANDLE HTCHandle); void htc_vote_link_up(HTC_HANDLE HTCHandle); #ifdef IPA_OFFLOAD void htc_ipa_get_ce_resource(HTC_HANDLE htc_handle, - 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 #define htc_ipa_get_ce_resource(htc_handle, \ ce_sr_base_paddr, \ diff --git a/htc/htc_debug.h b/htc/htc_debug.h index fe0c8496f813..c3c0a7ae8a4b 100644 --- a/htc/htc_debug.h +++ b/htc/htc_debug.h @@ -30,7 +30,7 @@ #define ATH_MODULE_NAME htc #include "a_debug.h" -#include "cdf_trace.h" +#include "qdf_trace.h" /* ------- Debug related stuff ------- */ @@ -40,11 +40,11 @@ #define ATH_DEBUG_DUMP ATH_DEBUG_MAKE_MODULE_MASK(3) #define ATH_DEBUG_SETUP ATH_DEBUG_MAKE_MODULE_MASK(4) #define HTC_ERROR(args ...) \ - CDF_TRACE(CDF_MODULE_ID_HTC, CDF_TRACE_LEVEL_ERROR, ## args) + QDF_TRACE(QDF_MODULE_ID_HTC, QDF_TRACE_LEVEL_ERROR, ## args) #define HTC_WARN(args ...) \ - CDF_TRACE(CDF_MODULE_ID_HTC, CDF_TRACE_LEVEL_WARN, ## args) + QDF_TRACE(QDF_MODULE_ID_HTC, QDF_TRACE_LEVEL_WARN, ## args) #define HTC_INFO(args ...) \ - CDF_TRACE(CDF_MODULE_ID_HTC, CDF_TRACE_LEVEL_INFO, ## args) + QDF_TRACE(QDF_MODULE_ID_HTC, QDF_TRACE_LEVEL_INFO, ## args) #define HTC_TRACE(args ...) \ - CDF_TRACE(CDF_MODULE_ID_HTC, CDF_TRACE_LEVEL_DEBUG, ## args) + QDF_TRACE(QDF_MODULE_ID_HTC, QDF_TRACE_LEVEL_DEBUG, ## args) #endif /*HTC_DEBUG_H_ */ diff --git a/htc/htc_internal.h b/htc/htc_internal.h index 9a69036a28e8..638d03b27eab 100644 --- a/htc/htc_internal.h +++ b/htc/htc_internal.h @@ -36,10 +36,10 @@ extern "C" { #include "a_types.h" #include "osapi_linux.h" #include <cdf_nbuf.h> -#include <cdf_types.h> -#include <cdf_lock.h> -#include <cdf_softirq_timer.h> -#include <cdf_atomic.h> +#include <qdf_types.h> +#include <qdf_lock.h> +#include <qdf_timer.h> +#include <qdf_atomic.h> #include "hif.h" #include <htc.h> #include "htc_api.h" @@ -105,23 +105,23 @@ typedef struct _HTC_ENDPOINT { HTC_EP_CALLBACKS EpCallBacks; /* callbacks associated with this endpoint */ HTC_PACKET_QUEUE TxQueue; /* HTC frame buffer TX queue */ int MaxTxQueueDepth; /* max depth of the TX queue before we need to - call driver's full handler */ + call driver's full handler */ int MaxMsgLength; /* max length of endpoint message */ uint8_t UL_PipeID; uint8_t DL_PipeID; int ul_is_polled; /* Need to call HIF to get tx completion callbacks? */ - cdf_softirq_timer_t ul_poll_timer; + qdf_timer_t ul_poll_timer; int ul_poll_timer_active; int ul_outstanding_cnt; int dl_is_polled; /* Need to call HIF to fetch rx? (Not currently supported.) */ #if 0 /* not currently supported */ - cdf_softirq_timer_t dl_poll_timer; + qdf_timer_t dl_poll_timer; #endif HTC_PACKET_QUEUE TxLookupQueue; /* lookup queue to match netbufs to htc packets */ HTC_PACKET_QUEUE RxBufferHoldQueue; /* temporary hold queue for back compatibility */ A_UINT8 SeqNo; /* TX seq no (helpful) for debugging */ - cdf_atomic_t TxProcessCount; /* serialization */ + qdf_atomic_t TxProcessCount; /* serialization */ struct _HTC_TARGET *target; int TxCredits; /* TX credits available on this endpoint */ int TxCreditSize; /* size in bytes of each credit (set by HTC) */ @@ -155,10 +155,10 @@ enum ol_ath_htc_pkt_ecodes { typedef struct _HTC_TARGET { struct hif_opaque_softc *hif_dev; HTC_ENDPOINT endpoint[ENDPOINT_MAX]; - cdf_spinlock_t HTCLock; - cdf_spinlock_t HTCRxLock; - cdf_spinlock_t HTCTxLock; - cdf_spinlock_t HTCCreditLock; + qdf_spinlock_t HTCLock; + qdf_spinlock_t HTCRxLock; + qdf_spinlock_t HTCTxLock; + qdf_spinlock_t HTCCreditLock; A_UINT32 HTCStateFlags; void *host_handle; HTC_INIT_INFO HTCInitInfo; @@ -166,7 +166,7 @@ typedef struct _HTC_TARGET { HTC_PACKET_QUEUE ControlBufferTXFreeList; A_UINT8 CtrlResponseBuffer[HTC_MAX_CONTROL_MESSAGE_LENGTH]; int CtrlResponseLength; - cdf_event_t ctrl_response_valid; + qdf_event_t ctrl_response_valid; A_BOOL CtrlResponseProcessing; int TotalTransmitCredits; HTC_SERVICE_TX_CREDIT_ALLOCATION @@ -178,13 +178,13 @@ typedef struct _HTC_TARGET { A_UINT32 CurRxSgTotalLen; /* current total length */ A_UINT32 ExpRxSgTotalLen; /* expected total length */ #endif - cdf_device_t osdev; + qdf_device_t osdev; struct ol_ath_htc_stats htc_pkt_stats; HTC_PACKET *pBundleFreeList; A_UINT32 ce_send_cnt; A_UINT32 TX_comp_cnt; A_UINT8 MaxMsgsPerHTCBundle; - cdf_work_t queue_kicker; + qdf_work_t queue_kicker; } HTC_TARGET; #define HTC_ENABLE_BUNDLE(target) (target->MaxMsgsPerHTCBundle > 1) @@ -197,14 +197,14 @@ typedef struct _HTC_TARGET { #define HTC_STATE_STOPPING (1 << 0) #define HTC_STOPPING(t) ((t)->HTCStateFlags & HTC_STATE_STOPPING) -#define LOCK_HTC(t) cdf_spin_lock_bh(&(t)->HTCLock); -#define UNLOCK_HTC(t) cdf_spin_unlock_bh(&(t)->HTCLock); -#define LOCK_HTC_RX(t) cdf_spin_lock_bh(&(t)->HTCRxLock); -#define UNLOCK_HTC_RX(t) cdf_spin_unlock_bh(&(t)->HTCRxLock); -#define LOCK_HTC_TX(t) cdf_spin_lock_bh(&(t)->HTCTxLock); -#define UNLOCK_HTC_TX(t) cdf_spin_unlock_bh(&(t)->HTCTxLock); -#define LOCK_HTC_CREDIT(t) cdf_spin_lock_bh(&(t)->HTCCreditLock); -#define UNLOCK_HTC_CREDIT(t) cdf_spin_unlock_bh(&(t)->HTCCreditLock); +#define LOCK_HTC(t) qdf_spin_lock_bh(&(t)->HTCLock); +#define UNLOCK_HTC(t) qdf_spin_unlock_bh(&(t)->HTCLock); +#define LOCK_HTC_RX(t) qdf_spin_lock_bh(&(t)->HTCRxLock); +#define UNLOCK_HTC_RX(t) qdf_spin_unlock_bh(&(t)->HTCRxLock); +#define LOCK_HTC_TX(t) qdf_spin_lock_bh(&(t)->HTCTxLock); +#define UNLOCK_HTC_TX(t) qdf_spin_unlock_bh(&(t)->HTCTxLock); +#define LOCK_HTC_CREDIT(t) qdf_spin_lock_bh(&(t)->HTCCreditLock); +#define UNLOCK_HTC_CREDIT(t) qdf_spin_unlock_bh(&(t)->HTCCreditLock); #define GET_HTC_TARGET_FROM_HANDLE(hnd) ((HTC_TARGET *)(hnd)) @@ -213,17 +213,23 @@ typedef struct _HTC_TARGET { #define HTC_POLL_CLEANUP_PERIOD_MS 10 /* milliseconds */ /* Macro to Increment the HTC_PACKET_ERRORS for Tx.*/ -#define OL_ATH_HTC_PKT_ERROR_COUNT_INCR(_target,_ecode) \ +#define OL_ATH_HTC_PKT_ERROR_COUNT_INCR(_target, _ecode) \ do { \ - if(_ecode==GET_HTC_PKT_Q_FAIL) (_target->htc_pkt_stats.htc_get_pkt_q_fail_count)+=1; \ - if(_ecode==HTC_PKT_Q_EMPTY) (_target->htc_pkt_stats.htc_pkt_q_empty_count)+=1; \ - if(_ecode==HTC_SEND_Q_EMPTY) (_target->htc_pkt_stats.htc_send_q_empty_count)+=1; \ - } while(0); + if (_ecode == GET_HTC_PKT_Q_FAIL) \ + (_target->htc_pkt_stats.htc_get_pkt_q_fail_count) += 1 \ + ; \ + if (_ecode == HTC_PKT_Q_EMPTY) \ + (_target->htc_pkt_stats.htc_pkt_q_empty_count) += 1 \ + ; \ + if (_ecode == HTC_SEND_Q_EMPTY) \ + (_target->htc_pkt_stats.htc_send_q_empty_count) += 1 \ + ; \ + } while (0); /* internal HTC functions */ -CDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf, +QDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf, uint8_t pipeID); -CDF_STATUS htc_tx_completion_handler(void *Context, cdf_nbuf_t netbuf, +QDF_STATUS htc_tx_completion_handler(void *Context, cdf_nbuf_t netbuf, unsigned int transferID, uint32_t toeplitz_hash_result); HTC_PACKET *allocate_htc_bundle_packet(HTC_TARGET *target); @@ -244,7 +250,7 @@ void htc_control_rx_complete(void *Context, HTC_PACKET *pPacket); void htc_process_credit_rpt(HTC_TARGET *target, HTC_CREDIT_REPORT *pRpt, int NumEntries, HTC_ENDPOINT_ID FromEndpoint); -void htc_fw_event_handler(void *context, CDF_STATUS status); +void htc_fw_event_handler(void *context, QDF_STATUS status); void htc_send_complete_check_cleanup(void *context); void htc_runtime_pm_init(HTC_TARGET *target); void htc_kick_queues(void *context); @@ -256,7 +262,7 @@ static inline void htc_send_complete_poll_timer_stop(HTC_ENDPOINT * pEndpoint) { LOCK_HTC_TX(pEndpoint->target); if (pEndpoint->ul_poll_timer_active) { - /* cdf_softirq_timer_cancel(&pEndpoint->ul_poll_timer); */ + /* qdf_timer_stop(&pEndpoint->ul_poll_timer); */ pEndpoint->ul_poll_timer_active = 0; } UNLOCK_HTC_TX(pEndpoint->target); @@ -268,7 +274,7 @@ static inline void htc_send_complete_poll_timer_start(HTC_ENDPOINT * if (pEndpoint->ul_outstanding_cnt && !pEndpoint->ul_poll_timer_active) { /* - cdf_softirq_timer_start( + qdf_timer_start( &pEndpoint->ul_poll_timer, HTC_POLL_CLEANUP_PERIOD_MS); */ pEndpoint->ul_poll_timer_active = 1; diff --git a/htc/htc_packet.h b/htc/htc_packet.h index ca3698f019b7..9e8993e017a3 100644 --- a/htc/htc_packet.h +++ b/htc/htc_packet.h @@ -95,11 +95,11 @@ typedef struct _HTC_PACKET { void *pPktContext; /* caller's per packet specific context */ A_UINT8 *pBufferStart; /* the true buffer start , the caller can - store the real buffer start here. In - receive callbacks, the HTC layer sets pBuffer - to the start of the payload past the header. This - field allows the caller to reset pBuffer when it - recycles receive packets back to HTC */ + store the real buffer start here. In + receive callbacks, the HTC layer sets pBuffer + to the start of the payload past the header. This + field allows the caller to reset pBuffer when it + recycles receive packets back to HTC */ /* * Pointer to the start of the buffer. In the transmit * direction this points to the start of the payload. In the @@ -122,40 +122,40 @@ typedef struct _HTC_PACKET { HTC_PACKET_COMPLETION Completion; /* completion */ void *pContext; /* HTC private completion context */ void *pNetBufContext; /* optimization for network-oriented data, the HTC packet - can pass the network buffer corresponding to the HTC packet - lower layers may optimized the transfer knowing this is - a network buffer */ + can pass the network buffer corresponding to the HTC packet + lower layers may optimized the transfer knowing this is + a network buffer */ } HTC_PACKET; -#define COMPLETE_HTC_PACKET(p,status) \ +#define COMPLETE_HTC_PACKET(p, status) \ { \ (p)->Status = (status); \ - (p)->Completion((p)->pContext,(p)); \ + (p)->Completion((p)->pContext, (p)); \ } -#define INIT_HTC_PACKET_INFO(p,b,len) \ +#define INIT_HTC_PACKET_INFO(p, b, len) \ { \ (p)->pBufferStart = (b); \ (p)->BufferLength = (len); \ } /* macro to set an initial RX packet for refilling HTC */ -#define SET_HTC_PACKET_INFO_RX_REFILL(p,c,b,len,ep) \ - { \ +#define SET_HTC_PACKET_INFO_RX_REFILL(p, c, b, len, ep) \ + do { \ (p)->pPktContext = (c); \ (p)->pBuffer = (b); \ (p)->pBufferStart = (b); \ (p)->BufferLength = (len); \ (p)->Endpoint = (ep); \ - } + } while (0) /* fast macro to recycle an RX packet that will be re-queued to HTC */ #define HTC_PACKET_RESET_RX(p) \ { (p)->pBuffer = (p)->pBufferStart; (p)->ActualLength = 0; } /* macro to set packet parameters for TX */ -#define SET_HTC_PACKET_INFO_TX(p,c,b,len,ep,tag) \ - { \ +#define SET_HTC_PACKET_INFO_TX(p, c, b, len, ep, tag) \ + do { \ (p)->pPktContext = (c); \ (p)->pBuffer = (b); \ (p)->ActualLength = (len); \ @@ -163,10 +163,12 @@ typedef struct _HTC_PACKET { (p)->PktInfo.AsTx.Tag = (tag); \ (p)->PktInfo.AsTx.Flags = 0; \ (p)->PktInfo.AsTx.SendFlags = 0; \ - } + } while (0) -#define SET_HTC_PACKET_NET_BUF_CONTEXT(p,nb) \ - (p)->pNetBufContext = (nb) +#define SET_HTC_PACKET_NET_BUF_CONTEXT(p, nb) \ + do { \ + (p)->pNetBufContext = (nb); \ + } while (0) #define GET_HTC_PACKET_NET_BUF_CONTEXT(p) (p)->pNetBufContext @@ -179,25 +181,25 @@ typedef struct _HTC_PACKET_QUEUE { /* initialize queue */ #define INIT_HTC_PACKET_QUEUE(pQ) \ { \ - DL_LIST_INIT(& (pQ)->QueueHead); \ + DL_LIST_INIT(&(pQ)->QueueHead); \ (pQ)->Depth = 0; \ } /* enqueue HTC packet to the tail of the queue */ -#define HTC_PACKET_ENQUEUE(pQ,p) \ - { dl_list_insert_tail(& (pQ)->QueueHead,& (p)->ListLink); \ - (pQ)->Depth ++; \ +#define HTC_PACKET_ENQUEUE(pQ, p) \ + { dl_list_insert_tail(&(pQ)->QueueHead, &(p)->ListLink); \ + (pQ)->Depth++; \ } /* enqueue HTC packet to the tail of the queue */ -#define HTC_PACKET_ENQUEUE_TO_HEAD(pQ,p) \ - { dl_list_insert_head(& (pQ)->QueueHead,& (p)->ListLink); \ - (pQ)->Depth ++; \ +#define HTC_PACKET_ENQUEUE_TO_HEAD(pQ, p) \ + { dl_list_insert_head(&(pQ)->QueueHead, &(p)->ListLink); \ + (pQ)->Depth++; \ } /* test if a queue is empty */ #define HTC_QUEUE_EMPTY(pQ) ((pQ)->Depth == 0) /* get packet at head without removing it */ -static INLINE HTC_PACKET *htc_get_pkt_at_head(HTC_PACKET_QUEUE *queue) +static inline HTC_PACKET *htc_get_pkt_at_head(HTC_PACKET_QUEUE *queue) { if (queue->Depth == 0) { return NULL; @@ -208,14 +210,14 @@ static INLINE HTC_PACKET *htc_get_pkt_at_head(HTC_PACKET_QUEUE *queue) } /* remove a packet from a queue, where-ever it is in the queue */ -#define HTC_PACKET_REMOVE(pQ,p) \ +#define HTC_PACKET_REMOVE(pQ, p) \ { \ - dl_list_remove(& (p)->ListLink); \ - (pQ)->Depth --; \ + dl_list_remove(&(p)->ListLink); \ + (pQ)->Depth--; \ } /* dequeue an HTC packet from the head of the queue */ -static INLINE HTC_PACKET *htc_packet_dequeue(HTC_PACKET_QUEUE *queue) +static inline HTC_PACKET *htc_packet_dequeue(HTC_PACKET_QUEUE *queue) { DL_LIST *pItem = dl_list_remove_item_from_head(&queue->QueueHead); if (pItem != NULL) { @@ -226,7 +228,7 @@ static INLINE HTC_PACKET *htc_packet_dequeue(HTC_PACKET_QUEUE *queue) } /* dequeue an HTC packet from the tail of the queue */ -static INLINE HTC_PACKET *htc_packet_dequeue_tail(HTC_PACKET_QUEUE *queue) +static inline HTC_PACKET *htc_packet_dequeue_tail(HTC_PACKET_QUEUE *queue) { DL_LIST *pItem = dl_list_remove_item_from_tail(&queue->QueueHead); if (pItem != NULL) { @@ -242,9 +244,9 @@ static INLINE HTC_PACKET *htc_packet_dequeue_tail(HTC_PACKET_QUEUE *queue) #define HTC_GET_TAG_FROM_PKT(p) (p)->PktInfo.AsTx.Tag /* transfer the packets from one queue to the tail of another queue */ -#define HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(pQDest,pQSrc) \ +#define HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(pQDest, pQSrc) \ { \ - dl_list_transfer_items_to_tail(&(pQDest)->QueueHead,&(pQSrc)->QueueHead); \ + dl_list_transfer_items_to_tail(&(pQDest)->QueueHead, &(pQSrc)->QueueHead); \ (pQDest)->Depth += (pQSrc)->Depth; \ (pQSrc)->Depth = 0; \ } @@ -257,20 +259,20 @@ static INLINE HTC_PACKET *htc_packet_dequeue_tail(HTC_PACKET_QUEUE *queue) */ #define HTC_PACKET_QUEUE_TRANSFER_TO_HEAD(pQDest, pQSrc) \ { \ - dl_list_transfer_items_to_head(&(pQDest)->QueueHead,&(pQSrc)->QueueHead); \ + dl_list_transfer_items_to_head(&(pQDest)->QueueHead, &(pQSrc)->QueueHead); \ (pQDest)->Depth += (pQSrc)->Depth; \ (pQSrc)->Depth = 0; \ } /* fast version to init and add a single packet to a queue */ -#define INIT_HTC_PACKET_QUEUE_AND_ADD(pQ,pP) \ +#define INIT_HTC_PACKET_QUEUE_AND_ADD(pQ, pP) \ { \ - DL_LIST_INIT_AND_ADD(&(pQ)->QueueHead,&(pP)->ListLink) \ + DL_LIST_INIT_AND_ADD(&(pQ)->QueueHead, &(pP)->ListLink) \ (pQ)->Depth = 1; \ } #define HTC_PACKET_QUEUE_ITERATE_ALLOW_REMOVE(pQ, pPTemp) \ - ITERATE_OVER_LIST_ALLOW_REMOVE(&(pQ)->QueueHead,(pPTemp), HTC_PACKET, ListLink) + ITERATE_OVER_LIST_ALLOW_REMOVE(&(pQ)->QueueHead, (pPTemp), HTC_PACKET, ListLink) #define HTC_PACKET_QUEUE_ITERATE_IS_VALID(pQ) ITERATE_IS_VALID(&(pQ)->QueueHead) #define HTC_PACKET_QUEUE_ITERATE_RESET(pQ) ITERATE_RESET(&(pQ)->QueueHead) diff --git a/htc/htc_recv.c b/htc/htc_recv.c index 79bf6c6847d0..cdd4e18e2c6f 100644 --- a/htc/htc_recv.c +++ b/htc/htc_recv.c @@ -240,7 +240,7 @@ cdf_nbuf_t rx_sg_to_single_netbuf(HTC_TARGET *target) skb = cdf_nbuf_queue_remove(rx_sg_queue); do { cdf_nbuf_peek_header(skb, &anbdata, &anblen); - cdf_mem_copy(anbdata_new, anbdata, cdf_nbuf_len(skb)); + qdf_mem_copy(anbdata_new, anbdata, cdf_nbuf_len(skb)); cdf_nbuf_put_tail(new_skb, cdf_nbuf_len(skb)); anbdata_new += cdf_nbuf_len(skb); cdf_nbuf_free(skb); @@ -261,10 +261,10 @@ _failed: } #endif -CDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf, +QDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf, uint8_t pipeID) { - CDF_STATUS status = CDF_STATUS_SUCCESS; + QDF_STATUS status = QDF_STATUS_SUCCESS; HTC_FRAME_HDR *HtcHdr; HTC_TARGET *target = (HTC_TARGET *) Context; uint8_t *netdata; @@ -310,8 +310,8 @@ CDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf, htc_ep_id)); debug_dump_bytes((A_UINT8 *) HtcHdr, sizeof(HTC_FRAME_HDR), "BAD HTC Header"); - status = CDF_STATUS_E_FAILURE; - CDF_BUG(0); + status = QDF_STATUS_E_FAILURE; + QDF_BUG(0); break; } @@ -347,8 +347,8 @@ CDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf, debug_dump_bytes((A_UINT8 *) HtcHdr, sizeof(HTC_FRAME_HDR), "BAD RX packet length"); - status = CDF_STATUS_E_FAILURE; - CDF_BUG(0); + status = QDF_STATUS_E_FAILURE; + QDF_BUG(0); break; #endif } @@ -374,7 +374,7 @@ CDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf, AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("htc_rx_completion_handler, invalid header (payloadlength should be :%d, CB[0] is:%d)\n", payloadLen, temp)); - status = CDF_STATUS_E_INVAL; + status = QDF_STATUS_E_INVAL; break; } @@ -386,7 +386,7 @@ CDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf, payloadLen - temp), temp, htc_ep_id); if (A_FAILED(temp_status)) { - status = CDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; break; } @@ -420,8 +420,8 @@ CDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf, * on the endpoint 0 */ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HTC Rx Ctrl still processing\n")); - status = CDF_STATUS_E_FAILURE; - CDF_BUG(false); + status = QDF_STATUS_E_FAILURE; + QDF_BUG(false); break; } @@ -436,7 +436,7 @@ CDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf, target->CtrlResponseProcessing = true; UNLOCK_HTC_RX(target); - cdf_event_set(&target->ctrl_response_valid); + qdf_event_set(&target->ctrl_response_valid); break; case HTC_MSG_SEND_SUSPEND_COMPLETE: wow_nack = 0; @@ -476,10 +476,10 @@ CDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf, * TODO_FIXME */ pPacket = allocate_htc_packet_container(target); if (NULL == pPacket) { - status = CDF_STATUS_E_RESOURCES; + status = QDF_STATUS_E_RESOURCES; break; } - pPacket->Status = CDF_STATUS_SUCCESS; + pPacket->Status = QDF_STATUS_SUCCESS; pPacket->Endpoint = htc_ep_id; pPacket->pPktContext = netbuf; pPacket->pBuffer = cdf_nbuf_data(netbuf) + HTC_HDR_LENGTH; @@ -601,7 +601,7 @@ void htc_flush_rx_hold_queue(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint) void htc_recv_init(HTC_TARGET *target) { /* Initialize ctrl_response_valid to block */ - cdf_event_init(&target->ctrl_response_valid); + qdf_event_create(&target->ctrl_response_valid); } /* polling routine to wait for a control packet to be received */ @@ -612,9 +612,9 @@ A_STATUS htc_wait_recv_ctrl_message(HTC_TARGET *target) AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+HTCWaitCtrlMessageRecv\n")); /* Wait for BMI request/response transaction to complete */ - if (cdf_wait_single_event(&target->ctrl_response_valid, - cdf_system_msecs_to_ticks(HTC_CONTROL_RX_TIMEOUT))) { - CDF_BUG(0); + if (qdf_wait_single_event(&target->ctrl_response_valid, + qdf_system_msecs_to_ticks(HTC_CONTROL_RX_TIMEOUT))) { + QDF_BUG(0); return A_ERROR; } diff --git a/htc/htc_send.c b/htc/htc_send.c index 26821fd542a4..b2a1b701e435 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -28,7 +28,7 @@ #include "htc_debug.h" #include "htc_internal.h" #include <cdf_nbuf.h> /* cdf_nbuf_t */ -#include <cdf_memory.h> /* cdf_mem_malloc */ +#include <qdf_mem.h> /* qdf_mem_malloc */ #include "epping_main.h" /* #define USB_HIF_SINGLE_PIPE_DATA_SCHED */ @@ -80,7 +80,7 @@ void htc_credit_record(htc_credit_exchange_type type, uint32_t tx_credit, htc_credit_history_buffer[g_htc_credit_history_idx].type = type; htc_credit_history_buffer[g_htc_credit_history_idx].time = - cdf_get_log_timestamp(); + qdf_get_log_timestamp(); htc_credit_history_buffer[g_htc_credit_history_idx].tx_credit = tx_credit; htc_credit_history_buffer[g_htc_credit_history_idx].htc_tx_queue_depth = @@ -130,11 +130,11 @@ void htc_get_control_endpoint_tx_host_credits(HTC_HANDLE HTCHandle, int *credits UNLOCK_HTC_TX(target); } -static INLINE void restore_tx_packet(HTC_TARGET *target, HTC_PACKET *pPacket) +static inline void restore_tx_packet(HTC_TARGET *target, HTC_PACKET *pPacket) { if (pPacket->PktInfo.AsTx.Flags & HTC_TX_PACKET_FLAG_FIXUP_NETBUF) { cdf_nbuf_t netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket); - cdf_nbuf_unmap(target->osdev, netbuf, CDF_DMA_TO_DEVICE); + cdf_nbuf_unmap(target->osdev, netbuf, QDF_DMA_TO_DEVICE); cdf_nbuf_pull_head(netbuf, sizeof(HTC_FRAME_HDR)); pPacket->PktInfo.AsTx.Flags &= ~HTC_TX_PACKET_FLAG_FIXUP_NETBUF; } @@ -216,17 +216,17 @@ HTC_PACKET *allocate_htc_bundle_packet(HTC_TARGET *target) if (!netbuf) { return NULL; } - pPacket = cdf_mem_malloc(sizeof(HTC_PACKET)); + pPacket = qdf_mem_malloc(sizeof(HTC_PACKET)); AR_DEBUG_ASSERT(pPacket); if (!pPacket) { cdf_nbuf_free(netbuf); return NULL; } - pQueueSave = cdf_mem_malloc(sizeof(HTC_PACKET_QUEUE)); + pQueueSave = qdf_mem_malloc(sizeof(HTC_PACKET_QUEUE)); AR_DEBUG_ASSERT(pQueueSave); if (!pQueueSave) { cdf_nbuf_free(netbuf); - cdf_mem_free(pPacket); + qdf_mem_free(pPacket); return NULL; } INIT_HTC_PACKET_QUEUE(pQueueSave); @@ -305,7 +305,7 @@ static A_STATUS htc_send_bundled_netbuf(HTC_TARGET *target, unsigned char *pBundleBuffer, HTC_PACKET *pPacketTx) { - cdf_size_t data_len; + qdf_size_t data_len; A_STATUS status; cdf_nbuf_t bundleBuf; uint32_t data_attr = 0; @@ -322,7 +322,7 @@ static A_STATUS htc_send_bundled_netbuf(HTC_TARGET *target, HTC_PACKET_ENQUEUE(&pEndpoint->TxLookupQueue, pPacketTx); UNLOCK_HTC_TX(target); #if DEBUG_BUNDLE - cdf_print(" Send bundle EP%d buffer size:0x%x, total:0x%x, count:%d.\n", + qdf_print(" Send bundle EP%d buffer size:0x%x, total:0x%x, count:%d.\n", pEndpoint->Id, pEndpoint->TxCreditSize, data_len, data_len / pEndpoint->TxCreditSize); @@ -331,7 +331,7 @@ static A_STATUS htc_send_bundled_netbuf(HTC_TARGET *target, pEndpoint->UL_PipeID, pEndpoint->Id, data_len, bundleBuf, data_attr); if (status != A_OK) { - cdf_print("%s:hif_send_head failed(len=%d).\n", __FUNCTION__, + qdf_print("%s:hif_send_head failed(len=%d).\n", __FUNCTION__, data_len); } return status; @@ -522,7 +522,7 @@ static A_STATUS htc_issue_packets(HTC_TARGET *target, Flags & HTC_TX_PACKET_FLAG_FIXUP_NETBUF) { cdf_nbuf_map(target->osdev, GET_HTC_PACKET_NET_BUF_CONTEXT - (pPacket), CDF_DMA_TO_DEVICE); + (pPacket), QDF_DMA_TO_DEVICE); } } LOCK_HTC_TX(target); @@ -538,7 +538,7 @@ static A_STATUS htc_issue_packets(HTC_TARGET *target, HTC_HDR_LENGTH + pPacket->ActualLength, netbuf, data_attr); #if DEBUG_BUNDLE - cdf_print(" Send single EP%d buffer size:0x%x, total:0x%x.\n", + qdf_print(" Send single EP%d buffer size:0x%x, total:0x%x.\n", pEndpoint->Id, pEndpoint->TxCreditSize, HTC_HDR_LENGTH + pPacket->ActualLength); @@ -546,7 +546,7 @@ static A_STATUS htc_issue_packets(HTC_TARGET *target, target->ce_send_cnt++; - if (cdf_unlikely(A_FAILED(status))) { + if (qdf_unlikely(A_FAILED(status))) { if (status != A_NO_RESOURCE) { /* TODO : if more than 1 endpoint maps to the same PipeID it is possible * to run out of resources in the HIF layer. Don't emit the error */ @@ -585,7 +585,7 @@ static A_STATUS htc_issue_packets(HTC_TARGET *target, if (pPacket->PktInfo.AsTx.Tag == HTC_TX_PACKET_TAG_RUNTIME_PUT) hif_pm_runtime_put(target->hif_dev); } - if (cdf_unlikely(A_FAILED(status))) { + if (qdf_unlikely(A_FAILED(status))) { #if defined(HIF_USB) if (pEndpoint->Id >= ENDPOINT_2 && pEndpoint->Id <= ENDPOINT_5) target->avail_tx_credits += @@ -688,7 +688,7 @@ void get_htc_send_packets_credit_based(HTC_TARGET *target, while (true) { if (do_pm_get && hif_pm_runtime_get(target->hif_dev)) { /* bus suspended, runtime resume issued */ - CDF_ASSERT(HTC_PACKET_QUEUE_DEPTH(pQueue) == 0); + QDF_ASSERT(HTC_PACKET_QUEUE_DEPTH(pQueue) == 0); break; } @@ -840,7 +840,7 @@ void get_htc_send_packets(HTC_TARGET *target, if (do_pm_get && hif_pm_runtime_get(target->hif_dev)) { /* bus suspended, runtime resume issued */ - CDF_ASSERT(HTC_PACKET_QUEUE_DEPTH(pQueue) == 0); + QDF_ASSERT(HTC_PACKET_QUEUE_DEPTH(pQueue) == 0); break; } @@ -878,7 +878,7 @@ void get_htc_send_packets(HTC_TARGET *target, num_frags = (pPacket->PktInfo.AsTx. Flags & HTC_TX_PACKET_FLAG_FIXUP_NETBUF) ? 1 - /* WMI messages are in a single-fragment network buffer */ : + /* WMI messages are in a single-fragment network buffer */ : cdf_nbuf_get_num_frags(GET_HTC_PACKET_NET_BUF_CONTEXT (pPacket)); Resources -= num_frags; @@ -1043,11 +1043,11 @@ static HTC_SEND_QUEUE_RESULT htc_try_send(HTC_TARGET *target, } /* increment tx processing count on entry */ - cdf_atomic_inc(&pEndpoint->TxProcessCount); - if (cdf_atomic_read(&pEndpoint->TxProcessCount) > 1) { + qdf_atomic_inc(&pEndpoint->TxProcessCount); + if (qdf_atomic_read(&pEndpoint->TxProcessCount) > 1) { /* another thread or task is draining the TX queues on this endpoint * that thread will reset the tx processing count when the queue is drained */ - cdf_atomic_dec(&pEndpoint->TxProcessCount); + qdf_atomic_dec(&pEndpoint->TxProcessCount); UNLOCK_HTC_TX(target); AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("-htc_try_send (busy) \n")); return HTC_SEND_QUEUE_OK; @@ -1125,7 +1125,7 @@ static HTC_SEND_QUEUE_RESULT htc_try_send(HTC_TARGET *target, UNLOCK_HTC_TX(target); /* done with this endpoint, we can clear the count */ - cdf_atomic_init(&pEndpoint->TxProcessCount); + qdf_atomic_init(&pEndpoint->TxProcessCount); AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("-htc_try_send: \n")); @@ -1157,15 +1157,15 @@ static A_UINT16 htc_send_pkts_sched_check(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID switch (id) { case ENDPOINT_2: /* BE */ - return (acQueueStatus[0] && acQueueStatus[2] - && acQueueStatus[3]); + return acQueueStatus[0] && acQueueStatus[2] + && acQueueStatus[3]; case ENDPOINT_3: /* BK */ - return (acQueueStatus[0] && acQueueStatus[1] && acQueueStatus[2] - && acQueueStatus[3]); + return acQueueStatus[0] && acQueueStatus[1] && acQueueStatus[2] + && acQueueStatus[3]; case ENDPOINT_4: /* VI */ - return (acQueueStatus[2] && acQueueStatus[3]); + return acQueueStatus[2] && acQueueStatus[3]; case ENDPOINT_5: /* VO */ - return (acQueueStatus[3]); + return acQueueStatus[3]; default: return 0; } @@ -1291,7 +1291,7 @@ A_STATUS htc_send_pkts_multiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueu */ cdf_nbuf_map(target->osdev, GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket), - CDF_DMA_TO_DEVICE); + QDF_DMA_TO_DEVICE); pPacket->PktInfo.AsTx.Flags |= HTC_TX_PACKET_FLAG_FIXUP_NETBUF; } @@ -1410,7 +1410,7 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, cdf_nbuf_t netbuf, int Epid, pEndpoint->SeqNo++; NBUF_UPDATE_TX_PKT_COUNT(netbuf, NBUF_TX_PKT_HTC); - DPTRACE(cdf_dp_trace(netbuf, CDF_DP_TRACE_HTC_PACKET_PTR_RECORD, + DPTRACE(qdf_dp_trace(netbuf, QDF_DP_TRACE_HTC_PACKET_PTR_RECORD, (uint8_t *)(cdf_nbuf_data(netbuf)), sizeof(cdf_nbuf_data(netbuf)))); status = hif_send_head(target->hif_dev, @@ -1492,14 +1492,14 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket, } /* increment tx processing count on entry */ - cdf_atomic_inc(&pEndpoint->TxProcessCount); - if (cdf_atomic_read(&pEndpoint->TxProcessCount) > 1) { + qdf_atomic_inc(&pEndpoint->TxProcessCount); + if (qdf_atomic_read(&pEndpoint->TxProcessCount) > 1) { /* * Another thread or task is draining the TX queues on this endpoint. * That thread will reset the tx processing count when the queue is * drained. */ - cdf_atomic_dec(&pEndpoint->TxProcessCount); + qdf_atomic_dec(&pEndpoint->TxProcessCount); UNLOCK_HTC_TX(target); return A_OK; } @@ -1545,7 +1545,7 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket, UNLOCK_HTC_TX(target); } NBUF_UPDATE_TX_PKT_COUNT(netbuf, NBUF_TX_PKT_HTC); - DPTRACE(cdf_dp_trace(netbuf, CDF_DP_TRACE_HTC_PACKET_PTR_RECORD, + DPTRACE(qdf_dp_trace(netbuf, QDF_DP_TRACE_HTC_PACKET_PTR_RECORD, (uint8_t *)(cdf_nbuf_data(netbuf)), sizeof(cdf_nbuf_data(netbuf)))); @@ -1579,13 +1579,13 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket, HTC_HDR_LENGTH + pPacket->ActualLength, netbuf, data_attr); #if DEBUG_BUNDLE - cdf_print(" Send single EP%d buffer size:0x%x, total:0x%x.\n", + qdf_print(" Send single EP%d buffer size:0x%x, total:0x%x.\n", pEndpoint->Id, pEndpoint->TxCreditSize, HTC_HDR_LENGTH + pPacket->ActualLength); #endif - if (cdf_unlikely(A_FAILED(status))) { + if (qdf_unlikely(A_FAILED(status))) { LOCK_HTC_TX(target); pEndpoint->ul_outstanding_cnt--; /* remove this packet from the tx completion queue */ @@ -1612,7 +1612,7 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket, } } /* done with this endpoint, we can clear the count */ - cdf_atomic_init(&pEndpoint->TxProcessCount); + qdf_atomic_init(&pEndpoint->TxProcessCount); if (pEndpoint->ul_is_polled) { /* @@ -1651,7 +1651,7 @@ static HTC_PACKET *htc_lookup_tx_packet(HTC_TARGET *target, /* Dequeue first packet directly because of in-order completion */ pPacket = htc_packet_dequeue(&pEndpoint->TxLookupQueue); - if (cdf_unlikely(!pPacket)) { + if (qdf_unlikely(!pPacket)) { UNLOCK_HTC_TX(target); return NULL; } @@ -1697,7 +1697,7 @@ static HTC_PACKET *htc_lookup_tx_packet(HTC_TARGET *target, return pFoundPacket; } -CDF_STATUS htc_tx_completion_handler(void *Context, +QDF_STATUS htc_tx_completion_handler(void *Context, cdf_nbuf_t netbuf, unsigned int EpID, uint32_t toeplitz_hash_result) { @@ -1705,8 +1705,8 @@ CDF_STATUS htc_tx_completion_handler(void *Context, HTC_ENDPOINT *pEndpoint; HTC_PACKET *pPacket; #ifdef USB_HIF_SINGLE_PIPE_DATA_SCHED - HTC_ENDPOINT_ID eid[DATA_EP_SIZE] = - { ENDPOINT_5, ENDPOINT_4, ENDPOINT_2, ENDPOINT_3 }; + HTC_ENDPOINT_ID eid[DATA_EP_SIZE] = { ENDPOINT_5, ENDPOINT_4, + ENDPOINT_2, ENDPOINT_3 }; int epidIdx; A_UINT16 resourcesThresh[DATA_EP_SIZE]; /* urb resources */ A_UINT16 resources; @@ -1739,11 +1739,11 @@ CDF_STATUS htc_tx_completion_handler(void *Context, } HTC_PACKET_QUEUE_ITERATE_END; free_htc_bundle_packet(target, pPacket); - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } /* will be giving this buffer back to upper layers */ netbuf = NULL; - pPacket->Status = CDF_STATUS_SUCCESS; + pPacket->Status = QDF_STATUS_SUCCESS; send_packet_completion(target, pPacket); } while (false); @@ -1755,7 +1755,7 @@ CDF_STATUS htc_tx_completion_handler(void *Context, htc_try_send(target, pEndpoint, NULL); } - return CDF_STATUS_SUCCESS; + return QDF_STATUS_SUCCESS; } /* callback when TX resources become available */ @@ -1928,8 +1928,8 @@ void htc_process_credit_rpt(HTC_TARGET *target, HTC_CREDIT_REPORT *pRpt, #endif #if defined(HIF_USB) if (pEndpoint->Id >= ENDPOINT_2 && pEndpoint->Id <= ENDPOINT_5) { - HTC_ENDPOINT_ID eid[DATA_EP_SIZE] = - { ENDPOINT_5, ENDPOINT_4, ENDPOINT_2, ENDPOINT_3 }; + HTC_ENDPOINT_ID eid[DATA_EP_SIZE] = { ENDPOINT_5, + ENDPOINT_4, ENDPOINT_2, ENDPOINT_3 }; int epid_idx; target->avail_tx_credits += rpt_credits; @@ -1998,5 +1998,5 @@ struct ol_ath_htc_stats *ieee80211_ioctl_get_htc_stats(HTC_HANDLE HTCHandle) { HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - return (&(target->htc_pkt_stats)); + return &(target->htc_pkt_stats); } diff --git a/htc/htc_services.c b/htc/htc_services.c index d2cb0dd27851..99fc20e25473 100644 --- a/htc/htc_services.c +++ b/htc/htc_services.c @@ -310,7 +310,7 @@ A_STATUS htc_connect_service(HTC_HANDLE HTCHandle, pEndpoint->TxCreditsPerMaxMsg++; } #if DEBUG_CREDIT - cdf_print(" Endpoint%d initial credit:%d, size:%d.\n", + qdf_print(" Endpoint%d initial credit:%d, size:%d.\n", pEndpoint->Id, pEndpoint->TxCredits, pEndpoint->TxCreditSize); #endif @@ -328,14 +328,14 @@ A_STATUS htc_connect_service(HTC_HANDLE HTCHandle, break; } - cdf_assert(!pEndpoint->dl_is_polled); /* not currently supported */ + qdf_assert(!pEndpoint->dl_is_polled); /* not currently supported */ if (pEndpoint->ul_is_polled) { - cdf_softirq_timer_init(target->osdev, + qdf_timer_init(target->osdev, &pEndpoint->ul_poll_timer, htc_send_complete_check_cleanup, pEndpoint, - CDF_TIMER_TYPE_SW); + QDF_TIMER_TYPE_SW); } AR_DEBUG_PRINTF(ATH_DEBUG_SETUP, @@ -372,7 +372,7 @@ void htc_set_credit_distribution(HTC_HANDLE HTCHandle, } -void htc_fw_event_handler(void *context, CDF_STATUS status) +void htc_fw_event_handler(void *context, QDF_STATUS status) { HTC_TARGET *target = (HTC_TARGET *) context; HTC_INIT_INFO *initInfo = &target->HTCInitInfo; |
