mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +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---
|
---help---
|
||||||
Hardware handles high and full speed operation (USB 2.0)
|
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
|
choice
|
||||||
prompt "Select USB device powered"
|
prompt "Select USB device powered"
|
||||||
default USBDEV_SELFPOWERED
|
default USBDEV_SELFPOWERED
|
||||||
|
|||||||
@@ -47,7 +47,11 @@
|
|||||||
# define EP_ALLOCBUFFER(ep,nb) (ep)->ops->allocbuffer(ep,nb)
|
# define EP_ALLOCBUFFER(ep,nb) (ep)->ops->allocbuffer(ep,nb)
|
||||||
# define EP_FREEBUFFER(ep,buf) (ep)->ops->freebuffer(ep,buf)
|
# define EP_FREEBUFFER(ep,buf) (ep)->ops->freebuffer(ep,buf)
|
||||||
#else
|
#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)
|
# define EP_FREEBUFFER(ep,buf) kmm_free(buf)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user