* [PATCH wpan-tools] mac: add handling for ackreq default handling
@ 2015-08-05 11:01 Alexander Aring
2015-08-06 17:50 ` Stefan Schmidt
2015-08-12 8:48 ` Alexander Aring
0 siblings, 2 replies; 3+ messages in thread
From: Alexander Aring @ 2015-08-05 11:01 UTC (permalink / raw)
To: linux-wpan; +Cc: kernel, Alexander Aring
This patch adds support to change the ack request default handling,
which indicates the default behaviour for the acknowledge request bit
of 802.15.4 frames.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
src/interface.c | 2 ++
src/mac.c | 28 ++++++++++++++++++++++++++++
src/nl802154.h | 4 ++++
3 files changed, 34 insertions(+)
diff --git a/src/interface.c b/src/interface.c
index 647247b..85d40a8 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -223,6 +223,8 @@ static int print_iface_handler(struct nl_msg *msg, void *arg)
printf("%s\tmax_csma_backoffs %d\n", indent, nla_get_u8(tb_msg[NL802154_ATTR_MAX_CSMA_BACKOFFS]));
if (tb_msg[NL802154_ATTR_LBT_MODE])
printf("%s\tlbt %d\n", indent, nla_get_u8(tb_msg[NL802154_ATTR_LBT_MODE]));
+ if (tb_msg[NL802154_ATTR_ACKREQ_DEFAULT])
+ printf("%s\tackreq_default %d\n", indent, nla_get_u8(tb_msg[NL802154_ATTR_ACKREQ_DEFAULT]));
return NL_SKIP;
}
diff --git a/src/mac.c b/src/mac.c
index 703d09f..76db58f 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -185,3 +185,31 @@ nla_put_failure:
}
COMMAND(set, lbt, "<1|0>",
NL802154_CMD_SET_LBT_MODE, 0, CIB_NETDEV, handle_lbt_mode, NULL);
+
+static int handle_ackreq_default(struct nl802154_state *state,
+ struct nl_cb *cb,
+ struct nl_msg *msg,
+ int argc, char **argv,
+ enum id_input id)
+{
+ unsigned long ackreq;
+ char *end;
+
+ if (argc < 1)
+ return 1;
+
+ /* ACKREQ_DEFAULT */
+ ackreq = strtoul(argv[0], &end, 0);
+ if (*end != '\0')
+ return 1;
+
+ NLA_PUT_U8(msg, NL802154_ATTR_ACKREQ_DEFAULT, ackreq);
+
+ return 0;
+
+nla_put_failure:
+ return -ENOBUFS;
+}
+COMMAND(set, ackreq_default, "<1|0>",
+ NL802154_CMD_SET_ACKREQ_DEFAULT, 0, CIB_NETDEV, handle_ackreq_default,
+ NULL);
diff --git a/src/nl802154.h b/src/nl802154.h
index b0ab530..cf2713d 100644
--- a/src/nl802154.h
+++ b/src/nl802154.h
@@ -52,6 +52,8 @@ enum nl802154_commands {
NL802154_CMD_SET_LBT_MODE,
+ NL802154_CMD_SET_ACKREQ_DEFAULT,
+
/* add new commands above here */
/* used to define NL802154_CMD_MAX below */
@@ -104,6 +106,8 @@ enum nl802154_attrs {
NL802154_ATTR_SUPPORTED_COMMANDS,
+ NL802154_ATTR_ACKREQ_DEFAULT,
+
/* add attributes here, update the policy in nl802154.c */
__NL802154_ATTR_AFTER_LAST,
--
2.5.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH wpan-tools] mac: add handling for ackreq default handling
2015-08-05 11:01 [PATCH wpan-tools] mac: add handling for ackreq default handling Alexander Aring
@ 2015-08-06 17:50 ` Stefan Schmidt
2015-08-12 8:48 ` Alexander Aring
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Schmidt @ 2015-08-06 17:50 UTC (permalink / raw)
To: Alexander Aring, linux-wpan; +Cc: kernel
Hello.
On 05/08/15 13:01, Alexander Aring wrote:
> This patch adds support to change the ack request default handling,
> which indicates the default behaviour for the acknowledge request bit
> of 802.15.4 frames.
>
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
> src/interface.c | 2 ++
> src/mac.c | 28 ++++++++++++++++++++++++++++
> src/nl802154.h | 4 ++++
> 3 files changed, 34 insertions(+)
>
> diff --git a/src/interface.c b/src/interface.c
> index 647247b..85d40a8 100644
> --- a/src/interface.c
> +++ b/src/interface.c
> @@ -223,6 +223,8 @@ static int print_iface_handler(struct nl_msg *msg, void *arg)
> printf("%s\tmax_csma_backoffs %d\n", indent, nla_get_u8(tb_msg[NL802154_ATTR_MAX_CSMA_BACKOFFS]));
> if (tb_msg[NL802154_ATTR_LBT_MODE])
> printf("%s\tlbt %d\n", indent, nla_get_u8(tb_msg[NL802154_ATTR_LBT_MODE]));
> + if (tb_msg[NL802154_ATTR_ACKREQ_DEFAULT])
> + printf("%s\tackreq_default %d\n", indent, nla_get_u8(tb_msg[NL802154_ATTR_ACKREQ_DEFAULT]));
>
> return NL_SKIP;
> }
> diff --git a/src/mac.c b/src/mac.c
> index 703d09f..76db58f 100644
> --- a/src/mac.c
> +++ b/src/mac.c
> @@ -185,3 +185,31 @@ nla_put_failure:
> }
> COMMAND(set, lbt, "<1|0>",
> NL802154_CMD_SET_LBT_MODE, 0, CIB_NETDEV, handle_lbt_mode, NULL);
> +
> +static int handle_ackreq_default(struct nl802154_state *state,
> + struct nl_cb *cb,
> + struct nl_msg *msg,
> + int argc, char **argv,
> + enum id_input id)
> +{
> + unsigned long ackreq;
> + char *end;
> +
> + if (argc < 1)
> + return 1;
> +
> + /* ACKREQ_DEFAULT */
> + ackreq = strtoul(argv[0], &end, 0);
> + if (*end != '\0')
> + return 1;
> +
> + NLA_PUT_U8(msg, NL802154_ATTR_ACKREQ_DEFAULT, ackreq);
> +
> + return 0;
> +
> +nla_put_failure:
> + return -ENOBUFS;
> +}
> +COMMAND(set, ackreq_default, "<1|0>",
> + NL802154_CMD_SET_ACKREQ_DEFAULT, 0, CIB_NETDEV, handle_ackreq_default,
> + NULL);
> diff --git a/src/nl802154.h b/src/nl802154.h
> index b0ab530..cf2713d 100644
> --- a/src/nl802154.h
> +++ b/src/nl802154.h
> @@ -52,6 +52,8 @@ enum nl802154_commands {
>
> NL802154_CMD_SET_LBT_MODE,
>
> + NL802154_CMD_SET_ACKREQ_DEFAULT,
> +
> /* add new commands above here */
>
> /* used to define NL802154_CMD_MAX below */
> @@ -104,6 +106,8 @@ enum nl802154_attrs {
>
> NL802154_ATTR_SUPPORTED_COMMANDS,
>
> + NL802154_ATTR_ACKREQ_DEFAULT,
> +
> /* add attributes here, update the policy in nl802154.c */
>
> __NL802154_ATTR_AFTER_LAST,
Tested this against the kernel patches.
Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>
regards
Stefan Schmidt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH wpan-tools] mac: add handling for ackreq default handling
2015-08-05 11:01 [PATCH wpan-tools] mac: add handling for ackreq default handling Alexander Aring
2015-08-06 17:50 ` Stefan Schmidt
@ 2015-08-12 8:48 ` Alexander Aring
1 sibling, 0 replies; 3+ messages in thread
From: Alexander Aring @ 2015-08-12 8:48 UTC (permalink / raw)
To: linux-wpan; +Cc: kernel
I added this change to this patch:
diff --git a/src/info.c b/src/info.c
index fd75fa0..e00ed3e 100644
--- a/src/info.c
+++ b/src/info.c
@@ -212,6 +212,7 @@ static const char *commands[NL802154_CMD_MAX + 1] = {
[NL802154_CMD_SET_BACKOFF_EXPONENT] = "set_backoff_exponent",
[NL802154_CMD_SET_MAX_CSMA_BACKOFFS] = "set_max_csma_backoffs",
[NL802154_CMD_SET_LBT_MODE] = "set_lbt_mode",
+ [NL802154_CMD_SET_ACKREQ_DEFAULT] = "set_ackreq_default",
};
static char cmdbuf[100];
For dumping that we will support "set_ackreq_default" which all current
SoftMAC transceivers supports.
- Alex
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-12 8:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-05 11:01 [PATCH wpan-tools] mac: add handling for ackreq default handling Alexander Aring
2015-08-06 17:50 ` Stefan Schmidt
2015-08-12 8:48 ` Alexander Aring
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.