summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorEric BENARD <eric@eukrea.com>2013-09-19 20:56:22 +0000
committerMartin Jansa <Martin.Jansa@gmail.com>2013-10-05 12:36:02 +0200
commit3f148a148085b3d1d8b200cd3916f308edceef67 (patch)
tree47260c8c64074054402553d428a9051d31ce60ad /meta-oe
parent8b9fccbbfaf757844f813b06a22c413dc5cafe94 (diff)
downloadmeta-openembedded-3f148a148085b3d1d8b200cd3916f308edceef67.tar.gz
canutils: update recipe
- use git hash instead of tag - backport "candump: Add error frame's handling" Signed-off-by: Eric BĂ©nard <eric@eukrea.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-extended/socketcan/canutils/0001-canutils-candump-Add-error-frame-s-handling.patch94
-rw-r--r--meta-oe/recipes-extended/socketcan/canutils_4.0.6.bb5
2 files changed, 97 insertions, 2 deletions
diff --git a/meta-oe/recipes-extended/socketcan/canutils/0001-canutils-candump-Add-error-frame-s-handling.patch b/meta-oe/recipes-extended/socketcan/canutils/0001-canutils-candump-Add-error-frame-s-handling.patch
new file mode 100644
index 000000000..fcc38e061
--- /dev/null
+++ b/meta-oe/recipes-extended/socketcan/canutils/0001-canutils-candump-Add-error-frame-s-handling.patch
@@ -0,0 +1,94 @@
1From bab595e38295dcafcfc17a011d3d51f2df1618e6 Mon Sep 17 00:00:00 2001
2From: AnilKumar Ch <anilkumar@ti.com>
3Date: Tue, 10 Jan 2012 18:55:11 +0530
4Subject: [PATCH] canutils: candump: Add error frame's handling
5
6This patch adds the error handling capability to candump utility
7by adding error flags for displaying all kind of error frames
8like tx_timeout, lost arbitration, controller problems, buserrors,
9bus warnings etc.
10
11Usage of candump for error frame display on console:
12candump [<can-interface>] [Options]
13Ex: candump can0 --error
14
15This patch is created on top of canutils-4.0.6 tag from
16http://git.pengutronix.de/?p=tools/canutils.git
17
18Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
19Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
20---
21Upstream-Status: Backport
22
23 src/candump.c | 20 ++++++++++++++++++++
24 1 file changed, 20 insertions(+)
25
26diff --git a/src/candump.c b/src/candump.c
27index 259d442..c16425b 100644
28--- a/src/candump.c
29+++ b/src/candump.c
30@@ -20,6 +20,7 @@
31
32 #include <linux/can.h>
33 #include <linux/can/raw.h>
34+#include <linux/can/error.h>
35
36 extern int optind, opterr, optopt;
37
38@@ -40,6 +41,7 @@ static void print_usage(char *prg)
39 " -p, --protocol=PROTO\t" "CAN protocol (default CAN_RAW = %d)\n"
40 " --filter=id:mask[:id:mask]...\n"
41 "\t\t\t" "apply filter\n"
42+ " -e, --error\t\t" "dump error frames along with data frames\n"
43 " -h, --help\t\t" "this help\n"
44 " -o <filename>\t\t" "output into filename\n"
45 " -d\t\t\t" "daemonize\n"
46@@ -86,6 +88,11 @@ int main(int argc, char **argv)
47 int nbytes, i;
48 int opt, optdaemon = 0;
49 uint32_t id, mask;
50+ int error = 0;
51+ can_err_mask_t err_mask = (CAN_ERR_TX_TIMEOUT | CAN_ERR_LOSTARB |
52+ CAN_ERR_CRTL | CAN_ERR_PROT |
53+ CAN_ERR_TRX | CAN_ERR_ACK | CAN_ERR_BUSOFF |
54+ CAN_ERR_BUSERROR);
55
56 signal(SIGPIPE, SIG_IGN);
57
58@@ -95,6 +102,7 @@ int main(int argc, char **argv)
59 { "protocol", required_argument, 0, 'p' },
60 { "type", required_argument, 0, 't' },
61 { "filter", required_argument, 0, FILTER_OPTION },
62+ { "error", no_argument, 0, 'e' },
63 { "version", no_argument, 0, VERSION_OPTION},
64 { 0, 0, 0, 0},
65 };
66@@ -121,6 +129,10 @@ int main(int argc, char **argv)
67 proto = strtoul(optarg, NULL, 0);
68 break;
69
70+ case 'e':
71+ error = 1;
72+ break;
73+
74 case 'o':
75 optout = optarg;
76 break;
77@@ -186,6 +198,14 @@ int main(int argc, char **argv)
78 }
79 }
80
81+ if (error) {
82+ if (setsockopt(s, SOL_CAN_RAW, CAN_RAW_ERR_FILTER, &err_mask,
83+ sizeof(err_mask)) != 0) {
84+ perror("setsockopt");
85+ exit(1);
86+ }
87+ }
88+
89 if (optdaemon)
90 daemon(1, 0);
91 else {
92--
931.8.3.1
94
diff --git a/meta-oe/recipes-extended/socketcan/canutils_4.0.6.bb b/meta-oe/recipes-extended/socketcan/canutils_4.0.6.bb
index 3bc2f93cf..504c5109f 100644
--- a/meta-oe/recipes-extended/socketcan/canutils_4.0.6.bb
+++ b/meta-oe/recipes-extended/socketcan/canutils_4.0.6.bb
@@ -7,8 +7,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
7 7
8DEPENDS = "libsocketcan" 8DEPENDS = "libsocketcan"
9 9
10TAG = "canutils-${PV}" 10SRCREV = "299dff7f5322bf0348dcdd60071958ebedf5f09d"
11SRC_URI = "git://git.pengutronix.de/git/tools/canutils.git;tag=${TAG} \ 11SRC_URI = "git://git.pengutronix.de/git/tools/canutils.git;protocol=git \
12 file://0001-canutils-candump-Add-error-frame-s-handling.patch \
12" 13"
13 14
14S = "${WORKDIR}/git" 15S = "${WORKDIR}/git"