public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Claudio Scordino <claudio@evidence.eu.com>
To: starvik@axis.com, jesper.nilsson@axis.com
Cc: linux-cris-kernel@axis.com, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	Hinko Kocevar <hinko.kocevar@cetrtapot.si>,
	Janez Cufer <janez.cufer@cetrtapot.si>,
	Andy Whitcroft <apw@canonical.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	dev-etrax@axis.com
Subject: [PATCH] ioctl for getting RS485 information on Cris architecture
Date: Mon, 31 May 2010 10:19:09 +0200	[thread overview]
Message-ID: <4C0370FD.3090909@evidence.eu.com> (raw)
In-Reply-To: <49A51878.7020206@evidence.eu.com>

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@evidence.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


  parent reply	other threads:[~2010-05-31  8:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25 10:07 [PATCH] Cleanup patch for RS485 on Cris architecture Claudio Scordino
2009-02-26 21:49 ` Andrew Morton
2009-02-27  8:45   ` Claudio Scordino
2010-05-31  8:19 ` Claudio Scordino [this message]
2010-05-31  8:33   ` [PATCH] ioctl for getting RS485 information " Jesper Nilsson

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=4C0370FD.3090909@evidence.eu.com \
    --to=claudio@evidence.eu.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=apw@canonical.com \
    --cc=dev-etrax@axis.com \
    --cc=hinko.kocevar@cetrtapot.si \
    --cc=janez.cufer@cetrtapot.si \
    --cc=jesper.nilsson@axis.com \
    --cc=linux-cris-kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=starvik@axis.com \
    /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