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()
370 hdr->eid = packet->endpoint; in ath6kl_htc_tx_prep_pkt()
409 struct htc_endpoint *endpoint, in htc_tx_comp_update() argument
419 packet->status, packet->endpoint, packet->act_len, in htc_tx_comp_update()
424 endpoint->cred_dist.cred_to_dist += in htc_tx_comp_update()
426 endpoint->cred_dist.txq_depth = get_queue_depth(&endpoint->txq); in htc_tx_comp_update()
438 static void htc_tx_complete(struct htc_endpoint *endpoint, in htc_tx_complete() argument
446 endpoint->eid, get_queue_depth(txq)); in htc_tx_complete()
448 ath6kl_tx_complete(endpoint->target, txq); in htc_tx_complete()
454 struct htc_endpoint *endpoint = &target->endpoint[packet->endpoint]; in htc_tx_comp_handler() local
460 htc_tx_comp_update(target, endpoint, packet); in htc_tx_comp_handler()
464 htc_tx_complete(endpoint, &container); in htc_tx_comp_handler()
470 struct htc_endpoint *endpoint; in htc_async_tx_scat_complete() local
485 endpoint = &target->endpoint[packet->endpoint]; in htc_async_tx_scat_complete()
496 htc_tx_comp_update(target, endpoint, packet); in htc_async_tx_scat_complete()
504 htc_tx_complete(endpoint, &tx_compq); in htc_async_tx_scat_complete()
541 trace_ath6kl_htc_tx(status, packet->endpoint, packet->buf, send_len); in ath6kl_htc_tx_issue()
600 struct htc_endpoint *endpoint, in ath6kl_htc_tx_pkts_get() argument
611 if (list_empty(&endpoint->txq)) in ath6kl_htc_tx_pkts_get()
613 packet = list_first_entry(&endpoint->txq, struct htc_packet, in ath6kl_htc_tx_pkts_get()
618 packet, get_queue_depth(&endpoint->txq)); in ath6kl_htc_tx_pkts_get()
623 if (htc_check_credits(target, endpoint, &flags, in ath6kl_htc_tx_pkts_get()
624 packet->endpoint, len, &req_cred)) in ath6kl_htc_tx_pkts_get()
628 packet = list_first_entry(&endpoint->txq, struct htc_packet, in ath6kl_htc_tx_pkts_get()
638 endpoint->ep_st.tx_issued += 1; in ath6kl_htc_tx_pkts_get()
642 packet->info.tx.seqno = endpoint->seqno; in ath6kl_htc_tx_pkts_get()
643 endpoint->seqno++; in ath6kl_htc_tx_pkts_get()
680 struct htc_endpoint *endpoint, in ath6kl_htc_tx_setup_scat_list() argument
703 &len, endpoint); in ath6kl_htc_tx_setup_scat_list()
755 static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint, in ath6kl_htc_tx_bundle() argument
759 struct htc_target *target = endpoint->target; in ath6kl_htc_tx_bundle()
767 if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) && in ath6kl_htc_tx_bundle()
768 (WMI_CONTROL_SVC != endpoint->svc_id)) in ath6kl_htc_tx_bundle()
769 ac = target->dev->ar->ep2ac_map[endpoint->eid]; in ath6kl_htc_tx_bundle()
821 status = ath6kl_htc_tx_setup_scat_list(target, endpoint, in ath6kl_htc_tx_bundle()
840 trace_ath6kl_htc_tx(packet->status, packet->endpoint, in ath6kl_htc_tx_bundle()
859 struct htc_endpoint *endpoint) in ath6kl_htc_tx_from_queue() argument
870 endpoint->tx_proc_cnt++; in ath6kl_htc_tx_from_queue()
871 if (endpoint->tx_proc_cnt > 1) { in ath6kl_htc_tx_from_queue()
872 endpoint->tx_proc_cnt--; in ath6kl_htc_tx_from_queue()
879 * drain the endpoint TX queue for transmission as long in ath6kl_htc_tx_from_queue()
884 if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) && in ath6kl_htc_tx_from_queue()
885 (WMI_CONTROL_SVC != endpoint->svc_id)) in ath6kl_htc_tx_from_queue()
886 ac = target->dev->ar->ep2ac_map[endpoint->eid]; in ath6kl_htc_tx_from_queue()
889 if (list_empty(&endpoint->txq)) in ath6kl_htc_tx_from_queue()
892 ath6kl_htc_tx_pkts_get(target, endpoint, &txq); in ath6kl_htc_tx_from_queue()
911 ath6kl_htc_tx_bundle(endpoint, &txq, in ath6kl_htc_tx_from_queue()
937 endpoint->ep_st.tx_bundles += bundle_sent; in ath6kl_htc_tx_from_queue()
938 endpoint->ep_st.tx_pkt_bundled += n_pkts_bundle; in ath6kl_htc_tx_from_queue()
961 endpoint->tx_proc_cnt = 0; in ath6kl_htc_tx_from_queue()
966 struct htc_endpoint *endpoint, in ath6kl_htc_tx_try() argument
973 ep_cb = endpoint->ep_cb; in ath6kl_htc_tx_try()
976 txq_depth = get_queue_depth(&endpoint->txq); in ath6kl_htc_tx_try()
979 if (txq_depth >= endpoint->max_txq_depth) in ath6kl_htc_tx_try()
985 endpoint->eid, txq_depth, in ath6kl_htc_tx_try()
986 endpoint->max_txq_depth); in ath6kl_htc_tx_try()
989 if (ep_cb.tx_full(endpoint->target, tx_pkt) == in ath6kl_htc_tx_try()
991 endpoint->ep_st.tx_dropped += 1; in ath6kl_htc_tx_try()
997 list_add_tail(&tx_pkt->list, &endpoint->txq); in ath6kl_htc_tx_try()
1000 ath6kl_htc_tx_from_queue(target, endpoint); in ath6kl_htc_tx_try()
1007 struct htc_endpoint *endpoint; in htc_chk_ep_txq() local
1017 endpoint = cred_dist->htc_ep; in htc_chk_ep_txq()
1020 if (!list_empty(&endpoint->txq)) { in htc_chk_ep_txq()
1023 cred_dist->endpoint, in htc_chk_ep_txq()
1024 endpoint->cred_dist.credits, in htc_chk_ep_txq()
1025 get_queue_depth(&endpoint->txq)); in htc_chk_ep_txq()
1034 ath6kl_htc_tx_from_queue(target, endpoint); in htc_chk_ep_txq()
1097 struct htc_endpoint *endpoint; in ath6kl_htc_set_credit_dist() local
1102 list_add_tail(&target->endpoint[ENDPOINT_0].cred_dist.list, in ath6kl_htc_set_credit_dist()
1107 endpoint = &target->endpoint[ep]; in ath6kl_htc_set_credit_dist()
1108 if (endpoint->svc_id == srvc_pri_order[i]) { in ath6kl_htc_set_credit_dist()
1109 list_add_tail(&endpoint->cred_dist.list, in ath6kl_htc_set_credit_dist()
1124 struct htc_endpoint *endpoint; in ath6kl_htc_mbox_tx() local
1129 packet->endpoint, packet->buf, packet->act_len); in ath6kl_htc_mbox_tx()
1131 if (packet->endpoint >= ENDPOINT_MAX) { in ath6kl_htc_mbox_tx()
1136 endpoint = &target->endpoint[packet->endpoint]; in ath6kl_htc_mbox_tx()
1138 if (!ath6kl_htc_tx_try(target, endpoint, packet)) { in ath6kl_htc_mbox_tx()
1143 htc_tx_complete(endpoint, &queue); in ath6kl_htc_mbox_tx()
1149 /* flush endpoint TX queue */
1155 struct htc_endpoint *endpoint = &target->endpoint[eid]; in ath6kl_htc_mbox_flush_txep() local
1157 if (!endpoint->svc_id) { in ath6kl_htc_mbox_flush_txep()
1167 list_for_each_entry_safe(packet, tmp_pkt, &endpoint->txq, list) { in ath6kl_htc_mbox_flush_txep()
1181 packet->endpoint, packet->info.tx.tag); in ath6kl_htc_mbox_flush_txep()
1185 htc_tx_complete(endpoint, &container); in ath6kl_htc_mbox_flush_txep()
1191 struct htc_endpoint *endpoint; in ath6kl_htc_flush_txep_all() local
1197 endpoint = &target->endpoint[i]; in ath6kl_htc_flush_txep_all()
1198 if (endpoint->svc_id == 0) in ath6kl_htc_flush_txep_all()
1209 struct htc_endpoint *endpoint = &target->endpoint[eid]; in ath6kl_htc_mbox_activity_changed() local
1212 if (endpoint->svc_id == 0) { in ath6kl_htc_mbox_activity_changed()
1220 if (!(endpoint->cred_dist.dist_flags & HTC_EP_ACTIVE)) { in ath6kl_htc_mbox_activity_changed()
1221 endpoint->cred_dist.dist_flags |= HTC_EP_ACTIVE; in ath6kl_htc_mbox_activity_changed()
1225 if (endpoint->cred_dist.dist_flags & HTC_EP_ACTIVE) { in ath6kl_htc_mbox_activity_changed()
1226 endpoint->cred_dist.dist_flags &= ~HTC_EP_ACTIVE; in ath6kl_htc_mbox_activity_changed()
1232 endpoint->cred_dist.txq_depth = in ath6kl_htc_mbox_activity_changed()
1233 get_queue_depth(&endpoint->txq); in ath6kl_htc_mbox_activity_changed()
1252 static inline void ath6kl_htc_rx_update_stats(struct htc_endpoint *endpoint, in ath6kl_htc_rx_update_stats() argument
1255 endpoint->ep_st.rx_pkts++; in ath6kl_htc_rx_update_stats()
1257 endpoint->ep_st.rx_lkahds++; in ath6kl_htc_rx_update_stats()
1259 endpoint->ep_st.rx_bundle_lkahd++; in ath6kl_htc_rx_update_stats()
1334 * on this endpoint.
1337 struct htc_endpoint *endpoint, in ath6kl_htc_rx_set_indicate() argument
1342 if (htc_hdr->eid == packet->endpoint) { in ath6kl_htc_rx_set_indicate()
1343 if (!list_empty(&endpoint->rx_bufq)) in ath6kl_htc_rx_set_indicate()
1349 static void ath6kl_htc_rx_chk_water_mark(struct htc_endpoint *endpoint) in ath6kl_htc_rx_chk_water_mark() argument
1351 struct htc_ep_callbacks ep_cb = endpoint->ep_cb; in ath6kl_htc_rx_chk_water_mark()
1354 spin_lock_bh(&endpoint->target->rx_lock); in ath6kl_htc_rx_chk_water_mark()
1355 if (get_queue_depth(&endpoint->rx_bufq) in ath6kl_htc_rx_chk_water_mark()
1357 spin_unlock_bh(&endpoint->target->rx_lock); in ath6kl_htc_rx_chk_water_mark()
1358 ep_cb.rx_refill(endpoint->target, endpoint->eid); in ath6kl_htc_rx_chk_water_mark()
1361 spin_unlock_bh(&endpoint->target->rx_lock); in ath6kl_htc_rx_chk_water_mark()
1471 struct htc_endpoint *endpoint, in ath6kl_htc_rx_alloc() argument
1491 if (htc_hdr->eid != endpoint->eid) { in ath6kl_htc_rx_alloc()
1493 htc_hdr->eid, endpoint->eid, i); in ath6kl_htc_rx_alloc()
1506 if (endpoint->svc_id == 0) { in ath6kl_htc_rx_alloc()
1528 endpoint->ep_st.rx_bundle_from_hdr += 1; in ath6kl_htc_rx_alloc()
1537 status = ath6kl_htc_rx_setup(target, endpoint, &lk_ahds[i], in ath6kl_htc_rx_alloc()
1560 &target->endpoint[packet->endpoint]); in ath6kl_htc_rx_alloc()
1569 if (packets->endpoint != ENDPOINT_0) { in htc_ctrl_rx()
1584 "htc rx unexpected endpoint 0 message", "", in htc_ctrl_rx()
1589 htc_reclaim_rxbuf(context, packets, &context->endpoint[0]); in htc_ctrl_rx()
1597 struct htc_endpoint *endpoint; in htc_proc_cred_rpt() local
1610 endpoint = &target->endpoint[rpt->eid]; in htc_proc_cred_rpt()
1616 endpoint->ep_st.tx_cred_rpt += 1; in htc_proc_cred_rpt()
1617 endpoint->ep_st.cred_retnd += rpt->credits; in htc_proc_cred_rpt()
1621 * This credit report arrived on the same endpoint in htc_proc_cred_rpt()
1624 endpoint->ep_st.cred_from_rx += rpt->credits; in htc_proc_cred_rpt()
1625 endpoint->ep_st.cred_rpt_from_rx += 1; in htc_proc_cred_rpt()
1627 /* credit arrived on endpoint 0 as a NULL message */ in htc_proc_cred_rpt()
1628 endpoint->ep_st.cred_from_ep0 += rpt->credits; in htc_proc_cred_rpt()
1629 endpoint->ep_st.cred_rpt_ep0 += 1; in htc_proc_cred_rpt()
1631 endpoint->ep_st.cred_from_other += rpt->credits; in htc_proc_cred_rpt()
1632 endpoint->ep_st.cred_rpt_from_other += 1; in htc_proc_cred_rpt()
1636 /* always give endpoint 0 credits back */ in htc_proc_cred_rpt()
1637 endpoint->cred_dist.credits += rpt->credits; in htc_proc_cred_rpt()
1639 endpoint->cred_dist.cred_to_dist += rpt->credits; in htc_proc_cred_rpt()
1648 endpoint->cred_dist.txq_depth = in htc_proc_cred_rpt()
1649 get_queue_depth(&endpoint->txq); in htc_proc_cred_rpt()
1673 enum htc_endpoint_id endpoint, in htc_parse_trailer() argument
1690 len, endpoint); in htc_parse_trailer()
1752 int *n_lk_ahds, enum htc_endpoint_id endpoint) in htc_proc_trailer() argument
1786 next_lk_ahds, endpoint, n_lk_ahds); in htc_proc_trailer()
1845 if (packet->endpoint != htc_hdr->eid) { in ath6kl_htc_rx_process_hdr()
1847 htc_hdr->eid, packet->endpoint); in ath6kl_htc_rx_process_hdr()
1881 n_lkahds, packet->endpoint); in ath6kl_htc_rx_process_hdr()
1900 static void ath6kl_htc_rx_complete(struct htc_endpoint *endpoint, in ath6kl_htc_rx_complete() argument
1905 endpoint->eid, packet); in ath6kl_htc_rx_complete()
1907 endpoint->ep_cb.rx(endpoint->target, packet); in ath6kl_htc_rx_complete()
2013 ep = &target->endpoint[packet->endpoint]; in ath6kl_htc_rx_process_packets()
2015 trace_ath6kl_htc_rx(packet->status, packet->endpoint, in ath6kl_htc_rx_process_packets()
2129 &target->endpoint[packet->endpoint]); in ath6kl_htc_rx_fetch()
2135 &target->endpoint[packet->endpoint]); in ath6kl_htc_rx_fetch()
2145 struct htc_endpoint *endpoint; in ath6kl_htc_rxmsg_pending_handler() local
2164 * First lookahead sets the expected endpoint IDs for all in ath6kl_htc_rxmsg_pending_handler()
2168 endpoint = &target->endpoint[id]; in ath6kl_htc_rxmsg_pending_handler()
2171 ath6kl_err("MsgPend, invalid endpoint in look-ahead: %d\n", in ath6kl_htc_rxmsg_pending_handler()
2185 num_look_ahead, endpoint, in ath6kl_htc_rxmsg_pending_handler()
2204 ath6kl_htc_rx_chk_water_mark(endpoint); in ath6kl_htc_rxmsg_pending_handler()
2233 &target->endpoint[packets->endpoint]); in ath6kl_htc_rxmsg_pending_handler()
2258 * on ENDPOINT 0 are expected.
2294 trace_ath6kl_htc_rx(packet->status, packet->endpoint, in htc_wait_for_ctrl_msg()
2320 struct htc_endpoint *endpoint; in ath6kl_htc_mbox_add_rxbuf_multiple() local
2330 if (first_pkt->endpoint >= ENDPOINT_MAX) in ath6kl_htc_mbox_add_rxbuf_multiple()
2337 first_pkt->endpoint, depth, first_pkt->buf_len); in ath6kl_htc_mbox_add_rxbuf_multiple()
2339 endpoint = &target->endpoint[first_pkt->endpoint]; in ath6kl_htc_mbox_add_rxbuf_multiple()
2348 ath6kl_htc_rx_complete(endpoint, packet); in ath6kl_htc_mbox_add_rxbuf_multiple()
2356 list_splice_tail_init(pkt_queue, &endpoint->rx_bufq); in ath6kl_htc_mbox_add_rxbuf_multiple()
2360 if (target->ep_waiting == first_pkt->endpoint) { in ath6kl_htc_mbox_add_rxbuf_multiple()
2381 struct htc_endpoint *endpoint; in ath6kl_htc_mbox_flush_rx_buf() local
2386 endpoint = &target->endpoint[i]; in ath6kl_htc_mbox_flush_rx_buf()
2387 if (!endpoint->svc_id) in ath6kl_htc_mbox_flush_rx_buf()
2393 &endpoint->rx_bufq, list) { in ath6kl_htc_mbox_flush_rx_buf()
2399 packet->endpoint); in ath6kl_htc_mbox_flush_rx_buf()
2401 * packets in rx_bufq of endpoint 0 have originally in ath6kl_htc_mbox_flush_rx_buf()
2404 * separately using kmalloc(). For other endpoint in ath6kl_htc_mbox_flush_rx_buf()
2409 if (packet->endpoint == ENDPOINT_0) { in ath6kl_htc_mbox_flush_rx_buf()
2429 struct htc_endpoint *endpoint; in ath6kl_htc_mbox_conn_service() local
2504 endpoint = &target->endpoint[assigned_ep]; in ath6kl_htc_mbox_conn_service()
2505 endpoint->eid = assigned_ep; in ath6kl_htc_mbox_conn_service()
2506 if (endpoint->svc_id) { in ath6kl_htc_mbox_conn_service()
2511 /* return assigned endpoint to caller */ in ath6kl_htc_mbox_conn_service()
2512 conn_resp->endpoint = assigned_ep; in ath6kl_htc_mbox_conn_service()
2515 /* setup the endpoint */ in ath6kl_htc_mbox_conn_service()
2517 /* this marks the endpoint in use */ in ath6kl_htc_mbox_conn_service()
2518 endpoint->svc_id = conn_req->svc_id; in ath6kl_htc_mbox_conn_service()
2520 endpoint->max_txq_depth = conn_req->max_txq_depth; in ath6kl_htc_mbox_conn_service()
2521 endpoint->len_max = max_msg_sz; in ath6kl_htc_mbox_conn_service()
2522 endpoint->ep_cb = conn_req->ep_cb; in ath6kl_htc_mbox_conn_service()
2523 endpoint->cred_dist.svc_id = conn_req->svc_id; in ath6kl_htc_mbox_conn_service()
2524 endpoint->cred_dist.htc_ep = endpoint; in ath6kl_htc_mbox_conn_service()
2525 endpoint->cred_dist.endpoint = assigned_ep; in ath6kl_htc_mbox_conn_service()
2526 endpoint->cred_dist.cred_sz = target->tgt_cred_sz; in ath6kl_htc_mbox_conn_service()
2528 switch (endpoint->svc_id) { in ath6kl_htc_mbox_conn_service()
2530 endpoint->tx_drop_packet_threshold = MAX_DEF_COOKIE_NUM / 3; in ath6kl_htc_mbox_conn_service()
2533 endpoint->tx_drop_packet_threshold = MAX_HI_COOKIE_NUM; in ath6kl_htc_mbox_conn_service()
2547 endpoint->cred_dist.cred_per_msg = in ath6kl_htc_mbox_conn_service()
2550 endpoint->cred_dist.cred_per_msg = in ath6kl_htc_mbox_conn_service()
2553 if (!endpoint->cred_dist.cred_per_msg) in ath6kl_htc_mbox_conn_service()
2554 endpoint->cred_dist.cred_per_msg = 1; in ath6kl_htc_mbox_conn_service()
2557 endpoint->conn_flags = conn_req->flags; in ath6kl_htc_mbox_conn_service()
2573 struct htc_endpoint *endpoint; in reset_ep_state() local
2577 endpoint = &target->endpoint[i]; in reset_ep_state()
2578 memset(&endpoint->cred_dist, 0, sizeof(endpoint->cred_dist)); in reset_ep_state()
2579 endpoint->svc_id = 0; in reset_ep_state()
2580 endpoint->len_max = 0; in reset_ep_state()
2581 endpoint->max_txq_depth = 0; in reset_ep_state()
2582 memset(&endpoint->ep_st, 0, in reset_ep_state()
2583 sizeof(endpoint->ep_st)); in reset_ep_state()
2584 INIT_LIST_HEAD(&endpoint->rx_bufq); in reset_ep_state()
2585 INIT_LIST_HEAD(&endpoint->txq); in reset_ep_state()
2586 endpoint->target = target; in reset_ep_state()
2595 enum htc_endpoint_id endpoint) in ath6kl_htc_mbox_get_rxbuf_num() argument
2600 num = get_queue_depth(&(target->endpoint[endpoint].rx_bufq)); in ath6kl_htc_mbox_get_rxbuf_num()
2707 /* setup our pseudo HTC control endpoint connection */ in ath6kl_htc_mbox_wait_target()
2753 /* Push control receive buffers into htc control endpoint */ in ath6kl_htc_mbox_start()
2810 packet->endpoint = ENDPOINT_0; in ath6kl_htc_reset()