mpfs_usb.c: Use kernel memory instead of user memory for DMA

DMA directly to user (virtual) memory won't work, as the DMA engine(s)
don't do address translations, i.e. they require a physical address.

Using kernel heap is fine as it is mapped vaddr=paddr. Also, the USB DMA
engine does not have any alignment requirements.
This commit is contained in:
Ville Juven
2023-12-15 12:44:42 +02:00
committed by Xiang Xiao
parent fbd8a2127a
commit baea0012e7
+2 -2
View File
@@ -1718,7 +1718,7 @@ static void *mpfs_ep_allocbuffer(struct usbdev_ep_s *ep, uint16_t nbytes)
{
/* There is not special buffer allocation requirement */
return kumm_malloc(nbytes);
return kmm_malloc(nbytes);
}
#endif
@@ -1745,7 +1745,7 @@ static void mpfs_ep_freebuffer(struct usbdev_ep_s *ep, void *buf)
{
/* There is not special buffer allocation requirement */
kumm_free(buf);
kmm_free(buf);
}
#endif