mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 04:16:35 +08:00
drivers/usbdev: support config usb req buffer alignment bytes
we need to alloc req buffer in cacheline size units, othersize the data may by incorrect. Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
@@ -25,6 +25,12 @@ config USBDEV_DUALSPEED
|
||||
---help---
|
||||
Hardware handles high and full speed operation (USB 2.0)
|
||||
|
||||
config USBDEV_EPBUFFER_ALIGNMENT
|
||||
int "The usbdev ep req bffer aligned bytes"
|
||||
default 0
|
||||
---help---
|
||||
The aligned bytes of usbdev ep req buffer
|
||||
|
||||
choice
|
||||
prompt "Select USB device powered"
|
||||
default USBDEV_SELFPOWERED
|
||||
|
||||
@@ -47,7 +47,11 @@
|
||||
# define EP_ALLOCBUFFER(ep,nb) (ep)->ops->allocbuffer(ep,nb)
|
||||
# define EP_FREEBUFFER(ep,buf) (ep)->ops->freebuffer(ep,buf)
|
||||
#else
|
||||
# define EP_ALLOCBUFFER(ep,nb) kmm_malloc(nb)
|
||||
# if CONFIG_USBDEV_EPBUFFER_ALIGNMENT != 0
|
||||
# define EP_ALLOCBUFFER(ep,nb) kmm_memalign(CONFIG_USBDEV_EPBUFFER_ALIGNMENT, nb)
|
||||
# else
|
||||
# define EP_ALLOCBUFFER(ep,nb) kmm_malloc(nb)
|
||||
# endif
|
||||
# define EP_FREEBUFFER(ep,buf) kmm_free(buf)
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user