Lines Matching full:endpoint
45 ep_dist->endpoint, credits); in ath6kl_credit_deposit()
65 if (cur_ep_dist->endpoint == ENDPOINT_0) in ath6kl_credit_init()
112 if (cur_ep_dist->endpoint == ENDPOINT_0) in ath6kl_credit_init()
123 * cover and then set each endpoint's normal value in ath6kl_credit_init()
136 cur_ep_dist->endpoint, in ath6kl_credit_init()
173 ep_dist->endpoint, limit); in ath6kl_credit_reduce()
191 if (cur_list->endpoint == ENDPOINT_0) in ath6kl_credit_update()
217 * HTC has an endpoint that needs credits, ep_dist is the endpoint in
253 * starve an endpoint completely) in ath6kl_credit_seek()
281 if (curdist_list->endpoint == ENDPOINT_0) in ath6kl_credit_seek()
302 if (curdist_list->endpoint == ENDPOINT_0) in ath6kl_credit_redistribute()
369 hdr->eid = packet->endpoint; in ath6kl_htc_tx_prep_pkt()
408 struct htc_endpoint *endpoint, in htc_tx_comp_update() argument
418 packet->status, packet->endpoint, packet->act_len, in htc_tx_comp_update()
423 endpoint->cred_dist.cred_to_dist += in htc_tx_comp_update()
425 endpoint->cred_dist.txq_depth = get_queue_depth(&endpoint->txq); in htc_tx_comp_update()
437 static void htc_tx_complete(struct htc_endpoint *endpoint, in htc_tx_complete() argument
445 endpoint->eid, get_queue_depth(txq)); in htc_tx_complete()
447 ath6kl_tx_complete(endpoint->target, txq); in htc_tx_complete()
453 struct htc_endpoint *endpoint = &target->endpoint[packet->endpoint]; in htc_tx_comp_handler() local
459 htc_tx_comp_update(target, endpoint, packet); in htc_tx_comp_handler()
463 htc_tx_complete(endpoint, &container); in htc_tx_comp_handler()
469 struct htc_endpoint *endpoint; in htc_async_tx_scat_complete() local
484 endpoint = &target->endpoint[packet->endpoint]; in htc_async_tx_scat_complete()
495 htc_tx_comp_update(target, endpoint, packet); in htc_async_tx_scat_complete()
503 htc_tx_complete(endpoint, &tx_compq); in htc_async_tx_scat_complete()
540 trace_ath6kl_htc_tx(status, packet->endpoint, packet->buf, send_len); in ath6kl_htc_tx_issue()
599 struct htc_endpoint *endpoint, in ath6kl_htc_tx_pkts_get() argument
610 if (list_empty(&endpoint->txq)) in ath6kl_htc_tx_pkts_get()
612 packet = list_first_entry(&endpoint->txq, struct htc_packet, in ath6kl_htc_tx_pkts_get()
617 packet, get_queue_depth(&endpoint->txq)); in ath6kl_htc_tx_pkts_get()
622 if (htc_check_credits(target, endpoint, &flags, in ath6kl_htc_tx_pkts_get()
623 packet->endpoint, len, &req_cred)) in ath6kl_htc_tx_pkts_get()
627 packet = list_first_entry(&endpoint->txq, struct htc_packet, in ath6kl_htc_tx_pkts_get()
637 endpoint->ep_st.tx_issued += 1; in ath6kl_htc_tx_pkts_get()
641 packet->info.tx.seqno = endpoint->seqno; in ath6kl_htc_tx_pkts_get()
642 endpoint->seqno++; in ath6kl_htc_tx_pkts_get()
679 struct htc_endpoint *endpoint, in ath6kl_htc_tx_setup_scat_list() argument
702 &len, endpoint); in ath6kl_htc_tx_setup_scat_list()
754 static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint, in ath6kl_htc_tx_bundle() argument
758 struct htc_target *target = endpoint->target; in ath6kl_htc_tx_bundle()
766 if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) && in ath6kl_htc_tx_bundle()
767 (WMI_CONTROL_SVC != endpoint->svc_id)) in ath6kl_htc_tx_bundle()
768 ac = target->dev->ar->ep2ac_map[endpoint->eid]; in ath6kl_htc_tx_bundle()
820 status = ath6kl_htc_tx_setup_scat_list(target, endpoint, in ath6kl_htc_tx_bundle()
839 trace_ath6kl_htc_tx(packet->status, packet->endpoint, in ath6kl_htc_tx_bundle()
858 struct htc_endpoint *endpoint) in ath6kl_htc_tx_from_queue() argument
869 endpoint->tx_proc_cnt++; in ath6kl_htc_tx_from_queue()
870 if (endpoint->tx_proc_cnt > 1) { in ath6kl_htc_tx_from_queue()
871 endpoint->tx_proc_cnt--; in ath6kl_htc_tx_from_queue()
878 * drain the endpoint TX queue for transmission as long in ath6kl_htc_tx_from_queue()
883 if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) && in ath6kl_htc_tx_from_queue()
884 (WMI_CONTROL_SVC != endpoint->svc_id)) in ath6kl_htc_tx_from_queue()
885 ac = target->dev->ar->ep2ac_map[endpoint->eid]; in ath6kl_htc_tx_from_queue()
888 if (list_empty(&endpoint->txq)) in ath6kl_htc_tx_from_queue()
891 ath6kl_htc_tx_pkts_get(target, endpoint, &txq); in ath6kl_htc_tx_from_queue()
910 ath6kl_htc_tx_bundle(endpoint, &txq, in ath6kl_htc_tx_from_queue()
936 endpoint->ep_st.tx_bundles += bundle_sent; in ath6kl_htc_tx_from_queue()
937 endpoint->ep_st.tx_pkt_bundled += n_pkts_bundle; in ath6kl_htc_tx_from_queue()
960 endpoint->tx_proc_cnt = 0; in ath6kl_htc_tx_from_queue()
965 struct htc_endpoint *endpoint, in ath6kl_htc_tx_try() argument
972 ep_cb = endpoint->ep_cb; in ath6kl_htc_tx_try()
975 txq_depth = get_queue_depth(&endpoint->txq); in ath6kl_htc_tx_try()
978 if (txq_depth >= endpoint->max_txq_depth) in ath6kl_htc_tx_try()
984 endpoint->eid, txq_depth, in ath6kl_htc_tx_try()
985 endpoint->max_txq_depth); in ath6kl_htc_tx_try()
988 if (ep_cb.tx_full(endpoint->target, tx_pkt) == in ath6kl_htc_tx_try()
990 endpoint->ep_st.tx_dropped += 1; in ath6kl_htc_tx_try()
996 list_add_tail(&tx_pkt->list, &endpoint->txq); in ath6kl_htc_tx_try()
999 ath6kl_htc_tx_from_queue(target, endpoint); in ath6kl_htc_tx_try()
1006 struct htc_endpoint *endpoint; in htc_chk_ep_txq() local
1016 endpoint = cred_dist->htc_ep; in htc_chk_ep_txq()
1019 if (!list_empty(&endpoint->txq)) { in htc_chk_ep_txq()
1022 cred_dist->endpoint, in htc_chk_ep_txq()
1023 endpoint->cred_dist.credits, in htc_chk_ep_txq()
1024 get_queue_depth(&endpoint->txq)); in htc_chk_ep_txq()
1033 ath6kl_htc_tx_from_queue(target, endpoint); in htc_chk_ep_txq()
1096 struct htc_endpoint *endpoint; in ath6kl_htc_set_credit_dist() local
1101 list_add_tail(&target->endpoint[ENDPOINT_0].cred_dist.list, in ath6kl_htc_set_credit_dist()
1106 endpoint = &target->endpoint[ep]; in ath6kl_htc_set_credit_dist()
1107 if (endpoint->svc_id == srvc_pri_order[i]) { in ath6kl_htc_set_credit_dist()
1108 list_add_tail(&endpoint->cred_dist.list, in ath6kl_htc_set_credit_dist()
1123 struct htc_endpoint *endpoint; in ath6kl_htc_mbox_tx() local
1128 packet->endpoint, packet->buf, packet->act_len); in ath6kl_htc_mbox_tx()
1130 if (packet->endpoint >= ENDPOINT_MAX) { in ath6kl_htc_mbox_tx()
1135 endpoint = &target->endpoint[packet->endpoint]; in ath6kl_htc_mbox_tx()
1137 if (!ath6kl_htc_tx_try(target, endpoint, packet)) { in ath6kl_htc_mbox_tx()
1142 htc_tx_complete(endpoint, &queue); in ath6kl_htc_mbox_tx()
1148 /* flush endpoint TX queue */
1154 struct htc_endpoint *endpoint = &target->endpoint[eid]; in ath6kl_htc_mbox_flush_txep() local
1156 if (!endpoint->svc_id) { in ath6kl_htc_mbox_flush_txep()
1166 list_for_each_entry_safe(packet, tmp_pkt, &endpoint->txq, list) { in ath6kl_htc_mbox_flush_txep()
1180 packet->endpoint, packet->info.tx.tag); in ath6kl_htc_mbox_flush_txep()
1184 htc_tx_complete(endpoint, &container); in ath6kl_htc_mbox_flush_txep()
1190 struct htc_endpoint *endpoint; in ath6kl_htc_flush_txep_all() local
1196 endpoint = &target->endpoint[i]; in ath6kl_htc_flush_txep_all()
1197 if (endpoint->svc_id == 0) in ath6kl_htc_flush_txep_all()
1208 struct htc_endpoint *endpoint = &target->endpoint[eid]; in ath6kl_htc_mbox_activity_changed() local
1211 if (endpoint->svc_id == 0) { in ath6kl_htc_mbox_activity_changed()
1219 if (!(endpoint->cred_dist.dist_flags & HTC_EP_ACTIVE)) { in ath6kl_htc_mbox_activity_changed()
1220 endpoint->cred_dist.dist_flags |= HTC_EP_ACTIVE; in ath6kl_htc_mbox_activity_changed()
1224 if (endpoint->cred_dist.dist_flags & HTC_EP_ACTIVE) { in ath6kl_htc_mbox_activity_changed()
1225 endpoint->cred_dist.dist_flags &= ~HTC_EP_ACTIVE; in ath6kl_htc_mbox_activity_changed()
1231 endpoint->cred_dist.txq_depth = in ath6kl_htc_mbox_activity_changed()
1232 get_queue_depth(&endpoint->txq); in ath6kl_htc_mbox_activity_changed()
1251 static inline void ath6kl_htc_rx_update_stats(struct htc_endpoint *endpoint, in ath6kl_htc_rx_update_stats() argument
1254 endpoint->ep_st.rx_pkts++; in ath6kl_htc_rx_update_stats()
1256 endpoint->ep_st.rx_lkahds++; in ath6kl_htc_rx_update_stats()
1258 endpoint->ep_st.rx_bundle_lkahd++; in ath6kl_htc_rx_update_stats()
1333 * on this endpoint.
1336 struct htc_endpoint *endpoint, in ath6kl_htc_rx_set_indicate() argument
1341 if (htc_hdr->eid == packet->endpoint) { in ath6kl_htc_rx_set_indicate()
1342 if (!list_empty(&endpoint->rx_bufq)) in ath6kl_htc_rx_set_indicate()
1348 static void ath6kl_htc_rx_chk_water_mark(struct htc_endpoint *endpoint) in ath6kl_htc_rx_chk_water_mark() argument
1350 struct htc_ep_callbacks ep_cb = endpoint->ep_cb; in ath6kl_htc_rx_chk_water_mark()
1353 spin_lock_bh(&endpoint->target->rx_lock); in ath6kl_htc_rx_chk_water_mark()
1354 if (get_queue_depth(&endpoint->rx_bufq) in ath6kl_htc_rx_chk_water_mark()
1356 spin_unlock_bh(&endpoint->target->rx_lock); in ath6kl_htc_rx_chk_water_mark()
1357 ep_cb.rx_refill(endpoint->target, endpoint->eid); in ath6kl_htc_rx_chk_water_mark()
1360 spin_unlock_bh(&endpoint->target->rx_lock); in ath6kl_htc_rx_chk_water_mark()
1470 struct htc_endpoint *endpoint, in ath6kl_htc_rx_alloc() argument
1490 if (htc_hdr->eid != endpoint->eid) { in ath6kl_htc_rx_alloc()
1492 htc_hdr->eid, endpoint->eid, i); in ath6kl_htc_rx_alloc()
1505 if (endpoint->svc_id == 0) { in ath6kl_htc_rx_alloc()
1527 endpoint->ep_st.rx_bundle_from_hdr += 1; in ath6kl_htc_rx_alloc()
1536 status = ath6kl_htc_rx_setup(target, endpoint, &lk_ahds[i], in ath6kl_htc_rx_alloc()
1559 &target->endpoint[packet->endpoint]); in ath6kl_htc_rx_alloc()
1568 if (packets->endpoint != ENDPOINT_0) { in htc_ctrl_rx()
1583 "htc rx unexpected endpoint 0 message", "", in htc_ctrl_rx()
1588 htc_reclaim_rxbuf(context, packets, &context->endpoint[0]); in htc_ctrl_rx()
1596 struct htc_endpoint *endpoint; in htc_proc_cred_rpt() local
1609 endpoint = &target->endpoint[rpt->eid]; in htc_proc_cred_rpt()
1615 endpoint->ep_st.tx_cred_rpt += 1; in htc_proc_cred_rpt()
1616 endpoint->ep_st.cred_retnd += rpt->credits; in htc_proc_cred_rpt()
1620 * This credit report arrived on the same endpoint in htc_proc_cred_rpt()
1623 endpoint->ep_st.cred_from_rx += rpt->credits; in htc_proc_cred_rpt()
1624 endpoint->ep_st.cred_rpt_from_rx += 1; in htc_proc_cred_rpt()
1626 /* credit arrived on endpoint 0 as a NULL message */ in htc_proc_cred_rpt()
1627 endpoint->ep_st.cred_from_ep0 += rpt->credits; in htc_proc_cred_rpt()
1628 endpoint->ep_st.cred_rpt_ep0 += 1; in htc_proc_cred_rpt()
1630 endpoint->ep_st.cred_from_other += rpt->credits; in htc_proc_cred_rpt()
1631 endpoint->ep_st.cred_rpt_from_other += 1; in htc_proc_cred_rpt()
1635 /* always give endpoint 0 credits back */ in htc_proc_cred_rpt()
1636 endpoint->cred_dist.credits += rpt->credits; in htc_proc_cred_rpt()
1638 endpoint->cred_dist.cred_to_dist += rpt->credits; in htc_proc_cred_rpt()
1647 endpoint->cred_dist.txq_depth = in htc_proc_cred_rpt()
1648 get_queue_depth(&endpoint->txq); in htc_proc_cred_rpt()
1672 enum htc_endpoint_id endpoint, in htc_parse_trailer() argument
1689 len, endpoint); in htc_parse_trailer()
1751 int *n_lk_ahds, enum htc_endpoint_id endpoint) in htc_proc_trailer() argument
1785 next_lk_ahds, endpoint, n_lk_ahds); in htc_proc_trailer()
1844 if (packet->endpoint != htc_hdr->eid) { in ath6kl_htc_rx_process_hdr()
1846 htc_hdr->eid, packet->endpoint); in ath6kl_htc_rx_process_hdr()
1880 n_lkahds, packet->endpoint); in ath6kl_htc_rx_process_hdr()
1899 static void ath6kl_htc_rx_complete(struct htc_endpoint *endpoint, in ath6kl_htc_rx_complete() argument
1904 endpoint->eid, packet); in ath6kl_htc_rx_complete()
1906 endpoint->ep_cb.rx(endpoint->target, packet); in ath6kl_htc_rx_complete()
2012 ep = &target->endpoint[packet->endpoint]; in ath6kl_htc_rx_process_packets()
2014 trace_ath6kl_htc_rx(packet->status, packet->endpoint, in ath6kl_htc_rx_process_packets()
2128 &target->endpoint[packet->endpoint]); in ath6kl_htc_rx_fetch()
2134 &target->endpoint[packet->endpoint]); in ath6kl_htc_rx_fetch()
2144 struct htc_endpoint *endpoint; in ath6kl_htc_rxmsg_pending_handler() local
2163 * First lookahead sets the expected endpoint IDs for all in ath6kl_htc_rxmsg_pending_handler()
2167 endpoint = &target->endpoint[id]; in ath6kl_htc_rxmsg_pending_handler()
2170 ath6kl_err("MsgPend, invalid endpoint in look-ahead: %d\n", in ath6kl_htc_rxmsg_pending_handler()
2184 num_look_ahead, endpoint, in ath6kl_htc_rxmsg_pending_handler()
2203 ath6kl_htc_rx_chk_water_mark(endpoint); in ath6kl_htc_rxmsg_pending_handler()
2232 &target->endpoint[packets->endpoint]); in ath6kl_htc_rxmsg_pending_handler()
2257 * on ENDPOINT 0 are expected.
2293 trace_ath6kl_htc_rx(packet->status, packet->endpoint, in htc_wait_for_ctrl_msg()
2319 struct htc_endpoint *endpoint; in ath6kl_htc_mbox_add_rxbuf_multiple() local
2329 if (first_pkt->endpoint >= ENDPOINT_MAX) in ath6kl_htc_mbox_add_rxbuf_multiple()
2336 first_pkt->endpoint, depth, first_pkt->buf_len); in ath6kl_htc_mbox_add_rxbuf_multiple()
2338 endpoint = &target->endpoint[first_pkt->endpoint]; in ath6kl_htc_mbox_add_rxbuf_multiple()
2347 ath6kl_htc_rx_complete(endpoint, packet); in ath6kl_htc_mbox_add_rxbuf_multiple()
2355 list_splice_tail_init(pkt_queue, &endpoint->rx_bufq); in ath6kl_htc_mbox_add_rxbuf_multiple()
2359 if (target->ep_waiting == first_pkt->endpoint) { in ath6kl_htc_mbox_add_rxbuf_multiple()
2380 struct htc_endpoint *endpoint; in ath6kl_htc_mbox_flush_rx_buf() local
2385 endpoint = &target->endpoint[i]; in ath6kl_htc_mbox_flush_rx_buf()
2386 if (!endpoint->svc_id) in ath6kl_htc_mbox_flush_rx_buf()
2392 &endpoint->rx_bufq, list) { in ath6kl_htc_mbox_flush_rx_buf()
2398 packet->endpoint); in ath6kl_htc_mbox_flush_rx_buf()
2400 * packets in rx_bufq of endpoint 0 have originally in ath6kl_htc_mbox_flush_rx_buf()
2403 * separately using kmalloc(). For other endpoint in ath6kl_htc_mbox_flush_rx_buf()
2408 if (packet->endpoint == ENDPOINT_0) { in ath6kl_htc_mbox_flush_rx_buf()
2428 struct htc_endpoint *endpoint; in ath6kl_htc_mbox_conn_service() local
2503 endpoint = &target->endpoint[assigned_ep]; in ath6kl_htc_mbox_conn_service()
2504 endpoint->eid = assigned_ep; in ath6kl_htc_mbox_conn_service()
2505 if (endpoint->svc_id) { in ath6kl_htc_mbox_conn_service()
2510 /* return assigned endpoint to caller */ in ath6kl_htc_mbox_conn_service()
2511 conn_resp->endpoint = assigned_ep; in ath6kl_htc_mbox_conn_service()
2514 /* setup the endpoint */ in ath6kl_htc_mbox_conn_service()
2516 /* this marks the endpoint in use */ in ath6kl_htc_mbox_conn_service()
2517 endpoint->svc_id = conn_req->svc_id; in ath6kl_htc_mbox_conn_service()
2519 endpoint->max_txq_depth = conn_req->max_txq_depth; in ath6kl_htc_mbox_conn_service()
2520 endpoint->len_max = max_msg_sz; in ath6kl_htc_mbox_conn_service()
2521 endpoint->ep_cb = conn_req->ep_cb; in ath6kl_htc_mbox_conn_service()
2522 endpoint->cred_dist.svc_id = conn_req->svc_id; in ath6kl_htc_mbox_conn_service()
2523 endpoint->cred_dist.htc_ep = endpoint; in ath6kl_htc_mbox_conn_service()
2524 endpoint->cred_dist.endpoint = assigned_ep; in ath6kl_htc_mbox_conn_service()
2525 endpoint->cred_dist.cred_sz = target->tgt_cred_sz; in ath6kl_htc_mbox_conn_service()
2527 switch (endpoint->svc_id) { in ath6kl_htc_mbox_conn_service()
2529 endpoint->tx_drop_packet_threshold = MAX_DEF_COOKIE_NUM / 3; in ath6kl_htc_mbox_conn_service()
2532 endpoint->tx_drop_packet_threshold = MAX_HI_COOKIE_NUM; in ath6kl_htc_mbox_conn_service()
2546 endpoint->cred_dist.cred_per_msg = in ath6kl_htc_mbox_conn_service()
2549 endpoint->cred_dist.cred_per_msg = in ath6kl_htc_mbox_conn_service()
2552 if (!endpoint->cred_dist.cred_per_msg) in ath6kl_htc_mbox_conn_service()
2553 endpoint->cred_dist.cred_per_msg = 1; in ath6kl_htc_mbox_conn_service()
2556 endpoint->conn_flags = conn_req->flags; in ath6kl_htc_mbox_conn_service()
2572 struct htc_endpoint *endpoint; in reset_ep_state() local
2576 endpoint = &target->endpoint[i]; in reset_ep_state()
2577 memset(&endpoint->cred_dist, 0, sizeof(endpoint->cred_dist)); in reset_ep_state()
2578 endpoint->svc_id = 0; in reset_ep_state()
2579 endpoint->len_max = 0; in reset_ep_state()
2580 endpoint->max_txq_depth = 0; in reset_ep_state()
2581 memset(&endpoint->ep_st, 0, in reset_ep_state()
2582 sizeof(endpoint->ep_st)); in reset_ep_state()
2583 INIT_LIST_HEAD(&endpoint->rx_bufq); in reset_ep_state()
2584 INIT_LIST_HEAD(&endpoint->txq); in reset_ep_state()
2585 endpoint->target = target; in reset_ep_state()
2594 enum htc_endpoint_id endpoint) in ath6kl_htc_mbox_get_rxbuf_num() argument
2599 num = get_queue_depth(&(target->endpoint[endpoint].rx_bufq)); in ath6kl_htc_mbox_get_rxbuf_num()
2706 /* setup our pseudo HTC control endpoint connection */ in ath6kl_htc_mbox_wait_target()
2752 /* Push control receive buffers into htc control endpoint */ in ath6kl_htc_mbox_start()
2809 packet->endpoint = ENDPOINT_0; in ath6kl_htc_reset()