drivers/usbdev: CDC/ACM should reset all 'irregular' notifications to zero after sending the SerialState packet.

This commit is contained in:
Gregory Nutt 2017-09-23 12:37:57 -06:00
parent 5d02baf205
commit 2e69e22af3
2 changed files with 19 additions and 1 deletions

View File

@ -703,6 +703,10 @@ static int cdcacm_serialstate(FAR struct cdcacm_dev_s *priv)
}
errout_with_flags:
/* Reset all of the "irregular" notification */
priv->serialstate &= CDC_UART_CONSISTENT;
leave_critical_section(flags);
return ret;
}
@ -2117,7 +2121,7 @@ static int cdcuart_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
#ifdef CONFIG_CDCACM_IFLOWCONTROL
/* Report state of input flow control */
termiosp->c_lflag = (priv->iflow) ? CRTS_IFLOW : 0;
termiosp->c_cflag |= (priv->iflow) ? CRTS_IFLOW : 0;
#endif
}
break;

View File

@ -419,6 +419,8 @@
* 105 and RS-232 signal RTS.
*/
/* CDC/ACM friendly naming */
#define CDCACM_UART_DTR CDC_DTE_PRESENT
#define CDCACM_UART_RTS CDC_ACTIVATE_CARRIER
@ -547,9 +549,21 @@
* overrun in the device.
*/
/* CDC/ACM friendly naming */
#define CDCACM_UART_DCD CDC_UART_RXCARRIER
#define CDCACM_UART_DSR CDC_UART_TXCARRIER
/* "SerialState is used like a real interrupt status register. Once a notification has been
* sent, the device will reset and reevaluate the different signals. For the consistent
* signals like carrier detect or transmission carrier, this will mean another notification
* will not be generated until there is a state change. For the irregular signals like
* break, the incoming ring signal, or the overrun error state, this will reset their values
* to zero and again will not send another notification until their state changes."
*/
#define CDC_UART_CONSISTENT (CDC_UART_RXCARRIER | CDC_UART_TXCARRIER)
/* Table 70: Call State Change Value Definitions */
#define CDC_CALLST_IDLE 0x01 /* Call has become idle */