From: Nikita Edward Baruzdin <nebaruzdin@gmail.com>
To: linux-can@vger.kernel.org
Subject: [iproute2 2/2] iplink: Support for CAN presume-ack feature
Date: Mon, 21 Jul 2014 13:43:18 +0400 [thread overview]
Message-ID: <1405935800-26622-3-git-send-email-nebaruzdin@gmail.com> (raw)
In-Reply-To: <1405935800-26622-1-git-send-email-nebaruzdin@gmail.com>
This patch makes the newly introduced CAN_CTRLMODE_PRESUME_ACK netlink
feature configurable. When enabled, the feature sets CAN controller in
mode in which acknowledgement absence is ignored.
Signed-off-by: Nikita Edward Baruzdin <nebaruzdin@gmail.com>
---
ip/iplink_can.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/ip/iplink_can.c b/ip/iplink_can.c
index 5674358..01d8131 100644
--- a/ip/iplink_can.c
+++ b/ip/iplink_can.c
@@ -32,6 +32,7 @@ static void usage(void)
"\t[ triple-sampling { on | off } ]\n"
"\t[ one-shot { on | off } ]\n"
"\t[ berr-reporting { on | off } ]\n"
+ "\t[ presume-ack { on | off } ]\n"
"\n"
"\t[ restart-ms TIME-MS ]\n"
"\t[ restart ]\n"
@@ -88,6 +89,7 @@ static void print_ctrlmode(FILE *f, __u32 cm)
_PF(CAN_CTRLMODE_3_SAMPLES, "TRIPLE-SAMPLING");
_PF(CAN_CTRLMODE_ONE_SHOT, "ONE-SHOT");
_PF(CAN_CTRLMODE_BERR_REPORTING, "BERR-REPORTING");
+ _PF(CAN_CTRLMODE_PRESUME_ACK, "PRESUME-ACK");
#undef _PF
if (cm)
fprintf(f, "%x", cm);
@@ -154,6 +156,10 @@ static int can_parse_opt(struct link_util *lu, int argc, char **argv,
NEXT_ARG();
set_ctrlmode("berr-reporting", *argv, &cm,
CAN_CTRLMODE_BERR_REPORTING);
+ } else if (matches(*argv, "presume-ack") == 0) {
+ NEXT_ARG();
+ set_ctrlmode("presume-ack", *argv, &cm,
+ CAN_CTRLMODE_PRESUME_ACK);
} else if (matches(*argv, "restart") == 0) {
__u32 val = 1;
--
2.0.2
next prev parent reply other threads:[~2014-07-21 9:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-21 9:43 CAN_CTRLMODE_PRESUME_ACK follow-up patches Nikita Edward Baruzdin
2014-07-21 9:43 ` [iproute2 1/2] Update CAN netlink header Nikita Edward Baruzdin
2014-07-21 17:51 ` Oliver Hartkopp
2014-07-22 14:09 ` Nikita Edward Baruzdin
2014-07-22 14:23 ` Marc Kleine-Budde
2014-07-21 9:43 ` Nikita Edward Baruzdin [this message]
2014-07-21 9:43 ` [libsocketcan " Nikita Edward Baruzdin
2014-07-21 9:43 ` [libsocketcan 2/2] Update can_set_ctrlmode() documentation Nikita Edward Baruzdin
2014-07-22 14:26 ` Marc Kleine-Budde
2014-07-22 14:42 ` Nikita Edward Baruzdin
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=1405935800-26622-3-git-send-email-nebaruzdin@gmail.com \
--to=nebaruzdin@gmail.com \
--cc=linux-can@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).