From: Alexander Aring <alex.aring@gmail.com>
To: linux-wpan@vger.kernel.org
Cc: Alexander Aring <alex.aring@gmail.com>
Subject: [PATCH wpan-tools 1/3] mac: add support for setting lbt mode
Date: Fri, 26 Sep 2014 10:06:07 +0200 [thread overview]
Message-ID: <1411718769-1986-2-git-send-email-alex.aring@gmail.com> (raw)
In-Reply-To: <1411718769-1986-1-git-send-email-alex.aring@gmail.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
src/mac.c | 27 +++++++++++++++++++++++++++
src/nl802154.h | 4 ++++
2 files changed, 31 insertions(+)
diff --git a/src/mac.c b/src/mac.c
index 1d12a04..a6c456f 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -178,3 +178,30 @@ nla_put_failure:
COMMAND(set, min_be, "<min_be>",
NL802154_CMD_SET_MIN_BE, 0, CIB_NETDEV,
handle_min_be, NULL);
+
+static int handle_lbt_mode(struct nl802154_state *state,
+ struct nl_cb *cb,
+ struct nl_msg *msg,
+ int argc, char **argv,
+ enum id_input id)
+{
+ unsigned long mode;
+ char *end;
+
+ if (argc < 1)
+ return 1;
+
+ /* LBT_MODE */
+ mode = strtoul(argv[0], &end, 0);
+ if (*end != '\0')
+ return 1;
+
+ NLA_PUT_U8(msg, NL802154_ATTR_LBT_MODE, mode);
+
+ return 0;
+
+nla_put_failure:
+ return -ENOBUFS;
+}
+COMMAND(set, lbt, "<1|0>",
+ NL802154_CMD_SET_LBT_MODE, 0, CIB_NETDEV, handle_lbt_mode, NULL);
diff --git a/src/nl802154.h b/src/nl802154.h
index ce6ae2a..a30e9c0 100644
--- a/src/nl802154.h
+++ b/src/nl802154.h
@@ -54,6 +54,8 @@ enum nl802154_commands {
NL802154_CMD_SET_MAX_CSMA_BACKOFFS,
NL802154_CMD_SET_MIN_BE,
+ NL802154_CMD_SET_LBT_MODE,
+
/* add new commands above here */
/* used to define NL802154_CMD_MAX below */
@@ -95,6 +97,8 @@ enum nl802154_attrs {
NL802154_ATTR_MAX_CSMA_BACKOFFS,
NL802154_ATTR_MIN_BE,
+ NL802154_ATTR_LBT_MODE,
+
/* add attributes here, update the policy in nl802154.c */
__NL802154_ATTR_AFTER_LAST,
--
2.1.0
next prev parent reply other threads:[~2014-09-26 8:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-26 8:06 [PATCH wpan-tools 0/3] mac: info: interface: add basic support Alexander Aring
2014-09-26 8:06 ` Alexander Aring [this message]
2014-09-26 8:06 ` [PATCH wpan-tools 2/3] info: add support to dump phy pib Alexander Aring
2014-09-26 8:06 ` [PATCH wpan-tools 3/3] interface: add dump for iface mac parameters Alexander Aring
2014-09-26 8:07 ` [PATCH wpan-tools 0/3] mac: info: interface: add basic support Alexander Aring
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=1411718769-1986-2-git-send-email-alex.aring@gmail.com \
--to=alex.aring@gmail.com \
--cc=linux-wpan@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.