[Armadeus-commitlog] armadeus branch, master, updated. armadeus-6.0-354-g510625e
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2017-11-15 10:16:41
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 510625e86d2c3d4f1a65b26b966b17175e25d02a (commit)
from 548c6e2aa5eab41e6f7ef3c74195b8a15c005ead (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 510625e86d2c3d4f1a65b26b966b17175e25d02a
Author: Julien BOIBESSOT <jul...@ar...>
Date: Wed Nov 15 11:16:17 2017 +0100
[BUILDROOT] 2017.02: bring back to life patch 205 which modify busybox stty to handle RS-485 serial port custom options
-----------------------------------------------------------------------
Summary of changes:
...-coreutils-stty-add-rs485-config-options.patch} | 154 ++++++++-------------
patches/buildroot/2017.02/cleanup_buildroot.sh | 1 +
2 files changed, 59 insertions(+), 96 deletions(-)
copy patches/buildroot/{2012.02/207-busybox-coreutils-stty-add-rs485-config-options.patch => 2017.02/205-busybox-coreutils-stty-add-rs485-config-options.patch} (61%)
diff --git a/patches/buildroot/2012.02/207-busybox-coreutils-stty-add-rs485-config-options.patch b/patches/buildroot/2017.02/205-busybox-coreutils-stty-add-rs485-config-options.patch
similarity index 61%
copy from patches/buildroot/2012.02/207-busybox-coreutils-stty-add-rs485-config-options.patch
copy to patches/buildroot/2017.02/205-busybox-coreutils-stty-add-rs485-config-options.patch
index dc2c4f9..63efe21 100644
--- a/patches/buildroot/2012.02/207-busybox-coreutils-stty-add-rs485-config-options.patch
+++ b/patches/buildroot/2017.02/205-busybox-coreutils-stty-add-rs485-config-options.patch
@@ -1,93 +1,48 @@
-BusyBox coreutils stty: Add RS485 config options
-
-Armadeus Buildroot 2012.02 version.
-Patch only for BusyBox v1.19.4
-
-
-Signed-off-by: Janos Angeli <an...@an...>
----
-
-Index: buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs485_config.patch
+Index: buildroot/package/busybox/0007-stty-Add-RS485-config-options.patch
===================================================================
--- /dev/null
-+++ buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs485_config.patch
-@@ -0,0 +1,342 @@
-+BusyBox coreutils stty: Add RS485 config options
++++ buildroot/package/busybox/0007-stty-Add-RS485-config-options.patch
+@@ -0,0 +1,313 @@
++From: Clemens Gruber <cle...@pq...>
++Date: Thu, 4 Aug 2016 14:51:44 +0200
++Subject: [PATCH] stty: RS-485 support
+
-+The patch adds RS485 config options for serial devices/drivers
-+which are supporting the ioctl based configurations documented in:
-+https://www.kernel.org/doc/Documentation/serial/serial-rs485.txt
-+
-+New config parameters:
-+rs485 - Switch on/off the RS485 mode
-+rs485rtsonsend - Set logical level for RTS pin when sending
-+rs485rtsaftersend - Set logical level for RTS pin after sent
-+rs485rxduringtx - Switch on/off Rx enable during packet transmit
-+rs485delaybefore 0 - Set delay between RTS signaling and the
-+ transmission of the first bit
-+rs485delayafter 0 - Set delay between the transmission of the last
-+ bit and the RTS state change
-+
-+New read only parameter:
-+rs485delaylastchartx 0 - Shows the automatically calculated delay
-+ between the serial port Tx FIFO empty
-+ state and the last bit transmission
-+
-+Currently the following serial drivers supports the RS485 options:
-+- crisv10.c ETRAX 100LX
-+- atmel_serial.c Atmel AT91 / AT32
-+- mxs-auart.c Freescale STMP37XX/STMP378X iMX28
-+
-+Signed-off-by: Janos Angeli <an...@an...>
++Signed-off-by: Clemens Gruber <cle...@pq...>
++Signed-off-by: Julien Boibessot <jul...@ar...> (adaptation to busybox 1.26)
+---
-+Index: busybox-1.19.4/coreutils/stty.c
-+===================================================================
-+--- busybox-1.19.4.orig/coreutils/stty.c
-++++ busybox-1.19.4/coreutils/stty.c
-+@@ -19,6 +19,8 @@
++ coreutils/stty.c | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++----
++ 1 file changed, 150 insertions(+), 9 deletions(-)
++
++diff --git a/coreutils/stty.c b/coreutils/stty.c
++index 52967ea8f351..5a2d44c7e790 100644
++--- a/coreutils/stty.c
+++++ b/coreutils/stty.c
++@@ -18,6 +18,10 @@
++ David MacKenzie <dj...@gn...>
+
+ Special for busybox ported by Vladimir Oleynik <dz...@si...> 2001
-+
+++
++ RS485 options added by Janos Angeli <an...@an...> 2013
+++ Adapted by Clemens Gruber <cle...@pq...> 2014-2016
++
-+ */
-+
-+ //usage:#define stty_trivial_usage
-+@@ -33,6 +35,33 @@
++ */
++ //config:config STTY
++ //config: bool "stty"
++@@ -40,8 +44,13 @@
++ //usage: "\n [SETTING] See manpage"
+
+ #include "libbb.h"
-+
-++//#include <asm/ioctls.h>
-++//We don't include <asm/ioctls.h> now, because older Linux kernels are missing the
-++//required RS485 definitions. We need only the TIOCGRS485 and TIOCSRS485 definition.
-++//In later versions we will be able to switch back to the original include.
-++#define TIOCGRS485 0x542E
-++#define TIOCSRS485 0x542F
-++//End of temporally include <asm/ioctls.h>
++
-++//#include <linux/serial.h>
-++//We don't include <linux/serial.h> now, because it is missing some RS485 definitions.
-++//We need only the serial_rs485 struct from it and the __u32 def from <linux/types.h>
-++//In later versions we will be able to switch back to the original include.
-++#include <linux/types.h>
-++struct serial_rs485 {
-++ __u32 flags; /* RS485 feature flags */
-++#define SER_RS485_ENABLED (1 << 0) /* If enabled */
-++#define SER_RS485_RTS_ON_SEND (1 << 1) /* Logical level for RTS pin when sending */
-++#define SER_RS485_RTS_AFTER_SEND (1 << 2) /* Logical level for RTS pin after sent */
-++#define SER_RS485_RX_DURING_TX (1 << 4)
-++ __u32 delay_rts_before_send; /* Delay before send */
-++ __u32 delay_rts_after_send; /* Delay after send */
-++ __u32 delay_rts_last_char_tx; /* Delay for last char Tx from FIFO (microseconds)
-++ This delay is automatically calculated from baudrate */
-++ __u32 padding[4]; /* Memory is cheap, new structs are a royal PITA .. */
-++};
-++//End of temporally include <linux/serial.h>
++ #include "common_bufsiz.h"
++
+++#include <asm-generic/ioctls.h>
+++#include <linux/ioctl.h>
+++#include <linux/serial.h>
++
+ #ifndef _POSIX_VDISABLE
+ # define _POSIX_VDISABLE ((unsigned char) 0)
+ #endif
-+@@ -966,11 +995,27 @@ static int find_param(const char *name)
++@@ -941,11 +950,27 @@ static int find_param(const char *name)
+ return i;
+ }
+
@@ -116,7 +71,7 @@ Index: buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs48
+
+ /* Scan into temporaries since it is too much trouble to figure out
+ the right format for 'tcflag_t' */
-+@@ -989,15 +1034,28 @@ static int recover_mode(const char *arg,
++@@ -964,15 +989,30 @@ static int recover_mode(const char *arg, struct termios *mode)
+ arg += n;
+ }
+
@@ -136,33 +91,35 @@ Index: buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs48
++ have RS485 support or not, so give a try for the extra RS485 params */
++ if ((paramcheck) && (sscanf(arg, ":%lx:%lx:%lx%n", &rsflags, &rsdelaybefore, &rsdelayafter, &n) == 3))
++ return 1;
+++
+ return 0;
-+-
++ }
++
+ return 1;
+ }
+
-+-static void display_recoverable(const struct termios *mode,
++ static void display_recoverable(const struct termios *mode,
+- int UNUSED_PARAM dummy)
-++static void display_recoverable(const struct termios *mode, const struct serial_rs485 *rs485conf,
-++ int UNUSED_PARAM dummy, int rs485)
+++ const struct serial_rs485 *rs485conf, int UNUSED_PARAM dummy, int rs485)
+ {
+ int i;
+ printf("%lx:%lx:%lx:%lx",
-+@@ -1005,6 +1063,12 @@ static void display_recoverable(const st
++@@ -980,6 +1020,14 @@ static void display_recoverable(const struct termios *mode,
+ (unsigned long) mode->c_cflag, (unsigned long) mode->c_lflag);
+ for (i = 0; i < NCCS; ++i)
+ printf(":%x", (unsigned int) mode->c_cc[i]);
+++
++ if (rs485 >= 0) {
++ printf(":%lx:%lx:%lx",
++ (unsigned long) rs485conf->flags,
++ (unsigned long) rs485conf->delay_rts_before_send,
++ (unsigned long) rs485conf->delay_rts_after_send);
++ }
+++
+ bb_putchar('\n');
+ }
+
-+@@ -1025,7 +1089,7 @@ static void display_speed(const struct t
++@@ -1000,7 +1048,7 @@ static void display_speed(const struct termios *mode, int fancy)
+ wrapf(fmt_str, tty_baud_to_value(ispeed), tty_baud_to_value(ospeed));
+ }
+
@@ -171,7 +128,7 @@ Index: buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs48
+ {
+ int i;
+ tcflag_t *bitsp;
-+@@ -1086,6 +1150,25 @@ static void do_display(const struct term
++@@ -1066,6 +1114,24 @@ static void do_display(const struct termios *mode, int all)
+ }
+ }
+ newline();
@@ -188,16 +145,15 @@ Index: buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs48
++ (rs485conf->flags & SER_RS485_RTS_AFTER_SEND) ? "" : "-",
++ (rs485conf->flags & SER_RS485_RX_DURING_TX) ? "" : "-");
++ newline();
-++ wrapf("rs485delaybefore = %d; rs485delayafter = %d; rs485delaylastchartx = %d;\n",
+++ wrapf("rs485delaybefore = %d; rs485delayafter = %d;\n",
++ rs485conf->delay_rts_before_send,
-++ rs485conf->delay_rts_after_send,
-++ rs485conf->delay_rts_last_char_tx);
+++ rs485conf->delay_rts_after_send);
++ newline();
++ }
+ }
+
+ static void sane_mode(struct termios *mode)
-+@@ -1277,11 +1360,14 @@ int stty_main(int argc, char **argv) MAI
++@@ -1260,11 +1326,14 @@ int stty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+ int stty_main(int argc UNUSED_PARAM, char **argv)
+ {
+ struct termios mode;
@@ -213,19 +169,21 @@ Index: buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs48
+
+ INIT_G();
+
-+@@ -1306,6 +1392,11 @@ int stty_main(int argc UNUSED_PARAM, cha
++@@ -1289,6 +1358,13 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
+ stty_state &= ~STTY_noargs;
+ continue;
+ }
+++
++ param = find_rs485config(arg+1);
++ if ((param) && ((param & param_need_arg) == 0)) {
++ stty_state &= ~STTY_noargs;
++ continue;
++ }
+++
+ /* It is an option - parse it */
+ i = 0;
+ while (arg[++i]) {
-+@@ -1360,6 +1451,17 @@ int stty_main(int argc UNUSED_PARAM, cha
++@@ -1343,6 +1419,17 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
+ continue;
+ }
+
@@ -243,7 +201,7 @@ Index: buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs48
+ param = find_param(arg);
+ if (param & param_need_arg) {
+ if (!argnext)
-+@@ -1394,7 +1496,7 @@ int stty_main(int argc UNUSED_PARAM, cha
++@@ -1377,7 +1464,7 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
+ set_speed_or_die(output_speed, argnext, &mode);
+ break;
+ default:
@@ -252,14 +210,14 @@ Index: buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs48
+ if (tty_value_to_baud(xatou(arg)) != (speed_t) -1) break;
+ invalid_argument:
+ bb_error_msg_and_die("invalid argument '%s'", arg);
-+@@ -1425,15 +1527,17 @@ int stty_main(int argc UNUSED_PARAM, cha
++@@ -1410,15 +1497,17 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
+ memset(&mode, 0, sizeof(mode));
+ if (tcgetattr(STDIN_FILENO, &mode))
+ perror_on_device_and_die("%s");
++ rs485_supported = ioctl(STDIN_FILENO, TIOCGRS485, &rs485conf);
+
+ if (stty_state & (STTY_verbose_output | STTY_recoverable_output | STTY_noargs)) {
-+ get_terminal_width_height(STDOUT_FILENO, &G.max_col, NULL);
++ G.max_col = get_terminal_width(STDOUT_FILENO);
+- output_func(&mode, display_all);
++ output_func(&mode, &rs485conf, display_all, rs485_supported);
+ return EXIT_SUCCESS;
@@ -271,10 +229,11 @@ Index: buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs48
+ while (argv[++k]) {
+ const struct mode_info *mp;
+ const struct control_info *cp;
-+@@ -1447,6 +1551,23 @@ int stty_main(int argc UNUSED_PARAM, cha
++@@ -1432,6 +1521,25 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
+ set_mode(mp, 1 /* reversed */, &mode);
+ stty_state |= STTY_require_set_attr;
+ }
+++
++ param = find_rs485config(arg+1);
++ if ((param) && ((param & param_need_arg) == 0)) {
++ rs485_setconfig = 1;
@@ -292,10 +251,11 @@ Index: buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs48
++ rs485conf.flags &= ~SER_RS485_RX_DURING_TX;
++ }
++ }
+++
+ /* It is an option - already parsed. Skip it */
+ continue;
+ }
-+@@ -1466,6 +1587,33 @@ int stty_main(int argc UNUSED_PARAM, cha
++@@ -1451,6 +1559,33 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
+ continue;
+ }
+
@@ -329,7 +289,7 @@ Index: buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs48
+ param = find_param(arg);
+ if (param & param_need_arg) {
+ ++k;
-+@@ -1502,9 +1650,11 @@ int stty_main(int argc UNUSED_PARAM, cha
++@@ -1487,9 +1622,11 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
+ stty_state |= (STTY_require_set_attr | STTY_speed_was_set);
+ break;
+ default:
@@ -343,7 +303,7 @@ Index: buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs48
+ set_speed_or_die(both_speeds, arg, &mode);
+ stty_state |= (STTY_require_set_attr | STTY_speed_was_set);
+ } /* else - impossible (caught in the first pass):
-+@@ -1550,5 +1700,10 @@ int stty_main(int argc UNUSED_PARAM, cha
++@@ -1540,5 +1677,10 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
+ }
+ }
+
@@ -354,3 +314,5 @@ Index: buildroot/package/busybox/busybox-1.19.4/001_busybox-1.19.4_stty_add_rs48
++
+ return EXIT_SUCCESS;
+ }
++--
++2.11.0
diff --git a/patches/buildroot/2017.02/cleanup_buildroot.sh b/patches/buildroot/2017.02/cleanup_buildroot.sh
index 37c81ba..b664a0f 100755
--- a/patches/buildroot/2017.02/cleanup_buildroot.sh
+++ b/patches/buildroot/2017.02/cleanup_buildroot.sh
@@ -25,6 +25,7 @@ rm -rf buildroot/package/beremiz/Config.in
rm -rf buildroot/package/beremiz/beremiz.mk
rm -rf buildroot/package/beremiz/host-beremiz-fix_compare_and_swap_problem_to_be_removed_with_kernel_3.1.patch
rm -rf buildroot/package/busybox/0006-rfkill-build.patch
+rm -rf buildroot/package/busybox/0007-stty-Add-RS485-config-options.patch
rm -rf buildroot/package/busybox/busybox.mk
rm -rf buildroot/package/can-utils/can-utils.hash
rm -rf buildroot/package/can-utils/can-utils.mk
hooks/post-receive
--
armadeus
|