Lines Matching refs:target

72 	HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);  in htc_dump_counter_info()  local
74 if (!target) in htc_dump_counter_info()
79 __func__, target->ce_send_cnt, target->TX_comp_cnt)); in htc_dump_counter_info()
84 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle); in htc_get_tx_queue_depth() local
85 HTC_ENDPOINT *endpoint = &target->endpoint[endpoint_id]; in htc_get_tx_queue_depth()
94 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); in htc_get_control_endpoint_tx_host_credits() local
98 if (!credits || !target) { in htc_get_control_endpoint_tx_host_credits()
104 LOCK_HTC_TX(target); in htc_get_control_endpoint_tx_host_credits()
106 pEndpoint = &target->endpoint[i]; in htc_get_control_endpoint_tx_host_credits()
112 UNLOCK_HTC_TX(target); in htc_get_control_endpoint_tx_host_credits()
115 static inline void restore_tx_packet(HTC_TARGET *target, HTC_PACKET *pPacket) in restore_tx_packet() argument
120 qdf_nbuf_unmap(target->osdev, netbuf, QDF_DMA_TO_DEVICE); in restore_tx_packet()
131 static void send_packet_completion(HTC_TARGET *target, HTC_PACKET *pPacket) in send_packet_completion() argument
133 HTC_ENDPOINT *pEndpoint = &target->endpoint[pPacket->Endpoint]; in send_packet_completion()
138 target->nbuf_nfc_unmap_count++; in send_packet_completion()
140 restore_tx_packet(target, pPacket); in send_packet_completion()
146 if (target->hif_dev && hif_get_target_status(target->hif_dev)) { in send_packet_completion()
147 htc_free_control_tx_packet(target, pPacket); in send_packet_completion()
174 static void log_packet_info(HTC_TARGET *target, HTC_PACKET *pPacket) in log_packet_info() argument
176 HTC_ENDPOINT *pEndpoint = &target->endpoint[pPacket->Endpoint]; in log_packet_info()
195 void htc_inc_htt_runtime_cnt(HTC_TARGET *target) in htc_inc_htt_runtime_cnt() argument
197 qdf_atomic_inc(&target->htc_htt_runtime_cnt); in htc_inc_htt_runtime_cnt()
200 static void log_packet_info(HTC_TARGET *target, HTC_PACKET *pPacket) in log_packet_info() argument
205 void htc_inc_htt_runtime_cnt(HTC_TARGET *target) in htc_inc_htt_runtime_cnt() argument
217 HTC_PACKET *allocate_htc_bundle_packet(HTC_TARGET *target) in allocate_htc_bundle_packet() argument
223 LOCK_HTC_TX(target); in allocate_htc_bundle_packet()
224 if (!target->pBundleFreeList) { in allocate_htc_bundle_packet()
225 UNLOCK_HTC_TX(target); in allocate_htc_bundle_packet()
227 target->MaxMsgsPerHTCBundle * in allocate_htc_bundle_packet()
228 target->TargetCreditSize, 0, 4, false); in allocate_htc_bundle_packet()
259 pPacket = target->pBundleFreeList; in allocate_htc_bundle_packet()
262 UNLOCK_HTC_TX(target); in allocate_htc_bundle_packet()
265 target->pBundleFreeList = (HTC_PACKET *) pPacket->ListLink.pNext; in allocate_htc_bundle_packet()
266 UNLOCK_HTC_TX(target); in allocate_htc_bundle_packet()
272 void free_htc_bundle_packet(HTC_TARGET *target, HTC_PACKET *pPacket) in free_htc_bundle_packet() argument
311 LOCK_HTC_TX(target); in free_htc_bundle_packet()
312 if (!target->pBundleFreeList) { in free_htc_bundle_packet()
313 target->pBundleFreeList = pPacket; in free_htc_bundle_packet()
316 pPacket->ListLink.pNext = (DL_LIST *) target->pBundleFreeList; in free_htc_bundle_packet()
317 target->pBundleFreeList = pPacket; in free_htc_bundle_packet()
319 UNLOCK_HTC_TX(target); in free_htc_bundle_packet()
334 htc_send_update_tx_bundle_stats(HTC_TARGET *target, in htc_send_update_tx_bundle_stats() argument
341 target->tx_bundle_stats[index]++; in htc_send_update_tx_bundle_stats()
352 htc_issue_tx_bundle_stats_inc(HTC_TARGET *target) in htc_issue_tx_bundle_stats_inc() argument
354 target->tx_bundle_stats[0]++; in htc_issue_tx_bundle_stats_inc()
359 htc_send_update_tx_bundle_stats(HTC_TARGET *target, in htc_send_update_tx_bundle_stats() argument
366 htc_issue_tx_bundle_stats_inc(HTC_TARGET *target) in htc_issue_tx_bundle_stats_inc() argument
373 static QDF_STATUS htc_send_bundled_netbuf(HTC_TARGET *target, in htc_send_bundled_netbuf() argument
387 target, in htc_send_bundled_netbuf()
391 LOCK_HTC_TX(target); in htc_send_bundled_netbuf()
394 UNLOCK_HTC_TX(target); in htc_send_bundled_netbuf()
402 htc_send_update_tx_bundle_stats(target, data_len, in htc_send_bundled_netbuf()
405 status = hif_send_head(target->hif_dev, in htc_send_bundled_netbuf()
414 LOCK_HTC_TX(target); in htc_send_bundled_netbuf()
428 UNLOCK_HTC_TX(target); in htc_send_bundled_netbuf()
429 free_htc_bundle_packet(target, pPacketTx); in htc_send_bundled_netbuf()
430 LOCK_HTC_TX(target); in htc_send_bundled_netbuf()
438 UNLOCK_HTC_TX(target); in htc_send_bundled_netbuf()
548 static void htc_issue_packets_bundle(HTC_TARGET *target, in htc_issue_packets_bundle() argument
565 target->MaxMsgsPerHTCBundle * pEndpoint->TxCreditSize; in htc_issue_packets_bundle()
566 pPacketTx = allocate_htc_bundle_packet(target); in htc_issue_packets_bundle()
606 htc_send_bundled_netbuf(target, pEndpoint, in htc_issue_packets_bundle()
618 target->MaxMsgsPerHTCBundle * in htc_issue_packets_bundle()
620 pPacketTx = allocate_htc_bundle_packet(target); in htc_issue_packets_bundle()
640 if (hif_get_bus_type(target->hif_dev) != QDF_BUS_TYPE_USB) { in htc_issue_packets_bundle()
673 if (hif_get_bus_type(target->hif_dev) == QDF_BUS_TYPE_USB) in htc_issue_packets_bundle()
684 htc_send_bundled_netbuf(target, pEndpoint, in htc_issue_packets_bundle()
688 free_htc_bundle_packet(target, pPacketTx); in htc_issue_packets_bundle()
712 static void htc_issue_packets_bundle(HTC_TARGET *target, in htc_issue_packets_bundle() argument
727 static QDF_STATUS htc_issue_packets(HTC_TARGET *target, in htc_issue_packets() argument
750 bus_type = hif_get_bus_type(target->hif_dev); in htc_issue_packets()
757 if (HTC_TX_BUNDLE_ENABLED(target) && in htc_issue_packets()
771 htc_issue_packets_bundle(target, in htc_issue_packets()
833 ret = qdf_nbuf_map(target->osdev, in htc_issue_packets()
849 LOCK_HTC_TX(target); in htc_issue_packets()
856 UNLOCK_HTC_TX(target); in htc_issue_packets()
857 hif_send_complete_check(target->hif_dev, in htc_issue_packets()
862 sys_state = hif_system_pm_get_state(target->hif_dev); in htc_issue_packets()
863 hif_system_pm_set_state_suspending(target->hif_dev); in htc_issue_packets()
877 htc_inc_htt_runtime_cnt(target); in htc_issue_packets()
892 status = hif_send_head(target->hif_dev, in htc_issue_packets()
899 htc_dec_return_htt_runtime_cnt((void *)target); in htc_issue_packets()
903 __hif_system_pm_set_state(target->hif_dev, in htc_issue_packets()
914 htc_issue_tx_bundle_stats_inc(target); in htc_issue_packets()
916 target->ce_send_cnt++; in htc_issue_packets()
930 if (target->htc_pkt_dbg) { in htc_issue_packets()
933 hif_print_napi_stats(target->hif_dev); in htc_issue_packets()
940 qdf_nbuf_unmap(target->osdev, in htc_issue_packets()
948 LOCK_HTC_TX(target); in htc_issue_packets()
950 target->ce_send_cnt--; in htc_issue_packets()
964 UNLOCK_HTC_TX(target); in htc_issue_packets()
1042 void htc_dec_wmi_runtime_cnt(HTC_TARGET *target, uint8_t rtpm_code) in htc_dec_wmi_runtime_cnt() argument
1045 qdf_atomic_dec(&target->htc_wmi_runtime_cnt); in htc_dec_wmi_runtime_cnt()
1056 void htc_inc_wmi_runtime_cnt(HTC_TARGET *target, uint8_t rtpm_code) in htc_inc_wmi_runtime_cnt() argument
1059 qdf_atomic_inc(&target->htc_wmi_runtime_cnt); in htc_inc_wmi_runtime_cnt()
1071 void htc_dec_wmi_runtime_cnt(HTC_TARGET *target, uint8_t rtpm_code) in htc_dec_wmi_runtime_cnt() argument
1076 void htc_inc_wmi_runtime_cnt(HTC_TARGET *target, uint8_t rtpm_code) in htc_inc_wmi_runtime_cnt() argument
1157 static void get_htc_send_packets_credit_based(HTC_TARGET *target, in get_htc_send_packets_credit_based() argument
1213 log_packet_info(target, pPacket); in get_htc_send_packets_credit_based()
1216 htc_inc_wmi_runtime_cnt(target, rtpm_code); in get_htc_send_packets_credit_based()
1225 htc_dec_wmi_runtime_cnt(target, rtpm_code); in get_htc_send_packets_credit_based()
1231 hif_system_pm_state_check(target->hif_dev)) { in get_htc_send_packets_credit_based()
1234 htc_dec_wmi_runtime_cnt(target, rtpm_code); in get_htc_send_packets_credit_based()
1281 htc_dec_wmi_runtime_cnt(target, in get_htc_send_packets_credit_based()
1304 target->hif_dev); in get_htc_send_packets_credit_based()
1337 static void get_htc_send_packets(HTC_TARGET *target, in get_htc_send_packets() argument
1379 log_packet_info(target, pPacket); in get_htc_send_packets()
1382 htc_inc_wmi_runtime_cnt(target, rtpm_code); in get_htc_send_packets()
1386 ret = hif_system_pm_state_check(target->hif_dev); in get_htc_send_packets()
1390 htc_dec_wmi_runtime_cnt(target, rtpm_code); in get_htc_send_packets()
1399 htc_dec_wmi_runtime_cnt(target, rtpm_code); in get_htc_send_packets()
1450 static enum HTC_SEND_QUEUE_RESULT htc_try_send(HTC_TARGET *target, in htc_try_send() argument
1482 OL_ATH_HTC_PKT_ERROR_COUNT_INCR(target, in htc_try_send()
1594 OL_ATH_HTC_PKT_ERROR_COUNT_INCR(target, in htc_try_send()
1609 LOCK_HTC_TX(target); in htc_try_send()
1612 if (target->is_nodrop_pkt) { in htc_try_send()
1620 target->is_nodrop_pkt = false; in htc_try_send()
1637 UNLOCK_HTC_TX(target); in htc_try_send()
1649 hif_get_free_queue_number(target->hif_dev, in htc_try_send()
1663 hif_schedule_ce_tasklet(target->hif_dev, in htc_try_send()
1677 get_htc_send_packets_credit_based(target, pEndpoint, in htc_try_send()
1699 if (HTC_TX_BUNDLE_ENABLED(target) && tx_resources && in htc_try_send()
1700 hif_get_bus_type(target->hif_dev) == in htc_try_send()
1713 get_htc_send_packets(target, pEndpoint, &sendQueue, in htc_try_send()
1725 UNLOCK_HTC_TX(target); in htc_try_send()
1728 status = htc_issue_packets(target, pEndpoint, &sendQueue); in htc_try_send()
1758 htc_dec_wmi_runtime_cnt(target, rtpm_code); in htc_try_send()
1762 LOCK_HTC_TX(target); in htc_try_send()
1774 hif_get_free_queue_number(target->hif_dev, in htc_try_send()
1779 LOCK_HTC_TX(target); in htc_try_send()
1787 UNLOCK_HTC_TX(target); in htc_try_send()
1798 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); in htc_send_pkts_sched_check() local
1809 pEndpoint = &target->endpoint[eid]; in htc_send_pkts_sched_check()
1833 static A_STATUS htc_send_pkts_sched_queue(HTC_TARGET *target, in htc_send_pkts_sched_queue() argument
1842 pEndpoint = &target->endpoint[eid]; in htc_send_pkts_sched_queue()
1845 LOCK_HTC_TX(target); in htc_send_pkts_sched_queue()
1878 UNLOCK_HTC_TX(target); in htc_send_pkts_sched_queue()
1888 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); in __htc_send_pkt() local
1902 OL_ATH_HTC_PKT_ERROR_COUNT_INCR(target, GET_HTC_PKT_Q_FAIL); in __htc_send_pkt()
1914 pEndpoint = &target->endpoint[pPacket->Endpoint]; in __htc_send_pkt()
1923 LOCK_HTC_TX(target); in __htc_send_pkt()
1925 UNLOCK_HTC_TX(target); in __htc_send_pkt()
1948 LOCK_HTC_TX(target); in __htc_send_pkt()
1957 UNLOCK_HTC_TX(target); in __htc_send_pkt()
1966 status = qdf_nbuf_map(target->osdev, in __htc_send_pkt()
1970 target->nbuf_nfc_map_count++; in __htc_send_pkt()
1984 htc_try_send(target, pEndpoint, &pPktQueue); in __htc_send_pkt()
1986 htc_try_send(target, pEndpoint, &pPktQueue); in __htc_send_pkt()
1993 if (HTC_STOPPING(target)) in __htc_send_pkt()
1998 send_packet_completion(target, pPacket); in __htc_send_pkt()
2019 HTC_TARGET *target; in htc_get_endpoint_ul_pipeid() local
2027 target = GET_HTC_TARGET_FROM_HANDLE(htc_handle); in htc_get_endpoint_ul_pipeid()
2035 end_point = &target->endpoint[endpoint_id]; in htc_get_endpoint_ul_pipeid()
2210 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_hdl); in htc_send_data_pkt() local
2219 pEndpoint = &target->endpoint[ep_id]; in htc_send_data_pkt()
2221 tx_resources = hif_get_free_queue_number(target->hif_dev, in htc_send_data_pkt()
2226 hif_send_complete_check(pEndpoint->target->hif_dev, in htc_send_data_pkt()
2229 hif_get_free_queue_number(target->hif_dev, in htc_send_data_pkt()
2246 if (target->htc_hdr_length_check) in htc_send_data_pkt()
2266 LOCK_HTC_TX(target); in htc_send_data_pkt()
2277 status = hif_send_head(target->hif_dev, in htc_send_data_pkt()
2281 UNLOCK_HTC_TX(target); in htc_send_data_pkt()
2297 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); in htc_send_data_pkt() local
2315 pEndpoint = &target->endpoint[pPacket->Endpoint]; in htc_send_data_pkt()
2346 hif_send_complete_check(pEndpoint->target->hif_dev, in htc_send_data_pkt()
2350 LOCK_HTC_TX(target); in htc_send_data_pkt()
2361 if (HTC_TX_BUNDLE_ENABLED(target) && (more_data)) { in htc_send_data_pkt()
2362 UNLOCK_HTC_TX(target); in htc_send_data_pkt()
2371 LOCK_HTC_TX(target); in htc_send_data_pkt()
2372 pEndpoint = &target->endpoint[1]; in htc_send_data_pkt()
2384 UNLOCK_HTC_TX(target); in htc_send_data_pkt()
2395 get_htc_send_packets_credit_based(target, pEndpoint, in htc_send_data_pkt()
2408 UNLOCK_HTC_TX(target); in htc_send_data_pkt()
2411 else if (HTC_TX_BUNDLE_ENABLED(target)) { in htc_send_data_pkt()
2412 if (hif_get_bus_type(target->hif_dev) == QDF_BUS_TYPE_USB) { in htc_send_data_pkt()
2413 if (hif_get_free_queue_number(target->hif_dev, in htc_send_data_pkt()
2420 get_htc_send_packets(target, pEndpoint, in htc_send_data_pkt()
2426 get_htc_send_packets(target, pEndpoint, &sendQueue, in htc_send_data_pkt()
2429 UNLOCK_HTC_TX(target); in htc_send_data_pkt()
2436 hif_get_free_queue_number(target->hif_dev, in htc_send_data_pkt()
2438 get_htc_send_packets(target, pEndpoint, &sendQueue, in htc_send_data_pkt()
2440 UNLOCK_HTC_TX(target); in htc_send_data_pkt()
2445 if (HTC_TX_BUNDLE_ENABLED(target) && in htc_send_data_pkt()
2448 (hif_get_bus_type(target->hif_dev) == QDF_BUS_TYPE_SDIO || in htc_send_data_pkt()
2449 hif_get_bus_type(target->hif_dev) == QDF_BUS_TYPE_USB)) { in htc_send_data_pkt()
2456 LOCK_HTC_TX(target); in htc_send_data_pkt()
2460 UNLOCK_HTC_TX(target); in htc_send_data_pkt()
2464 htc_issue_packets_bundle(target, pEndpoint, &sendQueue); in htc_send_data_pkt()
2472 LOCK_HTC_TX(target); in htc_send_data_pkt()
2476 UNLOCK_HTC_TX(target); in htc_send_data_pkt()
2486 LOCK_HTC_TX(target); in htc_send_data_pkt()
2491 UNLOCK_HTC_TX(target); in htc_send_data_pkt()
2500 status = hif_send_head(target->hif_dev, in htc_send_data_pkt()
2521 htc_issue_tx_bundle_stats_inc(target); in htc_send_data_pkt()
2524 LOCK_HTC_TX(target); in htc_send_data_pkt()
2549 UNLOCK_HTC_TX(target); in htc_send_data_pkt()
2579 static HTC_PACKET *htc_lookup_tx_packet(HTC_TARGET *target, in htc_lookup_tx_packet() argument
2590 LOCK_HTC_TX(target); in htc_lookup_tx_packet()
2597 UNLOCK_HTC_TX(target); in htc_lookup_tx_packet()
2602 UNLOCK_HTC_TX(target); in htc_lookup_tx_packet()
2636 UNLOCK_HTC_TX(target); in htc_lookup_tx_packet()
2655 HTC_TARGET *target = (HTC_TARGET *) Context; in htc_tx_completion_handler() local
2667 pEndpoint = &target->endpoint[EpID]; in htc_tx_completion_handler()
2668 target->TX_comp_cnt++; in htc_tx_completion_handler()
2672 pPacket = htc_lookup_tx_packet(target, pEndpoint, netbuf); in htc_tx_completion_handler()
2683 htc_dec_wmi_runtime_cnt(target, HIF_RTPM_ID_WMI); in htc_tx_completion_handler()
2694 send_packet_completion(target, pPacketTemp); in htc_tx_completion_handler()
2697 free_htc_bundle_packet(target, pPacket); in htc_tx_completion_handler()
2699 if (hif_get_bus_type(target->hif_dev) == in htc_tx_completion_handler()
2702 htc_try_send(target, pEndpoint, NULL); in htc_tx_completion_handler()
2710 send_packet_completion(target, pPacket); in htc_tx_completion_handler()
2721 htc_try_send(target, pEndpoint, NULL); in htc_tx_completion_handler()
2740 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_pdev); in htc_ctrl_msg_cmpl() local
2741 HTC_ENDPOINT *pendpoint = &target->endpoint[htc_ep_id]; in htc_ctrl_msg_cmpl()
2752 HTC_TARGET *target = (HTC_TARGET *) context; in htc_tx_resource_avail_handler() local
2756 pEndpoint = &target->endpoint[i]; in htc_tx_resource_avail_handler()
2774 htc_try_send(target, pEndpoint, NULL); in htc_tx_resource_avail_handler()
2790 HTC_TARGET *target = (HTC_TARGET *)context; in htc_kick_queues() local
2797 endpoint = &target->endpoint[i]; in htc_kick_queues()
2806 htc_try_send(target, endpoint, NULL); in htc_kick_queues()
2809 hif_fastpath_resume(target->hif_dev); in htc_kick_queues()
2816 void htc_flush_endpoint_tx(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint, in htc_flush_endpoint_tx() argument
2821 LOCK_HTC_TX(target); in htc_flush_endpoint_tx()
2828 send_packet_completion(target, pPacket); in htc_flush_endpoint_tx()
2831 UNLOCK_HTC_TX(target); in htc_flush_endpoint_tx()
2835 void htc_flush_endpoint_txlookupQ(HTC_TARGET *target, in htc_flush_endpoint_txlookupQ() argument
2842 endpoint = &target->endpoint[endpoint_id]; in htc_flush_endpoint_txlookupQ()
2847 LOCK_HTC_TX(target); in htc_flush_endpoint_txlookupQ()
2854 send_packet_completion(target, packet); in htc_flush_endpoint_txlookupQ()
2860 UNLOCK_HTC_TX(target); in htc_flush_endpoint_txlookupQ()
2867 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); in htc_flush_endpoint() local
2868 HTC_ENDPOINT *pEndpoint = &target->endpoint[Endpoint]; in htc_flush_endpoint()
2876 htc_flush_endpoint_tx(target, pEndpoint, Tag); in htc_flush_endpoint()
2893 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(handle); in htc_set_pkt_dbg() local
2895 target->htc_pkt_dbg = dbg_flag; in htc_set_pkt_dbg()
2900 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); in htc_set_nodrop_pkt() local
2902 target->is_nodrop_pkt = isNodropPkt; in htc_set_nodrop_pkt()
2907 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_hdl); in htc_enable_hdr_length_check() local
2909 target->htc_hdr_length_check = htc_hdr_length_check; in htc_enable_hdr_length_check()
2921 void htc_process_credit_rpt(HTC_TARGET *target, HTC_CREDIT_REPORT *pRpt, in htc_process_credit_rpt() argument
2934 LOCK_HTC_TX(target); in htc_process_credit_rpt()
2947 pEndpoint = &target->endpoint[rpt_ep_id]; in htc_process_credit_rpt()
2991 target->hif_dev); in htc_process_credit_rpt()
2998 UNLOCK_HTC_TX(target); in htc_process_credit_rpt()
3000 htc_try_send(target, pEndpoint, NULL); in htc_process_credit_rpt()
3003 htc_send_data_pkt((HTC_HANDLE)target, NULL, 0); in htc_process_credit_rpt()
3005 htc_try_send(target, pEndpoint, NULL); in htc_process_credit_rpt()
3007 LOCK_HTC_TX(target); in htc_process_credit_rpt()
3016 UNLOCK_HTC_TX(target); in htc_process_credit_rpt()
3024 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); in ieee80211_ioctl_get_htc_stats() local
3026 return &(target->htc_pkt_stats); in ieee80211_ioctl_get_htc_stats()
3032 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc); in htc_system_resume() local
3036 if (!target) in htc_system_resume()
3040 endpoint = &target->endpoint[i]; in htc_system_resume()
3045 htc_try_send(target, endpoint, NULL); in htc_system_resume()