Re: [PATCH 1/6] tty: add port flag to suppress raising DTR & RTS on open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 28, 2022 at 8:51 PM Mychaela N. Falconia
<falcon@xxxxxxxxxxxxxxx> wrote:
>
> There exist special serial devices (either attaching to generic serial
> ports or containing a built-in USB-serial chip) in which DTR and/or RTS
> have been repurposed for non-standard uses.  Depending on exactly how
> these signals are repurposed, standard POSIX/SUS behaviour of

Which version of POSIX and SUS standards are in consideration?

> unconditionally raising both signals on open may range from harmless
> to undesirable to a total killer, precluding the use of Linux with
> such custom hardware.
>
> The newly added TTY_PORT_MANUAL_RTSDTR flag switches an individual
> serial port from POSIX/SUS standard to non-standard behaviour: when
> set, it suppresses the built-in action of raising DTR & RTS on serial
> port open.
>
> This flag can be exported through sysfs, and it can also be set by
> USB-serial device drivers when they see a custom hw device (identified
> by VID:PID) that is known to be wired in a way that requires this flag
> to be set.

Is it only the USB class of devices that are affected or do we have
examples on other buses?

...

>  void tty_port_raise_dtr_rts(struct tty_port *port)
>  {
> -       if (port->ops->dtr_rts)
> +       if (port->ops->dtr_rts && !tty_port_manual_rtsdtr(port))
>                 port->ops->dtr_rts(port, 1);

Logically I would put them otherwise, first to check a custom flag and
then the existence of the callback.

>  }

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux