usb: dwc3: gadget: Fix TRB pointer increment logic

Currently the driver assumes that the number of TRBs per EP would
be 256 (DWC3_TRB_NUM) and accordingly goes back to 0th TRB if
pointer reaches 255th index (link TRB). But the GSI EPs can have
lesser number of TRBs, say 16. And if it uses SW interrupt, then
the TRB pointer increment logic fails because TRB from index 16
to 254 is invalid.
Fix this by checking index against dep->num_trbs which is
programmed separately for normal and GSI EPs.

Change-Id: Ida5745c2d7d0564507333c5b38d728090e70fcf6
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
1 file changed