Re: [PATCH v2] tty: serial: Add RS422 flag to struct serial_rs485

From: Crescent CY Hsieh
Date: Fri Nov 03 2023 - 06:47:52 EST


On Wed, Nov 01, 2023 at 07:49:48AM +0100, Greg Kroah-Hartman wrote:
> On Wed, Nov 01, 2023 at 02:44:04PM +0800, Crescent CY Hsieh wrote:
> > diff --git a/include/uapi/linux/serial.h b/include/uapi/linux/serial.h
> > index 53bc1af67..427609fd5 100644
> > --- a/include/uapi/linux/serial.h
> > +++ b/include/uapi/linux/serial.h
> > @@ -137,6 +137,8 @@ struct serial_icounter_struct {
> > * * %SER_RS485_ADDRB - Enable RS485 addressing mode.
> > * * %SER_RS485_ADDR_RECV - Receive address filter (enables @addr_recv). Requires %SER_RS485_ADDRB.
> > * * %SER_RS485_ADDR_DEST - Destination address (enables @addr_dest). Requires %SER_RS485_ADDRB.
> > + *
> > + * * %SER_RS422_ENABLED - RS422 enabled.
> > */
> > struct serial_rs485 {
> > __u32 flags;
> > @@ -149,6 +151,8 @@ struct serial_rs485 {
> > #define SER_RS485_ADDR_RECV (1 << 7)
> > #define SER_RS485_ADDR_DEST (1 << 8)
> >
> > +#define SER_RS422_ENABLED (1 << 9)
>
> Why the extra blank line before this?

The extra blank line is for the clarity, to seperate RS422 flag from
RS485 flags.

> Also, what userspace code is going to use this? How is it tested?

This flag could be used when user tries to switch serial interface into
RS422, just like the original flag "SER_RS485_ENABLED" can also be used to
switch serial interface into RS485 with some RS485 configurations.

---
Sincerely,
Crescent CY Hsieh