Lines Matching refs:priv_req
397 struct cdns3_request *priv_req;
400 priv_req = to_cdns3_request(request);
401 if ((priv_req->flags & REQUEST_INTERNAL) ||
510 struct cdns3_request *priv_req)
513 priv_req->flags & REQUEST_INTERNAL) {
545 return &priv_req->request;
550 struct cdns3_request *priv_req)
580 !(priv_req->flags & REQUEST_INTERNAL)) {
582 &priv_req->request);
586 list_add_tail(&priv_req->request.list,
588 cdns3_gadget_giveback(priv_ep, priv_req,
589 priv_req->request.status);
608 if (priv_req->flags & REQUEST_INTERNAL)
609 list_add_tail(&priv_req->list,
618 struct cdns3_request *priv_req;
623 priv_req = cdns3_next_priv_request(&priv_ep->wa2_descmiss_req_list);
624 chain = !!(priv_req->flags & REQUEST_INTERNAL_CH);
628 kfree(priv_req->request.buf);
629 list_del_init(&priv_req->list);
631 &priv_req->request);
648 struct cdns3_request *priv_req;
675 priv_req = to_cdns3_request(request);
676 priv_req->flags |= REQUEST_INTERNAL;
687 priv_req->request.buf = kzalloc(CDNS3_DESCMIS_BUF_SIZE,
691 if (!priv_req->request.buf) {
696 priv_req->request.length = CDNS3_DESCMIS_BUF_SIZE;
697 priv_ep->descmis_req = priv_req;
785 * @priv_req: The request we're giving back
793 struct cdns3_request *priv_req,
797 struct usb_request *request = &priv_req->request;
804 if (likely(!(priv_req->flags & REQUEST_UNALIGNED)))
808 if ((priv_req->flags & REQUEST_UNALIGNED) &&
812 priv_req->aligned_buf->dma,
814 priv_req->aligned_buf->dir);
815 memcpy(request->buf, priv_req->aligned_buf->buf,
819 priv_req->flags &= ~(REQUEST_PENDING | REQUEST_UNALIGNED);
821 priv_req->finished_trb = 0;
822 trace_cdns3_gadget_giveback(priv_req);
826 priv_req);
893 static int cdns3_prepare_aligned_request_buf(struct cdns3_request *priv_req)
895 struct cdns3_endpoint *priv_ep = priv_req->priv_ep;
900 if (!((uintptr_t)priv_req->request.buf & 0x7))
903 buf = priv_req->aligned_buf;
905 if (!buf || priv_req->request.length > buf->size) {
910 buf->size = priv_req->request.length;
924 if (priv_req->aligned_buf) {
925 trace_cdns3_free_aligned_request(priv_req);
926 priv_req->aligned_buf->in_use = 0;
932 priv_req->aligned_buf = buf;
942 memcpy(buf->buf, priv_req->request.buf,
943 priv_req->request.length);
950 priv_req->flags |= REQUEST_UNALIGNED;
951 trace_cdns3_prepare_aligned_request(priv_req);
995 struct cdns3_request *priv_req;
1004 priv_req = to_cdns3_request(request);
1010 if (priv_req->flags & REQUEST_UNALIGNED)
1011 trb_dma = priv_req->aligned_buf->dma;
1017 priv_req->start_trb = priv_ep->enqueue;
1018 priv_req->end_trb = priv_req->start_trb;
1019 priv_req->trb = trb;
1024 TRB_STREAM_ID(priv_req->request.stream_id) | TRB_ISP;
1047 priv_req->flags |= REQUEST_PENDING;
1051 trace_cdns3_prepare_trb(priv_ep, priv_req->trb);
1081 priv_ep->last_stream_id = priv_req->request.stream_id;
1083 writel(EP_CMD_ERDY_SID(priv_req->request.stream_id) |
1120 struct cdns3_request *priv_req;
1144 priv_req = to_cdns3_request(request);
1150 if (priv_req->flags & REQUEST_UNALIGNED)
1151 trb_dma = priv_req->aligned_buf->dma;
1156 priv_req->start_trb = priv_ep->enqueue;
1157 priv_req->trb = trb;
1203 priv_req->trb = trb;
1301 priv_req->trb->control = cpu_to_le32(control);
1314 priv_req->end_trb = priv_ep->enqueue;
1320 trb = priv_req->trb;
1322 priv_req->flags |= REQUEST_PENDING;
1323 priv_req->num_of_trb = num_trb;
1371 trace_cdns3_prepare_trb(priv_ep, priv_req->trb);
1398 priv_req->start_trb * TRB_SIZE),
1449 * @priv_req: request object for checking
1459 * ST = priv_req->start_trb - index of first TRB in transfer ring
1460 * ET = priv_req->end_trb - index of last TRB in transfer ring
1485 struct cdns3_request *priv_req)
1497 if (priv_req->start_trb < priv_req->end_trb) {
1498 if (priv_ep->dequeue > priv_req->end_trb)
1501 if (priv_ep->dequeue < priv_req->start_trb)
1505 if ((priv_req->start_trb > priv_req->end_trb) &&
1506 (priv_ep->dequeue > priv_req->end_trb) &&
1507 (priv_ep->dequeue < priv_req->start_trb))
1510 if ((priv_req->start_trb == priv_req->end_trb) &&
1511 (priv_ep->dequeue != priv_req->end_trb))
1542 trace_cdns3_request_handled(priv_req, current_index, handled);
1550 struct cdns3_request *priv_req;
1558 priv_req = to_cdns3_request(request);
1581 while (cdns3_trb_handled(priv_ep, priv_req)) {
1582 priv_req->finished_trb++;
1583 if (priv_req->finished_trb >= priv_req->num_of_trb)
1593 if (priv_req->num_of_trb > 1 &&
1606 cdns3_gadget_giveback(priv_ep, priv_req, 0);
1625 if (trb != priv_req->trb)
1628 priv_req->trb, trb);
1635 cdns3_gadget_giveback(priv_ep, priv_req, 0);
2313 struct cdns3_request *priv_req;
2315 priv_req = kzalloc(sizeof(*priv_req), gfp_flags);
2316 if (!priv_req)
2319 priv_req->priv_ep = priv_ep;
2321 trace_cdns3_alloc_request(priv_req);
2322 return &priv_req->request;
2333 struct cdns3_request *priv_req = to_cdns3_request(request);
2335 if (priv_req->aligned_buf)
2336 priv_req->aligned_buf->in_use = 0;
2338 trace_cdns3_free_request(priv_req);
2339 kfree(priv_req);
2491 struct cdns3_request *priv_req;
2545 priv_req = cdns3_next_priv_request(&priv_ep->wa2_descmiss_req_list);
2546 list_del_init(&priv_req->list);
2548 kfree(priv_req->request.buf);
2550 &priv_req->request);
2586 struct cdns3_request *priv_req;
2591 priv_req = to_cdns3_request(request);
2592 trace_cdns3_ep_queue(priv_req);
2596 priv_req);
2602 ret = cdns3_prepare_aligned_request_buf(priv_req);
2606 if (likely(!(priv_req->flags & REQUEST_UNALIGNED))) {
2656 struct cdns3_request *priv_req;
2662 priv_req = to_cdns3_request(zlp_request);
2663 priv_req->flags |= REQUEST_ZLP;
2687 struct cdns3_request *priv_req;
2701 priv_req = to_cdns3_request(request);
2703 trace_cdns3_ep_dequeue(priv_req);
2724 link_trb = priv_req->trb;
2736 ((priv_req->end_trb + 1) * TRB_SIZE)));
2740 if (priv_ep->wa1_trb == priv_req->trb)
2744 cdns3_gadget_giveback(priv_ep, priv_req, -ECONNRESET);
2785 struct cdns3_request *priv_req;
2795 priv_req = to_cdns3_request(request);
2796 trb = priv_req->trb;