Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Lino Sanfilippo <LinoSanfilippo@gmx.de>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	linux-serial@vger.kernel.org,
	"Greg KH" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Arnd Bergmann" <arnd@arndb.de>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arch@vger.kernel.org
Cc: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Lukas Wunner" <lukas.wunner@intel.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	linux-api@vger.kernel.org
Subject: Re: [PATCH v6 5/6] serial: Support for RS-485 multipoint addresses
Date: Tue, 14 Jun 2022 00:22:10 +0200	[thread overview]
Message-ID: <cd72151d-b087-0fdf-2775-6068999f7d05@gmx.de> (raw)
In-Reply-To: <20220613075227.10394-6-ilpo.jarvinen@linux.intel.com>


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

  reply	other threads:[~2022-06-13 22:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-13  7:52 [PATCH v6 0/6] Add RS485 9th bit addressing mode support to DW UART Ilpo Järvinen
2022-06-13  7:52 ` [PATCH v6 1/6] serial: 8250: make saved LSR larger Ilpo Järvinen
2022-06-13  8:26   ` Jiri Slaby
2022-06-13  9:25     ` Ilpo Järvinen
2022-06-13  7:52 ` [PATCH v6 2/6] serial: 8250: create lsr_save_mask Ilpo Järvinen
2022-06-13  7:52 ` [PATCH v6 3/6] serial: 8250_lpss: Use 32-bit reads Ilpo Järvinen
2022-06-13  7:52 ` [PATCH v6 4/6] serial: take termios_rwsem for .rs485_config() & pass termios as param Ilpo Järvinen
2022-06-13  7:52 ` [PATCH v6 5/6] serial: Support for RS-485 multipoint addresses Ilpo Järvinen
2022-06-13 22:22   ` Lino Sanfilippo [this message]
2022-06-13  7:52 ` [PATCH v6 6/6] serial: 8250_dwlib: Support for 9th bit multipoint addressing Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd72151d-b087-0fdf-2775-6068999f7d05@gmx.de \
    --to=linosanfilippo@gmx.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lukas.wunner@intel.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox