1
0
Fork 0

MLK-23595-2 usb: cdns3: gadget: add CHAIN and ISP bit for sg list

For sg buffer list use case, we need to add ISP for each TRB, and
add CHAIN bit for each TRB except for the last TRB.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Peter Chen 2020-03-16 17:27:24 +08:00
parent d2e892c29d
commit 3490e68497
No known key found for this signature in database
GPG Key ID: 4859298150D671BB
1 changed files with 9 additions and 3 deletions

View File

@ -715,14 +715,20 @@ int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep,
trb->control = control;
control = 0;
++sg_iter;
if (request->num_mapped_sgs)
if (request->num_mapped_sgs) {
trb->control |= TRB_ISP;
/* Don't set chain bit for last TRB */
if (sg_iter < num_trb - 1)
trb->control |= TRB_CHAIN;
s = sg_next(s);
}
priv_req->end_trb = priv_ep->enqueue;
cdns3_ep_inc_enq(priv_ep);
trb = priv_ep->trb_pool + priv_ep->enqueue;
trb->length = 0;
} while (sg_iter < num_trb);
} while (++sg_iter < num_trb);
trb = priv_req->trb;