From: Crescent CY Hsieh <crescentcy.hsieh@moxa.com>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org
Subject: Re: [PATCH 4/4] tty: serial: 8250: Add support for MOXA PCIe boards to switch interface between RS422/RS485
Date: Tue, 3 Oct 2023 17:57:41 +0800 [thread overview]
Message-ID: <ZRvllYZS3ks+dOYc@moxa-ThinkCentre-M90t> (raw)
In-Reply-To: <92aed0d9-791f-4708-8a73-4c78457a710e@kernel.org>
On Mon, Oct 02, 2023 at 09:19:26AM +0200, Jiri Slaby wrote:
> On 02. 10. 23, 3:57, Crescent CY Hsieh wrote:
> > MOXA PCIe boards have 4 serial interfaces and don't require additional
> > stuff to switch between interfaces:
> >
> > - RS232
> > - RS422
> > - RS485_2W (half-duplex)
> > - RS485_4W (full-duplex)
> >
> > By using ioctl command "TIOCRS485", it can switch between default
> > interface and RS485 if supported.
> >
> > That means, for RS422/RS485 board, it can switch between RS422 and
> > RS485 by setting the flags within struct serial_rs485.
> >
> > However, for the RS232/RS422/RS485 board, it can only switch between
> > RS232 and RS485, there's no flag for switching interface into RS422.
> >
> > This patch adds a flag call "SER_RS422_ENALBED" in serial.h and modifies
>
> Hopefully not SER_RS422_ENALBED.
What if I use an existing flag within struct serial_rs485 to represent
RS422 as a workaround solution?
> > @@ -1299,7 +1299,7 @@ static int uart_get_icount(struct tty_struct *tty,
> > #define SER_RS485_LEGACY_FLAGS (SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | \
> > SER_RS485_RTS_AFTER_SEND | SER_RS485_RX_DURING_TX | \
> > - SER_RS485_TERMINATE_BUS)
> > + SER_RS485_TERMINATE_BUS | SER_RS422_ENALBED)
>
> So have you tested this at all?
I have tested it by switching the serial interface using TIOCSRS485
ioctl command, but it seems that I send the wrong patch which mistyping
SER_RS422_ENABLED.
---
Sincerely,
Crescent CY Hsieh
prev parent reply other threads:[~2023-10-03 9:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-02 1:56 [PATCH 0/4] tty: serial: 8250: Changes of MOXA PCIe boards in 8250_pci.c Crescent CY Hsieh
2023-10-02 1:56 ` [PATCH 1/4] tty: serial: 8250: Cleanup MOXA configurations " Crescent CY Hsieh
2023-10-02 6:51 ` Jiri Slaby
2023-10-03 7:17 ` Crescent CY Hsieh
2023-10-03 7:30 ` Greg KH
2023-10-03 9:49 ` Jiri Slaby
2023-10-02 1:57 ` [PATCH 2/4] tty: serial: 8250: Add support for MOXA Mini PCIe boards Crescent CY Hsieh
2023-10-02 7:05 ` Jiri Slaby
2023-10-03 8:17 ` Crescent CY Hsieh
2023-10-02 1:57 ` [PATCH 3/4] tty: serial: 8250: Fix MOXA RS422/RS485 PCIe boards not work by default Crescent CY Hsieh
2023-10-02 7:14 ` Jiri Slaby
2023-10-03 8:22 ` Crescent CY Hsieh
2023-10-02 1:57 ` [PATCH 4/4] tty: serial: 8250: Add support for MOXA PCIe boards to switch interface between RS422/RS485 Crescent CY Hsieh
2023-10-02 4:13 ` kernel test robot
2023-10-02 5:47 ` kernel test robot
2023-10-02 7:19 ` Jiri Slaby
2023-10-03 9:57 ` Crescent CY Hsieh [this message]
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=ZRvllYZS3ks+dOYc@moxa-ThinkCentre-M90t \
--to=crescentcy.hsieh@moxa.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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