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]
Date:	Mon, 31 May 2010 10:19:09 +0200
From:	Claudio Scordino <claudio@...dence.eu.com>
To:	starvik@...s.com, jesper.nilsson@...s.com
CC:	linux-cris-kernel@...s.com, Alan Cox <alan@...rguk.ukuu.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Hinko Kocevar <hinko.kocevar@...rtapot.si>,
	Janez Cufer <janez.cufer@...rtapot.si>,
	Andy Whitcroft <apw@...onical.com>,
	Linux Kernel <linux-kernel@...r.kernel.org>, dev-etrax@...s.com
Subject: [PATCH] ioctl for getting RS485 information on Cris architecture

Hi Jesper, hi Mikael, 

	I think that the Cris architecture should provide a full RS485 interface (like the atmel_serial driver).

Therefore, I propose this patch which adds an ioctl to get RS485 information from user-level.

Best regards,

             Claudio


Cris serial driver: ioctl to get RS485 data from user-space

Signed-off-by: Claudio Scordino <claudio@...dence.eu.com>
---
 arch/cris/include/asm/ioctls.h |    1 +
 drivers/serial/crisv10.c       |   11 +++++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/cris/include/asm/ioctls.h b/arch/cris/include/asm/ioctls.h
index 35bbc18..076c078 100644
--- a/arch/cris/include/asm/ioctls.h
+++ b/arch/cris/include/asm/ioctls.h
@@ -77,6 +77,7 @@
 #define TIOCSERSETRS485	0x5461  /* enable rs-485 (deprecated) */
 #define TIOCSERWRRS485	0x5462  /* write rs-485 */
 #define TIOCSRS485	0x5463  /* enable rs-485 */
+#define TIOCGRS485	0x542E  /* get rs-485 */
 
 /* Used for packet mode */
 #define TIOCPKT_DATA		 0
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c
index 31f1723..3062644 100644
--- a/drivers/serial/crisv10.c
+++ b/drivers/serial/crisv10.c
@@ -3724,6 +3724,17 @@ rs_ioctl(struct tty_struct *tty, struct file * file,
 		return e100_enable_rs485(tty, &rs485data);
 	}
 
+	case TIOCGRS485:
+	{
+		struct serial_rs485 *rs485data =
+			&(((struct e100_serial *)tty->driver_data)->rs485);
+		/* This is the ioctl to get RS485 data from user-space */
+		if (copy_to_user((struct serial_rs485 *) arg,
+					rs485data,
+					sizeof(serial_rs485)))
+			return -EFAULT;
+		break;
+	}
 
 	case TIOCSERWRRS485:
 	{
-- 
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ