summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_hub.h
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_hub.h
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_hub.h')
-rw-r--r--sys/dev/usb/usb_hub.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/usb/usb_hub.h b/sys/dev/usb/usb_hub.h
index 23a1fa4..4a48f74 100644
--- a/sys/dev/usb/usb_hub.h
+++ b/sys/dev/usb/usb_hub.h
@@ -48,7 +48,11 @@ struct usb_hub {
uint16_t portpower; /* mA per USB port */
uint8_t isoc_last_time;
uint8_t nports;
+#if (USB_HAVE_FIXED_PORT == 0)
struct usb_port ports[0];
+#else
+ struct usb_port ports[USB_MAX_PORTS];
+#endif
};
/* function prototypes */
OpenPOWER on IntegriCloud