Skip to contentSkip to conversation

Remove duplicate code for RS485 communications

PATCH New Claudio Scordino 1 participant 1 message Jan 12, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove duplicate code for RS485 communications

Hi Alan,

I didn't understand who is the actual maintainer of this
code, and I didn't receive any feedback from the maintainers of the cris architecture. Therefore, I follow Andy's suggestion of sending this patch to you, putting LKML in CC.

With commit number c26c56c0f40e200e61d1390629c806f6adaffbcc you introduced a new general data structure to handle RS485 serial communications (starting from the one defined for the cris platform).

I think that now the cris architecture should use this new general data structure instead of its old "private" one...

Unfortunately, I don't have any cris platform to test this patch (I
could only check that it compiles without errors). But maybe you know some volunteer who can test this patch...

Many thanks,

Claudio

Quoted 1 line

From 1278f84de8a9c7b5ea0d15b292ad0a4dfeb71134 Mon Sep 17 00:00:00 2001

From: Claudio Scordino <[email protected]>
Date: Sun, 11 Jan 2009 22:55:50 +0100
Subject: [PATCH 1/1] RS485 support on Cris rewritten in order to use new serial_rs485 data structure

---
 arch/cris/include/asm/ioctls.h  |    5 +-
 arch/cris/include/asm/rs485.h   |    8 +--
 arch/cris/include/asm/termios.h |    1 +
 drivers/serial/crisv10.c        |   79 ++++++++++++++++++++++++++++-----------
 drivers/serial/crisv10.h        |    2 +-
 5 files changed, 65 insertions(+), 30 deletions(-)
arch/cris/include/asm/ioctls.h +3 -2
index 4f4e525..35bbc18 100644
@@ -74,8 +74,9 @@
 #define TIOCSHAYESESP   0x545F  /* Set Hayes ESP configuration */
 #define FIOQSIZE	0x5460
 
-#define TIOCSERSETRS485 0x5461  /* enable rs-485 */
-#define TIOCSERWRRS485  0x5462  /* write rs-485 */
+#define TIOCSERSETRS485	0x5461  /* enable rs-485 (deprecated) */
+#define TIOCSERWRRS485	0x5462  /* write rs-485 */
+#define TIOCSRS485	0x5463  /* enable rs-485 */
 
 /* Used for packet mode */
 #define TIOCPKT_DATA		 0
arch/cris/include/asm/rs485.h +3 -5
index c331c51..ad40f9f 100644
@@ -1,15 +1,13 @@
 /* RS-485 structures */
 
-/* RS-485 support */
-/* Used with ioctl() TIOCSERSETRS485 */
+/* Used with ioctl() TIOCSERSETRS485 for backward compatibility!
+ * XXX: Do not use it for new code!
+ */
 struct rs485_control {
         unsigned short rts_on_send;
         unsigned short rts_after_sent;
         unsigned long delay_rts_before_send;
         unsigned short enabled;
-#ifdef __KERNEL__
-        int disable_serial_loopback;
-#endif
 };
 
 /* Used with ioctl() TIOCSERWRRS485 */
arch/cris/include/asm/termios.h +1 -0
index b0124e6..1265109 100644
@@ -4,6 +4,7 @@
 #include <asm/termbits.h>
 #include <asm/ioctls.h>
 #include <asm/rs485.h>
+#include <linux/serial.h>
 
 struct winsize {
 	unsigned short ws_row;
drivers/serial/crisv10.c +57 -22

182 lines not on this page · raw message

drivers/serial/crisv10.h +1 -1
index f36a729..ea0beb4 100644
@@ -125,7 +125,7 @@ struct e100_serial {
 	int errorcode;
 
 #ifdef CONFIG_ETRAX_RS485
-	struct rs485_control	rs485;  /* RS-485 support */
+	struct serial_rs485	rs485;  /* RS-485 support */
 #endif
 };
 
Signature · 1 line
1.5.4.3