diff --git a/drivers/usbhost/usbhost_enumerate.c b/drivers/usbhost/usbhost_enumerate.c index b75a52db5e..8f4d973c2b 100644 --- a/drivers/usbhost/usbhost_enumerate.c +++ b/drivers/usbhost/usbhost_enumerate.c @@ -600,11 +600,13 @@ int usbhost_ctrlxfer(FAR struct usbhost_class_s *devclass, sem_init(&xfer.done, 0, 0); +#ifdef CONFIG_USBHOST_HUB if (ROOTHUB(devclass)) { ret = DRVR_RHCTRL(devclass->drvr, &xfer, ctrlreq); } else +#endif { if ((ctrlreq->type & USB_REQ_DIR_IN) != 0) { diff --git a/include/nuttx/usb/usbhost.h b/include/nuttx/usb/usbhost.h index b0c7b0257a..039da28b29 100644 --- a/include/nuttx/usb/usbhost.h +++ b/include/nuttx/usb/usbhost.h @@ -630,18 +630,13 @@ typedef FAR void *usbhost_ep_t; struct usbhost_class_s { #ifdef CONFIG_USBHOST_HUB - /* Host driver */ + /* Common host driver */ - struct usbhost_driver_s *drvr; - - /* USB device address & speed */ - - uint8_t addr; - uint8_t speed; + FAR struct usbhost_driver_s *drvr; /* Parent class */ - struct usbhost_class_s *parent; + FAR struct usbhost_class_s *parent; /* Control endpoint, ep0 */ @@ -651,13 +646,18 @@ struct usbhost_class_s FAR struct usb_hubtt_s *tt; - /* Transaction translator port */ - - uint8_t ttport; - /* Class specific private data */ FAR void *priv; + + /* USB device address & speed */ + + uint8_t addr; + uint8_t speed; + + /* Transaction translator port */ + + uint8_t ttport; #endif /* Provides the configuration descriptor to the class. The configuration