Eliminate use of apps/system/usbmonitor. Use drivers/usbmonitor instead.
This commit is contained in:
parent
7c34a77b54
commit
a897fd4ccf
27 changed files with 168 additions and 43 deletions
|
@ -56,7 +56,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MIKROE_FLASH_CONFIG_PART
|
||||
|
@ -347,7 +347,7 @@ int board_app_initialize(uintptr_t arg)
|
|||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#include "lpc31.h"
|
||||
|
@ -137,7 +137,7 @@ int board_app_initialize(uintptr_t arg)
|
|||
/* Start the USB Monitor */
|
||||
|
||||
syslog(LOG_ERR, "ERROR: Failed to start the USB monitor\n");
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32_OTGFS
|
||||
|
@ -225,7 +225,7 @@ int board_app_initialize(uintptr_t arg)
|
|||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32_OTGFS
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32_OTGFS
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32_OTGFS
|
||||
|
@ -152,7 +152,7 @@ int stm32_bringup(void)
|
|||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR,
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32_OTGFS
|
||||
|
@ -172,7 +172,7 @@ int board_app_initialize(uintptr_t arg)
|
|||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
#include <nuttx/mmcsd.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USBDEV
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#include "sam4e-ek.h"
|
||||
|
@ -118,7 +118,7 @@ int board_app_initialize(uintptr_t arg)
|
|||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#include "sam4s-xplained-pro.h"
|
||||
|
@ -169,7 +169,7 @@ int board_app_initialize(uintptr_t arg)
|
|||
/* Start the USB Monitor */
|
||||
|
||||
syslog(LOG_INFO, "Starting USB Monitor\n");
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d (%d)\n", ret, errno);
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#include "sama5d3-xplained.h"
|
||||
|
@ -155,7 +155,7 @@ int board_app_initialize(uintptr_t arg)
|
|||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#include "sama5d3x-ek.h"
|
||||
|
@ -170,7 +170,7 @@ int board_app_initialize(uintptr_t arg)
|
|||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Start USB monitor: %d\n", ret);
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <debug.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#include <nuttx/fs/ramdisk.h>
|
||||
|
@ -286,7 +286,7 @@ int sam_bringup(void)
|
|||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
_err("ERROR: Failed to start the USB monitor: %d\n", ret);
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <debug.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
|
@ -311,7 +311,7 @@ int sam_bringup(void)
|
|||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
_err("ERROR: Failed to start the USB monitor: %d\n", ret);
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <debug.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
|
@ -477,7 +477,7 @@ int sam_bringup(void)
|
|||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
_err("ERROR: Failed to start the USB monitor: %d\n", ret);
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USBDEV
|
||||
|
@ -305,7 +305,7 @@ int board_app_initialize(uintptr_t arg)
|
|||
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USBDEV
|
||||
|
@ -269,7 +269,7 @@ static int stm32_composite_initialize(void)
|
|||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
ferr("ERROR: Failed to start USB monitor: %d\n", ret);
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#include "stm32.h"
|
||||
|
@ -120,7 +120,7 @@ int board_app_initialize(uintptr_t arg)
|
|||
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_STM32F429I_DISCO_FLASH_MINOR
|
||||
|
@ -371,7 +371,7 @@ int board_app_initialize(uintptr_t arg)
|
|||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#include <nuttx/binfmt/elf.h>
|
||||
|
@ -151,7 +151,7 @@ int stm32_bringup(void)
|
|||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
uerr("ERROR: Failed to start USB monitor: %d\n", ret);
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include <nuttx/usb/usbhost.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
# include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#include "pic32mx.h"
|
||||
|
@ -415,7 +415,7 @@ int board_app_initialize(uintptr_t arg)
|
|||
{
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
ret = usbmonitor_start();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -515,10 +515,14 @@ if USBHOST
|
|||
source drivers/usbhost/Kconfig
|
||||
endif # USBHOST
|
||||
|
||||
config HAVE_USBTRACE
|
||||
bool
|
||||
default n
|
||||
|
||||
menuconfig USBMONITOR
|
||||
bool "USB Monitor"
|
||||
default n
|
||||
depends on (USBDEV && USBDEV_TRACE) || (USBHOST && USBHOST_TRACE)
|
||||
depends on HAVE_USBTRACE
|
||||
---help---
|
||||
If USB device tracing (USBDEV_TRACE) AND/OR USB host tracing
|
||||
(USBHOST_TRACE) are enabled then this option will select the USB
|
||||
|
@ -527,7 +531,7 @@ menuconfig USBMONITOR
|
|||
|
||||
if USBMONITOR
|
||||
source drivers/usbmonitor/Kconfig
|
||||
endif
|
||||
endif # USBMONITOR
|
||||
|
||||
menuconfig DRIVERS_WIRELESS
|
||||
bool "Wireless Device Support"
|
||||
|
|
|
@ -73,6 +73,7 @@ include syslog$(DELIM)Make.defs
|
|||
include timers$(DELIM)Make.defs
|
||||
include usbdev$(DELIM)Make.defs
|
||||
include usbhost$(DELIM)Make.defs
|
||||
include usbmonitor$(DELIM)Make.defs
|
||||
include video$(DELIM)Make.defs
|
||||
include wireless$(DELIM)Make.defs
|
||||
|
||||
|
|
|
@ -91,6 +91,7 @@ config ARCH_USBDEV_STALLQUEUE
|
|||
menuconfig USBDEV_TRACE
|
||||
bool "Enable USB tracing for debug"
|
||||
default n
|
||||
select HAVE_USBTRACE
|
||||
---help---
|
||||
Enables USB tracing for debug
|
||||
|
||||
|
|
|
@ -508,6 +508,7 @@ endif # USBHOST_RTL8187
|
|||
config USBHOST_TRACE
|
||||
bool "Enable USB HCD tracing for debug"
|
||||
default n
|
||||
select HAVE_USBTRACE
|
||||
---help---
|
||||
Enables USB tracing for debug. Only supported for the HCD and,
|
||||
further, no supported by all HCD implementations.
|
||||
|
|
|
@ -188,7 +188,21 @@ static int usbmonitor_daemon(int argc, char **argv)
|
|||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
int usbmonitor_start(int argc, char **argv)
|
||||
/****************************************************************************
|
||||
* Name: usbmonitor_start
|
||||
*
|
||||
* Start the USB monitor kernal daemon.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned values:
|
||||
* Zero (OK) is returned on success; a negated errno value is return on
|
||||
* any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int usbmonitor_start(void)
|
||||
{
|
||||
/* Has the monitor already started? */
|
||||
|
||||
|
@ -237,7 +251,21 @@ int usbmonitor_start(int argc, char **argv)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int usbmonitor_stop(int argc, char **argv)
|
||||
/****************************************************************************
|
||||
* Name: usbmonitor_stop
|
||||
*
|
||||
* Stop the USB monitor kernel daemon.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned values:
|
||||
* Zero (OK) is returned on success; a negated errno value is return on
|
||||
* any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int usbmonitor_stop(void)
|
||||
{
|
||||
/* Has the monitor already started? */
|
||||
|
||||
|
|
90
include/nuttx/usb/usbmonitor.h
Normal file
90
include/nuttx/usb/usbmonitor.h
Normal file
|
@ -0,0 +1,90 @@
|
|||
/****************************************************************************
|
||||
* include/nuttx/usb/usbmonitor.h
|
||||
*
|
||||
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_USB_USBMONITOR_H
|
||||
#define __INCLUDE_NUTTX_USB_USBMONITOR_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: usbmonitor_start and usbmonitor_stop
|
||||
*
|
||||
* Start and stop the USB monitor kernel deamon.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned values:
|
||||
* Zero (OK) is returned on success; a negated errno value is return on
|
||||
* any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int usbmonitor_start(void);
|
||||
int usbmonitor_stop(void);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_USBMONITOR */
|
||||
#endif /* __INCLUDE_NUTTX_USB_USBMONITOR_H */
|
Loading…
Reference in a new issue