-/* $OpenBSD: dwc2.c,v 1.66 2022/09/09 21:16:54 mglocker Exp $ */
+/* $OpenBSD: dwc2.c,v 1.67 2022/09/10 08:13:16 mglocker Exp $ */
/* $NetBSD: dwc2.c,v 1.32 2014/09/02 23:26:20 macallan Exp $ */
/*-
DWC2_EVCNT_INCR(sc->sc_ev_xferpoolget);
dxfer = pool_get(&sc->sc_xferpool, PR_NOWAIT | PR_ZERO);
if (dxfer != NULL) {
- dxfer->urb = dwc2_hcd_urb_alloc(sc->sc_hsotg,
- DWC2_MAXISOCPACKETS, M_NOWAIT);
#ifdef DIAGNOSTIC
dxfer->xfer.busy_free = XFER_ONQU;
#endif
xfer->busy_free = XFER_FREE;
#endif
DWC2_EVCNT_INCR(sc->sc_ev_xferpoolput);
- dwc2_hcd_urb_free(sc->sc_hsotg, dxfer->urb, DWC2_MAXISOCPACKETS);
+ dwc2_hcd_urb_free(sc->sc_hsotg, dxfer->urb, xfer->nframes);
pool_put(&sc->sc_xferpool, xfer);
}
len = xfer->length;
}
+ dxfer->urb = dwc2_hcd_urb_alloc(sc->sc_hsotg, xfer->nframes, M_NOWAIT);
dwc2_urb = dxfer->urb;
if (!dwc2_urb)
return USBD_NOMEM;
-// KASSERT(dwc2_urb->packet_count == xfer->nframes);
memset(dwc2_urb, 0, sizeof(*dwc2_urb) +
- sizeof(dwc2_urb->iso_descs[0]) * DWC2_MAXISOCPACKETS);
+ sizeof(dwc2_urb->iso_descs[0]) * xfer->nframes);
dwc2_urb->priv = xfer;
dwc2_urb->packet_count = xfer->nframes;
xfer->actlen = 0;
- KASSERT(xfertype != UE_ISOCHRONOUS ||
- xfer->nframes <= DWC2_MAXISOCPACKETS);
KASSERTMSG(xfer->nframes == 0 || xfertype == UE_ISOCHRONOUS,
"nframes %d xfertype %d\n", xfer->nframes, xfertype);
-/* $OpenBSD: dwc2var.h,v 1.23 2022/09/04 08:42:40 mglocker Exp $ */
+/* $OpenBSD: dwc2var.h,v 1.24 2022/09/10 08:13:16 mglocker Exp $ */
/* $NetBSD: dwc2var.h,v 1.3 2013/10/22 12:57:40 skrll Exp $ */
/*-
* XXX Compat
*/
#define USB_MAXCHILDREN 31 /* XXX: Include in to our USB stack */
-#define DWC2_MAXISOCPACKETS 40 /* XXX: Fix nframes handling */
#define ENOSR 90
#define device_xname(d) ((d)->dv_xname)
#define jiffies hardclock_ticks