From 9df6bd0543594de8677678282851bcd4616922d1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 11 May 2015 15:10:41 -0600 Subject: [PATCH] USB host CDC/ACM driver requires CONFIG_SERIAL_REMOVABLE --- TODO | 1 - drivers/usbhost/Kconfig | 1 + drivers/usbhost/usbhost_cdcacm.c | 10 ++++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index cdb57a33d4..4751de5883 100644 --- a/TODO +++ b/TODO @@ -1126,7 +1126,6 @@ o USB (drivers/usbdev, drivers/usbhost) the RX reception logic probably should be moved to its own dedicated thread. - Most of these problems are unique to the Olimex LPC1766STK DCD; some are probably design problems in the CDC/ACM host driver. The bottom line is that the host CDC/ACM driver is diff --git a/drivers/usbhost/Kconfig b/drivers/usbhost/Kconfig index a04251ceed..691f9c8170 100644 --- a/drivers/usbhost/Kconfig +++ b/drivers/usbhost/Kconfig @@ -90,6 +90,7 @@ config USBHOST_CDCACM default n depends on USBHOST_HAVE_ASYNCH && !USBHOST_BULK_DISABLE && !USBHOST_INT_DISABLE select USBHOST_ASYNCH + select SERIAL_REMOVABLE ---help--- Select this option to build in host support for CDC/ACM serial devices. diff --git a/drivers/usbhost/usbhost_cdcacm.c b/drivers/usbhost/usbhost_cdcacm.c index c08eaedf44..9a10d06bc3 100644 --- a/drivers/usbhost/usbhost_cdcacm.c +++ b/drivers/usbhost/usbhost_cdcacm.c @@ -99,6 +99,10 @@ # warning Asynchronous transfer support is required (CONFIG_USBHOST_ASYNCH) #endif +#ifndef CONFIG_SERIAL_REMOVABLE +# warning Removable serial device support is required (CONFIG_SERIAL_REMOVABLE) +#endif + #ifdef CONFIG_USBHOST_CDCACM_NTDELAY # define USBHOST_CDCACM_NTDELAY MSEC2TICK(CONFIG_USBHOST_CDCACM_NTDELAY) #else @@ -2102,6 +2106,12 @@ static int usbhost_disconnected(struct usbhost_class_s *usbclass) flags = irqsave(); priv->disconnected = true; + /* Let the upper half driver know that serial device is no longer + * connected. + */ + + uart_connected(&priv->uartdev, false); + /* Cancel any ongoing Bulk transfers */ ret = DRVR_CANCEL(hport->drvr, priv->bulkin);