arch/tiva: Fix inability to control serial CTS/RTS via termios
* arch/arm/src/tiva/common/tiva_serial.c: (up_ioctl): PR #8406 (commit 1edec0aaa1) added support for configuring the serial port's CTS/RTS flow control at runtime using termios when built with CONFIG_SERIAL_TERMIOS and either or both of CONFIG_SERIAL_OFLOWCONTROL and CONFIG_SERIAL_IFLOWCONTROL. However, a runtime sanity check left over from before prevented this from working: When processing ioctl TCSETS, we would return -EINVAL if one or both of CCTS_OFLOW and CRTS_IFLOW were requested, which was not deserved if the requested features were in fact supported. Fixing the sanity check so it depends on features actually configured.
This commit is contained in:
parent
18cf2c4297
commit
5d2e1d40dc
@ -1193,15 +1193,25 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
/* Perform some sanity checks before accepting any changes */
|
||||
|
||||
if (termiosp->c_cflag & CRTSCTS)
|
||||
#ifndef CONFIG_SERIAL_OFLOWCONTROL
|
||||
if (termiosp->c_cflag & CCTS_OFLOW)
|
||||
{
|
||||
/* We don't support for flow control right now, so we report an
|
||||
* error
|
||||
*/
|
||||
/* CTS not supported in this build, so report error */
|
||||
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_SERIAL_OFLOWCONTROL */
|
||||
|
||||
#ifndef CONFIG_SERIAL_IFLOWCONTROL
|
||||
if (termiosp->c_cflag & CRTS_IFLOW)
|
||||
{
|
||||
/* RTS not supported in this build, so report error */
|
||||
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_SERIAL_IFLOWCONTROL */
|
||||
|
||||
if (termiosp->c_cflag & PARENB)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user