Lines Matching refs:ep

26 static inline void ath10k_htc_send_complete_check(struct ath10k_htc_ep *ep,  in ath10k_htc_send_complete_check()  argument
33 ath10k_hif_send_complete_check(ep->htc->ar, ep->ul_pipe_id, force); in ath10k_htc_send_complete_check()
70 static void ath10k_htc_notify_tx_completion(struct ath10k_htc_ep *ep, in ath10k_htc_notify_tx_completion() argument
73 struct ath10k *ar = ep->htc->ar; in ath10k_htc_notify_tx_completion()
76 ep->eid, skb); in ath10k_htc_notify_tx_completion()
78 ath10k_htc_restore_tx_skb(ep->htc, skb); in ath10k_htc_notify_tx_completion()
80 if (!ep->ep_ops.ep_tx_complete) { in ath10k_htc_notify_tx_completion()
81 ath10k_warn(ar, "no tx handler for eid %d\n", ep->eid); in ath10k_htc_notify_tx_completion()
86 ep->ep_ops.ep_tx_complete(ep->htc->ar, skb); in ath10k_htc_notify_tx_completion()
90 static bool ath10k_htc_ep_need_credit_update(struct ath10k_htc_ep *ep) in ath10k_htc_ep_need_credit_update() argument
92 struct ath10k *ar = ep->htc->ar; in ath10k_htc_ep_need_credit_update()
94 if (!ep->tx_credit_flow_enabled) in ath10k_htc_ep_need_credit_update()
96 if (ep->tx_credits >= ep->tx_credits_per_max_message) in ath10k_htc_ep_need_credit_update()
100 ep->eid); in ath10k_htc_ep_need_credit_update()
104 static void ath10k_htc_prepare_tx_skb(struct ath10k_htc_ep *ep, in ath10k_htc_prepare_tx_skb() argument
111 hdr->eid = ep->eid; in ath10k_htc_prepare_tx_skb()
115 spin_lock_bh(&ep->htc->tx_lock); in ath10k_htc_prepare_tx_skb()
116 hdr->seq_no = ep->seq_no++; in ath10k_htc_prepare_tx_skb()
118 if (ath10k_htc_ep_need_credit_update(ep)) in ath10k_htc_prepare_tx_skb()
121 spin_unlock_bh(&ep->htc->tx_lock); in ath10k_htc_prepare_tx_skb()
129 struct ath10k_htc_ep *ep = &htc->endpoint[eid]; in ath10k_htc_send() local
146 if (ep->tx_credit_flow_enabled) { in ath10k_htc_send()
149 if (ep->tx_credits < credits) { in ath10k_htc_send()
154 ep->tx_credits -= credits; in ath10k_htc_send()
157 eid, credits, ep->tx_credits); in ath10k_htc_send()
161 ath10k_htc_prepare_tx_skb(ep, skb); in ath10k_htc_send()
171 sg_item.transfer_id = ep->eid; in ath10k_htc_send()
177 ret = ath10k_hif_tx_sg(htc->ar, ep->ul_pipe_id, &sg_item, 1); in ath10k_htc_send()
186 if (ep->tx_credit_flow_enabled) { in ath10k_htc_send()
188 ep->tx_credits += credits; in ath10k_htc_send()
191 eid, credits, ep->tx_credits); in ath10k_htc_send()
194 if (ep->ep_ops.ep_tx_credits) in ath10k_htc_send()
195 ep->ep_ops.ep_tx_credits(htc->ar); in ath10k_htc_send()
207 struct ath10k_htc_ep *ep; in ath10k_htc_tx_completion_handler() local
213 ep = &htc->endpoint[skb_cb->eid]; in ath10k_htc_tx_completion_handler()
215 ath10k_htc_notify_tx_completion(ep, skb); in ath10k_htc_tx_completion_handler()
232 struct ath10k_htc_ep *ep; in ath10k_htc_process_credit_report() local
245 ep = &htc->endpoint[report->eid]; in ath10k_htc_process_credit_report()
246 ep->tx_credits += report->credits; in ath10k_htc_process_credit_report()
249 report->eid, report->credits, ep->tx_credits); in ath10k_htc_process_credit_report()
251 if (ep->ep_ops.ep_tx_credits) { in ath10k_htc_process_credit_report()
253 ep->ep_ops.ep_tx_credits(htc->ar); in ath10k_htc_process_credit_report()
331 struct ath10k_htc_ep *ep; in ath10k_htc_rx_completion_handler() local
351 ep = &htc->endpoint[eid]; in ath10k_htc_rx_completion_handler()
359 if (ep->ul_is_polled) in ath10k_htc_rx_completion_handler()
360 ath10k_htc_send_complete_check(ep, 1); in ath10k_htc_rx_completion_handler()
449 ep->ep_ops.ep_rx_complete(ar, skb); in ath10k_htc_rx_completion_handler()
504 struct ath10k_htc_ep *ep; in ath10k_htc_reset_endpoint_states() local
508 ep = &htc->endpoint[i]; in ath10k_htc_reset_endpoint_states()
509 ep->service_id = ATH10K_HTC_SVC_ID_UNUSED; in ath10k_htc_reset_endpoint_states()
510 ep->max_ep_message_len = 0; in ath10k_htc_reset_endpoint_states()
511 ep->max_tx_queue_depth = 0; in ath10k_htc_reset_endpoint_states()
512 ep->eid = i; in ath10k_htc_reset_endpoint_states()
513 ep->htc = htc; in ath10k_htc_reset_endpoint_states()
514 ep->tx_credit_flow_enabled = true; in ath10k_htc_reset_endpoint_states()
647 struct ath10k_htc_ep *ep; in ath10k_htc_connect_service() local
752 ep = &htc->endpoint[assigned_eid]; in ath10k_htc_connect_service()
753 ep->eid = assigned_eid; in ath10k_htc_connect_service()
755 if (ep->service_id != ATH10K_HTC_SVC_ID_UNUSED) in ath10k_htc_connect_service()
763 ep->service_id = conn_req->service_id; in ath10k_htc_connect_service()
764 ep->max_tx_queue_depth = conn_req->max_send_queue_depth; in ath10k_htc_connect_service()
765 ep->max_ep_message_len = __le16_to_cpu(resp_msg->max_msg_size); in ath10k_htc_connect_service()
766 ep->tx_credits = tx_alloc; in ath10k_htc_connect_service()
767 ep->tx_credit_size = htc->target_credit_size; in ath10k_htc_connect_service()
768 ep->tx_credits_per_max_message = ep->max_ep_message_len / in ath10k_htc_connect_service()
771 if (ep->max_ep_message_len % htc->target_credit_size) in ath10k_htc_connect_service()
772 ep->tx_credits_per_max_message++; in ath10k_htc_connect_service()
775 ep->ep_ops = conn_req->ep_ops; in ath10k_htc_connect_service()
778 ep->service_id, in ath10k_htc_connect_service()
779 &ep->ul_pipe_id, in ath10k_htc_connect_service()
780 &ep->dl_pipe_id, in ath10k_htc_connect_service()
781 &ep->ul_is_polled, in ath10k_htc_connect_service()
782 &ep->dl_is_polled); in ath10k_htc_connect_service()
788 htc_service_name(ep->service_id), ep->ul_pipe_id, in ath10k_htc_connect_service()
789 ep->dl_pipe_id, ep->eid); in ath10k_htc_connect_service()
793 ep->eid, ep->ul_is_polled, ep->dl_is_polled); in ath10k_htc_connect_service()
795 if (disable_credit_flow_ctrl && ep->tx_credit_flow_enabled) { in ath10k_htc_connect_service()
796 ep->tx_credit_flow_enabled = false; in ath10k_htc_connect_service()
799 htc_service_name(ep->service_id), assigned_eid); in ath10k_htc_connect_service()
855 struct ath10k_htc_ep *ep = NULL; in ath10k_htc_init() local
868 ep = &htc->endpoint[ATH10K_HTC_EP_0]; in ath10k_htc_init()
871 ath10k_hif_get_default_pipe(ar, &ep->ul_pipe_id, &ep->dl_pipe_id); in ath10k_htc_init()