mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-17 23:50:27 +08:00
USB: Update to FreeBSD trunk 2015-11-10
This commit is contained in:
@@ -26,6 +26,9 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef USB_GLOBAL_INCLUDE_FILE
|
||||
#include USB_GLOBAL_INCLUDE_FILE
|
||||
#else
|
||||
#include <sys/stdint.h>
|
||||
#include <sys/stddef.h>
|
||||
#include <rtems/bsd/sys/param.h>
|
||||
@@ -49,6 +52,11 @@
|
||||
#include <dev/usb/usbdi.h>
|
||||
#include <dev/usb/usbdi_util.h>
|
||||
|
||||
#define USB_DEBUG_VAR usb_debug
|
||||
|
||||
#include <dev/usb/usb_core.h>
|
||||
#include <dev/usb/usb_debug.h>
|
||||
#endif /* USB_GLOBAL_INCLUDE_FILE */
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* usb_desc_foreach
|
||||
@@ -141,7 +149,7 @@ usb_idesc_foreach(struct usb_config_descriptor *cd,
|
||||
}
|
||||
|
||||
if (ps->desc == NULL) {
|
||||
/* first time */
|
||||
/* first time or zero descriptors */
|
||||
} else if (new_iface) {
|
||||
/* new interface */
|
||||
ps->iface_index ++;
|
||||
@@ -150,6 +158,14 @@ usb_idesc_foreach(struct usb_config_descriptor *cd,
|
||||
/* new alternate interface */
|
||||
ps->iface_index_alt ++;
|
||||
}
|
||||
#if (USB_IFACE_MAX <= 0)
|
||||
#error "USB_IFACE_MAX must be defined greater than zero"
|
||||
#endif
|
||||
/* check for too many interfaces */
|
||||
if (ps->iface_index >= USB_IFACE_MAX) {
|
||||
DPRINTF("Interface limit reached\n");
|
||||
id = NULL;
|
||||
}
|
||||
|
||||
/* store and return current descriptor */
|
||||
ps->desc = (struct usb_descriptor *)id;
|
||||
|
Reference in New Issue
Block a user