diff options
Diffstat (limited to 'nuttx/drivers/usbdev')
-rw-r--r-- | nuttx/drivers/usbdev/cdcacm.c | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/nuttx/drivers/usbdev/cdcacm.c b/nuttx/drivers/usbdev/cdcacm.c index 289e1cd10..441ac907e 100644 --- a/nuttx/drivers/usbdev/cdcacm.c +++ b/nuttx/drivers/usbdev/cdcacm.c @@ -941,7 +941,7 @@ static int cdcacm_bind(FAR struct usbdevclass_driver_s *driver, priv->usbdev = dev; /* Save the reference to our private data structure in EP0 so that it - * can be recovered in ep0 completion events (Unless we are part of + * can be recovered in ep0 completion events (Unless we are part of * a composite device and, in that case, the composite device owns * EP0). */ @@ -1804,9 +1804,10 @@ static void cdcuart_detach(FAR struct uart_dev_s *dev) static int cdcuart_ioctl(FAR struct file *filep,int cmd,unsigned long arg) { - struct inode *inode = filep->f_inode; - struct cdcacm_dev_s *priv = inode->i_private; - int ret = OK; + struct inode *inode = filep->f_inode; + struct cdcacm_dev_s *priv = inode->i_private; + FAR uart_dev_t *serdev = &priv->serdev; + int ret = OK; switch (cmd) { @@ -1898,6 +1899,44 @@ static int cdcuart_ioctl(FAR struct file *filep,int cmd,unsigned long arg) } break; +#ifdef CONFIG_SERIAL_TERMIOS + case TCGETS: + { + struct termios *termiosp = (struct termios*)arg; + + if (!termiosp) + { + ret = -EINVAL; + break; + } + + /* And update with flags from this layer */ + + termiosp->c_iflag = serdev->tc_iflag; + termiosp->c_oflag = serdev->tc_oflag; + termiosp->c_lflag = serdev->tc_lflag; + } + break; + + case TCSETS: + { + struct termios *termiosp = (struct termios*)arg; + + if (!termiosp) + { + ret = -EINVAL; + break; + } + + /* Update the flags we keep at this layer */ + + serdev->tc_iflag = termiosp->c_iflag; + serdev->tc_oflag = termiosp->c_oflag; + serdev->tc_lflag = termiosp->c_lflag; + } + break; +#endif + default: ret = -ENOTTY; break; |