diff options
author | hselasky <hselasky@FreeBSD.org> | 2013-05-03 11:10:04 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2013-05-03 11:10:04 +0000 |
commit | fad53c9a9b9475ec66f6ccb57acaac47c314a49e (patch) | |
tree | da34869305f7442f6ba4ce940376c157aa9705e3 /sys/dev/usb/usb_dynamic.c | |
parent | bf0ecb667034d07b6288c04623d895a0919377c0 (diff) | |
download | FreeBSD-src-fad53c9a9b9475ec66f6ccb57acaac47c314a49e.zip FreeBSD-src-fad53c9a9b9475ec66f6ccb57acaac47c314a49e.tar.gz |
- Add more defines to limit USB memory usage and number of allocations
in reduced memory systems.
- Split allocation and freeing of the configuration descriptor into a separate
function, so that the configuration descriptor can be made fixed size
to save memory allocations. This applies for both device and host mode.
Diffstat (limited to 'sys/dev/usb/usb_dynamic.c')
-rw-r--r-- | sys/dev/usb/usb_dynamic.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/dev/usb/usb_dynamic.c b/sys/dev/usb/usb_dynamic.c index 58deb4e..d08e7f8 100644 --- a/sys/dev/usb/usb_dynamic.c +++ b/sys/dev/usb/usb_dynamic.c @@ -53,6 +53,7 @@ #include <dev/usb/usb_process.h> #include <dev/usb/usb_device.h> #include <dev/usb/usb_dynamic.h> +#include <dev/usb/usb_request.h> #endif /* USB_GLOBAL_INCLUDE_FILE */ /* function prototypes */ @@ -98,12 +99,8 @@ usb_temp_get_desc_w(struct usb_device *udev, struct usb_device_request *req, con static void usb_temp_unsetup_w(struct usb_device *udev) { - if (udev->usb_template_ptr) { - - free(udev->usb_template_ptr, M_USB); - - udev->usb_template_ptr = NULL; - } + usbd_free_config_desc(udev, udev->usb_template_ptr); + udev->usb_template_ptr = NULL; } void |