Lines Matching refs:priv_req

397 		struct cdns3_request *priv_req;  in cdns3_start_all_request()  local
400 priv_req = to_cdns3_request(request); in cdns3_start_all_request()
401 if ((priv_req->flags & REQUEST_INTERNAL) || in cdns3_start_all_request()
510 struct cdns3_request *priv_req) in cdns3_wa2_gadget_giveback() argument
513 priv_req->flags & REQUEST_INTERNAL) { in cdns3_wa2_gadget_giveback()
545 return &priv_req->request; in cdns3_wa2_gadget_giveback()
550 struct cdns3_request *priv_req) in cdns3_wa2_gadget_ep_queue() argument
580 !(priv_req->flags & REQUEST_INTERNAL)) { in cdns3_wa2_gadget_ep_queue()
582 &priv_req->request); in cdns3_wa2_gadget_ep_queue()
586 list_add_tail(&priv_req->request.list, in cdns3_wa2_gadget_ep_queue()
588 cdns3_gadget_giveback(priv_ep, priv_req, in cdns3_wa2_gadget_ep_queue()
589 priv_req->request.status); in cdns3_wa2_gadget_ep_queue()
608 if (priv_req->flags & REQUEST_INTERNAL) in cdns3_wa2_gadget_ep_queue()
609 list_add_tail(&priv_req->list, in cdns3_wa2_gadget_ep_queue()
618 struct cdns3_request *priv_req; in cdns3_wa2_remove_old_request() local
623 priv_req = cdns3_next_priv_request(&priv_ep->wa2_descmiss_req_list); in cdns3_wa2_remove_old_request()
624 chain = !!(priv_req->flags & REQUEST_INTERNAL_CH); in cdns3_wa2_remove_old_request()
628 kfree(priv_req->request.buf); in cdns3_wa2_remove_old_request()
629 list_del_init(&priv_req->list); in cdns3_wa2_remove_old_request()
631 &priv_req->request); in cdns3_wa2_remove_old_request()
648 struct cdns3_request *priv_req; in cdns3_wa2_descmissing_packet() local
675 priv_req = to_cdns3_request(request); in cdns3_wa2_descmissing_packet()
676 priv_req->flags |= REQUEST_INTERNAL; in cdns3_wa2_descmissing_packet()
687 priv_req->request.buf = kzalloc(CDNS3_DESCMIS_BUF_SIZE, in cdns3_wa2_descmissing_packet()
691 if (!priv_req->request.buf) { in cdns3_wa2_descmissing_packet()
696 priv_req->request.length = CDNS3_DESCMIS_BUF_SIZE; in cdns3_wa2_descmissing_packet()
697 priv_ep->descmis_req = priv_req; in cdns3_wa2_descmissing_packet()
793 struct cdns3_request *priv_req, in cdns3_gadget_giveback() argument
797 struct usb_request *request = &priv_req->request; in cdns3_gadget_giveback()
804 if (likely(!(priv_req->flags & REQUEST_UNALIGNED))) in cdns3_gadget_giveback()
808 if ((priv_req->flags & REQUEST_UNALIGNED) && in cdns3_gadget_giveback()
812 priv_req->aligned_buf->dma, in cdns3_gadget_giveback()
814 priv_req->aligned_buf->dir); in cdns3_gadget_giveback()
815 memcpy(request->buf, priv_req->aligned_buf->buf, in cdns3_gadget_giveback()
819 priv_req->flags &= ~(REQUEST_PENDING | REQUEST_UNALIGNED); in cdns3_gadget_giveback()
821 priv_req->finished_trb = 0; in cdns3_gadget_giveback()
822 trace_cdns3_gadget_giveback(priv_req); in cdns3_gadget_giveback()
826 priv_req); in cdns3_gadget_giveback()
893 static int cdns3_prepare_aligned_request_buf(struct cdns3_request *priv_req) in cdns3_prepare_aligned_request_buf() argument
895 struct cdns3_endpoint *priv_ep = priv_req->priv_ep; in cdns3_prepare_aligned_request_buf()
900 if (!((uintptr_t)priv_req->request.buf & 0x7)) in cdns3_prepare_aligned_request_buf()
903 buf = priv_req->aligned_buf; in cdns3_prepare_aligned_request_buf()
905 if (!buf || priv_req->request.length > buf->size) { in cdns3_prepare_aligned_request_buf()
910 buf->size = priv_req->request.length; in cdns3_prepare_aligned_request_buf()
924 if (priv_req->aligned_buf) { in cdns3_prepare_aligned_request_buf()
925 trace_cdns3_free_aligned_request(priv_req); in cdns3_prepare_aligned_request_buf()
926 priv_req->aligned_buf->in_use = 0; in cdns3_prepare_aligned_request_buf()
932 priv_req->aligned_buf = buf; in cdns3_prepare_aligned_request_buf()
942 memcpy(buf->buf, priv_req->request.buf, in cdns3_prepare_aligned_request_buf()
943 priv_req->request.length); in cdns3_prepare_aligned_request_buf()
950 priv_req->flags |= REQUEST_UNALIGNED; in cdns3_prepare_aligned_request_buf()
951 trace_cdns3_prepare_aligned_request(priv_req); in cdns3_prepare_aligned_request_buf()
995 struct cdns3_request *priv_req; in cdns3_ep_run_stream_transfer() local
1004 priv_req = to_cdns3_request(request); in cdns3_ep_run_stream_transfer()
1010 if (priv_req->flags & REQUEST_UNALIGNED) in cdns3_ep_run_stream_transfer()
1011 trb_dma = priv_req->aligned_buf->dma; in cdns3_ep_run_stream_transfer()
1017 priv_req->start_trb = priv_ep->enqueue; in cdns3_ep_run_stream_transfer()
1018 priv_req->end_trb = priv_req->start_trb; in cdns3_ep_run_stream_transfer()
1019 priv_req->trb = trb; in cdns3_ep_run_stream_transfer()
1024 TRB_STREAM_ID(priv_req->request.stream_id) | TRB_ISP; in cdns3_ep_run_stream_transfer()
1047 priv_req->flags |= REQUEST_PENDING; in cdns3_ep_run_stream_transfer()
1051 trace_cdns3_prepare_trb(priv_ep, priv_req->trb); in cdns3_ep_run_stream_transfer()
1081 priv_ep->last_stream_id = priv_req->request.stream_id; in cdns3_ep_run_stream_transfer()
1083 writel(EP_CMD_ERDY_SID(priv_req->request.stream_id) | in cdns3_ep_run_stream_transfer()
1120 struct cdns3_request *priv_req; in cdns3_ep_run_transfer() local
1145 priv_req = to_cdns3_request(request); in cdns3_ep_run_transfer()
1151 if (priv_req->flags & REQUEST_UNALIGNED) in cdns3_ep_run_transfer()
1152 trb_dma = priv_req->aligned_buf->dma; in cdns3_ep_run_transfer()
1157 priv_req->start_trb = priv_ep->enqueue; in cdns3_ep_run_transfer()
1158 priv_req->trb = trb; in cdns3_ep_run_transfer()
1204 priv_req->trb = trb; in cdns3_ep_run_transfer()
1302 priv_req->trb->control = cpu_to_le32(control); in cdns3_ep_run_transfer()
1315 priv_req->end_trb = priv_ep->enqueue; in cdns3_ep_run_transfer()
1321 trb = priv_req->trb; in cdns3_ep_run_transfer()
1323 priv_req->flags |= REQUEST_PENDING; in cdns3_ep_run_transfer()
1324 priv_req->num_of_trb = num_trb; in cdns3_ep_run_transfer()
1372 trace_cdns3_prepare_trb(priv_ep, priv_req->trb); in cdns3_ep_run_transfer()
1399 priv_req->start_trb * TRB_SIZE), in cdns3_ep_run_transfer()
1486 struct cdns3_request *priv_req) in cdns3_trb_handled() argument
1498 if (priv_req->start_trb < priv_req->end_trb) { in cdns3_trb_handled()
1499 if (priv_ep->dequeue > priv_req->end_trb) in cdns3_trb_handled()
1502 if (priv_ep->dequeue < priv_req->start_trb) in cdns3_trb_handled()
1506 if ((priv_req->start_trb > priv_req->end_trb) && in cdns3_trb_handled()
1507 (priv_ep->dequeue > priv_req->end_trb) && in cdns3_trb_handled()
1508 (priv_ep->dequeue < priv_req->start_trb)) in cdns3_trb_handled()
1511 if ((priv_req->start_trb == priv_req->end_trb) && in cdns3_trb_handled()
1512 (priv_ep->dequeue != priv_req->end_trb)) in cdns3_trb_handled()
1543 trace_cdns3_request_handled(priv_req, current_index, handled); in cdns3_trb_handled()
1551 struct cdns3_request *priv_req; in cdns3_transfer_completed() local
1559 priv_req = to_cdns3_request(request); in cdns3_transfer_completed()
1582 while (cdns3_trb_handled(priv_ep, priv_req)) { in cdns3_transfer_completed()
1583 priv_req->finished_trb++; in cdns3_transfer_completed()
1584 if (priv_req->finished_trb >= priv_req->num_of_trb) in cdns3_transfer_completed()
1594 if (priv_req->num_of_trb > 1 && in cdns3_transfer_completed()
1607 cdns3_gadget_giveback(priv_ep, priv_req, 0); in cdns3_transfer_completed()
1626 if (trb != priv_req->trb) in cdns3_transfer_completed()
1629 priv_req->trb, trb); in cdns3_transfer_completed()
1636 cdns3_gadget_giveback(priv_ep, priv_req, 0); in cdns3_transfer_completed()
2314 struct cdns3_request *priv_req; in cdns3_gadget_ep_alloc_request() local
2316 priv_req = kzalloc(sizeof(*priv_req), gfp_flags); in cdns3_gadget_ep_alloc_request()
2317 if (!priv_req) in cdns3_gadget_ep_alloc_request()
2320 priv_req->priv_ep = priv_ep; in cdns3_gadget_ep_alloc_request()
2322 trace_cdns3_alloc_request(priv_req); in cdns3_gadget_ep_alloc_request()
2323 return &priv_req->request; in cdns3_gadget_ep_alloc_request()
2334 struct cdns3_request *priv_req = to_cdns3_request(request); in cdns3_gadget_ep_free_request() local
2336 if (priv_req->aligned_buf) in cdns3_gadget_ep_free_request()
2337 priv_req->aligned_buf->in_use = 0; in cdns3_gadget_ep_free_request()
2339 trace_cdns3_free_request(priv_req); in cdns3_gadget_ep_free_request()
2340 kfree(priv_req); in cdns3_gadget_ep_free_request()
2492 struct cdns3_request *priv_req; in cdns3_gadget_ep_disable() local
2546 priv_req = cdns3_next_priv_request(&priv_ep->wa2_descmiss_req_list); in cdns3_gadget_ep_disable()
2547 list_del_init(&priv_req->list); in cdns3_gadget_ep_disable()
2549 kfree(priv_req->request.buf); in cdns3_gadget_ep_disable()
2551 &priv_req->request); in cdns3_gadget_ep_disable()
2587 struct cdns3_request *priv_req; in __cdns3_gadget_ep_queue() local
2592 priv_req = to_cdns3_request(request); in __cdns3_gadget_ep_queue()
2593 trace_cdns3_ep_queue(priv_req); in __cdns3_gadget_ep_queue()
2597 priv_req); in __cdns3_gadget_ep_queue()
2603 ret = cdns3_prepare_aligned_request_buf(priv_req); in __cdns3_gadget_ep_queue()
2607 if (likely(!(priv_req->flags & REQUEST_UNALIGNED))) { in __cdns3_gadget_ep_queue()
2657 struct cdns3_request *priv_req; in cdns3_gadget_ep_queue() local
2663 priv_req = to_cdns3_request(zlp_request); in cdns3_gadget_ep_queue()
2664 priv_req->flags |= REQUEST_ZLP; in cdns3_gadget_ep_queue()
2688 struct cdns3_request *priv_req; in cdns3_gadget_ep_dequeue() local
2702 priv_req = to_cdns3_request(request); in cdns3_gadget_ep_dequeue()
2704 trace_cdns3_ep_dequeue(priv_req); in cdns3_gadget_ep_dequeue()
2725 link_trb = priv_req->trb; in cdns3_gadget_ep_dequeue()
2737 ((priv_req->end_trb + 1) * TRB_SIZE))); in cdns3_gadget_ep_dequeue()
2741 if (priv_ep->wa1_trb == priv_req->trb) in cdns3_gadget_ep_dequeue()
2745 cdns3_gadget_giveback(priv_ep, priv_req, -ECONNRESET); in cdns3_gadget_ep_dequeue()
2786 struct cdns3_request *priv_req; in __cdns3_gadget_ep_clear_halt() local
2796 priv_req = to_cdns3_request(request); in __cdns3_gadget_ep_clear_halt()
2797 trb = priv_req->trb; in __cdns3_gadget_ep_clear_halt()