-/* $OpenBSD: dwc2.c,v 1.58 2021/07/30 18:56:01 mglocker Exp $ */
+/* $OpenBSD: dwc2.c,v 1.59 2021/11/28 09:25:02 mglocker Exp $ */
/* $NetBSD: dwc2.c,v 1.32 2014/09/02 23:26:20 macallan Exp $ */
/*-
pool_init(&sc->sc_qtdpool, sizeof(struct dwc2_qtd), 0, IPL_USB, 0,
"dwc2qtd", NULL);
- sc->sc_hsotg = malloc(sizeof(struct dwc2_hsotg), M_DEVBUF,
+ sc->sc_hsotg = malloc(sizeof(struct dwc2_hsotg), M_USBHC,
M_ZERO | M_WAITOK);
sc->sc_hsotg->hsotg_sc = sc;
sc->sc_hsotg->dev = &sc->sc_bus.bdev;
goto fail2;
}
- hsotg->core_params = malloc(sizeof(*hsotg->core_params), M_DEVBUF,
+ hsotg->core_params = malloc(sizeof(*hsotg->core_params), M_USBHC,
M_ZERO | M_WAITOK);
dwc2_set_all_params(hsotg->core_params, -1);
fail2:
err = -retval;
- free(sc->sc_hsotg, M_DEVBUF, sizeof(struct dwc2_hsotg));
+ free(sc->sc_hsotg, M_USBHC, sizeof(struct dwc2_hsotg));
softintr_disestablish(sc->sc_rhc_si);
return err;
-/* $OpenBSD: dwc2_hcd.c,v 1.25 2021/09/04 10:19:28 mglocker Exp $ */
+/* $OpenBSD: dwc2_hcd.c,v 1.26 2021/11/28 09:25:02 mglocker Exp $ */
/* $NetBSD: dwc2_hcd.c,v 1.15 2014/11/24 10:14:14 skrll Exp $ */
/*
u32 size = sizeof(*urb) + iso_desc_count *
sizeof(struct dwc2_hcd_iso_packet_desc);
- urb = malloc(size, M_DEVBUF, M_ZERO | mem_flags);
+ urb = malloc(size, M_USBHC, M_ZERO | mem_flags);
if (urb)
urb->packet_count = iso_desc_count;
return urb;
u32 size = sizeof(*urb) + iso_desc_count *
sizeof(struct dwc2_hcd_iso_packet_desc);
- free(urb, M_DEVBUF, size);
+ free(urb, M_USBHC, size);
}
void
dev_dbg(hsotg->dev, "HCD Free channel #%i, chan=%p\n",
i, chan);
hsotg->hc_ptr_array[i] = NULL;
- free(chan, M_DEVBUF, sizeof(*chan));
+ free(chan, M_USBHC, sizeof(*chan));
}
}
hsotg->status_buf = NULL;
}
} else {
- free(hsotg->status_buf, M_DEVBUF, DWC2_HCD_STATUS_BUF_SIZE);
+ free(hsotg->status_buf, M_USBHC, DWC2_HCD_STATUS_BUF_SIZE);
hsotg->status_buf = NULL;
}
taskq_destroy(hsotg->wq_otg);
}
- free(hsotg->core_params, M_DEVBUF, sizeof(*hsotg->core_params));
+ free(hsotg->core_params, M_USBHC, sizeof(*hsotg->core_params));
hsotg->core_params = NULL;
timeout_del(&hsotg->wkp_timer);
}
#ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS
hsotg->frame_num_array = malloc(sizeof(*hsotg->frame_num_array) *
- FRAME_NUM_ARRAY_SIZE, M_DEVBUF,
+ FRAME_NUM_ARRAY_SIZE, M_USBHC,
M_ZERO | M_WAITOK);
if (!hsotg->frame_num_array)
goto error1;
hsotg->last_frame_num_array = malloc(
sizeof(*hsotg->last_frame_num_array) *
- FRAME_NUM_ARRAY_SIZE, M_DEVBUF, M_ZERO | M_WAITOK);
+ FRAME_NUM_ARRAY_SIZE, M_USBHC, M_ZERO | M_WAITOK);
if (!hsotg->last_frame_num_array)
goto error1;
hsotg->last_frame_num = HFNUM_MAX_FRNUM;
memset(&hsotg->hc_ptr_array[0], 0, sizeof(hsotg->hc_ptr_array));
for (i = 0; i < num_channels; i++) {
- channel = malloc(sizeof(*channel), M_DEVBUF, M_ZERO | M_WAITOK);
+ channel = malloc(sizeof(*channel), M_USBHC, M_ZERO | M_WAITOK);
if (channel == NULL)
goto error3;
channel->hc_num = i;
hsotg->status_buf_dma = DMAADDR(&hsotg->status_buf_usbdma, 0);
}
} else
- hsotg->status_buf = malloc(DWC2_HCD_STATUS_BUF_SIZE, M_DEVBUF,
+ hsotg->status_buf = malloc(DWC2_HCD_STATUS_BUF_SIZE, M_USBHC,
M_ZERO | M_WAITOK);
/* retval is already -ENOMEM */
dwc2_hcd_release(hsotg);
error2:
if (hsotg->core_params != NULL)
- free(hsotg->core_params, M_DEVBUF, sizeof(*hsotg->core_params));
+ free(hsotg->core_params, M_USBHC, sizeof(*hsotg->core_params));
#ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS
if (hsotg->last_frame_num_array != NULL)
- free(hsotg->last_frame_num_array, M_DEVBUF,
+ free(hsotg->last_frame_num_array, M_USBHC,
sizeof(*hsotg->last_frame_num_array) * FRAME_NUM_ARRAY_SIZE);
if (hsotg->frame_num_array != NULL)
- free(hsotg->frame_num_array, M_DEVBUF,
+ free(hsotg->frame_num_array, M_USBHC,
sizeof(*hsotg->frame_num_array) * FRAME_NUM_ARRAY_SIZE);
#endif
dwc2_hcd_release(hsotg);
#ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS
- free(hsotg->last_frame_num_array, M_DEVBUF, sizeof(*hsotg->last_frame_num_array) * FRAME_NUM_ARRAY_SIZE);
- free(hsotg->frame_num_array, M_DEVBUF, sizeof(*hsotg->frame_num_array) * FRAME_NUM_ARRAY_SIZE);
+ free(hsotg->last_frame_num_array, M_USBHC, sizeof(*hsotg->last_frame_num_array) * FRAME_NUM_ARRAY_SIZE);
+ free(hsotg->frame_num_array, M_USBHC, sizeof(*hsotg->frame_num_array) * FRAME_NUM_ARRAY_SIZE);
#endif
}