lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 14 Jun 2022 00:22:10 +0200
From:   Lino Sanfilippo <LinoSanfilippo@....de>
To:     Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
        linux-serial@...r.kernel.org, Greg KH <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>,
        Jonathan Corbet <corbet@....net>,
        Arnd Bergmann <arnd@...db.de>, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Lukas Wunner <lukas.wunner@...el.com>,
        Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
        linux-api@...r.kernel.org
Subject: Re: [PATCH v6 5/6] serial: Support for RS-485 multipoint addresses


Hi,

there are some typos in the documentation and comments (see below).


On 13.06.22 at 09:52, Ilpo Järvinen wrote:

> -5. References
> +5. Multipoint Addressing
> +========================
> +
> +   The Linux kernel provides addressiong mode for multipoint RS-485 serial

addressiong -> addressing

> +   communications line. The addressing mode is enabled with SER_RS485_ADDRB
> +   flag in serial_rs485. Struct serial_rs485 fhas two additional flags and

fhas -> has

> +   fields for enabling reveive and destination addresses.

reveive -> receive

> +
> +   Address mode flags:
> +	- SER_RS485_ADDRB: Enabled addressing mode (sets also ADDRB in termios).
> +	- SER_RS485_ADDR_RECV: Receive (filter) address enabled.
> +	- SER_RS485_ADDR_DEST: Set destination address.
> +
> +   Address fields (enabled with corresponding SER_RS485_ADDR_* flag):
> +	- addr_recv: Receive address.
> +	- addr_dest: Destination address.
> +
> +   Once a receive address is set, the communication can occur only with the
> +   particular device and other peers are filtered out. It is left up to the
> +   receiver side to enforce the filtering. Receive address will be cleared
> +   if SER_RS485_ADDR_RECV is not set.
> +
> +   Note: not all devices supporting RS485 support multipoint addressing.
> +
> +6. References
>  =============
>
>   [1]	include/uapi/linux/serial.h
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index 76bb1b77b06e..bc18018e8d4b 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -1294,6 +1294,17 @@ static int uart_check_rs485_flags(struct uart_port *port, struct serial_rs485 *r
>  	if (flags & ~port->rs485_supported->flags)
>  		return -EINVAL;
>
> +	/* Asking for address w/o addressing mode? */
> +	if (!(rs485->flags & SER_RS485_ADDRB) &&
> +	    (rs485->flags & (SER_RS485_ADDR_RECV|SER_RS485_ADDR_DEST)))
> +		return -EINVAL;
> +
> +	/* Address gived but not enabled? */

gived -> given



Regards,
Lino

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ