summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_device.c
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2013-05-03 11:10:04 +0000
committerhselasky <hselasky@FreeBSD.org>2013-05-03 11:10:04 +0000
commitfad53c9a9b9475ec66f6ccb57acaac47c314a49e (patch)
treeda34869305f7442f6ba4ce940376c157aa9705e3 /sys/dev/usb/usb_device.c
parentbf0ecb667034d07b6288c04623d895a0919377c0 (diff)
downloadFreeBSD-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_device.c')
-rw-r--r--sys/dev/usb/usb_device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c
index b1770ce..b88a0e1 100644
--- a/sys/dev/usb/usb_device.c
+++ b/sys/dev/usb/usb_device.c
@@ -493,7 +493,7 @@ usb_unconfigure(struct usb_device *udev, uint8_t flag)
/* free "cdesc" after "ifaces" and "endpoints", if any */
if (udev->cdesc != NULL) {
if (udev->flags.usb_mode != USB_MODE_DEVICE)
- free(udev->cdesc, M_USB);
+ usbd_free_config_desc(udev, udev->cdesc);
udev->cdesc = NULL;
}
/* set unconfigured state */
@@ -552,7 +552,7 @@ usbd_set_config_index(struct usb_device *udev, uint8_t index)
} else {
/* normal request */
err = usbd_req_get_config_desc_full(udev,
- NULL, &cdp, M_USB, index);
+ NULL, &cdp, index);
}
if (err) {
goto done;
OpenPOWER on IntegriCloud