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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251130104222.63077-29-crescentcy.hsieh@moxa.com>
Date: Sun, 30 Nov 2025 18:42:19 +0800
From: Crescent Hsieh <crescentcy.hsieh@...a.com>
To: gregkh@...uxfoundation.org,
	jirislaby@...nel.org,
	ilpo.jarvinen@...ux.intel.com,
	andy.shevchenko@...il.com
Cc: linux-kernel@...r.kernel.org,
	linux-serial@...r.kernel.org,
	crescentcy.hsieh@...a.com
Subject: [PATCH v1 28/31] serial: 8250_mxpcie: Track current serial interface for later feature gating

Introduce an `interface` field in struct mxpcie8250_port and update it
whenever the serial interface is switched via mxpcie8250_set_interface().

This allows runtime checks based on the active interface (e.g. RS-232 vs
RS-422/485) in later patches, where features such as terminator, pull
state, or auto mode must only be enabled for differential modes.

Signed-off-by: Crescent Hsieh <crescentcy.hsieh@...a.com>
---
 drivers/tty/serial/8250/8250_mxpcie.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_mxpcie.c b/drivers/tty/serial/8250/8250_mxpcie.c
index 88ab918fd000..7a1030a47b00 100644
--- a/drivers/tty/serial/8250/8250_mxpcie.c
+++ b/drivers/tty/serial/8250/8250_mxpcie.c
@@ -128,6 +128,7 @@
 
 struct mxpcie8250_port {
 	int line;
+	int interface;
 	unsigned long event_flags;
 	u8 rx_trig_level;
 	struct uart_port *uport;
@@ -505,6 +506,8 @@ static int mxpcie8250_set_interface(struct mxpcie8250 *priv,
 	}
 	outb(cval, UIR_addr);
 
+	priv->port[port_idx].interface = mode;
+
 	return 0;
 }
 
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ