usbhost: Do not disable usb monitor if usb host is enabled but dev is not

This commit is contained in:
Brennan Ashton 2021-03-28 12:45:15 -07:00 committed by Xiang Xiao
parent 6106557034
commit 4851d232c0
18 changed files with 224 additions and 66 deletions

View File

@ -62,13 +62,21 @@
# undef HAVE_USBHOST # undef HAVE_USBHOST
#endif #endif
/* Check if we need to support the USB monitor */ /* Check if we should enable the USB monitor before starting NSH */
#ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST #ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE # undef CONFIG_USBHOST_TRACE
#endif #endif
#if !defined(CONFIG_USBMONITOR) || !defined(CONFIG_USBHOST_TRACE) #if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -115,11 +115,19 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV #ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE # undef CONFIG_USBDEV_TRACE
#endif #endif
#if !defined(CONFIG_USBMONITOR) || !defined(CONFIG_USBDEV_TRACE) #ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -143,11 +143,19 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV #ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE # undef CONFIG_USBDEV_TRACE
#endif #endif
#if !defined(CONFIG_USBMONITOR) || !defined(CONFIG_USBDEV_TRACE) #ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -151,11 +151,19 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV #ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE # undef CONFIG_USBDEV_TRACE
#endif #endif
#if !defined(CONFIG_USBMONITOR) || !defined(CONFIG_USBDEV_TRACE) #ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -106,21 +106,25 @@
/* Can't support USB device feature if USB OTG FS is not enabled */ /* Can't support USB device feature if USB OTG FS is not enabled */
#ifndef CONFIG_STM32_OTGFS #if defined(CONFIG_STM32_OTGFS) && defined(CONFIG_USBDEV)
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif
/* Can't support USB device monitor if USB device is not enabled */
#ifndef CONFIG_USBDEV
# undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR) #ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -81,14 +81,12 @@
#ifndef CONFIG_STM32_OTGFS #ifndef CONFIG_STM32_OTGFS
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBHOST # undef HAVE_USBHOST
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB device is USB device is not enabled */ /* Can't support USB device is USB device is not enabled */
#ifndef CONFIG_USBDEV #ifndef CONFIG_USBDEV
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB host is USB host is not enabled */ /* Can't support USB host is USB host is not enabled */
@ -99,7 +97,19 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR) #ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -65,14 +65,12 @@
#ifndef CONFIG_STM32_OTGFS #ifndef CONFIG_STM32_OTGFS
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBHOST # undef HAVE_USBHOST
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB device monitor if USB device is not enabled */ /* Can't support USB device if USB device is not enabled */
#ifndef CONFIG_USBDEV #ifndef CONFIG_USBDEV
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB host is USB host is not enabled */ /* Can't support USB host is USB host is not enabled */
@ -83,7 +81,19 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR) #ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -68,14 +68,12 @@
#ifndef CONFIG_STM32_OTGHS #ifndef CONFIG_STM32_OTGHS
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBHOST # undef HAVE_USBHOST
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB device monitor if USB device is not enabled */ /* Can't support USB device USB device is not enabled */
#ifndef CONFIG_USBDEV #ifndef CONFIG_USBDEV
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB host is USB host is not enabled */ /* Can't support USB host is USB host is not enabled */
@ -86,7 +84,19 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR) #ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -61,14 +61,12 @@
#ifndef CONFIG_STM32_OTGHS #ifndef CONFIG_STM32_OTGHS
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBHOST # undef HAVE_USBHOST
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB device monitor if USB device is not enabled */ /* Can't support USB device if USB device is not enabled */
#ifndef CONFIG_USBDEV #ifndef CONFIG_USBDEV
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB host is USB host is not enabled */ /* Can't support USB host is USB host is not enabled */
@ -79,12 +77,20 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR) #ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif
#if !defined(CONFIG_STM32_CAN1) && !defined(CONFIG_STM32_CAN2) #ifndef HAVE_USBDEV
# undef CONFIG_CAN # undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support MMC/SD features if mountpoints are disabled or if SDIO /* Can't support MMC/SD features if mountpoints are disabled or if SDIO

View File

@ -57,14 +57,12 @@
#ifndef CONFIG_STM32_OTGFS #ifndef CONFIG_STM32_OTGFS
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBHOST # undef HAVE_USBHOST
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB device monitor if USB device is not enabled */ /* Can't support USB device if USB device is not enabled */
#ifndef CONFIG_USBDEV #ifndef CONFIG_USBDEV
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB host is USB host is not enabled */ /* Can't support USB host is USB host is not enabled */
@ -76,7 +74,19 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR) #ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -105,14 +105,12 @@
#ifndef CONFIG_STM32_OTGFS #ifndef CONFIG_STM32_OTGFS
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBHOST # undef HAVE_USBHOST
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB device monitor if USB device is not enabled */ /* Can't support USB device if USB device is not enabled */
#ifndef CONFIG_USBDEV #ifndef CONFIG_USBDEV
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB host is USB host is not enabled */ /* Can't support USB host is USB host is not enabled */
@ -123,7 +121,19 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR) #ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -57,19 +57,29 @@
#ifndef CONFIG_STM32_USB #ifndef CONFIG_STM32_USB
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB device is USB device is not enabled */ /* Can't support USB device is USB device is not enabled */
#ifndef CONFIG_USBDEV #ifndef CONFIG_USBDEV
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR) #ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -69,14 +69,12 @@
#ifndef CONFIG_STM32_OTGHS #ifndef CONFIG_STM32_OTGHS
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBHOST # undef HAVE_USBHOST
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB device monitor if USB device is not enabled */ /* Can't support USB device monitor if USB device is not enabled */
#ifndef CONFIG_USBDEV #ifndef CONFIG_USBDEV
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB host is USB host is not enabled */ /* Can't support USB host is USB host is not enabled */
@ -87,7 +85,19 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR) #ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -68,14 +68,12 @@
#ifndef CONFIG_STM32_OTGFS #ifndef CONFIG_STM32_OTGFS
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBHOST # undef HAVE_USBHOST
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB device monitor if USB device is not enabled */ /* Can't support USB device if USB device is not enabled */
#ifndef CONFIG_USBDEV #ifndef CONFIG_USBDEV
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB host is USB host is not enabled */ /* Can't support USB host is USB host is not enabled */
@ -86,7 +84,19 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR) #ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -62,14 +62,12 @@
#ifndef CONFIG_STM32H7_OTGFS #ifndef CONFIG_STM32H7_OTGFS
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBHOST # undef HAVE_USBHOST
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB device monitor if USB device is not enabled */ /* Can't support USB device if USB device is not enabled */
#ifndef CONFIG_USBDEV #ifndef CONFIG_USBDEV
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB host is USB host is not enabled */ /* Can't support USB host is USB host is not enabled */
@ -80,7 +78,19 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR) #ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -135,14 +135,12 @@
#ifndef CONFIG_STM32L4_OTGFS #ifndef CONFIG_STM32L4_OTGFS
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBHOST # undef HAVE_USBHOST
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB device monitor if USB device is not enabled */ /* Can't support USB device if USB device is not enabled */
#ifndef CONFIG_USBDEV #ifndef CONFIG_USBDEV
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB host is USB host is not enabled */ /* Can't support USB host is USB host is not enabled */
@ -153,7 +151,19 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR) #ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -86,14 +86,12 @@
#ifndef CONFIG_STM32L4_OTGFS #ifndef CONFIG_STM32L4_OTGFS
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBHOST # undef HAVE_USBHOST
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB device monitor if USB device is not enabled */ /* Can't support USB device if USB device is not enabled */
#ifndef CONFIG_USBDEV #ifndef CONFIG_USBDEV
# undef HAVE_USBDEV # undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif #endif
/* Can't support USB host is USB host is not enabled */ /* Can't support USB host is USB host is not enabled */
@ -104,7 +102,19 @@
/* Check if we should enable the USB monitor before starting NSH */ /* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR) #ifndef CONFIG_USBMONITOR
# undef HAVE_USBMONITOR
#endif
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#ifndef HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif

View File

@ -130,15 +130,21 @@
/* USB Monitor */ /* USB Monitor */
/* Can't support USB device monitor if USB device is not enabled */ /* Check if we should enable the USB monitor before starting NSH */
#ifndef CONFIG_USBDEV #ifndef CONFIG_USBMONITOR
# undef NSH_HAVE_USBMONITOR # undef NSH_HAVE_USBMONITOR
#endif #endif
/* Check if we should enable the USB monitor before starting NSH */ #ifndef NSH_HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR) #ifndef NSH_HAVE_USBHOST
# undef CONFIG_USBHOST_TRACE
#endif
#if !defined(CONFIG_USBDEV_TRACE) && !defined(CONFIG_USBHOST_TRACE)
# undef NSH_HAVE_USBMONITOR # undef NSH_HAVE_USBMONITOR
#endif #endif